# config/deploy.yml
env: clear: # Safe to commit (Public info) RAILS_ENV: production POSTGRES_USER: my_app_user secret: # DANGEROUS! Do not put the actual values here! - RAILS_MASTER_KEY - POSTGRES_PASSWORD - STRIPE_SECRET_KEY - OPENAI_API_KEY
# config/deploy.yml
env: clear: # Safe to commit (Public info) RAILS_ENV: production POSTGRES_USER: my_app_user secret: # DANGEROUS! Do not put the actual values here! - RAILS_MASTER_KEY - POSTGRES_PASSWORD - STRIPE_SECRET_KEY - OPENAI_API_KEY
# config/deploy.yml
env: clear: # Safe to commit (Public info) RAILS_ENV: production POSTGRES_USER: my_app_user secret: # DANGEROUS! Do not put the actual values here! - RAILS_MASTER_KEY - POSTGRES_PASSWORD - STRIPE_SECRET_KEY - OPENAI_API_KEY
# .kamal/secrets
RAILS_MASTER_KEY=abc123supersecret...
POSTGRES_PASSWORD=databasepassword99!
STRIPE_SECRET_KEY=sk_live_55555...
# .kamal/secrets
RAILS_MASTER_KEY=abc123supersecret...
POSTGRES_PASSWORD=databasepassword99!
STRIPE_SECRET_KEY=sk_live_55555...
# .kamal/secrets
RAILS_MASTER_KEY=abc123supersecret...
POSTGRES_PASSWORD=databasepassword99!
STRIPE_SECRET_KEY=sk_live_55555...
# .kamal/secrets # Fetch the master key from my 1Password vault
RAILS_MASTER_KEY=$(op read "op://Work/RailsApp/master_key") # Fetch the database password
POSTGRES_PASSWORD=$(op read "op://Work/Database/password") # Fetch the Stripe key
STRIPE_SECRET_KEY=$(op read "op://Work/Stripe/secret_key")
# .kamal/secrets # Fetch the master key from my 1Password vault
RAILS_MASTER_KEY=$(op read "op://Work/RailsApp/master_key") # Fetch the database password
POSTGRES_PASSWORD=$(op read "op://Work/Database/password") # Fetch the Stripe key
STRIPE_SECRET_KEY=$(op read "op://Work/Stripe/secret_key")
# .kamal/secrets # Fetch the master key from my 1Password vault
RAILS_MASTER_KEY=$(op read "op://Work/RailsApp/master_key") # Fetch the database password
POSTGRES_PASSWORD=$(op read "op://Work/Database/password") # Fetch the Stripe key
STRIPE_SECRET_KEY=$(op read "op://Work/Stripe/secret_key")
kamal deploy
kamal deploy
kamal deploy - Kamal reads .kamal/secrets.
- It sees the op read commands.
- 1Password pops up on my screen, asking for my fingerprint (TouchID).
- I scan my finger.
- 1Password securely hands the keys to Kamal in memory.
- Kamal pushes the keys to the server and boots the app. - List the variable names in deploy.yml.
- Put the values (or the fetch commands) in .kamal/secrets.
- Keep your .gitignore clean.
- Use a password manager CLI to never store plain text keys locally.