From 337c0daf2232128a37ef09d529f5b5af6ed367a6 Mon Sep 17 00:00:00 2001 From: Matthew Grotke Date: Thu, 11 Jun 2026 01:55:15 -0400 Subject: [PATCH] Development --- docker/routlin-dash/app/config_utils.py | 2 +- docker/routlin-dash/app/settings.py | 9 ++++++++- docker/routlin-portal/app/config_utils.py | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/docker/routlin-dash/app/config_utils.py b/docker/routlin-dash/app/config_utils.py index f618482..4ab2a7f 100644 --- a/docker/routlin-dash/app/config_utils.py +++ b/docker/routlin-dash/app/config_utils.py @@ -5,7 +5,7 @@ from datetime import datetime, timezone from flask import session APP_DIR = _os.path.dirname(_os.path.abspath(__file__)) -CONFIGS_DIR = '/routlin_location' +CONFIGS_DIR = _settings.routlin_location() DATA_DIR = '/data' WWW_DIR = '/www' ACCOUNTS_DB = f'{DATA_DIR}/.dashboard-accounts' diff --git a/docker/routlin-dash/app/settings.py b/docker/routlin-dash/app/settings.py index 945458d..d0a83af 100644 --- a/docker/routlin-dash/app/settings.py +++ b/docker/routlin-dash/app/settings.py @@ -14,8 +14,15 @@ def is_production(): return not os.environ.get('DEV_MODE', '').lower() in ('1', 'true', 'yes') +def routlin_location(): + return os.environ.get('ROUTLIN_LOCATION', '/routlin_location') + + def is_pro(): - return bool(os.environ.get('LICENSE', '').strip()) + try: + return bool(open(f'{routlin_location()}/.license').read().strip()) + except OSError: + return False def get_host_utc_offset(): diff --git a/docker/routlin-portal/app/config_utils.py b/docker/routlin-portal/app/config_utils.py index 58de7d0..8d1c559 100644 --- a/docker/routlin-portal/app/config_utils.py +++ b/docker/routlin-portal/app/config_utils.py @@ -1,6 +1,6 @@ import copy, json, os -CONFIGS_DIR = '/routlin_location' +CONFIGS_DIR = os.environ.get('ROUTLIN_LOCATION', '/routlin_location') CONFIG_FILE = f'{CONFIGS_DIR}/config.json' CAPTIVE_QUEUE = f'{CONFIGS_DIR}/.captive-queue'