Conversation
jcscottiii
commented
Mar 1, 2017
- Use RDS instance
Is open.foia.fov now running on GovCloud?
Have there been any changes it hosting or features since last year?
On Wed, Mar 1, 2017 at 11:53 AM James C Scott III ***@***.***> wrote:
cc: @erik-burgess <https://github.com/erik-burgess> @alain-hoang
<https://github.com/alain-hoang>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#838 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACcoN23P218d_bCeOy4rZG3svPZkk5neks5rhaJ-gaJpZM4MP6dj>
.
--
Alexander B. Howard
Deputy Director <http://sunlightfoundation.com/author/ahoward/>, Sunlight
Foundation
Phone: 410.849.9808 | @digiphile <http://twitter.com/digiphile>
Social Media: http://j.mp/ContactABH
|
@digiphile sorry for the confusion. currently it runs on the cloud.gov platform that resides in AWS E/W. that cloud.gov environment is going away. cloud.gov has a new FedRAMP'ed environment in AWS GovCloud. This PR is just some small changes to make so it will work there eventually. |
The changes associated with this pull request addresses compatibility modifications to adapt open.foia.gov for the new cloud.gov that has been FedRAMPed. A note for the person(s) who can perform merge (and deploy) these changes include:
While the main issue is that the pull request for these modifications is that someone with the necessary permissions can perform the merge, it is also recommended that someone with access should deploy the application post merge. This will help verify that the master branch (post merge) for this project is in sync with application in cloud.gov. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly efficiency comments, but I would like to confirm that we need to remove the AWS env vars from the local settings before merging.
env = AppEnv() | ||
cf_foia_db = env.get_service(name=re.compile('foia-db')) | ||
if cf_foia_db: | ||
database_url = cf_foia_db.credentials['uri'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think lines 9-12 are needed -- cloud.gov will inject a DATABASE_URL env var. Using an env var directly (rather than jumping through cfenv) reduces coupling.
|
||
# See env.example for an explanation of these settings. | ||
|
||
SECRET_KEY = os.getenv("FOIA_SECRET_SESSION_KEY") | ||
DATABASES = {'default': dj_database_url.parse(os.getenv("DATABASE_URL"))} | ||
DATABASES = {'default': dj_database_url.parse(database_url)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heads up, this can be dj_database_url.config()
, which will read from os.getenv['DATABASE_URL']
.
SHOW_WEBFORM = (os.getenv("FOIA_SHOW_WEBFORM") == "true") | ||
ANALYTICS_ID = os.getenv("FOIA_ANALYTICS_ID") | ||
|
||
AWS_ACCESS_KEY_ID = os.getenv('FOIA_AWS_ACCESS_KEY_ID') | ||
AWS_SECRET_ACCESS_KEY = os.getenv('FOIA_AWS_SECRET_ACCESS_KEY') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These seem important for running locally. Do we need to delete them?
@@ -3,7 +3,7 @@ | |||
# Some possible hosts | |||
ALLOWED_HOSTS = [ | |||
'open.foia.gov', 'foia-a.cf.18f.us', 'foia-b.cf.18f.us', | |||
'openfoia-staging.cf.18f.us' | |||
'openfoia-staging.cf.18f.us', 'foia.app.cloud.gov' | |||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we grab this from cfenv? i.e.
env = AppEnv()
ALLOWED_HOSTS = env.uris