forked from Infra/risotto
add setting prefix (name of the module)
This commit is contained in:
@ -1,32 +1,31 @@
|
||||
MESSAGE_ROOT_PATH = 'messages'
|
||||
INTERNAL_USER = 'internal'
|
||||
CONFIGURATION_DIR = 'configurations'
|
||||
TEMPLATE_DIR = 'templates'
|
||||
TMP_DIR = 'tmp'
|
||||
DEFAULT_USER = 'Anonymous'
|
||||
DEFAULT_DSN = 'postgres:///risotto?host=/var/run/postgresql/&user=risotto'
|
||||
DEFAULT_TIRAMISU_DSN = 'postgres:///tiramisu?host=/var/run/postgresql/&user=tiramisu'
|
||||
|
||||
from os import environ
|
||||
from pathlib import PurePosixPath
|
||||
CURRENT_PATH = PurePosixPath(__file__)
|
||||
|
||||
|
||||
CONFIGURATION_DIR = 'configurations'
|
||||
TMP_DIR = 'tmp'
|
||||
DEFAULT_USER = environ.get('DEFAULT_USER', 'Anonymous')
|
||||
DEFAULT_DSN = environ.get('RISOTTO_DSN', 'postgres:///risotto?host=/var/run/postgresql/&user=risotto')
|
||||
DEFAULT_TIRAMISU_DSN = environ.get('DEFAULT_TIRAMISU_DSN', 'postgres:///tiramisu?host=/var/run/postgresql/&user=tiramisu')
|
||||
MESSAGE_PATH = environ.get('MESSAGE_PATH', '/root/risotto-message/messages')
|
||||
MODULE_NAME = environ.get('MODULE_NAME', 'test')
|
||||
|
||||
|
||||
def get_config():
|
||||
return {'database': {'dsn': environ.get('RISOTTO_DSN', DEFAULT_DSN),
|
||||
'tiramisu_dsn': environ.get('RISOTTO_TIRAMISU_DSN', DEFAULT_TIRAMISU_DSN),
|
||||
return {'database': {'dsn': DEFAULT_DSN,
|
||||
'tiramisu_dsn': DEFAULT_TIRAMISU_DSN,
|
||||
},
|
||||
'http_server': {'port': 8080,
|
||||
#'default_user': "gnunux"},
|
||||
'default_user': DEFAULT_USER},
|
||||
'global': {'message_root_path': CURRENT_PATH.parents[2] / 'messages',
|
||||
'global': {'message_root_path': MESSAGE_PATH,
|
||||
'debug': True,
|
||||
'internal_user': 'internal',
|
||||
'check_role': True,
|
||||
'admin_user': DEFAULT_USER},
|
||||
'admin_user': DEFAULT_USER,
|
||||
'module_name': MODULE_NAME,
|
||||
'version': 'v1'},
|
||||
'source': {'root_path': '/srv/seed'},
|
||||
'cache': {'root_path': '/var/cache/risotto'},
|
||||
'servermodel': {'internal_source': 'internal',
|
||||
'internal_distribution': 'last',
|
||||
'internal_release_name': 'none'},
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user