Skip to content

Commit

Permalink
README v1
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilchm committed Jun 5, 2024
1 parent 780b860 commit d883030
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions README.md
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
```

0 comments on commit d883030

Please sign in to comment.