From 4cf00ed5cfdd99dad94b4c86c5073aa4ad89e36f Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Thu, 31 Mar 2022 16:37:54 +0000 Subject: [PATCH] lifecycle: fix password and hostname not properly quoted #2623 --- lifecycle/wait_for_db.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lifecycle/wait_for_db.py b/lifecycle/wait_for_db.py index 7088f070f..bc880c3db 100755 --- a/lifecycle/wait_for_db.py +++ b/lifecycle/wait_for_db.py @@ -5,6 +5,7 @@ from json import dumps from sys import exit as sysexit from sys import stderr from time import sleep, time +from urllib.parse import quote_plus from psycopg2 import OperationalError, connect from redis import Redis @@ -58,7 +59,7 @@ if CONFIG.y_bool("redis.tls", False): REDIS_PROTOCOL_PREFIX = "rediss://" REDIS_URL = ( f"{REDIS_PROTOCOL_PREFIX}:" - f"{CONFIG.y('redis.password')}@{CONFIG.y('redis.host')}:" + f"{quote_plus(CONFIG.y('redis.password'))}@{quote_plus(CONFIG.y('redis.host'))}:" f"{int(CONFIG.y('redis.port'))}/{CONFIG.y('redis.ws_db')}" ) while True: