diff --git a/bin/plugin-server b/bin/plugin-server index 23d5f809435..825045ace03 100755 --- a/bin/plugin-server +++ b/bin/plugin-server @@ -22,8 +22,13 @@ while test $# -gt 0; do done if [[ -n $POSTHOG_DB_NAME ]]; then - [[ -n $POSTHOG_DB_PASSWORD ]] && PASSWORD_COMPONENT=":$POSTHOG_DB_PASSWORD" - export DATABASE_URL="postgres://${POSTHOG_DB_USER:-"postgres"}${PASSWORD_COMPONENT}@${POSTHOG_POSTGRES_HOST:-"localhost"}:${POSTHOG_POSTGRES_PORT:-"5432"}/${POSTHOG_DB_NAME}" + [[ -n $POSTHOG_DB_PASSWORD ]] && DB_PASSWORD_COMPONENT=":$POSTHOG_DB_PASSWORD" + export DATABASE_URL="postgres://${POSTHOG_DB_USER:-"postgres"}${DB_PASSWORD_COMPONENT}@${POSTHOG_POSTGRES_HOST:-"localhost"}:${POSTHOG_POSTGRES_PORT:-"5432"}/${POSTHOG_DB_NAME}" +fi + +if [[ -z $REDIS_URL ]]; then + [[ -n $POSTHOG_REDIS_PASSWORD ]] && REDIS_PASSWORD_COMPONENT="$POSTHOG_REDIS_PASSWORD@" + export REDIS_URL="redis://${REDIS_PASSWORD_COMPONENT}${POSTHOG_REDIS_HOST:-"localhost"}:${POSTHOG_REDIS_PORT:-"6379"}/" fi export BASE_DIR=$(dirname $(dirname "$PWD/${0#./}"))