From 8c36a0dc033738b63447702b796a87ff5568718e Mon Sep 17 00:00:00 2001 From: Gagan Deep Date: Fri, 10 Jun 2022 17:45:36 +0530 Subject: [PATCH] [fix] Fixed REDIS_PASS environment variable --- images/openwisp_wireguard/update_wireguard.sh | 4 ++-- images/openwisp_wireguard_updater/vpn_updater.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/images/openwisp_wireguard/update_wireguard.sh b/images/openwisp_wireguard/update_wireguard.sh index 8a46f648..dd72ddb9 100644 --- a/images/openwisp_wireguard/update_wireguard.sh +++ b/images/openwisp_wireguard/update_wireguard.sh @@ -123,8 +123,8 @@ watch_configuration_change() { if [[ "$REDIS_PORT" ]]; then _REDIS_CMD="$_REDIS_CMD -p $REDIS_PORT" fi - if [[ "$REDIS_PASSWORD" ]]; then - _REDIS_CMD="$_REDIS_CMD -a $REDIS_PASSWORD" + if [[ "$REDIS_PASS" ]]; then + _REDIS_CMD="$_REDIS_CMD -a $REDIS_PASS" fi while true; do if [ -f "$_TIMESTAMP_FILE" ]; then diff --git a/images/openwisp_wireguard_updater/vpn_updater.py b/images/openwisp_wireguard_updater/vpn_updater.py index c5c106c3..bfee5c61 100644 --- a/images/openwisp_wireguard_updater/vpn_updater.py +++ b/images/openwisp_wireguard_updater/vpn_updater.py @@ -9,14 +9,14 @@ KEY = os.environ.get('WIREGUARD_UPDATER_KEY') REDIS_HOST = os.environ.get('REDIS_HOST') REDIS_PORT = os.environ.get('REDIS_PORT') -REDIS_PASSWORD = os.environ.get('REDIS_PASSWORD') +REDIS_PASS = os.environ.get('REDIS_PASS') REDIS_DATABASE = os.environ.get('REDIS_DB', 15) def _trigger_configuration_update(vpn_id): redis_kwargs = {} - if REDIS_PASSWORD: - redis_kwargs['password'] = REDIS_PASSWORD + if REDIS_PASS: + redis_kwargs['password'] = REDIS_PASS if REDIS_PORT: redis_kwargs['port'] = REDIS_PORT unix_timestamp = int(datetime.now().timestamp())