docker environment control improvement
This commit is contained in:
@@ -13,7 +13,13 @@ class DatabaseManager:
|
||||
def load_config(self):
|
||||
if os.path.exists(self.config_file):
|
||||
self.config.read(self.config_file)
|
||||
self.db_path = self.config.get('openvpn_monitor', 'db_path', fallback='openvpn_monitor.db')
|
||||
|
||||
# Priority: ENV > Config File > Fallback
|
||||
env_db_path = os.getenv('OVPMON_OPENVPN_MONITOR_DB_PATH')
|
||||
if env_db_path:
|
||||
self.db_path = env_db_path
|
||||
else:
|
||||
self.db_path = self.config.get('openvpn_monitor', 'db_path', fallback='openvpn_monitor.db')
|
||||
|
||||
def get_connection(self):
|
||||
"""Get a database connection"""
|
||||
|
||||
Reference in New Issue
Block a user