A simple utility to automatically update your secrets on fly.io based on your .env
file.
fly-secrets
reads your .env
file in the current directory and updates your secrets on fly.io. Only the secrets specified after the # FLY SECRETS
comment in the .env
file will be considered for updating.
The script will look for a fly.toml
file and prompt you if you would like to update the secrets for that app defined in fly.foml. This is overridden if you provide a -a tag to the command.
This tool makes it easy to manage and synchronize your application secrets between your local environment and your fly.io deployment.
You can use the package without installing it globally using npx
:
npx fly-secrets
- Update your
.env
file with the secrets you want to synchronize with fly.io. Make sure to place them after the# FLY SECRETS
comment:
SOME_LOCAL_ONLY_SECRET=asdf
# FLY SECRETS
SOME_NEEDED_SECRET=real_secret
ANOTHER_NEEDED_SECRET=another_secret
In the above example, only SOME_NEEDED_SECRET
and ANOTHER_NEEDED_SECRET
will be added to fly.io.
- Run the command:
npx fly-secrets -a <your-app-name>
Replace <your-app-name>
with the name of your fly.io application.
npx fly-secrets -a my-app-name
This will update the secrets of the my-app-name
application on fly.io based on the .env
file in the current directory.
If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.