From e3ee1a37ca4e19d62f18d69b279c9fdf51f9a8a9 Mon Sep 17 00:00:00 2001 From: Michael Matloka Date: Mon, 22 Feb 2021 19:15:45 +0100 Subject: [PATCH] Support POSTHOG_REDIS_* vars in bin/plugin-server (#3426) --- bin/plugin-server | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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#./}"))