add gateway automatic template and fefan vm

This commit is contained in:
2026-01-19 17:05:38 +01:00
parent d98c7b8bdb
commit f851ead7cd
56 changed files with 1243 additions and 82 deletions

View File

@@ -0,0 +1,23 @@
from flask import Flask, request, abort
import subprocess
import os
SECRET = os.environ.get("WEBHOOK_SECRET")
REPOSITORY = os.environ.get("GATEWAY_REPOSITORY_LOCATION")
app = Flask(__name__)
@app.route("/reload", methods=["POST"])
def reload():
token = request.headers.get("X-Webhook-Token")
if token != SECRET:
abort(403)
subprocess.run(
["git", "-C", REPOSITORY, "pull"],
check=True
)
return "ok\n"
if __name__ == "__main__":
app.run()