flight
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
template templates/hosthostname /etc/hostname
|
||||
|
||||
# ass swap file ????
|
||||
# ------ create user 4server
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,2 @@
|
||||
#!/bin/ass
|
||||
|
||||
doas apk update
|
||||
doas apk upgrade
|
||||
#!/bin/bash
|
||||
rex doas restart
|
||||
|
||||
10
app/sbin/api
10
app/sbin/api
@@ -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__":
|
||||
|
||||
2
app/templates/hosts
Normal file
2
app/templates/hosts
Normal file
@@ -0,0 +1,2 @@
|
||||
127.0.0.1 {{hostname}} localhost
|
||||
10.5.0.200 beedb
|
||||
@@ -4,11 +4,13 @@
|
||||
rex doas mkdir -p /4server
|
||||
rex doas chmod 777 /4server
|
||||
rex mkdir -p /4server/data
|
||||
template templates/hosts /etc/hosts
|
||||
|
||||
|
||||
### PACKAGES
|
||||
template templates/repositories /etc/apk/repositories
|
||||
rex doas apk update && upgrade
|
||||
rex doas apk add jq rsync mc vim docker docker-compose htop linux-lts sqlite bash
|
||||
rex doas apk add jq rsync mc vim docker docker-compose htop linux-lts sqlite bash postgresql-16-client
|
||||
|
||||
### own bins
|
||||
prsync -h "$hosts_file" -avz ./sbin/ /4server/sbin/
|
||||
@@ -19,7 +21,7 @@ prsync -h "$hosts_file" -avz ./sbin/ /4server/sbin/
|
||||
template templates/4server /etc/4server
|
||||
|
||||
#INSTALL API SERVICE
|
||||
template templates/init.d/4server-api /etc/init.d/4server-api
|
||||
template templates/init.d/4server-api /etc/init.d/4server-api:
|
||||
rex doas chmod 0755 /etc/init.d/4server-api
|
||||
rex doas chown root:root /etc/init.d/4server-api
|
||||
rex doas rc-update add 4server-api default
|
||||
@@ -31,6 +33,8 @@ rex doas rc-service 4server-api restart
|
||||
rex doas rc-service docker start
|
||||
rex doas rc-update add docker boot
|
||||
|
||||
|
||||
|
||||
rex mkdir -p /4server/data/treafik/config/
|
||||
template templates/traefik.yaml /4server/data/traefik/config/traefik.yaml
|
||||
|
||||
|
||||
Reference in New Issue
Block a user