Skip to content
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

master.key #712

Open
rubydesign opened this issue Mar 30, 2022 · 5 comments
Open

master.key #712

rubydesign opened this issue Mar 30, 2022 · 5 comments

Comments

@rubydesign
Copy link

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

@dillonhafer
Copy link

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.

@rubydesign
Copy link
Author

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.

@Frexuz
Copy link

Frexuz commented Aug 24, 2022

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? 🤔

@dillonhafer
Copy link

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.

@elik-ru
Copy link

elik-ru commented Apr 21, 2023

Checkout this plugin for managing secret keys: https://github.com/railsblueprint/mina-secrets-transfer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants