Update api
This commit is contained in:
@@ -386,6 +386,16 @@ def get_cpu_log():
|
|||||||
raise HTTPException(status_code=500, detail=f"Error reading CPU log: {e}")
|
raise HTTPException(status_code=500, detail=f"Error reading CPU log: {e}")
|
||||||
|
|
||||||
|
|
||||||
|
@app.get("/server/audit", dependencies=[Depends(verify_api_key)])
|
||||||
|
def server_audit():
|
||||||
|
output = run_command([f"{BIN_PATH}/audit"])
|
||||||
|
# The audit script outputs JSON; parse and return it
|
||||||
|
try:
|
||||||
|
return json.loads(output)
|
||||||
|
except json.JSONDecodeError:
|
||||||
|
return {"raw_output": output}
|
||||||
|
|
||||||
|
|
||||||
@app.get("/system/info", dependencies=[Depends(verify_api_key)])
|
@app.get("/system/info", dependencies=[Depends(verify_api_key)])
|
||||||
def get_system_info():
|
def get_system_info():
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user