Skip to content

Conversation

@meara
Copy link
Contributor

@meara meara commented Mar 16, 2018

Release Notes

Secret information such as API keys should exist in secrets.yml rather than in settings.yml or by being overridden in settings.local.yml.

Deploy Note

Will need to update settings.yml and secrets.yml to match the updated templates on staging and production servers in conjunction with the release.

@meara meara requested review from giladshanan and jhanggi March 16, 2018 20:35
@meara meara changed the title [#140196, #140197]extract secrets from settings.yml [#140196, #140197] extract secrets from settings.yml Mar 16, 2018
# - account_manager

# This may be overridden in settings.local.yml if your fork is using S3, so
# This may be overridden in secrets.yml if your fork is using S3, so
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part isn't quite true as it stands. I think it might be nice to think about how this can work.

What might work is to do a Settings.paperclip.merge(Rails.application.secrets.paperclip) and then we can get the best of both worlds. Thoughts on that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. Where would we actually do the merge?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we use the paperclip settings in app/models/concerns/downloadable_file.rb. So probably in there.

@giladshanan
Copy link
Collaborator

Looks good. Does it make sense to add a "Deploy Note" that changes will need to be made to secrets.yml on the stage and production servers?

@meara
Copy link
Contributor Author

meara commented Mar 20, 2018

Good call on adding a "Deploy Note" @giladshanan.

@meara meara requested a review from jhanggi March 20, 2018 15:20
Copy link
Contributor

@jhanggi jhanggi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One tiny thing we might be able to clean up, but otherwise looks good.


included do
has_attached_file :file, Settings.paperclip.to_hash.merge(validate_media_type: false)
has_attached_file :file, PaperclipSettings.config.to_hash.merge(validate_media_type: false)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The to_hash here might now be unnecessary.

@meara meara force-pushed the extract-secrets-from-settings branch from 3f41766 to afd0f3d Compare March 20, 2018 20:31
@meara meara merged commit 407c0c9 into master Mar 20, 2018
@meara meara deleted the extract-secrets-from-settings branch March 20, 2018 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants