detached 9a1176c

feat(config): add gordon_domain as preferred alias for registry_domain

- Add gordon_domain config option that takes precedence over registry_domain
- registry_domain remains supported for backwards compatibility
- Update docs to use gordon_domain in all examples
- Clarify that this domain serves both registry and admin API
commit
9a1176c8807faae05522fabccb8949ca59b2af52
author
bnema · · 2026-01-16 21:27 UTC
parent
ee1db19
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
4 files · +40 -14
M docs/cli/commands.md +4 -2
@@ -55,10 +55,12 @@ gordon auth internal
5555
5656 ### Remote Targeting
5757
58-The CLI can target remote Gordon instances using the `--remote` flag or `GORDON_REMOTE` environment variable:
58+The CLI can target remote Gordon instances using the `--remote` flag or `GORDON_REMOTE` environment variable.
59+
60+**Important:** The remote URL must be the `gordon_domain` configured on the remote Gordon instance. This is the domain that serves both the container registry and the Admin API.
5961
6062 ```bash
61-# Using flags
63+# Using flags (use the gordon_domain from remote Gordon config)
6264 gordon routes list --remote https://gordon.mydomain.com --token $TOKEN
6365
6466 # Using environment variables
@@ -55,10 +55,12 @@ gordon auth internal
55 55
56 ### Remote Targeting56 ### Remote Targeting
57 57
58-The CLI can target remote Gordon instances using the `--remote` flag or `GORDON_REMOTE` environment variable:58+The CLI can target remote Gordon instances using the `--remote` flag or `GORDON_REMOTE` environment variable.
59+
60+**Important:** The remote URL must be the `gordon_domain` configured on the remote Gordon instance. This is the domain that serves both the container registry and the Admin API.
59 61
60 ```bash62 ```bash
61-# Using flags63+# Using flags (use the gordon_domain from remote Gordon config)
62 gordon routes list --remote https://gordon.mydomain.com --token $TOKEN64 gordon routes list --remote https://gordon.mydomain.com --token $TOKEN
63 65
64 # Using environment variables66 # Using environment variables
M docs/config/server.md +17 -11
@@ -8,7 +8,7 @@ Core server settings for Gordon.
88 [server]
99 port = 8080 # HTTP proxy port
1010 registry_port = 5000 # Container registry port
11-registry_domain = "registry.mydomain.com" # Registry domain (required)
11+gordon_domain = "gordon.mydomain.com" # Gordon domain (required)
1212 # data_dir = "~/.gordon" # Data storage directory (default)
1313 ```
1414
@@ -18,7 +18,8 @@ registry_domain = "registry.mydomain.com" # Registry domain (required)
1818 |--------|------|---------|-------------|
1919 | `port` | int | `80` | HTTP proxy port for routing traffic to containers |
2020 | `registry_port` | int | `5000` | Docker registry port for image push/pull |
21-| `registry_domain` | string | **required** | Domain for the container registry |
21+| `gordon_domain` | string | **required** | Domain for Gordon (registry + admin API) |
22+| `registry_domain` | string | - | Deprecated alias for `gordon_domain` |
2223 | `data_dir` | string | `~/.gordon` | Directory for registry data, logs, and env files |
2324
2425 ## Port Configuration
@@ -54,19 +55,24 @@ Docker/Podman clients push to this port:
5455 docker push registry.mydomain.com:5000/myapp:latest
5556 ```
5657
57-## Registry Domain
58+## Gordon Domain
5859
59-The `registry_domain` is required and must match your DNS configuration:
60+The `gordon_domain` is required and must match your DNS configuration:
6061
6162 ```toml
6263 [server]
63-registry_domain = "registry.mydomain.com"
64+gordon_domain = "gordon.mydomain.com"
6465 ```
6566
6667 This domain is used for:
67-- Docker login authentication
68-- Image push/pull operations
69-- Internal registry references
68+- Docker login and image push/pull operations
69+- Admin API access (`/admin/*` endpoints)
70+- CLI remote targeting (`gordon routes --remote https://gordon.mydomain.com`)
71+- Token endpoint for authentication (`/v2/token`)
72+
73+When requests arrive on the proxy port with this domain as the Host header, Gordon routes them to the backend services (registry and admin API).
74+
75+> **Note:** `registry_domain` is supported as a deprecated alias for backwards compatibility.
7076
7177 ## Data Directory
7278
@@ -108,7 +114,7 @@ Gordon creates directories with secure permissions:
108114 [server]
109115 port = 8080
110116 registry_port = 5000
111-registry_domain = "registry.local"
117+gordon_domain = "gordon.local"
112118 data_dir = "./dev-data"
113119 ```
114120
@@ -118,7 +124,7 @@ data_dir = "./dev-data"
118124 [server]
119125 port = 8080
120126 registry_port = 5000
121-registry_domain = "registry.company.com"
127+gordon_domain = "gordon.company.com"
122128 data_dir = "/var/lib/gordon"
123129 ```
124130
@@ -128,7 +134,7 @@ data_dir = "/var/lib/gordon"
128134 [server]
129135 port = 8080 # High port for rootless
130136 registry_port = 5000
131-registry_domain = "registry.mydomain.com"
137+gordon_domain = "gordon.mydomain.com"
132138 ```
133139
134140 With firewall port forwarding:
@@ -8,7 +8,7 @@ Core server settings for Gordon.
8 [server]8 [server]
9 port = 8080 # HTTP proxy port9 port = 8080 # HTTP proxy port
10 registry_port = 5000 # Container registry port10 registry_port = 5000 # Container registry port
11-registry_domain = "registry.mydomain.com" # Registry domain (required)11+gordon_domain = "gordon.mydomain.com" # Gordon domain (required)
12 # data_dir = "~/.gordon" # Data storage directory (default)12 # data_dir = "~/.gordon" # Data storage directory (default)
13 ```13 ```
14 14
@@ -18,7 +18,8 @@ registry_domain = "registry.mydomain.com" # Registry domain (required)
18 |--------|------|---------|-------------|18 |--------|------|---------|-------------|
19 | `port` | int | `80` | HTTP proxy port for routing traffic to containers |19 | `port` | int | `80` | HTTP proxy port for routing traffic to containers |
20 | `registry_port` | int | `5000` | Docker registry port for image push/pull |20 | `registry_port` | int | `5000` | Docker registry port for image push/pull |
21-| `registry_domain` | string | **required** | Domain for the container registry |21+| `gordon_domain` | string | **required** | Domain for Gordon (registry + admin API) |
22+| `registry_domain` | string | - | Deprecated alias for `gordon_domain` |
22 | `data_dir` | string | `~/.gordon` | Directory for registry data, logs, and env files |23 | `data_dir` | string | `~/.gordon` | Directory for registry data, logs, and env files |
23 24
24 ## Port Configuration25 ## Port Configuration
@@ -54,19 +55,24 @@ Docker/Podman clients push to this port:
54 docker push registry.mydomain.com:5000/myapp:latest55 docker push registry.mydomain.com:5000/myapp:latest
55 ```56 ```
56 57
57-## Registry Domain58+## Gordon Domain
58 59
59-The `registry_domain` is required and must match your DNS configuration:60+The `gordon_domain` is required and must match your DNS configuration:
60 61
61 ```toml62 ```toml
62 [server]63 [server]
63-registry_domain = "registry.mydomain.com"64+gordon_domain = "gordon.mydomain.com"
64 ```65 ```
65 66
66 This domain is used for:67 This domain is used for:
67-- Docker login authentication68+- Docker login and image push/pull operations
68-- Image push/pull operations69+- Admin API access (`/admin/*` endpoints)
69-- Internal registry references70+- CLI remote targeting (`gordon routes --remote https://gordon.mydomain.com`)
71+- Token endpoint for authentication (`/v2/token`)
72+
73+When requests arrive on the proxy port with this domain as the Host header, Gordon routes them to the backend services (registry and admin API).
74+
75+> **Note:** `registry_domain` is supported as a deprecated alias for backwards compatibility.
70 76
71 ## Data Directory77 ## Data Directory
72 78
@@ -108,7 +114,7 @@ Gordon creates directories with secure permissions:
108 [server]114 [server]
109 port = 8080115 port = 8080
110 registry_port = 5000116 registry_port = 5000
111-registry_domain = "registry.local"117+gordon_domain = "gordon.local"
112 data_dir = "./dev-data"118 data_dir = "./dev-data"
113 ```119 ```
114 120
@@ -118,7 +124,7 @@ data_dir = "./dev-data"
118 [server]124 [server]
119 port = 8080125 port = 8080
120 registry_port = 5000126 registry_port = 5000
121-registry_domain = "registry.company.com"127+gordon_domain = "gordon.company.com"
122 data_dir = "/var/lib/gordon"128 data_dir = "/var/lib/gordon"
123 ```129 ```
124 130
@@ -128,7 +134,7 @@ data_dir = "/var/lib/gordon"
128 [server]134 [server]
129 port = 8080 # High port for rootless135 port = 8080 # High port for rootless
130 registry_port = 5000136 registry_port = 5000
131-registry_domain = "registry.mydomain.com"137+gordon_domain = "gordon.mydomain.com"
132 ```138 ```
133 139
134 With firewall port forwarding:140 With firewall port forwarding:
M internal/app/run.go +7 -1
@@ -52,7 +52,8 @@ type Config struct {
5252 Server struct {
5353 Port int `mapstructure:"port"`
5454 RegistryPort int `mapstructure:"registry_port"`
55- RegistryDomain string `mapstructure:"registry_domain"`
55+ GordonDomain string `mapstructure:"gordon_domain"`
56+ RegistryDomain string `mapstructure:"registry_domain"` // Deprecated: use gordon_domain
5657 DataDir string `mapstructure:"data_dir"`
5758 } `mapstructure:"server"`
5859
@@ -183,6 +184,11 @@ func initConfig(configPath string) (*viper.Viper, Config, error) {
183184 return nil, Config{}, fmt.Errorf("failed to unmarshal config: %w", err)
184185 }
185186
187+ // Normalize domain config: prefer gordon_domain over registry_domain
188+ if cfg.Server.GordonDomain != "" {
189+ cfg.Server.RegistryDomain = cfg.Server.GordonDomain
190+ }
191+
186192 return v, cfg, nil
187193 }
188194
@@ -52,7 +52,8 @@ type Config struct {
52 Server struct {52 Server struct {
53 Port int `mapstructure:"port"`53 Port int `mapstructure:"port"`
54 RegistryPort int `mapstructure:"registry_port"`54 RegistryPort int `mapstructure:"registry_port"`
55- RegistryDomain string `mapstructure:"registry_domain"`55+ GordonDomain string `mapstructure:"gordon_domain"`
56+ RegistryDomain string `mapstructure:"registry_domain"` // Deprecated: use gordon_domain
56 DataDir string `mapstructure:"data_dir"`57 DataDir string `mapstructure:"data_dir"`
57 } `mapstructure:"server"`58 } `mapstructure:"server"`
58 59
@@ -183,6 +184,11 @@ func initConfig(configPath string) (*viper.Viper, Config, error) {
183 return nil, Config{}, fmt.Errorf("failed to unmarshal config: %w", err)184 return nil, Config{}, fmt.Errorf("failed to unmarshal config: %w", err)
184 }185 }
185 186
187+ // Normalize domain config: prefer gordon_domain over registry_domain
188+ if cfg.Server.GordonDomain != "" {
189+ cfg.Server.RegistryDomain = cfg.Server.GordonDomain
190+ }
191+
186 return v, cfg, nil192 return v, cfg, nil
187 }193 }
188 194
M wiki/guides/remote-cli.md +12 -0
@@ -16,6 +16,18 @@ Manage Gordon instances remotely using the CLI with the `--remote` flag or saved
1616 - A remote Gordon instance running with admin API enabled
1717 - Authentication token for the remote instance
1818
19+## Understanding the Remote URL
20+
21+The `--remote` URL must be the `gordon_domain` configured on the remote Gordon instance. This domain serves both the container registry and the Admin API.
22+
23+```toml
24+# On the remote Gordon server
25+[server]
26+gordon_domain = "gordon.example.com" # Use this as --remote URL
27+```
28+
29+The CLI connects to `https://gordon.example.com/admin/*` endpoints.
30+
1931 ## Quick Start
2032
2133 ### One-off Remote Command
@@ -16,6 +16,18 @@ Manage Gordon instances remotely using the CLI with the `--remote` flag or saved
16 - A remote Gordon instance running with admin API enabled16 - A remote Gordon instance running with admin API enabled
17 - Authentication token for the remote instance17 - Authentication token for the remote instance
18 18
19+## Understanding the Remote URL
20+
21+The `--remote` URL must be the `gordon_domain` configured on the remote Gordon instance. This domain serves both the container registry and the Admin API.
22+
23+```toml
24+# On the remote Gordon server
25+[server]
26+gordon_domain = "gordon.example.com" # Use this as --remote URL
27+```
28+
29+The CLI connects to `https://gordon.example.com/admin/*` endpoints.
30+
19 ## Quick Start31 ## Quick Start
20 32
21 ### One-off Remote Command33 ### One-off Remote Command

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