diff --git a/deploy-production/docker-compose.prod.yml b/deploy-production/docker-compose.prod.yml index 24b574e..4e99985 100644 --- a/deploy-production/docker-compose.prod.yml +++ b/deploy-production/docker-compose.prod.yml @@ -132,6 +132,7 @@ services: - sh - -c - | + # All subpath rewriting is handled by nginx sub_filter — no container patching needed. # All subpath rewriting is handled by nginx sub_filter — no container patching needed. echo "[grampsweb] Ensuring admin user exists ..." python3 << 'PYEOF' 2>&1 | grep -v Gtk @@ -147,7 +148,17 @@ services: add_user(name='Admin', email=email, password=pw, role=ROLE_OWNER) print('[grampsweb] Admin user created') else: - print('[grampsweb] Users already exist, skipping') + try: + add_user(name='Admin', email=email, password=pw, role=ROLE_OWNER) + print('[grampsweb] Admin user created') + except Exception: + from gramps_webapi.auth import get_user_details, modify_user + try: + user = get_user_details(name='Admin') + modify_user(name='Admin', password=pw, role=ROLE_OWNER) + print('[grampsweb] Admin user password reset') + except Exception as e: + print(f'[grampsweb] Could not update admin user: {e}') else: print('[grampsweb] No admin credentials configured, skipping') PYEOF