diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..0d91a54 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.3.0 diff --git a/app.py b/app.py index 2306716..701b60b 100644 --- a/app.py +++ b/app.py @@ -1444,6 +1444,7 @@ def admin_settings(): hermes_key_masked=hermes_key_masked, hermes_key_set=hermes_key_set, hermes_key_just_generated=hermes_key_just_generated, + version=current_app.config['VERSION'], ) diff --git a/config.py b/config.py index 3aaeedf..17df86d 100644 --- a/config.py +++ b/config.py @@ -32,10 +32,20 @@ Environment variables (defaults shown): import os from dotenv import load_dotenv +from pathlib import Path + # Load variables from .env file if present (development mode). load_dotenv() +def _load_version(): + """Read the package version from the VERSION file next to this module.""" + version_file = Path(__file__).parent / 'VERSION' + if version_file.exists(): + return version_file.read_text().strip() + return '0.0.0' + + class Config: # Flask secret key: used to sign session cookies and encrypt stored credentials. SECRET_KEY = os.environ.get('APP_SECRET_KEY', 'dev-secret-change-me') @@ -82,3 +92,6 @@ class Config: # Informational price shown to the operator/customer; actual payment is collected manually (e.g. Square). PRICE_PER_VERSION = float(os.environ.get('PRICE_PER_VERSION', '10.00')) CURRENCY = os.environ.get('CURRENCY', 'CAD') + + # Package version, read from VERSION file. + VERSION = _load_version() diff --git a/templates/admin/settings.html b/templates/admin/settings.html index 843276e..d70e3b2 100644 --- a/templates/admin/settings.html +++ b/templates/admin/settings.html @@ -164,7 +164,7 @@