Skip to content

Commit

Permalink
[fix] Fixed REDIS_PASS environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
pandafy committed Jun 10, 2022
1 parent 95a6933 commit 8c36a0d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions images/openwisp_wireguard/update_wireguard.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions images/openwisp_wireguard_updater/vpn_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 8c36a0d

Please sign in to comment.