Repository navigation
Commit 8e5a172
authored
Force the admin password from CM_INITIAL_ADMIN_PASS on every boot (#24)
Upstream scripts/docker/create_superuser.py only acts when no superuser
exists. Every VFB instance boots by restoring a *.pgsql dump that already
contains superusers, so that check always fails and CM_INITIAL_ADMIN_PASS
is silently ignored - the admin password is whatever the dump happened to
carry. It has therefore never been applied to any seeded instance, and the
passwords have drifted apart (l1em no longer matches the others).
Postgres data lives inside the container and only /backup persists, so a
manual correction is wiped on the next recreate. Reapplying on boot is the
only durable fix.
modify_superuser.py now reads CM_INITIAL_ADMIN_USER/CM_INITIAL_ADMIN_PASS
instead of carrying a hardcoded password hash, and is idempotent: it writes
only when the password or the staff/active flags actually differ, and is a
no-op when the variable is unset or the user does not exist.
init.sh invokes it in the background, since catmaid-entry.sh never returns,
polling for up to 10 minutes while the fixture loads and the database comes
up. Loaders are unaffected - they start from an empty /backup, so upstream
create_superuser.py already applies the variable correctly there.1 parent 0e9edfa commit 8e5a172
2 files changed
Lines changed: 65 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
15 | 39 | | |
16 | 40 | | |
17 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
1 | 24 | | |
2 | | - | |
3 | | - | |
4 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
0 commit comments