[conf] set SECRET in environ

This commit is contained in:
Maxime Alves LIRMM@home 2020-08-07 01:58:41 +02:00
parent 3849ba4500
commit bdc131434b
1 changed files with 2 additions and 0 deletions

View File

@ -47,6 +47,8 @@ if IS_PROJECT:
try: try:
with open(config.get('project', 'secret')) as secret_file: with open(config.get('project', 'secret')) as secret_file:
SECRET = secret_file.read() SECRET = secret_file.read()
# Set the secret so we can use it in domains
os.environ['HALFAPI_SECRET'] = SECRET
except FileNotFoundError: except FileNotFoundError:
print('There is no file like {}'.format(config.get('project', 'secret'))) print('There is no file like {}'.format(config.get('project', 'secret')))
sys.exit(1) sys.exit(1)