neb/servers/kid/docker-compose.d/custom/firefish/docker-entrypoint.d/50-replace-config-with-env.sh

17 lines
718 B
Bash
Raw Permalink Normal View History

#!/bin/sh
POSTGRES_USER=${POSTGRES_USER:-}
POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-}
POSTGRES_DB=${POSTGRES_DB:-firefish}
SONIC_HOST=${SONIC_HOST:-}
SONIC_PORT=${SONIC_PORT:-1491}
SONIC_SECRET=${SONIC_SECRET:-}
if [ -f /firefish/.config/default.yml ]; then
sed -i "s/\[POSTGRES_USER\]/$POSTGRES_USER/g" /firefish/.config/default.yml
sed -i "s/\[POSTGRES_PASSWORD\]/$POSTGRES_PASSWORD/g" /firefish/.config/default.yml
sed -i "s/\[POSTGRES_DB\]/$POSTGRES_DB/g" /firefish/.config/default.yml
sed -i "s/\[SONIC_HOST\]/$SONIC_HOST/g" /firefish/.config/default.yml
sed -i "s/\[SONIC_PORT\]/$SONIC_PORT/g" /firefish/.config/default.yml
sed -i "s/\[SONIC_SECRET\]/$SONIC_SECRET/g" /firefish/.config/default.yml
fi