mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-17 18:52:30 -05:00
Update config
Source the configuration from an environment file, this way it is similar to how the aws environment works
This commit is contained in:
15
wsgi.py
15
wsgi.py
@@ -1,17 +1,14 @@
|
||||
from app import create_app
|
||||
from credstash import getAllSecrets
|
||||
import os
|
||||
|
||||
config = 'live'
|
||||
default_env_file = '/home/ubuntu/environment'
|
||||
|
||||
if os.path.isfile(default_env_file):
|
||||
environment = open(default_env_file, 'r')
|
||||
config = environment.readline().strip()
|
||||
from app import create_app
|
||||
from credstash import getAllSecrets
|
||||
|
||||
# on aws get secrets and export to env
|
||||
secrets = getAllSecrets(region="eu-west-1")
|
||||
for key, val in secrets.items():
|
||||
os.environ[key] = val
|
||||
|
||||
application = create_app(config, secrets)
|
||||
application = create_app()
|
||||
|
||||
if __name__ == "__main__":
|
||||
application.run()
|
||||
|
||||
Reference in New Issue
Block a user