docs: update auth config to use inferred type and new CLI commands
- commit
- 9f5497edd5f76316c75add01a1da7c1f3e81554c
- author
- bnema · · 2026-01-18 03:17 UTC
- parent
- 3819799
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
13 files · +204 -52
M .github/actions/deploy/README.md +1 -2
| @@ -122,12 +122,11 @@ In your repository settings, add: | |||
| 122 | 122 | ||
| 123 | 123 | ### 3. Configure Gordon | |
| 124 | 124 | ||
| 125 | - | Ensure your Gordon config uses token authentication: | |
| 125 | + | Ensure your Gordon config has authentication enabled: | |
| 126 | 126 | ||
| 127 | 127 | ```toml | |
| 128 | 128 | [auth] | |
| 129 | 129 | enabled = true | |
| 130 | - | type = "token" | |
| 131 | 130 | secrets_backend = "pass" # or "sops" | |
| 132 | 131 | token_secret = "gordon/auth/token_secret" | |
| 133 | 132 | ``` | |
| @@ -122,12 +122,11 @@ In your repository settings, add: | |||||
| 122 | 122 | ||||
| 123 | ### 3. Configure Gordon | 123 | ### 3. Configure Gordon | ||
| 124 | 124 | ||||
| 125 | - | Ensure your Gordon config uses token authentication: | 125 | + | Ensure your Gordon config has authentication enabled: |
| 126 | 126 | ||||
| 127 | ```toml | 127 | ```toml | ||
| 128 | [auth] | 128 | [auth] | ||
| 129 | enabled = true | 129 | enabled = true | ||
| 130 | - | type = "token" | |||
| 131 | secrets_backend = "pass" # or "sops" | 130 | secrets_backend = "pass" # or "sops" | ||
| 132 | token_secret = "gordon/auth/token_secret" | 131 | token_secret = "gordon/auth/token_secret" | ||
| 133 | ``` | 132 | ``` | ||
M docs/cli/auth.md +58 -2
| @@ -8,6 +8,7 @@ Manage Gordon server authentication tokens and passwords. | |||
| 8 | 8 | ||
| 9 | 9 | | Subcommand | Description | | |
| 10 | 10 | |------------|-------------| | |
| 11 | + | | `login` | Authenticate with a remote Gordon server | | |
| 11 | 12 | | `token generate` | Generate a new JWT token | | |
| 12 | 13 | | `token list` | List all stored tokens | | |
| 13 | 14 | | `token revoke` | Revoke a token by ID (use `--all` to revoke all tokens) | | |
| @@ -16,6 +17,56 @@ Manage Gordon server authentication tokens and passwords. | |||
| 16 | 17 | ||
| 17 | 18 | --- | |
| 18 | 19 | ||
| 20 | + | ## gordon auth login | |
| 21 | + | ||
| 22 | + | Authenticate with a remote Gordon server using password authentication. | |
| 23 | + | ||
| 24 | + | ```bash | |
| 25 | + | gordon auth login [options] | |
| 26 | + | ``` | |
| 27 | + | ||
| 28 | + | ### Options | |
| 29 | + | ||
| 30 | + | | Option | Description | | |
| 31 | + | |--------|-------------| | |
| 32 | + | | `-r, --remote` | Remote to authenticate with (defaults to active remote) | | |
| 33 | + | | `-u, --username` | Username for authentication | | |
| 34 | + | ||
| 35 | + | ### Description | |
| 36 | + | ||
| 37 | + | This command prompts for your username and password, authenticates with the remote server's `/auth/password` endpoint, and stores the returned token in your remotes configuration. | |
| 38 | + | ||
| 39 | + | The token is a long-lived JWT (7 days) that's used for subsequent CLI operations against the remote. | |
| 40 | + | ||
| 41 | + | > **Note:** This command only works with servers that have password authentication configured (`username` + `password_hash`). For token-only servers, use `gordon remotes set-token` instead. | |
| 42 | + | ||
| 43 | + | ### Examples | |
| 44 | + | ||
| 45 | + | ```bash | |
| 46 | + | # Login using active remote | |
| 47 | + | gordon auth login | |
| 48 | + | ||
| 49 | + | # Login to specific remote | |
| 50 | + | gordon auth login --remote prod | |
| 51 | + | ||
| 52 | + | # Pre-fill username | |
| 53 | + | gordon auth login --username admin | |
| 54 | + | ``` | |
| 55 | + | ||
| 56 | + | ### Output | |
| 57 | + | ||
| 58 | + | ``` | |
| 59 | + | Username: admin | |
| 60 | + | Password: ******** | |
| 61 | + | Authenticating with prod... | |
| 62 | + | ||
| 63 | + | ✓ Authentication successful! | |
| 64 | + | Token stored for remote 'prod' | |
| 65 | + | Expires in: 604800 seconds | |
| 66 | + | ``` | |
| 67 | + | ||
| 68 | + | --- | |
| 69 | + | ||
| 19 | 70 | ## gordon auth token generate | |
| 20 | 71 | ||
| 21 | 72 | Generate a new JWT authentication token for registry access. | |
| @@ -146,8 +197,9 @@ $2a$10$N9qo8uLOickgx2ZMRZoMye... | |||
| 146 | 197 | ||
| 147 | 198 | Then reference the path in your config: | |
| 148 | 199 | [auth] | |
| 149 | - | type = "password" | |
| 200 | + | username = "deploy" | |
| 150 | 201 | password_hash = "gordon/auth/password_hash" | |
| 202 | + | token_secret = "gordon/auth/token_secret" | |
| 151 | 203 | ``` | |
| 152 | 204 | ||
| 153 | 205 | --- | |
| @@ -253,13 +305,17 @@ gordon auth password hash | |||
| 253 | 305 | pass insert gordon/auth/password_hash | |
| 254 | 306 | # Paste: $2a$10$... | |
| 255 | 307 | ||
| 308 | + | # Create token secret | |
| 309 | + | pass insert gordon/auth/token_secret | |
| 310 | + | # Enter a random 32+ character string | |
| 311 | + | ||
| 256 | 312 | # Configure gordon.toml | |
| 257 | 313 | [auth] | |
| 258 | 314 | enabled = true | |
| 259 | - | type = "password" | |
| 260 | 315 | secrets_backend = "pass" | |
| 261 | 316 | username = "deploy" | |
| 262 | 317 | password_hash = "gordon/auth/password_hash" | |
| 318 | + | token_secret = "gordon/auth/token_secret" | |
| 263 | 319 | ``` | |
| 264 | 320 | ||
| 265 | 321 | ## Related | |
| @@ -8,6 +8,7 @@ Manage Gordon server authentication tokens and passwords. | |||||
| 8 | 8 | ||||
| 9 | | Subcommand | Description | | 9 | | Subcommand | Description | | ||
| 10 | |------------|-------------| | 10 | |------------|-------------| | ||
| 11 | + | | `login` | Authenticate with a remote Gordon server | | |||
| 11 | | `token generate` | Generate a new JWT token | | 12 | | `token generate` | Generate a new JWT token | | ||
| 12 | | `token list` | List all stored tokens | | 13 | | `token list` | List all stored tokens | | ||
| 13 | | `token revoke` | Revoke a token by ID (use `--all` to revoke all tokens) | | 14 | | `token revoke` | Revoke a token by ID (use `--all` to revoke all tokens) | | ||
| @@ -16,6 +17,56 @@ Manage Gordon server authentication tokens and passwords. | |||||
| 16 | 17 | ||||
| 17 | --- | 18 | --- | ||
| 18 | 19 | ||||
| 20 | + | ## gordon auth login | |||
| 21 | + | ||||
| 22 | + | Authenticate with a remote Gordon server using password authentication. | |||
| 23 | + | ||||
| 24 | + | ```bash | |||
| 25 | + | gordon auth login [options] | |||
| 26 | + | ``` | |||
| 27 | + | ||||
| 28 | + | ### Options | |||
| 29 | + | ||||
| 30 | + | | Option | Description | | |||
| 31 | + | |--------|-------------| | |||
| 32 | + | | `-r, --remote` | Remote to authenticate with (defaults to active remote) | | |||
| 33 | + | | `-u, --username` | Username for authentication | | |||
| 34 | + | ||||
| 35 | + | ### Description | |||
| 36 | + | ||||
| 37 | + | This command prompts for your username and password, authenticates with the remote server's `/auth/password` endpoint, and stores the returned token in your remotes configuration. | |||
| 38 | + | ||||
| 39 | + | The token is a long-lived JWT (7 days) that's used for subsequent CLI operations against the remote. | |||
| 40 | + | ||||
| 41 | + | > **Note:** This command only works with servers that have password authentication configured (`username` + `password_hash`). For token-only servers, use `gordon remotes set-token` instead. | |||
| 42 | + | ||||
| 43 | + | ### Examples | |||
| 44 | + | ||||
| 45 | + | ```bash | |||
| 46 | + | # Login using active remote | |||
| 47 | + | gordon auth login | |||
| 48 | + | ||||
| 49 | + | # Login to specific remote | |||
| 50 | + | gordon auth login --remote prod | |||
| 51 | + | ||||
| 52 | + | # Pre-fill username | |||
| 53 | + | gordon auth login --username admin | |||
| 54 | + | ``` | |||
| 55 | + | ||||
| 56 | + | ### Output | |||
| 57 | + | ||||
| 58 | + | ``` | |||
| 59 | + | Username: admin | |||
| 60 | + | Password: ******** | |||
| 61 | + | Authenticating with prod... | |||
| 62 | + | ||||
| 63 | + | ✓ Authentication successful! | |||
| 64 | + | Token stored for remote 'prod' | |||
| 65 | + | Expires in: 604800 seconds | |||
| 66 | + | ``` | |||
| 67 | + | ||||
| 68 | + | --- | |||
| 69 | + | ||||
| 19 | ## gordon auth token generate | 70 | ## gordon auth token generate | ||
| 20 | 71 | ||||
| 21 | Generate a new JWT authentication token for registry access. | 72 | Generate a new JWT authentication token for registry access. | ||
| @@ -146,8 +197,9 @@ $2a$10$N9qo8uLOickgx2ZMRZoMye... | |||||
| 146 | 197 | ||||
| 147 | Then reference the path in your config: | 198 | Then reference the path in your config: | ||
| 148 | [auth] | 199 | [auth] | ||
| 149 | - | type = "password" | 200 | + | username = "deploy" |
| 150 | password_hash = "gordon/auth/password_hash" | 201 | password_hash = "gordon/auth/password_hash" | ||
| 202 | + | token_secret = "gordon/auth/token_secret" | |||
| 151 | ``` | 203 | ``` | ||
| 152 | 204 | ||||
| 153 | --- | 205 | --- | ||
| @@ -253,13 +305,17 @@ gordon auth password hash | |||||
| 253 | pass insert gordon/auth/password_hash | 305 | pass insert gordon/auth/password_hash | ||
| 254 | # Paste: $2a$10$... | 306 | # Paste: $2a$10$... | ||
| 255 | 307 | ||||
| 308 | + | # Create token secret | |||
| 309 | + | pass insert gordon/auth/token_secret | |||
| 310 | + | # Enter a random 32+ character string | |||
| 311 | + | ||||
| 256 | # Configure gordon.toml | 312 | # Configure gordon.toml | ||
| 257 | [auth] | 313 | [auth] | ||
| 258 | enabled = true | 314 | enabled = true | ||
| 259 | - | type = "password" | |||
| 260 | secrets_backend = "pass" | 315 | secrets_backend = "pass" | ||
| 261 | username = "deploy" | 316 | username = "deploy" | ||
| 262 | password_hash = "gordon/auth/password_hash" | 317 | password_hash = "gordon/auth/password_hash" | ||
| 318 | + | token_secret = "gordon/auth/token_secret" | |||
| 263 | ``` | 319 | ``` | ||
| 264 | 320 | ||||
| 265 | ## Related | 321 | ## Related | ||
M docs/cli/remotes.md +47 -0
| @@ -12,6 +12,7 @@ Manage saved remote Gordon instances for easier CLI usage. | |||
| 12 | 12 | | `add` | Add a new remote | | |
| 13 | 13 | | `remove` | Remove a saved remote | | |
| 14 | 14 | | `use` | Set active remote | | |
| 15 | + | | `set-token` | Set or update token for a remote | | |
| 15 | 16 | ||
| 16 | 17 | --- | |
| 17 | 18 | ||
| @@ -165,6 +166,52 @@ gordon remotes use prod | |||
| 165 | 166 | ||
| 166 | 167 | --- | |
| 167 | 168 | ||
| 169 | + | ## gordon remotes set-token | |
| 170 | + | ||
| 171 | + | Set or update the authentication token for a saved remote. | |
| 172 | + | ||
| 173 | + | ```bash | |
| 174 | + | gordon remotes set-token <name> <token> | |
| 175 | + | ``` | |
| 176 | + | ||
| 177 | + | ### Arguments | |
| 178 | + | ||
| 179 | + | | Argument | Description | | |
| 180 | + | |----------|-------------| | |
| 181 | + | | `<name>` | Name of the remote | | |
| 182 | + | | `<token>` | The JWT token to set | | |
| 183 | + | ||
| 184 | + | ### Description | |
| 185 | + | ||
| 186 | + | This command is useful when: | |
| 187 | + | ||
| 188 | + | - The server uses token-based authentication (not password auth) | |
| 189 | + | - You have a pre-generated token from `gordon auth token generate` | |
| 190 | + | - You want to update an expired token | |
| 191 | + | ||
| 192 | + | For servers with password authentication, use `gordon auth login` instead. | |
| 193 | + | ||
| 194 | + | ### Examples | |
| 195 | + | ||
| 196 | + | ```bash | |
| 197 | + | # Set token for prod remote | |
| 198 | + | gordon remotes set-token prod eyJhbGciOiJIUzI1NiIs... | |
| 199 | + | ||
| 200 | + | # Set token from file | |
| 201 | + | gordon remotes set-token staging $(cat token.txt) | |
| 202 | + | ||
| 203 | + | # Set token from environment variable | |
| 204 | + | gordon remotes set-token prod "$GORDON_TOKEN" | |
| 205 | + | ``` | |
| 206 | + | ||
| 207 | + | ### Output | |
| 208 | + | ||
| 209 | + | ``` | |
| 210 | + | ✓ Token updated for remote 'prod' | |
| 211 | + | ``` | |
| 212 | + | ||
| 213 | + | --- | |
| 214 | + | ||
| 168 | 215 | ## Configuration File | |
| 169 | 216 | ||
| 170 | 217 | Remotes are stored in `~/.config/gordon/remotes.toml`: | |
| @@ -12,6 +12,7 @@ Manage saved remote Gordon instances for easier CLI usage. | |||||
| 12 | | `add` | Add a new remote | | 12 | | `add` | Add a new remote | | ||
| 13 | | `remove` | Remove a saved remote | | 13 | | `remove` | Remove a saved remote | | ||
| 14 | | `use` | Set active remote | | 14 | | `use` | Set active remote | | ||
| 15 | + | | `set-token` | Set or update token for a remote | | |||
| 15 | 16 | ||||
| 16 | --- | 17 | --- | ||
| 17 | 18 | ||||
| @@ -165,6 +166,52 @@ gordon remotes use prod | |||||
| 165 | 166 | ||||
| 166 | --- | 167 | --- | ||
| 167 | 168 | ||||
| 169 | + | ## gordon remotes set-token | |||
| 170 | + | ||||
| 171 | + | Set or update the authentication token for a saved remote. | |||
| 172 | + | ||||
| 173 | + | ```bash | |||
| 174 | + | gordon remotes set-token <name> <token> | |||
| 175 | + | ``` | |||
| 176 | + | ||||
| 177 | + | ### Arguments | |||
| 178 | + | ||||
| 179 | + | | Argument | Description | | |||
| 180 | + | |----------|-------------| | |||
| 181 | + | | `<name>` | Name of the remote | | |||
| 182 | + | | `<token>` | The JWT token to set | | |||
| 183 | + | ||||
| 184 | + | ### Description | |||
| 185 | + | ||||
| 186 | + | This command is useful when: | |||
| 187 | + | ||||
| 188 | + | - The server uses token-based authentication (not password auth) | |||
| 189 | + | - You have a pre-generated token from `gordon auth token generate` | |||
| 190 | + | - You want to update an expired token | |||
| 191 | + | ||||
| 192 | + | For servers with password authentication, use `gordon auth login` instead. | |||
| 193 | + | ||||
| 194 | + | ### Examples | |||
| 195 | + | ||||
| 196 | + | ```bash | |||
| 197 | + | # Set token for prod remote | |||
| 198 | + | gordon remotes set-token prod eyJhbGciOiJIUzI1NiIs... | |||
| 199 | + | ||||
| 200 | + | # Set token from file | |||
| 201 | + | gordon remotes set-token staging $(cat token.txt) | |||
| 202 | + | ||||
| 203 | + | # Set token from environment variable | |||
| 204 | + | gordon remotes set-token prod "$GORDON_TOKEN" | |||
| 205 | + | ``` | |||
| 206 | + | ||||
| 207 | + | ### Output | |||
| 208 | + | ||||
| 209 | + | ``` | |||
| 210 | + | ✓ Token updated for remote 'prod' | |||
| 211 | + | ``` | |||
| 212 | + | ||||
| 213 | + | --- | |||
| 214 | + | ||||
| 168 | ## Configuration File | 215 | ## Configuration File | ||
| 169 | 216 | ||||
| 170 | Remotes are stored in `~/.config/gordon/remotes.toml`: | 217 | Remotes are stored in `~/.config/gordon/remotes.toml`: | ||
M docs/config/auth.md +51 -16
| @@ -34,10 +34,13 @@ enabled = false | |||
| 34 | 34 | ```toml | |
| 35 | 35 | [auth] | |
| 36 | 36 | enabled = true | |
| 37 | - | type = "token" | |
| 38 | 37 | secrets_backend = "pass" | |
| 39 | 38 | token_secret = "gordon/auth/token_secret" | |
| 40 | 39 | token_expiry = "30d" | |
| 40 | + | ||
| 41 | + | # Optional: enable password authentication | |
| 42 | + | username = "deploy" | |
| 43 | + | password_hash = "gordon/auth/password_hash" | |
| 41 | 44 | ``` | |
| 42 | 45 | ||
| 43 | 46 | ## Options | |
| @@ -45,12 +48,22 @@ token_expiry = "30d" | |||
| 45 | 48 | | Option | Type | Default | Description | | |
| 46 | 49 | |--------|------|---------|-------------| | |
| 47 | 50 | | `enabled` | bool | `true` | Enable authentication | | |
| 48 | - | | `type` | string | `"password"` | Auth type: `"password"` or `"token"` | | |
| 49 | 51 | | `secrets_backend` | string | `"unsafe"` | Secrets backend: `"pass"`, `"sops"`, or `"unsafe"` | | |
| 50 | - | | `username` | string | - | Username for password auth | | |
| 51 | - | | `password_hash` | string | - | Path to bcrypt hash in secrets backend | | |
| 52 | - | | `token_secret` | string | - | Path to JWT signing secret in secrets backend | | |
| 52 | + | | `token_secret` | string | - | **Required.** Path to JWT signing secret in secrets backend | | |
| 53 | 53 | | `token_expiry` | string | `"30d"` | Token validity duration (0 = never expires) | | |
| 54 | + | | `username` | string | - | Username for password auth (optional) | | |
| 55 | + | | `password_hash` | string | - | Path to bcrypt hash in secrets backend (optional) | | |
| 56 | + | ||
| 57 | + | ## Authentication Modes | |
| 58 | + | ||
| 59 | + | Gordon infers the authentication mode from your configuration: | |
| 60 | + | ||
| 61 | + | | Config | Mode | Description | | |
| 62 | + | |--------|------|-------------| | |
| 63 | + | | Only `token_secret` | Token-only | JWT tokens for all access | | |
| 64 | + | | `token_secret` + `username` + `password_hash` | Password + Token | Password for interactive login, tokens for CI/CD | | |
| 65 | + | ||
| 66 | + | Tokens always work regardless of mode. The difference is whether password authentication is available. | |
| 54 | 67 | ||
| 55 | 68 | ## Environment Variables | |
| 56 | 69 | ||
| @@ -81,14 +94,13 @@ See [Secret Providers](./secrets.md) for detailed configuration of each backend. | |||
| 81 | 94 | ||
| 82 | 95 | ## Authentication Types | |
| 83 | 96 | ||
| 84 | - | ### Token Authentication (Recommended) | |
| 97 | + | ### Token-Only Mode | |
| 85 | 98 | ||
| 86 | - | JWT-based authentication, ideal for CI/CD pipelines: | |
| 99 | + | JWT-based authentication, ideal for CI/CD pipelines when you don't need interactive login: | |
| 87 | 100 | ||
| 88 | 101 | ```toml | |
| 89 | 102 | [auth] | |
| 90 | 103 | enabled = true | |
| 91 | - | type = "token" | |
| 92 | 104 | secrets_backend = "pass" | |
| 93 | 105 | token_secret = "gordon/auth/token_secret" | |
| 94 | 106 | token_expiry = "30d" | |
| @@ -121,19 +133,21 @@ gordon auth token revoke <token-id> | |||
| 121 | 133 | gordon auth token revoke --all | |
| 122 | 134 | ``` | |
| 123 | 135 | ||
| 124 | - | ### Password Authentication | |
| 136 | + | ### Password + Token Mode | |
| 125 | 137 | ||
| 126 | - | Simple username/password authentication: | |
| 138 | + | Password authentication for interactive login, plus tokens for CI/CD: | |
| 127 | 139 | ||
| 128 | 140 | ```toml | |
| 129 | 141 | [auth] | |
| 130 | 142 | enabled = true | |
| 131 | - | type = "password" | |
| 132 | 143 | secrets_backend = "pass" | |
| 133 | 144 | username = "deploy" | |
| 134 | 145 | password_hash = "gordon/auth/password_hash" | |
| 146 | + | token_secret = "gordon/auth/token_secret" | |
| 135 | 147 | ``` | |
| 136 | 148 | ||
| 149 | + | When `username` and `password_hash` are configured, both password and token authentication work. | |
| 150 | + | ||
| 137 | 151 | **Setup:** | |
| 138 | 152 | ```bash | |
| 139 | 153 | # Generate bcrypt hash | |
| @@ -143,13 +157,36 @@ gordon auth password hash | |||
| 143 | 157 | # Store hash in secrets backend | |
| 144 | 158 | pass insert gordon/auth/password_hash | |
| 145 | 159 | # Paste the bcrypt hash | |
| 160 | + | ||
| 161 | + | # Create token secret (for CI/CD token generation) | |
| 162 | + | pass insert gordon/auth/token_secret | |
| 163 | + | # Enter a random 32+ character string | |
| 146 | 164 | ``` | |
| 147 | 165 | ||
| 148 | 166 | **Usage:** | |
| 149 | 167 | ```bash | |
| 168 | + | # Docker registry access | |
| 150 | 169 | docker login -u deploy -p <password> registry.mydomain.com | |
| 170 | + | ||
| 171 | + | # Remote CLI authentication | |
| 172 | + | gordon auth login --remote prod | |
| 173 | + | # Enter username and password when prompted | |
| 151 | 174 | ``` | |
| 152 | 175 | ||
| 176 | + | **Remote CLI Authentication:** | |
| 177 | + | ||
| 178 | + | With password authentication enabled, you can use `gordon auth login` to obtain a token for remote CLI operations: | |
| 179 | + | ||
| 180 | + | ```bash | |
| 181 | + | gordon auth login --remote prod | |
| 182 | + | # Username: deploy | |
| 183 | + | # Password: ******** | |
| 184 | + | # ✓ Authentication successful! | |
| 185 | + | # Token stored for remote 'prod' | |
| 186 | + | ``` | |
| 187 | + | ||
| 188 | + | The returned token is stored automatically and used for subsequent CLI commands. | |
| 189 | + | ||
| 153 | 190 | ## Token Scopes | |
| 154 | 191 | ||
| 155 | 192 | Tokens can have different permission levels: | |
| @@ -232,12 +269,11 @@ enabled = false | |||
| 232 | 269 | ||
| 233 | 270 | ## Examples | |
| 234 | 271 | ||
| 235 | - | ### CI/CD Setup | |
| 272 | + | ### CI/CD Setup (Token-Only) | |
| 236 | 273 | ||
| 237 | 274 | ```toml | |
| 238 | 275 | [auth] | |
| 239 | 276 | enabled = true | |
| 240 | - | type = "token" | |
| 241 | 277 | secrets_backend = "pass" | |
| 242 | 278 | token_secret = "gordon/auth/token_secret" | |
| 243 | 279 | ``` | |
| @@ -253,15 +289,15 @@ In GitHub Actions: | |||
| 253 | 289 | run: docker login -u github-actions -p ${{ secrets.GORDON_TOKEN }} ${{ secrets.GORDON_REGISTRY }} | |
| 254 | 290 | ``` | |
| 255 | 291 | ||
| 256 | - | ### Production with Password | |
| 292 | + | ### Production with Password + Token | |
| 257 | 293 | ||
| 258 | 294 | ```toml | |
| 259 | 295 | [auth] | |
| 260 | 296 | enabled = true | |
| 261 | - | type = "password" | |
| 262 | 297 | secrets_backend = "pass" | |
| 263 | 298 | username = "deploy" | |
| 264 | 299 | password_hash = "gordon/auth/password_hash" | |
| 300 | + | token_secret = "gordon/auth/token_secret" | |
| 265 | 301 | ``` | |
| 266 | 302 | ||
| 267 | 303 | ### Enterprise with SOPS | |
| @@ -269,7 +305,6 @@ password_hash = "gordon/auth/password_hash" | |||
| 269 | 305 | ```toml | |
| 270 | 306 | [auth] | |
| 271 | 307 | enabled = true | |
| 272 | - | type = "token" | |
| 273 | 308 | secrets_backend = "sops" | |
| 274 | 309 | token_secret = "gordon/auth/token_secret" | |
| 275 | 310 | ``` | |
| @@ -34,10 +34,13 @@ enabled = false | |||||
| 34 | ```toml | 34 | ```toml | ||
| 35 | [auth] | 35 | [auth] | ||
| 36 | enabled = true | 36 | enabled = true | ||
| 37 | - | type = "token" | |||
| 38 | secrets_backend = "pass" | 37 | secrets_backend = "pass" | ||
| 39 | token_secret = "gordon/auth/token_secret" | 38 | token_secret = "gordon/auth/token_secret" | ||
| 40 | token_expiry = "30d" | 39 | token_expiry = "30d" | ||
| 40 | + | ||||
| 41 | + | # Optional: enable password authentication | |||
| 42 | + | username = "deploy" | |||
| 43 | + | password_hash = "gordon/auth/password_hash" | |||
| 41 | ``` | 44 | ``` | ||
| 42 | 45 | ||||
| 43 | ## Options | 46 | ## Options | ||
| @@ -45,12 +48,22 @@ token_expiry = "30d" | |||||
| 45 | | Option | Type | Default | Description | | 48 | | Option | Type | Default | Description | | ||
| 46 | |--------|------|---------|-------------| | 49 | |--------|------|---------|-------------| | ||
| 47 | | `enabled` | bool | `true` | Enable authentication | | 50 | | `enabled` | bool | `true` | Enable authentication | | ||
| 48 | - | | `type` | string | `"password"` | Auth type: `"password"` or `"token"` | | |||
| 49 | | `secrets_backend` | string | `"unsafe"` | Secrets backend: `"pass"`, `"sops"`, or `"unsafe"` | | 51 | | `secrets_backend` | string | `"unsafe"` | Secrets backend: `"pass"`, `"sops"`, or `"unsafe"` | | ||
| 50 | - | | `username` | string | - | Username for password auth | | 52 | + | | `token_secret` | string | - | **Required.** Path to JWT signing secret in secrets backend | |
| 51 | - | | `password_hash` | string | - | Path to bcrypt hash in secrets backend | | |||
| 52 | - | | `token_secret` | string | - | Path to JWT signing secret in secrets backend | | |||
| 53 | | `token_expiry` | string | `"30d"` | Token validity duration (0 = never expires) | | 53 | | `token_expiry` | string | `"30d"` | Token validity duration (0 = never expires) | | ||
| 54 | + | | `username` | string | - | Username for password auth (optional) | | |||
| 55 | + | | `password_hash` | string | - | Path to bcrypt hash in secrets backend (optional) | | |||
| 56 | + | ||||
| 57 | + | ## Authentication Modes | |||
| 58 | + | ||||
| 59 | + | Gordon infers the authentication mode from your configuration: | |||
| 60 | + | ||||
| 61 | + | | Config | Mode | Description | | |||
| 62 | + | |--------|------|-------------| | |||
| 63 | + | | Only `token_secret` | Token-only | JWT tokens for all access | | |||
| 64 | + | | `token_secret` + `username` + `password_hash` | Password + Token | Password for interactive login, tokens for CI/CD | | |||
| 65 | + | ||||
| 66 | + | Tokens always work regardless of mode. The difference is whether password authentication is available. | |||
| 54 | 67 | ||||
| 55 | ## Environment Variables | 68 | ## Environment Variables | ||
| 56 | 69 | ||||
| @@ -81,14 +94,13 @@ See [Secret Providers](./secrets.md) for detailed configuration of each backend. | |||||
| 81 | 94 | ||||
| 82 | ## Authentication Types | 95 | ## Authentication Types | ||
| 83 | 96 | ||||
| 84 | - | ### Token Authentication (Recommended) | 97 | + | ### Token-Only Mode |
| 85 | 98 | ||||
| 86 | - | JWT-based authentication, ideal for CI/CD pipelines: | 99 | + | JWT-based authentication, ideal for CI/CD pipelines when you don't need interactive login: |
| 87 | 100 | ||||
| 88 | ```toml | 101 | ```toml | ||
| 89 | [auth] | 102 | [auth] | ||
| 90 | enabled = true | 103 | enabled = true | ||
| 91 | - | type = "token" | |||
| 92 | secrets_backend = "pass" | 104 | secrets_backend = "pass" | ||
| 93 | token_secret = "gordon/auth/token_secret" | 105 | token_secret = "gordon/auth/token_secret" | ||
| 94 | token_expiry = "30d" | 106 | token_expiry = "30d" | ||
| @@ -121,19 +133,21 @@ gordon auth token revoke <token-id> | |||||
| 121 | gordon auth token revoke --all | 133 | gordon auth token revoke --all | ||
| 122 | ``` | 134 | ``` | ||
| 123 | 135 | ||||
| 124 | - | ### Password Authentication | 136 | + | ### Password + Token Mode |
| 125 | 137 | ||||
| 126 | - | Simple username/password authentication: | 138 | + | Password authentication for interactive login, plus tokens for CI/CD: |
| 127 | 139 | ||||
| 128 | ```toml | 140 | ```toml | ||
| 129 | [auth] | 141 | [auth] | ||
| 130 | enabled = true | 142 | enabled = true | ||
| 131 | - | type = "password" | |||
| 132 | secrets_backend = "pass" | 143 | secrets_backend = "pass" | ||
| 133 | username = "deploy" | 144 | username = "deploy" | ||
| 134 | password_hash = "gordon/auth/password_hash" | 145 | password_hash = "gordon/auth/password_hash" | ||
| 146 | + | token_secret = "gordon/auth/token_secret" | |||
| 135 | ``` | 147 | ``` | ||
| 136 | 148 | ||||
| 149 | + | When `username` and `password_hash` are configured, both password and token authentication work. | |||
| 150 | + | ||||
| 137 | **Setup:** | 151 | **Setup:** | ||
| 138 | ```bash | 152 | ```bash | ||
| 139 | # Generate bcrypt hash | 153 | # Generate bcrypt hash | ||
| @@ -143,13 +157,36 @@ gordon auth password hash | |||||
| 143 | # Store hash in secrets backend | 157 | # Store hash in secrets backend | ||
| 144 | pass insert gordon/auth/password_hash | 158 | pass insert gordon/auth/password_hash | ||
| 145 | # Paste the bcrypt hash | 159 | # Paste the bcrypt hash | ||
| 160 | + | ||||
| 161 | + | # Create token secret (for CI/CD token generation) | |||
| 162 | + | pass insert gordon/auth/token_secret | |||
| 163 | + | # Enter a random 32+ character string | |||
| 146 | ``` | 164 | ``` | ||
| 147 | 165 | ||||
| 148 | **Usage:** | 166 | **Usage:** | ||
| 149 | ```bash | 167 | ```bash | ||
| 168 | + | # Docker registry access | |||
| 150 | docker login -u deploy -p <password> registry.mydomain.com | 169 | docker login -u deploy -p <password> registry.mydomain.com | ||
| 170 | + | ||||
| 171 | + | # Remote CLI authentication | |||
| 172 | + | gordon auth login --remote prod | |||
| 173 | + | # Enter username and password when prompted | |||
| 151 | ``` | 174 | ``` | ||
| 152 | 175 | ||||
| 176 | + | **Remote CLI Authentication:** | |||
| 177 | + | ||||
| 178 | + | With password authentication enabled, you can use `gordon auth login` to obtain a token for remote CLI operations: | |||
| 179 | + | ||||
| 180 | + | ```bash | |||
| 181 | + | gordon auth login --remote prod | |||
| 182 | + | # Username: deploy | |||
| 183 | + | # Password: ******** | |||
| 184 | + | # ✓ Authentication successful! | |||
| 185 | + | # Token stored for remote 'prod' | |||
| 186 | + | ``` | |||
| 187 | + | ||||
| 188 | + | The returned token is stored automatically and used for subsequent CLI commands. | |||
| 189 | + | ||||
| 153 | ## Token Scopes | 190 | ## Token Scopes | ||
| 154 | 191 | ||||
| 155 | Tokens can have different permission levels: | 192 | Tokens can have different permission levels: | ||
| @@ -232,12 +269,11 @@ enabled = false | |||||
| 232 | 269 | ||||
| 233 | ## Examples | 270 | ## Examples | ||
| 234 | 271 | ||||
| 235 | - | ### CI/CD Setup | 272 | + | ### CI/CD Setup (Token-Only) |
| 236 | 273 | ||||
| 237 | ```toml | 274 | ```toml | ||
| 238 | [auth] | 275 | [auth] | ||
| 239 | enabled = true | 276 | enabled = true | ||
| 240 | - | type = "token" | |||
| 241 | secrets_backend = "pass" | 277 | secrets_backend = "pass" | ||
| 242 | token_secret = "gordon/auth/token_secret" | 278 | token_secret = "gordon/auth/token_secret" | ||
| 243 | ``` | 279 | ``` | ||
| @@ -253,15 +289,15 @@ In GitHub Actions: | |||||
| 253 | run: docker login -u github-actions -p ${{ secrets.GORDON_TOKEN }} ${{ secrets.GORDON_REGISTRY }} | 289 | run: docker login -u github-actions -p ${{ secrets.GORDON_TOKEN }} ${{ secrets.GORDON_REGISTRY }} | ||
| 254 | ``` | 290 | ``` | ||
| 255 | 291 | ||||
| 256 | - | ### Production with Password | 292 | + | ### Production with Password + Token |
| 257 | 293 | ||||
| 258 | ```toml | 294 | ```toml | ||
| 259 | [auth] | 295 | [auth] | ||
| 260 | enabled = true | 296 | enabled = true | ||
| 261 | - | type = "password" | |||
| 262 | secrets_backend = "pass" | 297 | secrets_backend = "pass" | ||
| 263 | username = "deploy" | 298 | username = "deploy" | ||
| 264 | password_hash = "gordon/auth/password_hash" | 299 | password_hash = "gordon/auth/password_hash" | ||
| 300 | + | token_secret = "gordon/auth/token_secret" | |||
| 265 | ``` | 301 | ``` | ||
| 266 | 302 | ||||
| 267 | ### Enterprise with SOPS | 303 | ### Enterprise with SOPS | ||
| @@ -269,7 +305,6 @@ password_hash = "gordon/auth/password_hash" | |||||
| 269 | ```toml | 305 | ```toml | ||
| 270 | [auth] | 306 | [auth] | ||
| 271 | enabled = true | 307 | enabled = true | ||
| 272 | - | type = "token" | |||
| 273 | secrets_backend = "sops" | 308 | secrets_backend = "sops" | ||
| 274 | token_secret = "gordon/auth/token_secret" | 309 | token_secret = "gordon/auth/token_secret" | ||
| 275 | ``` | 310 | ``` | ||
M docs/config/index.md +3 -6
| @@ -38,14 +38,12 @@ gordon_domain = "gordon.mydomain.com" # Required: Gordon domain (registry + A | |||
| 38 | 38 | # Authentication (includes secrets backend) | |
| 39 | 39 | [auth] | |
| 40 | 40 | enabled = true # Enable registry authentication (default: true) | |
| 41 | - | type = "token" # "password" or "token" | |
| 42 | 41 | secrets_backend = "pass" # "pass", "sops", or "unsafe" | |
| 43 | - | # Password auth: | |
| 42 | + | token_secret = "gordon/auth/token_secret" # Required: JWT signing secret | |
| 43 | + | token_expiry = "30d" # Duration (1y, 30d, 2w) or 0 for never | |
| 44 | + | # Optional: enable password authentication (for interactive login) | |
| 44 | 45 | # username = "deploy" | |
| 45 | 46 | # password_hash = "gordon/auth/password_hash" | |
| 46 | - | # Token auth: | |
| 47 | - | token_secret = "gordon/auth/token_secret" | |
| 48 | - | token_expiry = "30d" # Duration (1y, 30d, 2w) or 0 for never | |
| 49 | 47 | ||
| 50 | 48 | # API rate limiting | |
| 51 | 49 | [api.rate_limit] | |
| @@ -139,7 +137,6 @@ enabled = false # Auto-create routes from image names | |||
| 139 | 137 | | `server.registry_port` | `5000` | | |
| 140 | 138 | | `server.data_dir` | `~/.gordon` | | |
| 141 | 139 | | `auth.enabled` | `true` | | |
| 142 | - | | `auth.type` | `"password"` | | |
| 143 | 140 | | `auth.secrets_backend` | `"unsafe"` | | |
| 144 | 141 | | `auth.token_expiry` | `"30d"` | | |
| 145 | 142 | | `api.rate_limit.enabled` | `true` | | |
| @@ -38,14 +38,12 @@ gordon_domain = "gordon.mydomain.com" # Required: Gordon domain (registry + A | |||||
| 38 | # Authentication (includes secrets backend) | 38 | # Authentication (includes secrets backend) | ||
| 39 | [auth] | 39 | [auth] | ||
| 40 | enabled = true # Enable registry authentication (default: true) | 40 | enabled = true # Enable registry authentication (default: true) | ||
| 41 | - | type = "token" # "password" or "token" | |||
| 42 | secrets_backend = "pass" # "pass", "sops", or "unsafe" | 41 | secrets_backend = "pass" # "pass", "sops", or "unsafe" | ||
| 43 | - | # Password auth: | 42 | + | token_secret = "gordon/auth/token_secret" # Required: JWT signing secret |
| 43 | + | token_expiry = "30d" # Duration (1y, 30d, 2w) or 0 for never | |||
| 44 | + | # Optional: enable password authentication (for interactive login) | |||
| 44 | # username = "deploy" | 45 | # username = "deploy" | ||
| 45 | # password_hash = "gordon/auth/password_hash" | 46 | # password_hash = "gordon/auth/password_hash" | ||
| 46 | - | # Token auth: | |||
| 47 | - | token_secret = "gordon/auth/token_secret" | |||
| 48 | - | token_expiry = "30d" # Duration (1y, 30d, 2w) or 0 for never | |||
| 49 | 47 | ||||
| 50 | # API rate limiting | 48 | # API rate limiting | ||
| 51 | [api.rate_limit] | 49 | [api.rate_limit] | ||
| @@ -139,7 +137,6 @@ enabled = false # Auto-create routes from image names | |||||
| 139 | | `server.registry_port` | `5000` | | 137 | | `server.registry_port` | `5000` | | ||
| 140 | | `server.data_dir` | `~/.gordon` | | 138 | | `server.data_dir` | `~/.gordon` | | ||
| 141 | | `auth.enabled` | `true` | | 139 | | `auth.enabled` | `true` | | ||
| 142 | - | | `auth.type` | `"password"` | | |||
| 143 | | `auth.secrets_backend` | `"unsafe"` | | 140 | | `auth.secrets_backend` | `"unsafe"` | | ||
| 144 | | `auth.token_expiry` | `"30d"` | | 141 | | `auth.token_expiry` | `"30d"` | | ||
| 145 | | `api.rate_limit.enabled` | `true` | | 142 | | `api.rate_limit.enabled` | `true` | | ||
M docs/config/reference.md +4 -13
| @@ -19,12 +19,12 @@ data_dir = "~/.gordon" # Data directory (varies by install | |||
| 19 | 19 | # ============================================================================= | |
| 20 | 20 | [auth] | |
| 21 | 21 | enabled = true # Enable registry authentication (default: true) | |
| 22 | - | type = "password" # "password" or "token" | |
| 23 | 22 | secrets_backend = "unsafe" # "pass", "sops", or "unsafe" | |
| 24 | - | username = "" # Username for password auth | |
| 25 | - | password_hash = "" # Path in secrets backend to bcrypt hash (REQUIRED for password type) | |
| 26 | - | token_secret = "" # Path in secrets backend to JWT signing key (REQUIRED for token type) | |
| 23 | + | token_secret = "" # Path in secrets backend to JWT signing key (REQUIRED) | |
| 27 | 24 | token_expiry = "720h" # Token expiry duration (720h = 30 days) | |
| 25 | + | # Optional: enable password authentication (for interactive login) | |
| 26 | + | # username = "" # Username for password auth | |
| 27 | + | # password_hash = "" # Path in secrets backend to bcrypt hash | |
| 28 | 28 | ||
| 29 | 29 | # ============================================================================= | |
| 30 | 30 | # API (applies to both Registry and Admin endpoints) | |
| @@ -126,7 +126,6 @@ preserve = true # Keep volumes when containers are | |||
| 126 | 126 | | `server.gordon_domain` | `""` | **Required** - Gordon domain | | |
| 127 | 127 | | `server.data_dir` | `~/.gordon` | Data directory | | |
| 128 | 128 | | `auth.enabled` | `true` | Enable authentication | | |
| 129 | - | | `auth.type` | `"password"` | Auth type | | |
| 130 | 129 | | `auth.secrets_backend` | `"unsafe"` | Secrets storage | | |
| 131 | 130 | | `auth.token_expiry` | `"720h"` | 30 days | | |
| 132 | 131 | | `api.rate_limit.enabled` | `true` | Enable rate limiting | | |
| @@ -166,7 +165,6 @@ Examples: | |||
| 166 | 165 | GORDON_SERVER_PORT=8080 | |
| 167 | 166 | GORDON_SERVER_GORDON_DOMAIN=gordon.example.com | |
| 168 | 167 | GORDON_AUTH_ENABLED=true | |
| 169 | - | GORDON_AUTH_TYPE=token | |
| 170 | 168 | GORDON_LOGGING_LEVEL=debug | |
| 171 | 169 | GORDON_NETWORK_ISOLATION_ENABLED=true | |
| 172 | 170 | ``` | |
| @@ -200,13 +198,6 @@ gordon serve | |||
| 200 | 198 | | `"if-tag-changed"` | Pull only if image tag differs from running container | | |
| 201 | 199 | | `"never"` | Never pull, use local image only | | |
| 202 | 200 | ||
| 203 | - | ## Auth Type Options | |
| 204 | - | ||
| 205 | - | | Value | Description | | |
| 206 | - | |-------|-------------| | |
| 207 | - | | `"password"` | HTTP Basic authentication with username/password | | |
| 208 | - | | `"token"` | JWT token authentication | | |
| 209 | - | ||
| 210 | 201 | ## Secrets Backend Options | |
| 211 | 202 | ||
| 212 | 203 | | Value | Description | | |
| @@ -19,12 +19,12 @@ data_dir = "~/.gordon" # Data directory (varies by install | |||||
| 19 | # ============================================================================= | 19 | # ============================================================================= | ||
| 20 | [auth] | 20 | [auth] | ||
| 21 | enabled = true # Enable registry authentication (default: true) | 21 | enabled = true # Enable registry authentication (default: true) | ||
| 22 | - | type = "password" # "password" or "token" | |||
| 23 | secrets_backend = "unsafe" # "pass", "sops", or "unsafe" | 22 | secrets_backend = "unsafe" # "pass", "sops", or "unsafe" | ||
| 24 | - | username = "" # Username for password auth | 23 | + | token_secret = "" # Path in secrets backend to JWT signing key (REQUIRED) |
| 25 | - | password_hash = "" # Path in secrets backend to bcrypt hash (REQUIRED for password type) | |||
| 26 | - | token_secret = "" # Path in secrets backend to JWT signing key (REQUIRED for token type) | |||
| 27 | token_expiry = "720h" # Token expiry duration (720h = 30 days) | 24 | token_expiry = "720h" # Token expiry duration (720h = 30 days) | ||
| 25 | + | # Optional: enable password authentication (for interactive login) | |||
| 26 | + | # username = "" # Username for password auth | |||
| 27 | + | # password_hash = "" # Path in secrets backend to bcrypt hash | |||
| 28 | 28 | ||||
| 29 | # ============================================================================= | 29 | # ============================================================================= | ||
| 30 | # API (applies to both Registry and Admin endpoints) | 30 | # API (applies to both Registry and Admin endpoints) | ||
| @@ -126,7 +126,6 @@ preserve = true # Keep volumes when containers are | |||||
| 126 | | `server.gordon_domain` | `""` | **Required** - Gordon domain | | 126 | | `server.gordon_domain` | `""` | **Required** - Gordon domain | | ||
| 127 | | `server.data_dir` | `~/.gordon` | Data directory | | 127 | | `server.data_dir` | `~/.gordon` | Data directory | | ||
| 128 | | `auth.enabled` | `true` | Enable authentication | | 128 | | `auth.enabled` | `true` | Enable authentication | | ||
| 129 | - | | `auth.type` | `"password"` | Auth type | | |||
| 130 | | `auth.secrets_backend` | `"unsafe"` | Secrets storage | | 129 | | `auth.secrets_backend` | `"unsafe"` | Secrets storage | | ||
| 131 | | `auth.token_expiry` | `"720h"` | 30 days | | 130 | | `auth.token_expiry` | `"720h"` | 30 days | | ||
| 132 | | `api.rate_limit.enabled` | `true` | Enable rate limiting | | 131 | | `api.rate_limit.enabled` | `true` | Enable rate limiting | | ||
| @@ -166,7 +165,6 @@ Examples: | |||||
| 166 | GORDON_SERVER_PORT=8080 | 165 | GORDON_SERVER_PORT=8080 | ||
| 167 | GORDON_SERVER_GORDON_DOMAIN=gordon.example.com | 166 | GORDON_SERVER_GORDON_DOMAIN=gordon.example.com | ||
| 168 | GORDON_AUTH_ENABLED=true | 167 | GORDON_AUTH_ENABLED=true | ||
| 169 | - | GORDON_AUTH_TYPE=token | |||
| 170 | GORDON_LOGGING_LEVEL=debug | 168 | GORDON_LOGGING_LEVEL=debug | ||
| 171 | GORDON_NETWORK_ISOLATION_ENABLED=true | 169 | GORDON_NETWORK_ISOLATION_ENABLED=true | ||
| 172 | ``` | 170 | ``` | ||
| @@ -200,13 +198,6 @@ gordon serve | |||||
| 200 | | `"if-tag-changed"` | Pull only if image tag differs from running container | | 198 | | `"if-tag-changed"` | Pull only if image tag differs from running container | | ||
| 201 | | `"never"` | Never pull, use local image only | | 199 | | `"never"` | Never pull, use local image only | | ||
| 202 | 200 | ||||
| 203 | - | ## Auth Type Options | |||
| 204 | - | ||||
| 205 | - | | Value | Description | | |||
| 206 | - | |-------|-------------| | |||
| 207 | - | | `"password"` | HTTP Basic authentication with username/password | | |||
| 208 | - | | `"token"` | JWT token authentication | | |||
| 209 | - | ||||
| 210 | ## Secrets Backend Options | 201 | ## Secrets Backend Options | ||
| 211 | 202 | ||||
| 212 | | Value | Description | | 203 | | Value | Description | | ||
M docs/config/secrets.md +0 -2
| @@ -139,7 +139,6 @@ API_SECRET=${sops:production.yaml:api.secret.key} | |||
| 139 | 139 | ```toml | |
| 140 | 140 | [auth] | |
| 141 | 141 | enabled = true | |
| 142 | - | type = "token" | |
| 143 | 142 | secrets_backend = "pass" | |
| 144 | 143 | token_secret = "gordon/auth/token_secret" | |
| 145 | 144 | ``` | |
| @@ -166,7 +165,6 @@ secrets_backend = "unsafe" | |||
| 166 | 165 | ```toml | |
| 167 | 166 | [auth] | |
| 168 | 167 | enabled = true | |
| 169 | - | type = "token" | |
| 170 | 168 | secrets_backend = "sops" | |
| 171 | 169 | token_secret = "gordon/auth/token_secret" | |
| 172 | 170 | ``` | |
| @@ -139,7 +139,6 @@ API_SECRET=${sops:production.yaml:api.secret.key} | |||||
| 139 | ```toml | 139 | ```toml | ||
| 140 | [auth] | 140 | [auth] | ||
| 141 | enabled = true | 141 | enabled = true | ||
| 142 | - | type = "token" | |||
| 143 | secrets_backend = "pass" | 142 | secrets_backend = "pass" | ||
| 144 | token_secret = "gordon/auth/token_secret" | 143 | token_secret = "gordon/auth/token_secret" | ||
| 145 | ``` | 144 | ``` | ||
| @@ -166,7 +165,6 @@ secrets_backend = "unsafe" | |||||
| 166 | ```toml | 165 | ```toml | ||
| 167 | [auth] | 166 | [auth] | ||
| 168 | enabled = true | 167 | enabled = true | ||
| 169 | - | type = "token" | |||
| 170 | secrets_backend = "sops" | 168 | secrets_backend = "sops" | ||
| 171 | token_secret = "gordon/auth/token_secret" | 169 | token_secret = "gordon/auth/token_secret" | ||
| 172 | ``` | 170 | ``` | ||
M wiki/examples/index.md +0 -1
| @@ -46,7 +46,6 @@ gordon_domain = "gordon.company.com" | |||
| 46 | 46 | ||
| 47 | 47 | [auth] | |
| 48 | 48 | enabled = true | |
| 49 | - | type = "token" | |
| 50 | 49 | secrets_backend = "pass" | |
| 51 | 50 | token_secret = "gordon/auth/token_secret" | |
| 52 | 51 | ||
| @@ -46,7 +46,6 @@ gordon_domain = "gordon.company.com" | |||||
| 46 | 46 | ||||
| 47 | [auth] | 47 | [auth] | ||
| 48 | enabled = true | 48 | enabled = true | ||
| 49 | - | type = "token" | |||
| 50 | secrets_backend = "pass" | 49 | secrets_backend = "pass" | ||
| 51 | token_secret = "gordon/auth/token_secret" | 50 | token_secret = "gordon/auth/token_secret" | ||
| 52 | 51 | ||||
M wiki/examples/production.md +0 -1
| @@ -22,7 +22,6 @@ gordon_domain = "gordon.company.com" | |||
| 22 | 22 | # Authentication with pass backend (recommended) | |
| 23 | 23 | [auth] | |
| 24 | 24 | enabled = true | |
| 25 | - | type = "token" | |
| 26 | 25 | secrets_backend = "pass" | |
| 27 | 26 | token_secret = "gordon/auth/token_secret" | |
| 28 | 27 | ||
| @@ -22,7 +22,6 @@ gordon_domain = "gordon.company.com" | |||||
| 22 | # Authentication with pass backend (recommended) | 22 | # Authentication with pass backend (recommended) | ||
| 23 | [auth] | 23 | [auth] | ||
| 24 | enabled = true | 24 | enabled = true | ||
| 25 | - | type = "token" | |||
| 26 | secrets_backend = "pass" | 25 | secrets_backend = "pass" | ||
| 27 | token_secret = "gordon/auth/token_secret" | 26 | token_secret = "gordon/auth/token_secret" | ||
| 28 | 27 | ||||
M wiki/guides/remote-cli.md +31 -0
| @@ -151,6 +151,37 @@ gordon remotes add prod https://gordon.mydomain.com --token-env PROD_TOKEN | |||
| 151 | 151 | | `--token <TOKEN>` | Store token directly in config | | |
| 152 | 152 | | `--token-env <VAR>` | Store env variable name (token resolved at runtime) | | |
| 153 | 153 | ||
| 154 | + | #### Authenticate with Password Auth | |
| 155 | + | ||
| 156 | + | For servers using password authentication, you can log in interactively: | |
| 157 | + | ||
| 158 | + | ```bash | |
| 159 | + | # Login to active remote | |
| 160 | + | gordon auth login | |
| 161 | + | ||
| 162 | + | # Login to specific remote | |
| 163 | + | gordon auth login --remote prod | |
| 164 | + | ||
| 165 | + | # Pre-fill username | |
| 166 | + | gordon auth login --username admin | |
| 167 | + | ``` | |
| 168 | + | ||
| 169 | + | This prompts for your username and password, authenticates with the remote server, and stores the returned token automatically. | |
| 170 | + | ||
| 171 | + | > **Note:** Only works with servers that have password authentication enabled (`username` + `password_hash` configured). For token-only servers, use `gordon remotes set-token` instead. | |
| 172 | + | ||
| 173 | + | #### Set Token Manually | |
| 174 | + | ||
| 175 | + | For servers using token-based auth, or to update a token manually: | |
| 176 | + | ||
| 177 | + | ```bash | |
| 178 | + | # Set token directly | |
| 179 | + | gordon remotes set-token prod eyJhbGciOiJIUzI1NiIs... | |
| 180 | + | ||
| 181 | + | # Set token from file | |
| 182 | + | gordon remotes set-token staging $(cat token.txt) | |
| 183 | + | ``` | |
| 184 | + | ||
| 154 | 185 | #### Remove a Remote | |
| 155 | 186 | ||
| 156 | 187 | ```bash | |
| @@ -151,6 +151,37 @@ gordon remotes add prod https://gordon.mydomain.com --token-env PROD_TOKEN | |||||
| 151 | | `--token <TOKEN>` | Store token directly in config | | 151 | | `--token <TOKEN>` | Store token directly in config | | ||
| 152 | | `--token-env <VAR>` | Store env variable name (token resolved at runtime) | | 152 | | `--token-env <VAR>` | Store env variable name (token resolved at runtime) | | ||
| 153 | 153 | ||||
| 154 | + | #### Authenticate with Password Auth | |||
| 155 | + | ||||
| 156 | + | For servers using password authentication, you can log in interactively: | |||
| 157 | + | ||||
| 158 | + | ```bash | |||
| 159 | + | # Login to active remote | |||
| 160 | + | gordon auth login | |||
| 161 | + | ||||
| 162 | + | # Login to specific remote | |||
| 163 | + | gordon auth login --remote prod | |||
| 164 | + | ||||
| 165 | + | # Pre-fill username | |||
| 166 | + | gordon auth login --username admin | |||
| 167 | + | ``` | |||
| 168 | + | ||||
| 169 | + | This prompts for your username and password, authenticates with the remote server, and stores the returned token automatically. | |||
| 170 | + | ||||
| 171 | + | > **Note:** Only works with servers that have password authentication enabled (`username` + `password_hash` configured). For token-only servers, use `gordon remotes set-token` instead. | |||
| 172 | + | ||||
| 173 | + | #### Set Token Manually | |||
| 174 | + | ||||
| 175 | + | For servers using token-based auth, or to update a token manually: | |||
| 176 | + | ||||
| 177 | + | ```bash | |||
| 178 | + | # Set token directly | |||
| 179 | + | gordon remotes set-token prod eyJhbGciOiJIUzI1NiIs... | |||
| 180 | + | ||||
| 181 | + | # Set token from file | |||
| 182 | + | gordon remotes set-token staging $(cat token.txt) | |||
| 183 | + | ``` | |||
| 184 | + | ||||
| 154 | #### Remove a Remote | 185 | #### Remove a Remote | ||
| 155 | 186 | ||||
| 156 | ```bash | 187 | ```bash | ||
M wiki/guides/running-in-container.md +3 -3
| @@ -309,11 +309,11 @@ volumes: | |||
| 309 | 309 | ```toml | |
| 310 | 310 | [auth] | |
| 311 | 311 | enabled = true | |
| 312 | - | type = "token" | |
| 313 | 312 | secrets_backend = "pass" | |
| 314 | - | username = "admin" | |
| 315 | - | password_hash = "gordon/auth/password_hash" | |
| 316 | 313 | token_secret = "gordon/auth/token_secret" | |
| 314 | + | # Optional: enable password auth for interactive login | |
| 315 | + | # username = "admin" | |
| 316 | + | # password_hash = "gordon/auth/password_hash" | |
| 317 | 317 | ``` | |
| 318 | 318 | ||
| 319 | 319 | ### GPG Agent (Optional) | |
| @@ -309,11 +309,11 @@ volumes: | |||||
| 309 | ```toml | 309 | ```toml | ||
| 310 | [auth] | 310 | [auth] | ||
| 311 | enabled = true | 311 | enabled = true | ||
| 312 | - | type = "token" | |||
| 313 | secrets_backend = "pass" | 312 | secrets_backend = "pass" | ||
| 314 | - | username = "admin" | |||
| 315 | - | password_hash = "gordon/auth/password_hash" | |||
| 316 | token_secret = "gordon/auth/token_secret" | 313 | token_secret = "gordon/auth/token_secret" | ||
| 314 | + | # Optional: enable password auth for interactive login | |||
| 315 | + | # username = "admin" | |||
| 316 | + | # password_hash = "gordon/auth/password_hash" | |||
| 317 | ``` | 317 | ``` | ||
| 318 | 318 | ||||
| 319 | ### GPG Agent (Optional) | 319 | ### GPG Agent (Optional) | ||
M wiki/guides/secrets-pass.md +3 -3
| @@ -99,11 +99,11 @@ pass generate gordon/auth/token_secret 32 | |||
| 99 | 99 | ```toml | |
| 100 | 100 | [auth] | |
| 101 | 101 | enabled = true | |
| 102 | - | type = "token" | |
| 103 | 102 | secrets_backend = "pass" | |
| 104 | - | username = "admin" | |
| 105 | - | password_hash = "gordon/auth/password_hash" | |
| 106 | 103 | token_secret = "gordon/auth/token_secret" | |
| 104 | + | # Optional: enable password auth for interactive login | |
| 105 | + | # username = "admin" | |
| 106 | + | # password_hash = "gordon/auth/password_hash" | |
| 107 | 107 | ``` | |
| 108 | 108 | ||
| 109 | 109 | ### Using Secrets in Environment Files | |
| @@ -99,11 +99,11 @@ pass generate gordon/auth/token_secret 32 | |||||
| 99 | ```toml | 99 | ```toml | ||
| 100 | [auth] | 100 | [auth] | ||
| 101 | enabled = true | 101 | enabled = true | ||
| 102 | - | type = "token" | |||
| 103 | secrets_backend = "pass" | 102 | secrets_backend = "pass" | ||
| 104 | - | username = "admin" | |||
| 105 | - | password_hash = "gordon/auth/password_hash" | |||
| 106 | token_secret = "gordon/auth/token_secret" | 103 | token_secret = "gordon/auth/token_secret" | ||
| 104 | + | # Optional: enable password auth for interactive login | |||
| 105 | + | # username = "admin" | |||
| 106 | + | # password_hash = "gordon/auth/password_hash" | |||
| 107 | ``` | 107 | ``` | ||
| 108 | 108 | ||||
| 109 | ### Using Secrets in Environment Files | 109 | ### Using Secrets in Environment Files | ||
M wiki/guides/secrets-sops.md +3 -3
| @@ -197,11 +197,11 @@ sops edit secrets.yaml | |||
| 197 | 197 | ```toml | |
| 198 | 198 | [auth] | |
| 199 | 199 | enabled = true | |
| 200 | - | type = "token" | |
| 201 | 200 | secrets_backend = "sops" | |
| 202 | - | username = "admin" | |
| 203 | - | password_hash = "secrets.yaml:auth.password_hash" | |
| 204 | 201 | token_secret = "secrets.yaml:auth.token_secret" | |
| 202 | + | # Optional: enable password auth for interactive login | |
| 203 | + | # username = "admin" | |
| 204 | + | # password_hash = "secrets.yaml:auth.password_hash" | |
| 205 | 205 | ``` | |
| 206 | 206 | ||
| 207 | 207 | The path format is `file:key.path` where: | |
| @@ -197,11 +197,11 @@ sops edit secrets.yaml | |||||
| 197 | ```toml | 197 | ```toml | ||
| 198 | [auth] | 198 | [auth] | ||
| 199 | enabled = true | 199 | enabled = true | ||
| 200 | - | type = "token" | |||
| 201 | secrets_backend = "sops" | 200 | secrets_backend = "sops" | ||
| 202 | - | username = "admin" | |||
| 203 | - | password_hash = "secrets.yaml:auth.password_hash" | |||
| 204 | token_secret = "secrets.yaml:auth.token_secret" | 201 | token_secret = "secrets.yaml:auth.token_secret" | ||
| 202 | + | # Optional: enable password auth for interactive login | |||
| 203 | + | # username = "admin" | |||
| 204 | + | # password_hash = "secrets.yaml:auth.password_hash" | |||
| 205 | ``` | 205 | ``` | ||
| 206 | 206 | ||||
| 207 | The path format is `file:key.path` where: | 207 | The path format is `file:key.path` where: | ||