-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# dotsecrets | ||
|
||
Simple and easy secrets, perfect for small teams. | ||
|
||
* A small, readable, self-contained file for managing and storing secrets. | ||
* Easy to use in both development and CI environments. | ||
* Less than [50 lines of code, and only two dependencies - `bash` and `openssl`. | ||
* Supports encryption of env vars and config files. | ||
|
||
## Rationale | ||
|
||
There's no easy and straightforward way to store secrets for an app when you're just starting out, | ||
with a team of a few engineers. | ||
You don't want to pay the cost of integrating with a dedicated system that someone has to maintain. | ||
|
||
With `dotsecrets`, you can store any secret you need in your git repo in encrypted form. | ||
Share a secret key with your team, and use it for all sensitive config values. | ||
|
||
Think [SOPS]-like workflow, but in one file that you commit to the repo, | ||
and use across dev and CI environments with no additional setup. | ||
|
||
[SOPS]: https://github.com/getsops/sops | ||
|
||
|
||
## Install | ||
|
||
```sh | ||
curl -f -o .secrets https://raw.githubusercontent.com/kamilchm/dotsecrets/main/dotsecrets | ||
``` | ||
|
||
## Usage | ||
|
||
Set the `SECRET_KEY` environment variable and start using it. | ||
|
||
### Encrypt an env var value | ||
|
||
```sh | ||
bash .secrets VAR_NAME "VALUE" >> .secrets | ||
``` | ||
|
||
### Encrypt a file | ||
|
||
```sh | ||
bash .secrets FILENAME >> .secrets | ||
``` | ||
|
||
### Decrypt env vars values and files | ||
|
||
```sh | ||
export `bash .secrets` | ||
``` | ||
|
||
### GitHub Actions | ||
|
||
Add your `SECRET_KEY` to [GitHub Actions Secrets]. | ||
|
||
[GitHub Actions Secrets]: https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository | ||
|
||
Use the `SECRET_KEY` to decrypt secrets in a job: | ||
|
||
```yaml | ||
- name: Job | ||
env: | ||
SECRET_KEY: ${{ secrets.SECRET_KEY }} | ||
run: | | ||
export `bash .secrets` # decrypt secrets before running a command | ||
./run_job | ||
``` |