Update the logic to wait for the hardware detection data.

This commit is contained in:
Raphaël Numbus
2026-05-17 19:52:02 +02:00
parent de890387d5
commit 440f4c8fb5
4 changed files with 36 additions and 11 deletions
+1 -6
View File
@@ -33,7 +33,7 @@ class BridgeHandler(http.server.SimpleHTTPRequestHandler):
return
# Restrict static file access to specific directories only
if not any(self.path.startswith(prefix) for prefix in ['/pages', '/media']):
if not any(self.path.startswith(prefix) for prefix in ['/pages', '/media', '/config']):
self.send_error(403, "Access Denied: Resource is restricted.")
return
@@ -48,16 +48,11 @@ class BridgeHandler(http.server.SimpleHTTPRequestHandler):
f.write(post_data)
self.send_response(200)
self.end_headers()
# Signal Bash that discovery data is ready and we can proceed to hardware detection
os.makedirs(SIGNALS_DIR, exist_ok=True)
with open(os.path.join(SIGNALS_DIR, "hw_detection_ready"), "w") as f: f.write("1")
with open(os.path.join(SIGNALS_DIR, "configuration_ready"), "w") as f: f.write("1")
elif self.path == '/deploy':
with open(os.path.join(CONFIG_DIR, "numbus.yaml"), "wb") as f:
f.write(post_data)
self.send_response(200)
self.end_headers()
with open(os.path.join(SIGNALS_DIR, "deployment_ready"), "w") as f: f.write("1")
http.server.HTTPServer(('localhost', 8088), BridgeHandler).serve_forever()