mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-20 00:01:24 +02:00
fix(backup): moodlit + herbatrium + wordeck Postgres-Container
3 Container fielen heimlich aus dem täglichen pg_dump-Backup raus: 1. moodlit-postgres, herbatrium-postgres — neu seit 2026-05-18 bzw. 2026-05-17, fehlten im db_user_for_container-case (defaultete auf 'postgres', der in diesen Containern nicht existiert). 2. wordeck-postgres — Cards-Rebrand 2026-05-17 hat den Container umbenannt, der case zeigte aber noch auf 'cards-postgres' → kein Match → default 'postgres' → role nicht da. Zusätzlich: psql -U <user> versuchte ohne -d zur DB '<user>' zu connecten (Default-Verhalten), das gibt's bei den Greenfield-Apps nicht (DBs heißen mana_moodlit / mana_herbatrium / wordeck). Mit expliziter `-d template1` (existiert in jeder Postgres-Instanz) funktioniert die Liste-Datenbanken-Query universell. Verifiziert per manuellem Run am 2026-05-18: OK: moodlit-postgres/mana_moodlit (1.0K) OK: wordeck-postgres/wordeck (575K) OK: herbatrium-postgres/mana_herbatrium (2.8K) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
0c15f73b58
commit
92195b83ec
1 changed files with 4 additions and 2 deletions
|
|
@ -66,13 +66,15 @@ send_notification() {
|
|||
# läuft als `postgres`-Superuser.
|
||||
db_user_for_container() {
|
||||
case "$1" in
|
||||
cards-postgres) echo "cards" ;;
|
||||
wordeck-postgres) echo "wordeck" ;;
|
||||
manaspur-postgres) echo "manaspur" ;;
|
||||
nutriphi-postgres) echo "nutriphi" ;;
|
||||
zitare-postgres) echo "zitare" ;;
|
||||
chorportal-prod-postgres) echo "chorportal" ;;
|
||||
seepuls-postgres) echo "seepuls" ;;
|
||||
manameme-postgres) echo "manameme" ;;
|
||||
moodlit-postgres) echo "moodlit" ;;
|
||||
herbatrium-postgres) echo "herbatrium" ;;
|
||||
pageta-postgres) echo "pageta" ;;
|
||||
mana-infra-postgres) echo "postgres" ;;
|
||||
*) echo "postgres" ;;
|
||||
|
|
@ -106,7 +108,7 @@ for CONTAINER in $CONTAINERS; do
|
|||
log "--- Container: $CONTAINER (user: $USER) ---"
|
||||
|
||||
# DB-Liste in diesem Container
|
||||
if ! DB_LIST=$(docker exec "$CONTAINER" psql -U "$USER" -t -c "SELECT datname FROM pg_database WHERE datistemplate = false AND datname != 'postgres';" 2>/dev/null | tr -d ' ' | grep -v "^$"); then
|
||||
if ! DB_LIST=$(docker exec "$CONTAINER" psql -U "$USER" -d template1 -t -c "SELECT datname FROM pg_database WHERE datistemplate = false AND datname != 'postgres';" 2>/dev/null | tr -d ' ' | grep -v "^$"); then
|
||||
log " FAILED to list databases in $CONTAINER (user $USER) — skipping"
|
||||
FAILED_DBS="$FAILED_DBS ${CONTAINER}:list"
|
||||
continue
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue