-
Notifications
You must be signed in to change notification settings - Fork 898
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add gitignores for rails credentials #23263
Conversation
Adding radjabov since #23254 was included on that branch. |
We're switching to rails credentials to keep current with rails 7.1 and the future. Note, we're assuming we won't want to commit and share encrypted credentials. If we want to share them, such as for recording cassettes, the comments describe how to switch to only ignoring the plain text encryption key files. Followup to: ManageIQ#23254 Required for: ManageIQ/manageiq-providers-autosde#253
9439091
to
45d2578
Compare
# See: EDITOR=vi be rails credentials:edit --help for more information | ||
# Rails credentials follow the following pattern: | ||
# If ENV['RAILS_MASTER_KEY'] isn't specified: | ||
# Global is used: | ||
# * config/master.key (plain text encryption key) | ||
# * config/credentials.yml.enc (encrypted credentials file) | ||
# If --environment test, the overrides for that environment is used: | ||
# * config/credentials/test.key | ||
# * test.yml.enc | ||
# If we want to commit and share encrypted credentials, we can change the two lines below to: | ||
# config/*.key | ||
# config/credentials/*.key | ||
config/credentials* |
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.
Is this the Rails boilerplate or is this something you wrote up? I'll merge regardless, I'm just curious.
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 added the comments.
Rails assumes you'll want to commit the yml.enc encrypted files and share your .key file so only the .key is .gitignored. When you do rails credentials:edit
with environment or without, it only adds the .gitignore for that particular .key file. I think it's safer to ignore both key and encrypted file for now and if we ever want to use a shared encrypted credentials file by sharing the key, we can remove the encrypted credentials file from the .gitignore.
We're switching to rails credentials to keep current with rails 7.1 and the future. Note, we're assuming we won't want to commit and share encrypted credentials. If we want to share them, such as for recording cassettes, the comments describe how to switch to only ignoring the plain text encryption key files.
Followup to: #23254
Required for: ManageIQ/manageiq-providers-autosde#253