From f988ddc4895d46c43a7d57afc25268457c8332e1 Mon Sep 17 00:00:00 2001 From: ION606 Date: Mon, 17 Feb 2025 15:10:11 -0500 Subject: [PATCH] added server name env var --- app.py | 9 ++++++++- templates/base.html | 8 ++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/app.py b/app.py index f0c8648..3533643 100644 --- a/app.py +++ b/app.py @@ -8,6 +8,7 @@ from flask import ( flash, abort, jsonify, + session ) from flask_sqlalchemy import SQLAlchemy from flask_login import ( @@ -46,7 +47,7 @@ PORT = 5121 app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:////app/instance/db.sqlite" app.config["UPLOAD_FOLDER"] = "sites" app.config["SERVER_NAME"] = "tinysite.cloud" -app.config["SESSION_COOKIE_DOMAIN"] = ".tinysite.cloud" +# app.config["SESSION_COOKIE_DOMAIN"] = ".tinysite.cloud" db = SQLAlchemy(app) @@ -104,6 +105,12 @@ class Site(db.Model): def page_not_found(_): return render_template("404.html", domain=request.host), 404 +@app.context_processor +def inject_global_variable(): + return { + "SERVERNAME": app.config["SERVER_NAME"], + } + # Auth setup login_manager = LoginManager() diff --git a/templates/base.html b/templates/base.html index 0db0d51..fd640ab 100644 --- a/templates/base.html +++ b/templates/base.html @@ -13,7 +13,7 @@ - +