From b516f6e8cea33553755977f24bf7ec37f86c0f9a Mon Sep 17 00:00:00 2001 From: Broque Thomas <26755000+Nezreka@users.noreply.github.com> Date: Sat, 18 Apr 2026 12:03:12 -0700 Subject: [PATCH] Restore python web_server.py support alongside gunicorn The gunicorn PR blocked direct Python execution with SystemExit. Replaced with _DIRECT_RUN flag at top and startup block at bottom so both paths work: - python web_server.py (Werkzeug dev server, Windows compatible) - gunicorn -c gunicorn.conf.py wsgi:application (production) --- web_server.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/web_server.py b/web_server.py index 0e55ea72..1a9b0fd5 100644 --- a/web_server.py +++ b/web_server.py @@ -1,10 +1,4 @@ -if __name__ == '__main__': - raise SystemExit( - "SoulSync must be started with Gunicorn.\n" - "Use:\n" - "`gunicorn -c gunicorn.conf.py wsgi:application` for production, or\n" - "`gunicorn -c gunicorn.dev.conf.py wsgi:application` for local development." - ) +_DIRECT_RUN = (__name__ == '__main__') import os import json @@ -54522,3 +54516,13 @@ def start_runtime_services(): print("WebSocket emitters started (Phase 1-7: global/dashboard/enrichment/tools/sync/automations/repair + rate monitor)") _runtime_started = True + + +# Direct execution: python web_server.py (dev/Windows fallback) +# Production should use: gunicorn -c gunicorn.conf.py wsgi:application +if _DIRECT_RUN: + print("Starting SoulSync Web UI Server...") + print("Open your browser and navigate to http://127.0.0.1:8008") + print("Tip: For production, use gunicorn -c gunicorn.conf.py wsgi:application") + start_runtime_services() + socketio.run(app, host='0.0.0.0', port=8008, debug=False, allow_unsafe_werkzeug=True)