WIP: postgres db support

Part of https://git.coopcloud.tech/coop-cloud/matrix-synapse/issues/2.
This commit is contained in:
cellarspoon
2021-12-12 20:00:51 +01:00
parent 93ae4d6c8a
commit b7cce0a516
5 changed files with 2704 additions and 12 deletions

View File

@ -1,7 +1,29 @@
#!/bin/bash
if [[ ! -f /data/homeserver.yaml ]]; then
/start.py generate
fi
set -e
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local def="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$def"
if [ "${!var:-}" ]; then
val="${!var}"
elif [ "${!fileVar:-}" ]; then
val="$(< "${!fileVar}")"
fi
export "$var"="$val"
unset "$fileVar"
}
file_env "POSTGRES_DB_PASSWORD"
/start.py