LibrePortal/containers/nextcloud/tools/nextcloud.tools.json
librelad 898068a390 refactor(apps): make app tools + helpers fully self-contained per app
Each app now carries everything under containers/<app>/: Tools-tab actions in
tools/ (declaration <app>.tools.json + function <app>_<tool_id>.sh) and logic
helpers in scripts/ (e.g. <app>_auth.sh). The container scan live-sources every
.sh under the app (maxdepth 3, prunes only resources/) and webui_tools.sh
auto-merges the .tools.json, so an app is a true drop-in — no central edit, no
array regen.

- Empty the central webui_tools.sh heredoc; all 34 tools across 11 apps now
  come from per-app declarations (verified byte-identical to the old output).
- Retire the orphaned mattermost tool scripts to scripts/unused (there is no
  containers/mattermost; its install fn already lived in unused).
- Update the dispatch comment/error path, the auth-adapter doc, and
  DEVELOPMENT.md to the new convention.
- Regenerate static arrays (files_app.sh no longer lists app/containers/*).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: librelad <librelad@digitalangels.vip>
2026-05-25 22:45:33 +01:00

178 lines
4.8 KiB
JSON
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"tools": [
{
"id": "reset_password",
"category": "users",
"label": "Reset User Password",
"description": "Reset an existing Nextcloud user's password. Leave the password field blank to generate a random one — it is shown in the task log.",
"icon": "🔑",
"fields": [
{
"name": "username",
"label": "Username",
"type": "text",
"placeholder": "alice",
"required": true
},
{
"name": "password",
"label": "New password (leave blank to generate)",
"type": "password",
"placeholder": "Leave blank for random"
}
]
},
{
"id": "create_account",
"category": "users",
"label": "Create User Account",
"description": "Create a new Nextcloud user. Tick \"Make admin\" to add them to the admin group. Leave the password blank to generate a random one.",
"icon": "👤",
"fields": [
{
"name": "username",
"label": "Username",
"type": "text",
"placeholder": "alice",
"required": true
},
{
"name": "display_name",
"label": "Display name",
"type": "text",
"placeholder": "Alice Smith"
},
{
"name": "password",
"label": "Password (leave blank to generate)",
"type": "password",
"placeholder": "Leave blank for random"
},
{
"name": "admin",
"label": "Make admin",
"type": "checkbox",
"default": false
}
]
},
{
"id": "list_users",
"category": "users",
"label": "List Users",
"description": "Show every Nextcloud user with their display name and admin flag.",
"icon": "📋",
"fields": []
},
{
"id": "delete_user",
"category": "users",
"label": "Delete User Account",
"description": "Permanently delete a user and all their files.",
"icon": "🗑",
"destructive": true,
"confirm": "This cannot be undone. The user's files will be removed.",
"fields": [
{
"name": "username",
"label": "Username",
"type": "text",
"required": true
}
]
},
{
"id": "set_admin",
"category": "users",
"label": "Set Admin Status",
"description": "Add a user to (or remove from) the admin group.",
"icon": "👑",
"fields": [
{
"name": "username",
"label": "Username",
"type": "text",
"required": true
},
{
"name": "admin",
"label": "Make admin",
"type": "checkbox",
"default": false
}
]
},
{
"id": "toggle_maintenance",
"category": "maintenance",
"label": "Toggle Maintenance Mode",
"description": "Lock all users out and show a maintenance notice — required before running upgrades or repairs from the CLI.",
"icon": "🚧",
"fields": [
{
"name": "enable",
"label": "Enable maintenance mode",
"type": "checkbox",
"default": true
}
]
},
{
"id": "rescan_files",
"category": "maintenance",
"label": "Rescan Files",
"description": "Re-index Nextcloud's file metadata. Run this after files were added or removed on disk outside Nextcloud (rsync, restore, manual copy). Leave the username blank to scan every user.",
"icon": "🔄",
"fields": [
{
"name": "username",
"label": "Username (blank = all users)",
"type": "text",
"placeholder": "blank for all"
}
]
},
{
"id": "add_trusted_domain",
"category": "system",
"label": "Add Trusted Domain",
"description": "Append a hostname to Nextcloud's trusted_domains list so requests to that host are accepted.",
"icon": "🌐",
"fields": [
{
"name": "domain",
"label": "Domain",
"type": "text",
"placeholder": "cloud.example.org",
"required": true
}
]
},
{
"id": "system_status",
"category": "system",
"label": "System Status",
"description": "Show Nextcloud's version, install state, and maintenance flag.",
"icon": "",
"fields": []
},
{
"id": "tail_logs",
"category": "system",
"label": "Tail Logs",
"description": "Show the most recent lines of nextcloud.log.",
"icon": "📜",
"fields": [
{
"name": "lines",
"label": "Lines",
"type": "number",
"default": 100,
"min": 10,
"max": 1000
}
]
}
]
}