Linkding has shipped without any Tools-tab actions since v0.1.0 — the only artifact was scripts/menu/tools/manage_linkding.sh, a dead legacy CLI menu referencing an `appLinkdingSetupUser` function that was never defined. Build the real thing, mirroring bookstack's pattern (manifest + thin tool wrappers + auth_adapter that drives the app's native admin shell): containers/linkding/tools/linkding.tools.json — manifest, 5 tools containers/linkding/tools/linkding_<id>.sh — one wrapper per tool containers/linkding/scripts/linkding_auth.sh — Django shell driver Tools (all category=users, so the WebUI's custom user-list panel and its row-level 🔑 / 👑 / 🗑 buttons light up): reset_password — set_password on an existing user (random if blank) create_account — create_user / create_superuser list_users — emits EZ_USER\t<username>\t<username>\t<role> rows (linkding is username-primary, so username goes into both display slots — keeps the panel click-through identifier consistent with the other tools' fields) delete_user — delete by username (destructive, confirm gated) set_admin — toggle is_superuser + is_staff Implementation runs entirely inside the linkding-service container via `runFileOp docker exec ... python manage.py shell -c "<code>"`, reading inputs through `-e` env vars so quoting stays safe. Django's default get_user_model() User is used directly — passwords hash exactly the way the web UI does, admin flags map to the same fields the UI reads. Also drop the dead legacy stub (scripts/menu/tools/manage_linkding.sh) and regenerate files_menu.sh so the source-scan no longer pulls it in. Nothing referenced linkdingToolsMenu — verified by tree-wide grep. Verified live on dev-ai (Debian 12, linkding installed, Django 5 + sqlite): $ libreportal app tool linkding create_account 'username=alice|password=…|admin=true' ✓ Linkding user created — Username: alice — Password: … $ libreportal app tool linkding list_users '' EZ_USER alice alice admin Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Signed-off-by: librelad <librelad@digitalangels.vip>
9 lines
182 B
Bash
9 lines
182 B
Bash
#!/bin/bash
|
|
|
|
appLinkdingSetAdmin() {
|
|
local args="$1"
|
|
authAdapterCall linkding setAdmin \
|
|
"$(authToolArg "$args" username)" \
|
|
"$(authToolArg "$args" admin)"
|
|
}
|