Spaces:
Paused
Paused
Automated deployment update from ML build
Browse files
services/open_webui_service.py
CHANGED
|
@@ -5,6 +5,6 @@ LOG_PATH=os.path.join(METRICS_DIR,'open_webui.log')
|
|
| 5 |
PORT=3000
|
| 6 |
PREFIX='[open-webui]'
|
| 7 |
def start():
|
| 8 |
-
|
| 9 |
-
with open(LOG_PATH,'a')as
|
| 10 |
-
logger.success(f"{PREFIX} Open WebUI started (pid {
|
|
|
|
| 5 |
PORT=3000
|
| 6 |
PREFIX='[open-webui]'
|
| 7 |
def start():
|
| 8 |
+
F='/opt/venv-openwebui/bin/open-webui';E='DATA_DIR';D='none';B='127.0.0.1';os.makedirs(METRICS_DIR,exist_ok=True);A=os.environ.copy();A['OPENAI_API_BASE_URL']='http://127.0.0.1:8080/v1';A['OPENAI_API_KEY']=A.get('LITELLM_MASTER_KEY',D)or D;A['WEBUI_AUTH']='False';A.setdefault('WEBUI_SECRET_KEY','sanctuary_owui_secret_key_server01');A.setdefault('OAUTH_SESSION_TOKEN_ENCRYPTION_KEY','sanctuary_owui_oauth_token_key_server01_32bytes');A[E]=os.path.join(METRICS_DIR,'open_webui_data');os.makedirs(A[E],exist_ok=True);A['PORT']=str(PORT);A['HOST']=B;A['UVICORN_HOST']=B;A['UVICORN_PORT']=str(PORT);from pathlib import Path;G=F if Path(F).exists()else'open-webui';H=[G,'serve','--host',B,'--port',str(PORT)];logger.info(f"{PREFIX} Starting Open WebUI on 127.0.0.1:{PORT}...")
|
| 9 |
+
with open(LOG_PATH,'a')as C:I=subprocess.Popen(H,stdout=C,stderr=C,env=A)
|
| 10 |
+
logger.success(f"{PREFIX} Open WebUI started (pid {I.pid}). Reachable at http://127.0.0.1:{PORT} exclusively over Tailscale / private overlay networks.")
|