mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-06-07 05:30:40 +02:00
fix(config): password auth to be url-encoded to avoid some deployment errors (#1422)
This commit is contained in:
parent
a467999984
commit
20a22e2bc0
@ -1,4 +1,5 @@
|
|||||||
import os
|
import os
|
||||||
|
import urllib.parse
|
||||||
|
|
||||||
from danswer.configs.constants import AuthType
|
from danswer.configs.constants import AuthType
|
||||||
from danswer.configs.constants import DocumentIndexType
|
from danswer.configs.constants import DocumentIndexType
|
||||||
@ -117,7 +118,10 @@ except ValueError:
|
|||||||
# Below are intended to match the env variables names used by the official postgres docker image
|
# Below are intended to match the env variables names used by the official postgres docker image
|
||||||
# https://hub.docker.com/_/postgres
|
# https://hub.docker.com/_/postgres
|
||||||
POSTGRES_USER = os.environ.get("POSTGRES_USER") or "postgres"
|
POSTGRES_USER = os.environ.get("POSTGRES_USER") or "postgres"
|
||||||
POSTGRES_PASSWORD = os.environ.get("POSTGRES_PASSWORD") or "password"
|
# URL-encode the password for asyncpg to avoid issues with special characters on some machines.
|
||||||
|
POSTGRES_PASSWORD = urllib.parse.quote_plus(
|
||||||
|
os.environ.get("POSTGRES_PASSWORD") or "password"
|
||||||
|
)
|
||||||
POSTGRES_HOST = os.environ.get("POSTGRES_HOST") or "localhost"
|
POSTGRES_HOST = os.environ.get("POSTGRES_HOST") or "localhost"
|
||||||
POSTGRES_PORT = os.environ.get("POSTGRES_PORT") or "5432"
|
POSTGRES_PORT = os.environ.get("POSTGRES_PORT") or "5432"
|
||||||
POSTGRES_DB = os.environ.get("POSTGRES_DB") or "postgres"
|
POSTGRES_DB = os.environ.get("POSTGRES_DB") or "postgres"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user