Skip to content

Commit 7874257

Browse files
authored
Merge pull request rails#34965 from bogdanvlviv/improve-rails-encrypted--help
Improve output of `rails encrypted(:edit/:show) --help`
2 parents 878e980 + f133fdd commit 7874257

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
=== Storing Encrypted Files in Source Control
2+
3+
The Rails `encrypted` commands provide access to encrypted files.
4+
5+
=== Editing Files
6+
7+
`rails encrypted:edit config/encrypted_file.yml.enc` opens a temporary file
8+
in `$EDITOR` with the decrypted contents of `config/encrypted_file.yml.enc` to
9+
edit. The encrypted key is either stored in `config/master.key`
10+
or `ENV["RAILS_MASTER_KEY"]` is used, but you can provide relative path
11+
to the encryption key by using `--key` option:
12+
13+
`rails encrypted:edit config/encrypted_file.yml.enc --key config/encrypted_file.key`.
14+
15+
=== Viewing files
16+
17+
`rails encrypted:show config/encrypted_file.yml.enc` prints the decrypted contents of
18+
`config/encrypted_file.yml.enc` file. The encrypted key is either stored in `config/master.key`
19+
or `ENV["RAILS_MASTER_KEY"]` is used, but you can provide relative path
20+
to the encryption key by using `--key` option:
21+
22+
`rails encrypted:show config/encrypted_file.yml.enc --key config/encrypted_file.key`.

railties/lib/rails/commands/encrypted/encrypted_command.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class EncryptedCommand < Rails::Command::Base # :nodoc:
1616
def help
1717
say "Usage:\n #{self.class.banner}"
1818
say ""
19+
say self.class.desc
1920
end
2021
end
2122

0 commit comments

Comments
 (0)