From e9de8f1adb16b47becf700100333c38b8e860f5c Mon Sep 17 00:00:00 2001 From: "Victor R. Santos" Date: Sat, 7 Nov 2020 16:21:34 -0300 Subject: [PATCH] Add env variable to change configuration file path. ETEBASE_EASY_CONFIG_PATH is optional, the server serches for the configurations files in this order: - "ETEBASE_EASY_CONFIG_PATH" - etebase-server.ini - /etc/etebase-server/etebase-server.ini --- etebase_server/settings.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/etebase_server/settings.py b/etebase_server/settings.py index f785cb7..ee98f55 100644 --- a/etebase_server/settings.py +++ b/etebase_server/settings.py @@ -141,7 +141,12 @@ MEDIA_URL = '/user-media/' # Define where to find configuration files -config_locations = ['etebase-server.ini', '/etc/etebase-server/etebase-server.ini'] +config_locations = [ + os.environ.get('ETEBASE_EASY_CONFIG_PATH', ''), + 'etebase-server.ini', + '/etc/etebase-server/etebase-server.ini', +] + # Use config file if present if any(os.path.isfile(x) for x in config_locations): config = configparser.ConfigParser()