doc: fix config validation formatting (#3386)

Signed-off-by: Jan Larwig <jan@larwig.com>
This commit is contained in:
Jan Larwig 2026-03-23 16:05:54 +01:00 committed by GitHub
parent 7bc4b5e5df
commit da9123f740
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 74 additions and 74 deletions

View File

@ -72,43 +72,6 @@ An example [oauth2-proxy.cfg](https://github.com/oauth2-proxy/oauth2-proxy/blob/
| `--config-test` | test configuration and exit (for CI/CD validation) |
| `--version` | print version string |
## Configuration Validation
The `--config-test` flag validates your configuration file without starting the proxy server. This is useful for:
- **CI/CD pipelines**: Pre-deployment validation
- **Configuration management**: Testing before applying changes
- **Debugging**: Verifying syntax and required fields
### Usage
```bash
# Test legacy config
oauth2-proxy --config /etc/oauth2-proxy.cfg --config-test
# Test alpha config
oauth2-proxy --config /etc/core.cfg --alpha-config /etc/alpha.yaml --config-test
# CI/CD pre-deployment check
# Returns with exit code 1 if any validation errors occur
oauth2-proxy --config new-config.cfg --config-test
```
### Exit Codes
- **0**: Configuration is valid ✅
- **1**: Configuration is invalid (errors printed to stderr) ❌
### Validation Coverage
The `--config-test` flag performs the **same comprehensive validation** as normal startup, including:
- Required fields (client ID, client secret, cookie secret, etc.)
- Syntax validation (TOML/YAML parsing)
- Provider configuration
- Upstream server definitions
- Session store connectivity (e.g., Redis network checks if configured)
**Note**: Cannot be combined with `--convert-config-to-alpha`.
### General Provider Options
Provider specific options can be found on their respective subpages.
@ -305,6 +268,43 @@ Provider specific options can be found on their respective subpages.
| flag: `--upstream-timeout`<br/>toml: `upstream_timeout` | duration | maximum amount of time the server will wait for a response from the upstream | 30s |
| flag: `--upstream`<br/>toml: `upstreams` | string \| list | the http url(s) of the upstream endpoint, file:// paths for static files or `static://<status_code>` for static response. Routing is based on the path | |
## Configuration Validation
The `--config-test` flag validates your configuration file without starting the proxy server. This is useful for:
- **CI/CD pipelines**: Pre-deployment validation
- **Configuration management**: Testing before applying changes
- **Debugging**: Verifying syntax and required fields
### Usage
```bash
# Test legacy config
oauth2-proxy --config /etc/oauth2-proxy.cfg --config-test
# Test alpha config
oauth2-proxy --config /etc/core.cfg --alpha-config /etc/alpha.yaml --config-test
# CI/CD pre-deployment check
# Returns with exit code 1 if any validation errors occur
oauth2-proxy --config new-config.cfg --config-test
```
### Exit Codes
- **0**: Configuration is valid ✅
- **1**: Configuration is invalid (errors printed to stderr) ❌
### Validation Coverage
The `--config-test` flag performs the **same comprehensive validation** as normal startup, including:
- Required fields (client ID, client secret, cookie secret, etc.)
- Syntax validation (TOML/YAML parsing)
- Provider configuration
- Upstream server definitions
- Session store connectivity (e.g., Redis network checks if configured)
**Note**: Cannot be combined with `--convert-config-to-alpha`.
## Upstreams Configuration
`oauth2-proxy` supports having multiple upstreams, and has the option to pass requests on to HTTP(S) servers, unix socket or serve static files from the file system.

View File

@ -72,43 +72,6 @@ An example [oauth2-proxy.cfg](https://github.com/oauth2-proxy/oauth2-proxy/blob/
| `--config-test` | test configuration and exit (for CI/CD validation) |
| `--version` | print version string |
## Configuration Validation
The `--config-test` flag validates your configuration file without starting the proxy server. This is useful for:
- **CI/CD pipelines**: Pre-deployment validation
- **Configuration management**: Testing before applying changes
- **Debugging**: Verifying syntax and required fields
### Usage
```bash
# Test legacy config
oauth2-proxy --config /etc/oauth2-proxy.cfg --config-test
# Test alpha config
oauth2-proxy --config /etc/core.cfg --alpha-config /etc/alpha.yaml --config-test
# CI/CD pre-deployment check
# Returns with exit code 1 if any validation errors occur
oauth2-proxy --config new-config.cfg --config-test
```
### Exit Codes
- **0**: Configuration is valid ✅
- **1**: Configuration is invalid (errors printed to stderr) ❌
### Validation Coverage
The `--config-test` flag performs the **same comprehensive validation** as normal startup, including:
- Required fields (client ID, client secret, cookie secret, etc.)
- Syntax validation (TOML/YAML parsing)
- Provider configuration
- Upstream server definitions
- Session store connectivity (e.g., Redis network checks if configured)
**Note**: Cannot be combined with `--convert-config-to-alpha`.
### General Provider Options
Provider specific options can be found on their respective subpages.
@ -305,6 +268,43 @@ Provider specific options can be found on their respective subpages.
| flag: `--upstream-timeout`<br/>toml: `upstream_timeout` | duration | maximum amount of time the server will wait for a response from the upstream | 30s |
| flag: `--upstream`<br/>toml: `upstreams` | string \| list | the http url(s) of the upstream endpoint, file:// paths for static files or `static://<status_code>` for static response. Routing is based on the path | |
## Configuration Validation
The `--config-test` flag validates your configuration file without starting the proxy server. This is useful for:
- **CI/CD pipelines**: Pre-deployment validation
- **Configuration management**: Testing before applying changes
- **Debugging**: Verifying syntax and required fields
### Usage
```bash
# Test legacy config
oauth2-proxy --config /etc/oauth2-proxy.cfg --config-test
# Test alpha config
oauth2-proxy --config /etc/core.cfg --alpha-config /etc/alpha.yaml --config-test
# CI/CD pre-deployment check
# Returns with exit code 1 if any validation errors occur
oauth2-proxy --config new-config.cfg --config-test
```
### Exit Codes
- **0**: Configuration is valid ✅
- **1**: Configuration is invalid (errors printed to stderr) ❌
### Validation Coverage
The `--config-test` flag performs the **same comprehensive validation** as normal startup, including:
- Required fields (client ID, client secret, cookie secret, etc.)
- Syntax validation (TOML/YAML parsing)
- Provider configuration
- Upstream server definitions
- Session store connectivity (e.g., Redis network checks if configured)
**Note**: Cannot be combined with `--convert-config-to-alpha`.
## Upstreams Configuration
`oauth2-proxy` supports having multiple upstreams, and has the option to pass requests on to HTTP(S) servers, unix socket or serve static files from the file system.