maint script

This commit is contained in:
Q
2023-08-19 12:28:58 +03:00
parent aa6a1d2373
commit bdacb80c43
4 changed files with 60 additions and 32 deletions

View File

@@ -28,6 +28,7 @@ from utils import (
db_add_download,
db_get_file,
db_delete_file,
db_maintenance,
)
__MINI_FLEES_VERSION__ = "20230818.0"
@@ -109,6 +110,12 @@ def ls():
return "\n".join(file_list()), 200
@app.route("/maintenance", methods=["GET"])
def maintenance():
secret = request.headers.get("Secret", "")
if secret != app.config["ACCESS_TOKEN"]:
return "Error", 401
return db_maintenance(), 200
@app.route("/dl/<token>/<name>", methods=["GET"])