Add no-cache response header to dashboard for immediate visibility after deploys; enhance Proxmox monitoring documentation and update flash script to allow Backup without a golden image.

This commit is contained in:
nearxos
2026-02-18 14:20:31 +02:00
parent ee1c8f1ea6
commit 1b902d18e6
7 changed files with 146 additions and 8 deletions

View File

@@ -14,6 +14,16 @@ from flask import Flask, render_template, jsonify, request, send_file, Response
app = Flask(__name__)
@app.after_request
def no_cache(response):
"""Prevent browser from caching the dashboard so deploys are visible immediately."""
if request.path == "/" or request.path.startswith("/api/"):
response.headers["Cache-Control"] = "no-store, no-cache, must-revalidate, max-age=0"
response.headers["Pragma"] = "no-cache"
return response
BASE_DIR = Path(os.environ.get("CM4_PROVISIONING_DIR", "/var/lib/cm4-provisioning"))
STATUS_FILE = os.environ.get("CM4_STATUS_FILE", str(BASE_DIR / "status.json"))
LOG_FILE = os.environ.get("CM4_LOG_FILE", str(BASE_DIR / "flash.log"))