v3.0.0-alpha.1 6fdddb8

secrets.md RawHistoryFolder

Secrets Configuration

Configure how Gordon stores and retrieves sensitive data. Two separate stores exist: installation secrets (this page) and app secret values (managed with gordon apps secrets, values in pass under gordon/apps/<uuid>/<service>/<name>).

Configuration

The secrets backend is configured within the [auth] section:

[auth]
secrets_backend = "pass"  # "pass", "sops", or "unsafe"

Options

Option Type Default Description
secrets_backend string "unsafe" Secrets storage backend

Backends

Uses the Unix password manager (pass) for secure secret storage:

[auth]
secrets_backend = "pass"

Setup:

# Install pass
sudo apt install pass

# Initialize with GPG key
pass init your-gpg-key-id

# Store secrets
pass insert gordon/auth/token_secret

Usage in config:

[auth]
token_secret = "gordon/auth/token_secret"  # Path in pass store

Benefits:

  • GPG-encrypted storage
  • Version control friendly (encrypted files)
  • Standard Unix tooling
  • Works with team GPG keys

Installation secrets storage:

  • gordon secrets set <domain> --from-file stores per-domain secrets in pass under gordon/env/<sanitized-domain>/<KEY> (dots/colons/slashes → underscores)
  • Eligible plaintext .env files are imported into pass at startup and removed only after all entries are stored successfully; conflicts or failures leave the source file for operator review

SOPS

Uses Mozilla SOPS for encrypted file-based secrets:

[auth]
secrets_backend = "sops"

Setup:

# Install sops
brew install sops  # macOS
# or download from https://github.com/getsops/sops/releases

# Create encrypted secrets file
sops secrets.yaml

Usage in env files:

API_SECRET=${sops:secrets.yaml:api.secret}
DB_PASSWORD=${sops:secrets.yaml:database.password}

Benefits:

  • Multiple encryption backends (AWS KMS, GCP KMS, Azure Key Vault, PGP)
  • YAML/JSON file encryption
  • Git-friendly (encrypted files in repo)

Security:

  • Absolute paths are rejected to prevent arbitrary file access
  • Path traversal (..) is blocked
  • Only relative paths from your config directory are allowed

Unsafe (Development Only)

Stores secrets as plain text files:

[auth]
secrets_backend = "unsafe"

Storage location:

{data_dir}/secrets/
├── gordon/
│   └── auth/
│       └── token_secret

Usage:

# Create secret
mkdir -p ~/.gordon/secrets/gordon/auth
echo "your-token-secret" > ~/.gordon/secrets/gordon/auth/token_secret

Warning: Only use for local development. Secrets are stored in plain text.

Secret Provider Syntax

In environment files, reference secrets using provider syntax:

Pass Provider

# ${pass:<path>}
DATABASE_PASSWORD=${pass:myapp/database/password}
API_KEY=${pass:myapp/api-key}

SOPS Provider

# ${sops:<file>:<key.path>}
DATABASE_PASSWORD=${sops:secrets.yaml:database.password}
API_SECRET=${sops:production.yaml:api.key}

App Secret Values

App secret names are registered in the app manifest ([service.secrets] maps ENV name to secret name); values are written separately and stay in pass:

gordon apps secrets set blog --service web DATABASE_URL=...

Values affect the next deploy/restart, never running containers. Only key names are ever echoed back, never values. See App Manifest and Apps CLI.

Examples

Production with Pass

[auth]
enabled = true
secrets_backend = "pass"
token_secret = "gordon/auth/token_secret"
# Setup
pass insert gordon/auth/token_secret
# Enter a random 32+ character string

# Generate tokens
gordon auth token generate --subject deploy --expiry 0

Development with Unsafe

[auth]
enabled = false
secrets_backend = "unsafe"

Security Recommendations

  1. Production: Always use pass or sops backend
  2. Never commit: Don't commit unencrypted secrets to git (app files must never contain secret values)
  3. Rotate regularly: Regenerate tokens and passwords periodically
  4. Least privilege: Use separate secrets per environment
  5. Path validation: SOPS provider rejects absolute paths and path traversal attempts for security
source
1# Secrets Configuration
2
3Configure how Gordon stores and retrieves sensitive data. Two separate stores exist: installation secrets (this page) and app secret values (managed with `gordon apps secrets`, values in pass under `gordon/apps/<uuid>/<service>/<name>`).
4
5## Configuration
6
7The secrets backend is configured within the `[auth]` section:
8
9```toml
10[auth]
11secrets_backend = "pass"  # "pass", "sops", or "unsafe"
12```
13
14## Options
15
16| Option | Type | Default | Description |
17|--------|------|---------|-------------|
18| `secrets_backend` | string | `"unsafe"` | Secrets storage backend |
19
20## Backends
21
22### Pass (Recommended for Production)
23
24Uses the Unix password manager (`pass`) for secure secret storage:
25
26```toml
27[auth]
28secrets_backend = "pass"
29```
30
31**Setup:**
32```bash
33# Install pass
34sudo apt install pass
35
36# Initialize with GPG key
37pass init your-gpg-key-id
38
39# Store secrets
40pass insert gordon/auth/token_secret
41```
42
43**Usage in config:**
44```toml
45[auth]
46token_secret = "gordon/auth/token_secret"  # Path in pass store
47```
48
49**Benefits:**
50- GPG-encrypted storage
51- Version control friendly (encrypted files)
52- Standard Unix tooling
53- Works with team GPG keys
54
55**Installation secrets storage:**
56- `gordon secrets set <domain> --from-file` stores per-domain secrets in pass under `gordon/env/<sanitized-domain>/<KEY>` (dots/colons/slashes → underscores)
57- Eligible plaintext `.env` files are imported into pass at startup and removed only after all entries are stored successfully; conflicts or failures leave the source file for operator review
58
59### SOPS
60
61Uses Mozilla SOPS for encrypted file-based secrets:
62
63```toml
64[auth]
65secrets_backend = "sops"
66```
67
68**Setup:**
69```bash
70# Install sops
71brew install sops  # macOS
72# or download from https://github.com/getsops/sops/releases
73
74# Create encrypted secrets file
75sops secrets.yaml
76```
77
78**Usage in env files:**
79```bash
80API_SECRET=${sops:secrets.yaml:api.secret}
81DB_PASSWORD=${sops:secrets.yaml:database.password}
82```
83
84**Benefits:**
85- Multiple encryption backends (AWS KMS, GCP KMS, Azure Key Vault, PGP)
86- YAML/JSON file encryption
87- Git-friendly (encrypted files in repo)
88
89**Security:**
90- Absolute paths are rejected to prevent arbitrary file access
91- Path traversal (`..`) is blocked
92- Only relative paths from your config directory are allowed
93
94### Unsafe (Development Only)
95
96Stores secrets as plain text files:
97
98```toml
99[auth]
100secrets_backend = "unsafe"
101```
102
103**Storage location:**
104```
105{data_dir}/secrets/
106├── gordon/
107│   └── auth/
108│       └── token_secret
109```
110
111**Usage:**
112```bash
113# Create secret
114mkdir -p ~/.gordon/secrets/gordon/auth
115echo "your-token-secret" > ~/.gordon/secrets/gordon/auth/token_secret
116```
117
118> **Warning:** Only use for local development. Secrets are stored in plain text.
119
120## Secret Provider Syntax
121
122In environment files, reference secrets using provider syntax:
123
124### Pass Provider
125
126```bash
127# ${pass:<path>}
128DATABASE_PASSWORD=${pass:myapp/database/password}
129API_KEY=${pass:myapp/api-key}
130```
131
132### SOPS Provider
133
134```bash
135# ${sops:<file>:<key.path>}
136DATABASE_PASSWORD=${sops:secrets.yaml:database.password}
137API_SECRET=${sops:production.yaml:api.key}
138```
139
140## App Secret Values
141
142App secret names are registered in the app manifest (`[service.secrets]` maps ENV name to secret name); values are written separately and stay in pass:
143
144```bash
145gordon apps secrets set blog --service web DATABASE_URL=...
146```
147
148Values affect the next deploy/restart, never running containers. Only key names are ever echoed back, never values. See [App Manifest](./apps.md) and [Apps CLI](../cli/apps.md).
149
150## Examples
151
152### Production with Pass
153
154```toml
155[auth]
156enabled = true
157secrets_backend = "pass"
158token_secret = "gordon/auth/token_secret"
159```
160
161```bash
162# Setup
163pass insert gordon/auth/token_secret
164# Enter a random 32+ character string
165
166# Generate tokens
167gordon auth token generate --subject deploy --expiry 0
168```
169
170### Development with Unsafe
171
172```toml
173[auth]
174enabled = false
175secrets_backend = "unsafe"
176```
177
178## Security Recommendations
179
1801. **Production**: Always use `pass` or `sops` backend
1812. **Never commit**: Don't commit unencrypted secrets to git (app files must never contain secret values)
1823. **Rotate regularly**: Regenerate tokens and passwords periodically
1834. **Least privilege**: Use separate secrets per environment
1845. **Path validation**: SOPS provider rejects absolute paths and path traversal attempts for security
185
186## Related
187
188- [Authentication](./auth.md)
189- [App Manifest](./apps.md)
190- [Configuration Overview](./index.md)

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 7

Tags 106

↑↓ moveenter openesc close