File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11export CORS_ALLOW_ORIGIN=" http://localhost:5173;http://localhost:8080"
22PORT=" ${PORT:- 8080} "
3- uvicorn open_webui.main:app --port $PORT --host 0.0.0.0 --forwarded-allow-ips ' * ' --reload
3+ uvicorn open_webui.main:app --port $PORT --host 0.0.0.0 --forwarded-allow-ips " ${FORWARDED_ALLOW_IPS :-* } " --reload
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ if [ -n "$SPACE_ID" ]; then
5050 echo " Configuring for HuggingFace Space deployment"
5151 if [ -n " $ADMIN_USER_EMAIL " ] && [ -n " $ADMIN_USER_PASSWORD " ]; then
5252 echo " Admin user configured, creating"
53- WEBUI_SECRET_KEY=" $WEBUI_SECRET_KEY " uvicorn open_webui.main:app --host " $HOST " --port " $PORT " --forwarded-allow-ips ' * ' &
53+ WEBUI_SECRET_KEY=" $WEBUI_SECRET_KEY " uvicorn open_webui.main:app --host " $HOST " --port " $PORT " --forwarded-allow-ips " ${FORWARDED_ALLOW_IPS :-* } " &
5454 webui_pid=$!
5555 echo " Waiting for webui to start..."
5656 while ! curl -s " http://localhost:${PORT} /health" > /dev/null; do
8383WEBUI_SECRET_KEY=" $WEBUI_SECRET_KEY " exec " $PYTHON_CMD " -m uvicorn open_webui.main:app \
8484 --host " $HOST " \
8585 --port " $PORT " \
86- --forwarded-allow-ips ' * ' \
86+ --forwarded-allow-ips " ${FORWARDED_ALLOW_IPS :-* } " \
8787 " ${ARGS[@]} "
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ IF NOT "%WEBUI_SECRET_KEY_FILE%" == "" (
2424
2525IF " %PORT% " == " " SET PORT = 8080
2626IF " %HOST% " == " " SET HOST = 0.0.0.0
27+ IF " %FORWARDED_ALLOW_IPS% " == " " SET " FORWARDED_ALLOW_IPS = *"
2728SET " WEBUI_SECRET_KEY = %WEBUI_SECRET_KEY% "
2829SET " WEBUI_JWT_SECRET_KEY = %WEBUI_JWT_SECRET_KEY% "
2930
@@ -46,5 +47,5 @@ IF "%WEBUI_SECRET_KEY% %WEBUI_JWT_SECRET_KEY%" == " " (
4647:: Execute uvicorn
4748SET " WEBUI_SECRET_KEY = %WEBUI_SECRET_KEY% "
4849IF " %UVICORN_WORKERS% " == " " SET UVICORN_WORKERS = 1
49- uvicorn open_webui.main:app --host " %HOST% " --port " %PORT% " --forwarded-allow-ips '*' --workers %UVICORN_WORKERS% --ws auto
50+ uvicorn open_webui.main:app --host " %HOST% " --port " %PORT% " --forwarded-allow-ips " %FORWARDED_ALLOW_IPS% " --workers %UVICORN_WORKERS% --ws auto
5051:: For ssl user uvicorn open_webui.main:app --host "%HOST%" --port "%PORT%" --forwarded-allow-ips '*' --ssl-keyfile "key.pem" --ssl-certfile "cert.pem" --ws auto
You can’t perform that action at this time.
0 commit comments