From df5132e97abced99b45ca701f36f9278aba7ae82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Numbus?= Date: Sun, 17 May 2026 14:21:23 +0200 Subject: [PATCH] Trying to get python bridge to work. --- script/deploy.sh | 7 ++----- web/logic/interactive.py | 3 ++- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/script/deploy.sh b/script/deploy.sh index cb4f252..fdda9f8 100755 --- a/script/deploy.sh +++ b/script/deploy.sh @@ -334,9 +334,7 @@ launch_gui() { echo -e "\n ➡️ You will now proceed to the configuration of your device through your browser" echo -e "\n 🚀 Launching Numbus Configurator..." - cd "${BRIDGE_SCRIPT_DIR}" - python3 "${BRIDGE_SCRIPT_FILE}" > /dev/null 2>&1 & - cd ../../ + python3 "${BRIDGE_SCRIPT}" > /dev/null 2>&1 & export BRIDGE_PID=$! xdg-open "http://localhost:${WEBSERVER_PORT}" 2>/dev/null || open "http://localhost:${WEBSERVER_PORT}" 2>/dev/null || true @@ -717,8 +715,7 @@ LIVE_DATA_FILE="config/live.yaml" HW_DATA_FILE="config/hardware.yaml" CONFIG_FILE="config/numbus.yaml" -BRIDGE_SCRIPT_FILE="interactive.py" -BRIDGE_SCRIPT_DIR="web/logic" +BRIDGE_SCRIPT="web/logic/interactive.py" TARGET_USER="nixos" diff --git a/web/logic/interactive.py b/web/logic/interactive.py index 514cf44..61956cb 100644 --- a/web/logic/interactive.py +++ b/web/logic/interactive.py @@ -12,6 +12,8 @@ CONFIG_DIR = "config/" SIGNALS_DIR = "signal/" ### <-- Variables +os.chdir(web/) + class BridgeHandler(http.server.SimpleHTTPRequestHandler): def do_GET(self): # Route for logs: /logs?type=out or /logs?type=err @@ -51,5 +53,4 @@ class BridgeHandler(http.server.SimpleHTTPRequestHandler): self.end_headers() with open(os.path.join(SIGNALS_DIR, ".deploy_signal"), "w") as f: f.write("1") -os.chdir(../) http.server.HTTPServer(('localhost', 8088), BridgeHandler).serve_forever() \ No newline at end of file