Skip to content

Commit

Permalink
Fix uds_path error in Ubuntu 22
Browse files Browse the repository at this point in the history
  • Loading branch information
eloravpn committed Nov 5, 2024
1 parent 08fbdf1 commit 05152e4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,11 @@ DEBUG=false
DOCS=false
UVICORN_HOST=0.0.0.0
UVICORN_PORT=${PORT}
UVICORN_UDS=
UVICORN_UDS=""
#SSL Configuration
UVICORN_SSL_CERTFILE=
UVICORN_SSL_KEYFILE=
UVICORN_SSL_CERTFILE=""
UVICORN_SSL_KEYFILE=""
# Database Configuration
SQLALCHEMY_DATABASE_URL="postgresql+psycopg2://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:5432/${DB_NAME}"
Expand Down
5 changes: 4 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@
"fmt"
] = "%(asctime)s - %(levelname)s - %(module)s.%(funcName)s:%(lineno)d - %(message)s"
log_config["loggers"]["uvicorn"]["level"] = config.LOG_LEVEL

uds_path = UVICORN_UDS if UVICORN_UDS and len(UVICORN_UDS.strip()) > 0 else None

try:
uvicorn.run(
"main:app",
host=("127.0.0.1" if DEBUG else UVICORN_HOST),
port=UVICORN_PORT,
uds=(None if DEBUG else UVICORN_UDS),
uds=uds_path,
ssl_certfile=UVICORN_SSL_CERTFILE,
ssl_keyfile=UVICORN_SSL_KEYFILE,
forwarded_allow_ips="*",
Expand Down

0 comments on commit 05152e4

Please sign in to comment.