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

Auto-generate env var values, e.g for SECRET_KEY_BASE #440

Merged
merged 2 commits into from
Apr 12, 2024

Conversation

mattbrictson
Copy link
Owner

When specifying :env_vars in the tomo config file, you can now use a special :generate_secret value. This will automatically generate a secret using SecureRandom.hex(64) the first time it is needed.

The tomo configuration template created by tomo init now includes this env var value:

SECRET_KEY_BASE: :generate_secret

This means that the first time the app is deployed, an appropriate value for SECRET_KEY_BASE will be generated automatically, without prompting the user.

When specifying `:env_vars` in the tomo config file, you can now use a
special `:generate_secret` value. This will automatically generate a
secret using `SecureRandom.hex(64)` the first time it is needed.

The tomo configuration template created by `tomo init` now includes this
env var value:

```
SECRET_KEY_BASE: :generate_secret
```

This means that the first time the app is deployed, an appropriate value
for `SECRET_KEY_BASE` will be generated automatically, without prompting
the user.
@mattbrictson mattbrictson added the ✨ Feature Adds a new feature label Apr 12, 2024
@mattbrictson mattbrictson changed the title Allow auto-generating env var values, e.g for SECRET_KEY_BASE Auto-generate env var values, e.g for SECRET_KEY_BASE Apr 12, 2024
@mattbrictson mattbrictson merged commit 4547f4e into main Apr 12, 2024
9 checks passed
@mattbrictson mattbrictson deleted the generate-secret branch April 12, 2024 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Feature Adds a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant