Extra debug info for webhooks

This commit is contained in:
AzureAD\AniketSaha 2025-07-08 16:26:17 +02:00
parent b1b691a368
commit 86c812178e

View File

@ -31,13 +31,17 @@ async def github_webhook(request: Request):
# Call the update script on the HOST using host bash # Call the update script on the HOST using host bash
subprocess.run( subprocess.run(
["/usr/bin/bash", "-c", "bash /home/hmi/Desktop/HMI/update_hmi.sh"], ["/usr/bin/bash", "-c", "bash /home/hmi/Desktop/HMI/update_hmi.sh"],
check=True check=True,
capture_output=True,
text=True
) )
return {"status": "Update triggered"} return {"status": "Update triggered"}
except subprocess.CalledProcessError as e: except subprocess.CalledProcessError as e:
print(f"[WEBHOOK] Update failed:\n{e.stderr}")
return {"status": "Update failed", "error": str(e)} return {"status": "Update failed", "error": str(e)}
@app.post("/connect_toggle") @app.post("/connect_toggle")
def connect_toggle(): def connect_toggle():
"""Toggle CAN connection.""" """Toggle CAN connection."""