Update the logic to wait for the hardware detection data.
This commit is contained in:
@@ -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()
|
||||
Reference in New Issue
Block a user