mirror of
https://github.com/goauthentik/authentik.git
synced 2026-06-17 19:09:11 +03:00
lifecycle: fix migration conn_options for psycopg connection (#19134)
fix migrations to add conn_options to the psycopg connection
This commit is contained in:
@@ -73,6 +73,7 @@ def release_lock(conn: Connection, cursor: Cursor):
|
||||
|
||||
|
||||
def run_migrations():
|
||||
conn_opts = CONFIG.get_dict_from_b64_json("postgresql.conn_options", default={})
|
||||
conn = connect(
|
||||
dbname=CONFIG.get("postgresql.name"),
|
||||
user=CONFIG.get("postgresql.user"),
|
||||
@@ -83,6 +84,7 @@ def run_migrations():
|
||||
sslrootcert=CONFIG.get("postgresql.sslrootcert"),
|
||||
sslcert=CONFIG.get("postgresql.sslcert"),
|
||||
sslkey=CONFIG.get("postgresql.sslkey"),
|
||||
**conn_opts,
|
||||
)
|
||||
curr = conn.cursor()
|
||||
try:
|
||||
|
||||
@@ -18,6 +18,7 @@ def check_postgres():
|
||||
if attempt >= CHECK_THRESHOLD:
|
||||
sysexit(1)
|
||||
try:
|
||||
conn_opts = CONFIG.get_dict_from_b64_json("postgresql.conn_options", default={})
|
||||
conn = connect(
|
||||
dbname=CONFIG.refresh("postgresql.name"),
|
||||
user=CONFIG.refresh("postgresql.user"),
|
||||
@@ -28,6 +29,7 @@ def check_postgres():
|
||||
sslrootcert=CONFIG.get("postgresql.sslrootcert"),
|
||||
sslcert=CONFIG.get("postgresql.sslcert"),
|
||||
sslkey=CONFIG.get("postgresql.sslkey"),
|
||||
**conn_opts,
|
||||
)
|
||||
conn.cursor()
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user