fix(ente): auto-whitelist admin by user_id from database

The admin CLI requires the user to be whitelisted via their numeric
user_id in museum.yaml's internal.admin field. The helper script
ente-upgrade-subscription now:
1. Looks up user_id from PostgreSQL by email
2. Adds internal.admin to museum.yaml if not present
3. Restarts museum
4. Runs the subscription upgrade

This replaces the previous approach that incorrectly assumed the
first user was auto-admin (that fallback only works when internal
section is completely absent AND was unreliable).
This commit is contained in:
CanbiZ (MickLesk)
2026-03-27 15:41:05 +01:00
parent dbabc9a1c2
commit 4fe1d95c81
2 changed files with 18 additions and 7 deletions

View File

@@ -41,15 +41,11 @@
"type": "warning"
},
{
"text": "First-Start: The first registered user automatically becomes admin",
"type": "info"
},
{
"text": "First-Start: Add your account to the CLI: `ente account add` (export dir: any path, e.g. /photos)",
"text": "First-Start: Add your account to the CLI first: `ente account add` (export dir: any path, e.g. /photos)",
"type": "warning"
},
{
"text": "First-Start: Remove the subscription limit: `ente admin update-subscription -a <email> -u <email> --no-limit True`",
"text": "First-Start: Whitelist admin and remove subscription limit: `ente-upgrade-subscription <email>`",
"type": "warning"
},
{