From 832bb0778700ac9ca7bbadb4c450c5bfefe8c8aa Mon Sep 17 00:00:00 2001 From: Antti Kettunen Date: Sat, 18 Apr 2026 12:38:36 +0300 Subject: [PATCH] Prevent running web_server.py directly, enforce gunicorn Should not support completely different ways of running the server, as that can lead to inconsistencies between environments / runtimes --- web_server.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/web_server.py b/web_server.py index 4360bad0..928cbb2f 100644 --- a/web_server.py +++ b/web_server.py @@ -1,3 +1,11 @@ +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." + ) + import os import json import asyncio @@ -54303,11 +54311,3 @@ def start_runtime_services(): print("WebSocket emitters started (Phase 1-7: global/dashboard/enrichment/tools/sync/automations/repair + rate monitor)") _runtime_started = True - - -if __name__ == '__main__': - print("Starting SoulSync Web UI Server...") - print("Open your browser and navigate to http://127.0.0.1:8008") - print("Note: direct `python web_server.py` startup is a legacy fallback; use Gunicorn for production.") - start_runtime_services() - socketio.run(app, host='0.0.0.0', port=8008, debug=False, allow_unsafe_werkzeug=True)