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

Add install instructions for Doppler adapter #144

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions docs/commands/secrets.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,57 @@ kamal secrets extract MyItem/REGISTRY_PASSWORD <SECRETS-FETCH-OUTPUT>
kamal secrets extract MyVault/MyItem/REGISTRY_PASSWORD <SECRETS-FETCH-OUTPUT>
```

## Doppler

First, install and configure [the Doppler CLI](https://docs.doppler.com/docs/install-cli).

Make sure you've either logged in with `doppler login` or have a `DOPPLER_TOKEN` in the environment.

Use the adapter `doppler`:

```bash
# Fetch passwords (must have a `DOPPLER_TOKEN` service token set to use this without --from)
kamal secrets fetch --adapter doppler --account ignored REGISTRY_PASSWORD DB_PASSWORD

# Fetch all secrets (must have a `DOPPLER_TOKEN` service token set to use this without --from)
kamal secrets fetch --adapter doppler --account ignored all

# Fetch passwords from a specific project/config
kamal secrets fetch --adapter doppler --account ignored --from example-project/dev REGISTRY_PASSWORD DB_PASSWORD

# Fetch all secrets from a specific project/config
kamal secrets fetch --adapter doppler --account ignored --from example-project/dev all

# Extract a secret
kamal secrets extract REGISTRY_PASSWORD <SECRETS-FETCH-OUTPUT>
```

Typical usage inside your `.kamal/secrets` would look something like this:

```bash
SECRETS=$(kamal secrets fetch --adapter doppler --account ignored --from example-project/dev all)
KAMAL_REGISTRY_PASSWORD=$(kamal secrets extract REGISTRY_PASSWORD $SECRETS)
KAMAL_REGISTRY_USER=$(kamal secrets extract REGISTRY_USER $SECRETS)
HOST=$(kamal secrets extract HOST $SECRETS)
PORT=$(kamal secrets extract PORT $SECRETS)
```

After setting that up, you would access those secrets in your `deploy.yml` like this:

```yaml
# Credentials for your image host.
registry:
username:
- KAMAL_REGISTRY_USER
password:
- KAMAL_REGISTRY_PASSWORD

env:
secret:
- HOST
- PORT
```

## LastPass

First, install and configure [the LastPass CLI](https://github.com/lastpass/lastpass-cli).
Expand Down