From 4f868a7c0983b50a61b577231e0918592ed34ff8 Mon Sep 17 00:00:00 2001 From: Jiri Vrany Date: Thu, 16 Oct 2025 12:45:20 +0200 Subject: [PATCH 1/2] debug instance config --- flowapp/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/flowapp/__init__.py b/flowapp/__init__.py index 9b9616a..c93a60e 100644 --- a/flowapp/__init__.py +++ b/flowapp/__init__.py @@ -34,6 +34,7 @@ def create_app(config_object=None): try: app.config.from_pyfile("../instance_config_override.py", silent=False) except FileNotFoundError: + print("No instance_config_override.py found, using defaults.") pass # No override file, use defaults app.config.setdefault("VERSION", __version__) From 24e35b0b3e152cb186a4f4290e6c33aa5607e538 Mon Sep 17 00:00:00 2001 From: Jiri Vrany Date: Thu, 16 Oct 2025 18:02:28 +0200 Subject: [PATCH 2/2] v 1.1.7. - fixes instance config loading when installed as a package --- CHANGELOG.md | 9 ++++++++- flowapp/__about__.py | 2 +- flowapp/__init__.py | 11 +++++++---- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d6a319f..99565bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to ExaFS will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.1.7] - 2025-10-16 + +### Fixed +- Fixed config loading to use Flask instance folder +- Resolves path issues when package is installed via pip + ## [1.1.6] - 2025-10-08 ### Fixed @@ -268,4 +274,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [0.5.0]: https://github.com/CESNET/exafs/compare/v0.4.8...v0.5.0 [0.4.8]: https://github.com/CESNET/exafs/compare/v0.4.7...v0.4.8 [0.4.7]: https://github.com/CESNET/exafs/compare/v0.4.6...v0.4.7 -[0.4.6]: https://github.com/CESNET/exafs/releases/tag/v0.4.6 \ No newline at end of file +[0.4.6]: https://github.com/CESNET/exafs/releases/tag/v0.4.6 + diff --git a/flowapp/__about__.py b/flowapp/__about__.py index 35407e8..b12417c 100755 --- a/flowapp/__about__.py +++ b/flowapp/__about__.py @@ -1,4 +1,4 @@ -__version__ = "1.1.6" +__version__ = "1.1.7" __title__ = "ExaFS" __description__ = "Tool for creation, validation, and execution of ExaBGP messages." __author__ = "CESNET / Jiri Vrany, Petr Adamec, Josef Verich, Jakub Man" diff --git a/flowapp/__init__.py b/flowapp/__init__.py index c93a60e..d1ea49d 100644 --- a/flowapp/__init__.py +++ b/flowapp/__init__.py @@ -1,4 +1,5 @@ # -*- coding: utf-8 -*- +import os from flask import Flask, redirect, render_template, session, url_for from flask_sso import SSO @@ -23,7 +24,8 @@ def create_app(config_object=None): - app = Flask(__name__) + # Enable instance_relative_config to use /app/instance folder + app = Flask(__name__, instance_relative_config=True) # Load the default configuration for dashboard and main menu app.config.from_object(InstanceConfig) @@ -31,10 +33,11 @@ def create_app(config_object=None): app.config.from_object(config_object) # Allow override of instance config from external file + # This now looks in /app/instance/config_override.py instead of ../instance_config_override.py try: - app.config.from_pyfile("../instance_config_override.py", silent=False) - except FileNotFoundError: - print("No instance_config_override.py found, using defaults.") + app.config.from_pyfile("config_override.py", silent=False) + except FileNotFoundError as e: + print(f"Instance config override file not found: {e.filename}, using defaults.") pass # No override file, use defaults app.config.setdefault("VERSION", __version__)