v2.31.0-dev2 4b72742

auth.md RawHistoryFolder

Authentication Commands

Manage Gordon server authentication tokens.

gordon auth

Subcommands

Subcommand Description
login Store a token for a remote Gordon server
show-token Print the stored token for a remote
logout Remove stored token for a remote
status Check authentication session status
token generate Generate a new JWT token
token list List all stored tokens
token revoke Revoke a token by ID (use --all to revoke all tokens)
internal Show internal registry credentials

gordon auth login

Store a pre-generated token for a remote Gordon server.

gordon auth login --token <token> [options]

Options

Option Description
-t, --token Required. Authentication token to store
-r, --remote Remote to authenticate with (defaults to active remote)

Description

Stores a token for use with a remote Gordon server. The --token flag is required — generate a token on the server with gordon auth token generate.

When pass is available, the token is stored encrypted at gordon/remotes/<name>/token and plaintext fields are cleared from remotes.toml. When pass is unavailable, the token is stored in plaintext with a warning.

The token is verified against /admin/status on a best-effort basis.

Examples

gordon auth login --token <token>
gordon auth login --remote prod --token <token>

Output

When pass is available:

Token stored in pass for remote 'prod'

When pass is not available:

Warning: 'pass' not available. Storing token in plaintext config. Consider installing pass (https://www.passwordstore.org/) for secure token storage.
Token stored for remote 'prod'

gordon auth show-token

Print the stored token for a remote.

gordon auth show-token [--remote <name>]

Output is the raw token string, suitable for piping. Returns an error if no token is stored.

gordon auth show-token
gordon auth show-token --remote prod
gordon auth show-token | pbcopy  # copy to clipboard

gordon auth logout

Remove the stored token for a remote.

gordon auth logout [--remote <name>] [--revoke]
Option Description
-r, --remote Remote to log out from (defaults to active remote)
--revoke Also revoke the token server-side (not yet implemented)

Deletes the token from pass and clears token fields in remotes.toml.


gordon auth token generate

Generate a new JWT authentication token for registry access.

gordon auth token generate --subject <name> [options]

Options

Option Default Description
--subject (required) Username/subject for the token
--scopes push,pull Comma-separated scopes
--expiry 30d Duration until expiry (0 = never)
-c, --config Auto Path to config file

Duration Format

Supports human-friendly duration units:

Unit Description Example
d Days (24 hours) 30d
w Weeks (7 days) 2w
M Months (30 days) 6M
y Years (365 days) 1y

Compound durations are also supported: 1y6M, 2w3d, 1d12h

Standard Go durations also work: 24h, 30m, 1h30m

Scopes

Registry scopes: push, pull, push,pull

Admin scopes: admin:*:*, admin:routes:read, admin:routes:write, admin:config:read, admin:config:write, admin:status:read, admin:secrets:read, admin:secrets:write

Combine scopes with commas:

gordon auth token generate --subject admin --scopes "push,pull,admin:*:*" --expiry 0

Examples

# CI token that never expires
gordon auth token generate --subject github-actions --expiry 0

# Read-only token for 30 days
gordon auth token generate --subject reader --scopes pull --expiry 30d

# Push-only token for 1 year
gordon auth token generate --subject builder --scopes push --expiry 1y

# Temporary token (24 hours)
gordon auth token generate --subject temp --expiry 24h

# Full admin access token
gordon auth token generate --subject admin --scopes "push,pull,admin:*:*" --expiry 6M

# Read-only admin token
gordon auth token generate --subject monitor --scopes "admin:status:read" --expiry 30d

Output

Token generated successfully!
Subject: github-actions
Scopes: push, pull
Expiry: never

Token (use as password with docker login):
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

Usage: docker login -u github-actions -p <token> <registry>

gordon auth token list

List all stored authentication tokens.

gordon auth token list [options]

Output

ID                                    Subject               Expires               Revoked
------------------------------------------------------------------------------------------
a1b2c3d4-e5f6-7890-abcd-ef1234567890  github-actions        never                 no
b2c3d4e5-f6a7-8901-bcde-f12345678901  deploy-bot            2024-02-15 10:30      no
c3d4e5f6-a7b8-9012-cdef-123456789012  old-token             2024-01-01 00:00      yes

gordon auth token revoke

Revoke a token by its ID.

gordon auth token revoke <token-id> [options]
gordon auth token revoke --all  # Revoke all tokens

Example

gordon auth token revoke a1b2c3d4-e5f6-7890-abcd-ef1234567890

Output

Token a1b2c3d4-e5f6-7890-abcd-ef1234567890 has been revoked.

gordon auth internal

Display the auto-generated internal registry credentials.

gordon auth internal

Gordon generates temporary credentials for loopback-only communication with its local registry. These credentials are useful for manual recovery when debugging deployment issues.

When registry auth is enabled, Gordon also generates a separate service token for its own registry-domain pulls. That token is not exposed via the CLI.

Output

Internal Registry Credentials
==============================
Username: gordon-internal
Password: 8f3a2b1c4d5e6f7a8b9c0d1e2f3a4b5c...

Usage:
  docker login localhost:5000 -u gordon-internal -p 8f3a2b1c4d5e6f7a8b9c0d1e2f3a4b5c...

Notes

  • Credentials are regenerated each time Gordon starts
  • Only available while Gordon is running
  • Used for manual docker pull from the local registry during debugging
  • Separate from the service token used by Gordon core for registry-domain pulls

Use Cases

  • Debugging image pull failures
  • Manual recovery after deployment issues
  • Inspecting images in the local registry

Token Scopes

Scope Permission
push Push images to registry
pull Pull images from registry
push,pull Both push and pull (default)
admin:*:* Full admin access
admin:routes:read Read-only routes access
admin:routes:write Routes write access
admin:config:read Read-only config access
admin:config:write Config write access
admin:status:read Read-only status/health
admin:secrets:read List secret keys
admin:secrets:write Set/delete secrets

Token Expiry Formats

Format Duration
0 Never expires
24h 24 hours
720h 30 days
8760h 1 year

Workflow Examples

CI/CD Setup

# Generate token for CI
gordon auth token generate --subject ci-bot --scopes push,pull --expiry 0

# Save token as CI secret
# GitHub: Settings > Secrets > New repository secret
# GitLab: Settings > CI/CD > Variables

Docker Login

# Using generated token
docker login -u ci-bot -p <token> registry.mydomain.com

# In CI/CD
echo "$GORDON_TOKEN" | docker login -u ci-bot --password-stdin registry.mydomain.com

Token Rotation

# Generate new token
gordon auth token generate --subject ci-bot --expiry 0

# Update CI secrets with new token

# Revoke old token
gordon auth token revoke <old-token-id>

Token-only Setup

# Create token secret
pass insert gordon/auth/token_secret
# Enter a random 32+ character string

# Configure gordon.toml
[auth]
enabled = true
secrets_backend = "pass"
token_secret = "gordon/auth/token_secret"

# Generate a deploy token
gordon auth token generate --subject deploy --scopes "push,pull" --expiry 0
source
1# Authentication Commands
2
3Manage Gordon server authentication tokens.
4
5## gordon auth
6
7### Subcommands
8
9| Subcommand | Description |
10|------------|-------------|
11| `login` | Store a token for a remote Gordon server |
12| `show-token` | Print the stored token for a remote |
13| `logout` | Remove stored token for a remote |
14| `status` | Check authentication session status |
15| `token generate` | Generate a new JWT token |
16| `token list` | List all stored tokens |
17| `token revoke` | Revoke a token by ID (use `--all` to revoke all tokens) |
18| `internal` | Show internal registry credentials |
19
20---
21
22## gordon auth login
23
24Store a pre-generated token for a remote Gordon server.
25
26```bash
27gordon auth login --token <token> [options]
28```
29
30### Options
31
32| Option | Description |
33|--------|-------------|
34| `-t, --token` | **Required.** Authentication token to store |
35| `-r, --remote` | Remote to authenticate with (defaults to active remote) |
36
37### Description
38
39Stores a token for use with a remote Gordon server. The `--token` flag is required — generate a token on the server with `gordon auth token generate`.
40
41When [pass](https://www.passwordstore.org/) is available, the token is stored encrypted at `gordon/remotes/<name>/token` and plaintext fields are cleared from `remotes.toml`. When `pass` is unavailable, the token is stored in plaintext with a warning.
42
43The token is verified against `/admin/status` on a best-effort basis.
44
45### Examples
46
47```bash
48gordon auth login --token <token>
49gordon auth login --remote prod --token <token>
50```
51
52### Output
53
54When `pass` is available:
55
56```text
57Token stored in pass for remote 'prod'
58```
59
60When `pass` is not available:
61
62```text
63Warning: 'pass' not available. Storing token in plaintext config. Consider installing pass (https://www.passwordstore.org/) for secure token storage.
64Token stored for remote 'prod'
65```
66
67---
68
69## gordon auth show-token
70
71Print the stored token for a remote.
72
73```bash
74gordon auth show-token [--remote <name>]
75```
76
77Output is the raw token string, suitable for piping. Returns an error if no token is stored.
78
79```bash
80gordon auth show-token
81gordon auth show-token --remote prod
82gordon auth show-token | pbcopy  # copy to clipboard
83```
84
85---
86
87## gordon auth logout
88
89Remove the stored token for a remote.
90
91```bash
92gordon auth logout [--remote <name>] [--revoke]
93```
94
95| Option | Description |
96|--------|-------------|
97| `-r, --remote` | Remote to log out from (defaults to active remote) |
98| `--revoke` | Also revoke the token server-side (not yet implemented) |
99
100Deletes the token from pass and clears token fields in `remotes.toml`.
101
102---
103
104## gordon auth token generate
105
106Generate a new JWT authentication token for registry access.
107
108```bash
109gordon auth token generate --subject <name> [options]
110```
111
112### Options
113
114| Option | Default | Description |
115|--------|---------|-------------|
116| `--subject` | (required) | Username/subject for the token |
117| `--scopes` | `push,pull` | Comma-separated scopes |
118| `--expiry` | `30d` | Duration until expiry (0 = never) |
119| `-c, --config` | Auto | Path to config file |
120
121### Duration Format
122
123Supports human-friendly duration units:
124
125| Unit | Description | Example |
126|------|-------------|---------|
127| `d` | Days (24 hours) | `30d` |
128| `w` | Weeks (7 days) | `2w` |
129| `M` | Months (30 days) | `6M` |
130| `y` | Years (365 days) | `1y` |
131
132Compound durations are also supported: `1y6M`, `2w3d`, `1d12h`
133
134Standard Go durations also work: `24h`, `30m`, `1h30m`
135
136### Scopes
137
138Registry scopes: `push`, `pull`, `push,pull`
139
140Admin scopes: `admin:*:*`, `admin:routes:read`, `admin:routes:write`, `admin:config:read`, `admin:config:write`, `admin:status:read`, `admin:secrets:read`, `admin:secrets:write`
141
142Combine scopes with commas:
143
144```bash
145gordon auth token generate --subject admin --scopes "push,pull,admin:*:*" --expiry 0
146```
147
148### Examples
149
150```bash
151# CI token that never expires
152gordon auth token generate --subject github-actions --expiry 0
153
154# Read-only token for 30 days
155gordon auth token generate --subject reader --scopes pull --expiry 30d
156
157# Push-only token for 1 year
158gordon auth token generate --subject builder --scopes push --expiry 1y
159
160# Temporary token (24 hours)
161gordon auth token generate --subject temp --expiry 24h
162
163# Full admin access token
164gordon auth token generate --subject admin --scopes "push,pull,admin:*:*" --expiry 6M
165
166# Read-only admin token
167gordon auth token generate --subject monitor --scopes "admin:status:read" --expiry 30d
168```
169
170### Output
171
172```
173Token generated successfully!
174Subject: github-actions
175Scopes: push, pull
176Expiry: never
177
178Token (use as password with docker login):
179eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
180
181Usage: docker login -u github-actions -p <token> <registry>
182```
183
184---
185
186## gordon auth token list
187
188List all stored authentication tokens.
189
190```bash
191gordon auth token list [options]
192```
193
194### Output
195
196```
197ID                                    Subject               Expires               Revoked
198------------------------------------------------------------------------------------------
199a1b2c3d4-e5f6-7890-abcd-ef1234567890  github-actions        never                 no
200b2c3d4e5-f6a7-8901-bcde-f12345678901  deploy-bot            2024-02-15 10:30      no
201c3d4e5f6-a7b8-9012-cdef-123456789012  old-token             2024-01-01 00:00      yes
202```
203
204---
205
206## gordon auth token revoke
207
208Revoke a token by its ID.
209
210```bash
211gordon auth token revoke <token-id> [options]
212gordon auth token revoke --all  # Revoke all tokens
213```
214
215### Example
216
217```bash
218gordon auth token revoke a1b2c3d4-e5f6-7890-abcd-ef1234567890
219```
220
221### Output
222
223```
224Token a1b2c3d4-e5f6-7890-abcd-ef1234567890 has been revoked.
225```
226
227---
228
229## gordon auth internal
230
231Display the auto-generated internal registry credentials.
232
233```bash
234gordon auth internal
235```
236
237Gordon generates temporary credentials for loopback-only communication with its local registry. These credentials are useful for manual recovery when debugging deployment issues.
238
239When registry auth is enabled, Gordon also generates a separate service token for its own registry-domain pulls. That token is not exposed via the CLI.
240
241### Output
242
243```
244Internal Registry Credentials
245==============================
246Username: gordon-internal
247Password: 8f3a2b1c4d5e6f7a8b9c0d1e2f3a4b5c...
248
249Usage:
250  docker login localhost:5000 -u gordon-internal -p 8f3a2b1c4d5e6f7a8b9c0d1e2f3a4b5c...
251```
252
253### Notes
254
255- Credentials are regenerated each time Gordon starts
256- Only available while Gordon is running
257- Used for manual `docker pull` from the local registry during debugging
258- Separate from the service token used by Gordon core for registry-domain pulls
259
260### Use Cases
261
262- Debugging image pull failures
263- Manual recovery after deployment issues
264- Inspecting images in the local registry
265
266---
267
268## Token Scopes
269
270| Scope | Permission |
271|-------|------------|
272| `push` | Push images to registry |
273| `pull` | Pull images from registry |
274| `push,pull` | Both push and pull (default) |
275| `admin:*:*` | Full admin access |
276| `admin:routes:read` | Read-only routes access |
277| `admin:routes:write` | Routes write access |
278| `admin:config:read` | Read-only config access |
279| `admin:config:write` | Config write access |
280| `admin:status:read` | Read-only status/health |
281| `admin:secrets:read` | List secret keys |
282| `admin:secrets:write` | Set/delete secrets |
283
284## Token Expiry Formats
285
286| Format | Duration |
287|--------|----------|
288| `0` | Never expires |
289| `24h` | 24 hours |
290| `720h` | 30 days |
291| `8760h` | 1 year |
292
293---
294
295## Workflow Examples
296
297### CI/CD Setup
298
299```bash
300# Generate token for CI
301gordon auth token generate --subject ci-bot --scopes push,pull --expiry 0
302
303# Save token as CI secret
304# GitHub: Settings > Secrets > New repository secret
305# GitLab: Settings > CI/CD > Variables
306```
307
308### Docker Login
309
310```bash
311# Using generated token
312docker login -u ci-bot -p <token> registry.mydomain.com
313
314# In CI/CD
315echo "$GORDON_TOKEN" | docker login -u ci-bot --password-stdin registry.mydomain.com
316```
317
318### Token Rotation
319
320```bash
321# Generate new token
322gordon auth token generate --subject ci-bot --expiry 0
323
324# Update CI secrets with new token
325
326# Revoke old token
327gordon auth token revoke <old-token-id>
328```
329
330### Token-only Setup
331
332```bash
333# Create token secret
334pass insert gordon/auth/token_secret
335# Enter a random 32+ character string
336
337# Configure gordon.toml
338[auth]
339enabled = true
340secrets_backend = "pass"
341token_secret = "gordon/auth/token_secret"
342
343# Generate a deploy token
344gordon auth token generate --subject deploy --scopes "push,pull" --expiry 0
345```
346
347## Related
348
349- [CLI Overview](./index.md)
350- [Authentication Configuration](../config/auth.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