| 1 | #!/bin/sh |
| 2 | set -eu |
| 3 | |
| 4 | storage=/var/lib/pgadmin/storage/$(printf '%s' "$PGADMIN_DEFAULT_EMAIL" | tr '@' '_') |
| 5 | mkdir -p "$storage" |
| 6 | printf '%s:%s:*:postgres:%s\n' "$POSTGRES_HOST" "$POSTGRES_PORT" "$POSTGRES_PASSWORD" >"$storage/pgpass" |
| 7 | chmod 600 "$storage/pgpass" |
| 8 | printf '{"Servers":{"1":{"Name":"Clover Postgres","Group":"Servers","Host":"%s","Port":%s,"MaintenanceDB":"postgres","Username":"postgres","SSLMode":"prefer","PassFile":"%s"}}}\n' \ |
| 9 | "$POSTGRES_HOST" "$POSTGRES_PORT" "$storage/pgpass" >/var/lib/pgadmin/servers.json |
| 10 | export PGADMIN_SERVER_JSON_FILE=/var/lib/pgadmin/servers.json |
| 11 | exec /entrypoint.sh python3 |