This commit is contained in:
Oliver
2025-08-13 09:23:21 +02:00
parent dfca0844f0
commit 140a712abf
9 changed files with 28 additions and 17 deletions

View File

@@ -49,7 +49,8 @@ def init_db():
comment text,
domains text,
status char (20).
created DATE
created DATE,
bump DATE
)
''')
conn.commit()
@@ -104,7 +105,7 @@ the shell script BIN_PATH/nukeContainer is called withtge containerid as paramet
def info_container(request: InfoContainerRequest):
--> refactor: When no container id is given, query all containers from the database. when a containeris is given, just select that one. Return the result
--> create an endpoint that changes the container image to the latest version of that image /container/bump besides updating the container image, also update the SQL for this container and put the current date into "bump"
--> add /container/quota return the disk and ram usage of this container. I think you can obtain this from docker
@@ -120,13 +121,14 @@ def get_containers():
return Response(content='{"error": "Script failed"}', media_type="application/json", status_code=500)
return Response(content=result.stdout, media_type="application/json")
--> create an endpoint that lkists all docker images available on the system /system/images
@app.get("/system/info", dependencies=[Depends(verify_api_key)])
def get_system_info():
return all INFOas JSON
in this function add last_update and return the content of /4server/data/update
if this file does not exist return NONE
also add the latest bump date of all images in the database
return the VERSION as well.
try:
with open("/etc/alpine-release") as f:
@@ -151,7 +153,7 @@ def get_resources():
"cpu_count": psutil.cpu_count(logical=True),
}
--> create an endpoint that docker pulls all containers /system/pull
# ---------------------- Entry Point ----------------------
if __name__ == "__main__":