From 31ebe96f76ada26847bf0bf4c8adabc70bb04f49 Mon Sep 17 00:00:00 2001 From: BoulderBadgeDad Date: Thu, 11 Jun 2026 17:29:12 -0700 Subject: [PATCH] dev: add `--lan` flag to dev.py to expose the dev server on the network Typing SOULSYNC_WEB_BIND_HOST=0.0.0.0 every launch is awkward. `python dev.py --lan` sets it for you (binds 0.0.0.0 so other devices can reach it); plain `python dev.py` stays localhost-only. Set before build_backend_env() so it propagates to both the direct (Windows) and gunicorn backend modes. --- dev.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dev.py b/dev.py index 95ca24bd..ea86e1bc 100755 --- a/dev.py +++ b/dev.py @@ -316,6 +316,14 @@ def watch_and_run_backend() -> None: def main() -> int: + # `--lan` exposes the dev server on the network (binds 0.0.0.0) so you can + # reach it from another device at http://:8008. Default stays + # localhost-only. Set before build_backend_env() so both backend modes see it. + if '--lan' in sys.argv: + os.environ['SOULSYNC_WEB_BIND_HOST'] = '0.0.0.0' + print('LAN mode ON — dev server reachable from other devices on your network ' + '(http://:8008). Allow port 8008 through the firewall if needed.') + if not (ROOT_DIR / 'webui' / 'node_modules').is_dir(): print('webui/node_modules is missing.') print('Run: cd webui && npm ci')