mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 10:21:14 -05:00
Merge pull request #1139 from alphagov/revert-credstash-removal
Revert "remove credstash"
This commit is contained in:
@@ -1,5 +1,11 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
from app import create_app
|
from app import notify_celery, create_app
|
||||||
|
from credstash import getAllSecrets
|
||||||
|
import os
|
||||||
|
|
||||||
|
# On AWS get secrets and export to env, skip this on Cloud Foundry
|
||||||
|
if os.getenv('VCAP_SERVICES') is None:
|
||||||
|
os.environ.update(getAllSecrets(region="eu-west-1"))
|
||||||
|
|
||||||
application = create_app("delivery")
|
application = create_app("delivery")
|
||||||
application.app_context().push()
|
application.app_context().push()
|
||||||
|
|||||||
6
db.py
6
db.py
@@ -1,8 +1,12 @@
|
|||||||
from flask.ext.script import Manager, Server
|
from flask.ext.script import Manager, Server
|
||||||
from flask_migrate import Migrate, MigrateCommand
|
from flask_migrate import Migrate, MigrateCommand
|
||||||
|
|
||||||
from app import create_app, db
|
from app import create_app, db
|
||||||
|
from credstash import getAllSecrets
|
||||||
|
import os
|
||||||
|
|
||||||
|
# On AWS get secrets and export to env, skip this on Cloud Foundry
|
||||||
|
if os.getenv('VCAP_SERVICES') is None:
|
||||||
|
os.environ.update(getAllSecrets(region="eu-west-1"))
|
||||||
|
|
||||||
application = create_app()
|
application = create_app()
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ marshmallow==2.4.2
|
|||||||
marshmallow-sqlalchemy==0.8.0
|
marshmallow-sqlalchemy==0.8.0
|
||||||
flask-marshmallow==0.6.2
|
flask-marshmallow==0.6.2
|
||||||
Flask-Bcrypt==0.6.2
|
Flask-Bcrypt==0.6.2
|
||||||
|
credstash==1.8.0
|
||||||
boto3==1.4.4
|
boto3==1.4.4
|
||||||
celery==3.1.25 # pyup: <4
|
celery==3.1.25 # pyup: <4
|
||||||
monotonic==1.2
|
monotonic==1.2
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
from flask.ext.script import Manager, Server
|
from flask.ext.script import Manager, Server
|
||||||
from flask_migrate import Migrate, MigrateCommand
|
from flask_migrate import Migrate, MigrateCommand
|
||||||
from app import (create_app, db, commands)
|
from app import (create_app, db, commands)
|
||||||
|
from credstash import getAllSecrets
|
||||||
import os
|
import os
|
||||||
|
|
||||||
default_env_file = '/home/ubuntu/environment'
|
default_env_file = '/home/ubuntu/environment'
|
||||||
@@ -10,6 +11,10 @@ if os.path.isfile(default_env_file):
|
|||||||
with open(default_env_file, 'r') as environment_file:
|
with open(default_env_file, 'r') as environment_file:
|
||||||
environment = environment_file.readline().strip()
|
environment = environment_file.readline().strip()
|
||||||
|
|
||||||
|
# On AWS get secrets and export to env, skip this on Cloud Foundry
|
||||||
|
if os.getenv('VCAP_SERVICES') is None:
|
||||||
|
os.environ.update(getAllSecrets(region="eu-west-1"))
|
||||||
|
|
||||||
from app.config import configs
|
from app.config import configs
|
||||||
|
|
||||||
os.environ['NOTIFY_API_ENVIRONMENT'] = configs[environment]
|
os.environ['NOTIFY_API_ENVIRONMENT'] = configs[environment]
|
||||||
|
|||||||
9
wsgi.py
9
wsgi.py
@@ -1,5 +1,12 @@
|
|||||||
from app import create_app
|
import os
|
||||||
|
|
||||||
|
from app import create_app
|
||||||
|
from credstash import getAllSecrets
|
||||||
|
|
||||||
|
|
||||||
|
# On AWS get secrets and export to env, skip this on Cloud Foundry
|
||||||
|
if os.getenv('VCAP_SERVICES') is None:
|
||||||
|
os.environ.update(getAllSecrets(region="eu-west-1"))
|
||||||
|
|
||||||
application = create_app()
|
application = create_app()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user