Fetch environment variable if possible

This commit is contained in:
Benjamin Bohard 2020-04-08 17:20:13 +02:00
parent 4ad337b965
commit 2b12c9bd0d
1 changed files with 3 additions and 2 deletions

View File

@ -1,8 +1,8 @@
from os import environ from os import environ
CONFIGURATION_DIR = 'configurations' CONFIGURATION_DIR = environ.get('CONFIGURATION_DIR', '/srv/risotto/configurations')
PROVIDER_FACTORY_CONFIG_DIR = environ.get('PROVIDER_FACTORY_CONFIG_DIR', 'factory') PROVIDER_FACTORY_CONFIG_DIR = environ.get('PROVIDER_FACTORY_CONFIG_DIR', '/srv/factory')
TMP_DIR = 'tmp' TMP_DIR = 'tmp'
DEFAULT_USER = environ.get('DEFAULT_USER', 'Anonymous') DEFAULT_USER = environ.get('DEFAULT_USER', 'Anonymous')
RISOTTO_DB_NAME = environ.get('RISOTTO_DB_NAME', 'risotto') RISOTTO_DB_NAME = environ.get('RISOTTO_DB_NAME', 'risotto')
@ -30,6 +30,7 @@ def get_config():
'http_server': {'port': 8080, 'http_server': {'port': 8080,
'default_user': DEFAULT_USER}, 'default_user': DEFAULT_USER},
'global': {'message_root_path': MESSAGE_PATH, 'global': {'message_root_path': MESSAGE_PATH,
'configurations_dir': CONFIGURATION_DIR,
'debug': True, 'debug': True,
'internal_user': 'internal', 'internal_user': 'internal',
'check_role': True, 'check_role': True,