Update secret key in Flask app and modify provisioning script to set image flag correctly

This commit is contained in:
2026-04-19 13:04:46 +02:00
parent 280d25dda9
commit 2f6cb382f7
2 changed files with 14 additions and 2 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ from bson.objectid import ObjectId
import user as user_store
app = Flask(__name__)
app.secret_key = "ASDfhbsdfseiufhgildsrfrjg874368546987s6e8468f4s"
app.secret_key = "ASDfhbsdfseiufhgildsrfrjg874368546987s6e8468f4!?FAUS/&s"
app.config["SESSION_COOKIE_HTTPONLY"] = True
app.config["SESSION_COOKIE_SAMESITE"] = "Strict"
app.config["SESSION_COOKIE_SECURE"] = os.environ.get("SESSION_COOKIE_SECURE", "0") == "1"
+13 -1
View File
@@ -202,7 +202,7 @@ for line in lines:
if not in_app and re.match(r"^\s{2}app:\s*$", line):
in_app = True
image_set = False
image_set = True
out.append(line)
out.append(f" image: {target_image}\n")
continue
@@ -352,6 +352,8 @@ out = []
in_nginx = False
in_ports = False
ports_indent = ""
in_app = False
seen_app_image = False
i = 0
while i < len(lines):
@@ -366,6 +368,10 @@ while i < len(lines):
i += 1
continue
if indent == 2 and stripped.endswith(":"):
in_app = stripped.startswith("app:")
seen_app_image = False
if in_nginx and indent == 2 and stripped.endswith(":") and not stripped.startswith("nginx:"):
in_nginx = False
in_ports = False
@@ -374,6 +380,12 @@ while i < len(lines):
i += 1
continue
if in_app and indent == 4 and stripped.startswith("image:"):
if seen_app_image:
i += 1
continue
seen_app_image = True
if in_nginx and stripped.startswith("ports:") and indent == 4:
out.append(line)
out.append(" - \"${INVENTAR_HTTP_PORT:-80}:80\"")