From fb730baa73b255901a31d122bafafa9e9a2e1179 Mon Sep 17 00:00:00 2001 From: Yusur Princeps Date: Sun, 16 Nov 2025 09:44:04 +0100 Subject: [PATCH] add config FORCE_SERVER_NAME --- CHANGELOG.md | 1 + freak/__init__.py | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 988919e..4884a3d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - **BREAKING**: `SERVER_NAME` env variable now contains the domain name. `DOMAIN_NAME` has been removed. - libsuou bumped to 0.6.0 - Added several REST routes. Change needed due to pending frontend separation. +- Deprecated the old web routes except for `/report` and `/admin` ## 0.4.0 diff --git a/freak/__init__.py b/freak/__init__.py index 7b98de3..ec60c54 100644 --- a/freak/__init__.py +++ b/freak/__init__.py @@ -26,7 +26,7 @@ from suou import twocolon_list, WantsContentType from .colors import color_themes, theme_classes -__version__ = '0.5.0-dev43' +__version__ = '0.5.0-dev44' APP_BASE_DIR = os.path.dirname(os.path.dirname(__file__)) @@ -38,6 +38,7 @@ class AppConfig(ConfigOptions): database_url = ConfigValue(required=True) app_name = ConfigValue() server_name = ConfigValue() + force_server_name = ConfigValue(cast=bool, default=True) private_assets = ConfigValue(cast=ssv_list) # deprecated jquery_url = ConfigValue(default='https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js') @@ -56,7 +57,9 @@ app.secret_key = app_config.secret_key app.config['SQLALCHEMY_DATABASE_URI'] = app_config.database_url app.config['JSONIFY_PRETTYPRINT_REGULAR'] = False app.config['QUART_AUTH_DURATION'] = 365 * 24 * 60 * 60 -app.config['SERVER_NAME'] = app_config.server_name + +if app_config.server_name and app_config.force_server_name: + app.config['SERVER_NAME'] = app_config.server_name ## DO NOT ADD LOCAL IMPORTS BEFORE THIS LINE