Open rubydesign opened 2 years ago
You can set an env var of RAILS_MASTER_KEY=yoursecret
or put the master.key
in your shared files directive:
set :shared_files, fetch(:shared_files, []).concat(%w(
config/master.key
))
I would probably just suggest you put the value RAILS_MASTER_KEY
along side your other environment variables.
Maybe i was unclear: I do have my deploy working. (and i don't use environemt since it can be avoided)
The suggestion was mainly to update the rails part / documentation. But if you are beyond maintenance i understand, just close this.
Issue here with the shared files:
set :shared_files, fetch(:shared_files, []).concat(
['config/credentials/staging.key', 'config/credentials/production.key']
)
Then i run
❯ bundle exec mina setup to=staging
-----> Using [Staging]
-----> Setting up /var/www/travclub.com/staging
/home/deployer
total 24
drwxrwxr-x 6 deployer deployer 4096 Aug 24 15:23 .
drwxrwxr-x 4 deployer deployer 4096 Aug 24 12:42 ..
drwxrwxr-x 2 deployer deployer 4096 Aug 24 12:42 releases
drwxrwxr-x 7 deployer deployer 4096 Aug 24 14:08 scm
drwxrwxr-x 9 deployer deployer 4096 Aug 24 12:43 shared
drwxrwxr-x 2 deployer deployer 4096 Aug 24 15:23 tmp
Connection to 167.235.224.232 closed.
Elapsed time: 3.35 seconds
But the key files are not there:
deployer@travclub:/var/www/travclub.com/staging/shared/config/credentials$ ls -la
total 8
drwxrwxr-x 2 deployer deployer 4096 Aug 24 12:42 .
drwxrwxr-x 3 deployer deployer 4096 Aug 24 12:43 ..
deployer@travclub:/var/www/travclub.com/staging/shared/config/credentials$
Mina v1.2.4
Anything I'm missing? 🤔
You are responsible for uploading your key files to /var/www/travclub.com/staging/shared/config/credentials
Mina will simply symlink the files in the shared folder into the current release.
Checkout this plugin for managing secret keys: https://github.com/railsblueprint/mina-secrets-transfer
Hi, and mainly thanks. Banged my head against a wall with capistrano ssh for hours and got mina up in minutes. Great job
But then it did take me a while to figure out the missing master.key The docs don't mention this (oh i'm deploying rails v7 ) and i assumed mina/rails would have done this. (only got the hint when the auto generated deploy still talks about secrets. No more secrets :-) )
I could try and fix this, maybe a copy in the setup would be smooth. But at least a mention in the readme?
Thanks for the work guys, Torsten