Skip to content

Commit

Permalink
utils/cobrautil/templates: markdown add value format
Browse files Browse the repository at this point in the history
This changes the flag doc structure adding bullet list containing: Environment variable, Value Format and Default value.
  • Loading branch information
mmatczuk committed Dec 4, 2023
1 parent 8c3cd16 commit 456749e
Show file tree
Hide file tree
Showing 5 changed files with 199 additions and 167 deletions.
54 changes: 28 additions & 26 deletions docs/content/cli/forwarder_pac_eval.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,29 @@ You can generate a config file by running `forwarder pac eval config-file` comma

### `-p, --pac` {#pac}

Environment variable: `FORWARDER_PAC`
* Environment variable: `FORWARDER_PAC`
* Value Format: `<path or URL>`
* Default value: `file://pac.js`

Proxy Auto-Configuration file to use for upstream proxy selection.
It can be a local file or a URL, you can also use '-' to read from stdin.
The data URI scheme is supported, the format is data:base64,<encoded data>.

Default value: `file://pac.js`

## DNS options

### `--dns-round-robin` {#dns-round-robin}

Environment variable: `FORWARDER_DNS_ROUND_ROBIN`
* Environment variable: `FORWARDER_DNS_ROUND_ROBIN`
* Value Format: `<value>`
* Default value: `false`

If more than one DNS server is specified with the --dns-server flag, passing this flag will enable round-robin selection.


Default value: `false`

### `-n, --dns-server` {#dns-server}

Environment variable: `FORWARDER_DNS_SERVER`
* Environment variable: `FORWARDER_DNS_SERVER`
* Value Format: `<ip>[:<port>]`

DNS server(s) to use instead of system default.
There are two execution policies, when more then one server is specified.
Expand All @@ -61,19 +62,20 @@ The port is optional, if not specified the default port is 53.

### `--dns-timeout` {#dns-timeout}

Environment variable: `FORWARDER_DNS_TIMEOUT`
* Environment variable: `FORWARDER_DNS_TIMEOUT`
* Value Format: `<duration>`
* Default value: `5s`

Timeout for dialing DNS servers.
Only used if DNS servers are specified.


Default value: `5s`

## HTTP client options

### `--cacert-file` {#cacert-file}

Environment variable: `FORWARDER_CACERT_FILE`
* Environment variable: `FORWARDER_CACERT_FILE`
* Value Format: `<path or base64>`

Add your own CA certificates to verify against.
The system root certificates will be used in addition to any certificates in this list.
Expand All @@ -82,51 +84,51 @@ Use this flag multiple times to specify multiple CA certificate files.

### `--http-dial-timeout` {#http-dial-timeout}

Environment variable: `FORWARDER_HTTP_DIAL_TIMEOUT`
* Environment variable: `FORWARDER_HTTP_DIAL_TIMEOUT`
* Value Format: `<duration>`
* Default value: `10s`

The maximum amount of time a dial will wait for a connect to complete.
With or without a timeout, the operating system may impose its own earlier timeout.
For instance, TCP timeouts are often around 3 minutes.


Default value: `10s`

### `--http-idle-conn-timeout` {#http-idle-conn-timeout}

Environment variable: `FORWARDER_HTTP_IDLE_CONN_TIMEOUT`
* Environment variable: `FORWARDER_HTTP_IDLE_CONN_TIMEOUT`
* Value Format: `<duration>`
* Default value: `1m30s`

The maximum amount of time an idle (keep-alive) connection will remain idle before closing itself.
Zero means no limit.


Default value: `1m30s`

### `--http-response-header-timeout` {#http-response-header-timeout}

Environment variable: `FORWARDER_HTTP_RESPONSE_HEADER_TIMEOUT`
* Environment variable: `FORWARDER_HTTP_RESPONSE_HEADER_TIMEOUT`
* Value Format: `<duration>`
* Default value: `0s`

The amount of time to wait for a server's response headers after fully writing the request (including its body, if any).This time does not include the time to read the response body.
Zero means no limit.


Default value: `0s`

### `--http-tls-handshake-timeout` {#http-tls-handshake-timeout}

Environment variable: `FORWARDER_HTTP_TLS_HANDSHAKE_TIMEOUT`
* Environment variable: `FORWARDER_HTTP_TLS_HANDSHAKE_TIMEOUT`
* Value Format: `<duration>`
* Default value: `10s`

The maximum amount of time waiting to wait for a TLS handshake.
Zero means no limit.

Default value: `10s`

### `--insecure` {#insecure}

Environment variable: `FORWARDER_INSECURE`
* Environment variable: `FORWARDER_INSECURE`
* Value Format: `<value>`
* Default value: `false`

Don't verify the server's certificate chain and host name.
Enable to work with self-signed certificates.


Default value: `false`

93 changes: 50 additions & 43 deletions docs/content/cli/forwarder_pac_server.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,46 +40,49 @@ You can generate a config file by running `forwarder pac server config-file` com

### `--address` {#address}

Environment variable: `FORWARDER_ADDRESS`
* Environment variable: `FORWARDER_ADDRESS`
* Value Format: `<host:port>`
* Default value: `:8080`

The server address to listen on.
If the host is empty, the server will listen on all available interfaces.

Default value: `:8080`

### `--basic-auth` {#basic-auth}

Environment variable: `FORWARDER_BASIC_AUTH`
* Environment variable: `FORWARDER_BASIC_AUTH`
* Value Format: `<username[:password]>`

Basic authentication credentials to protect the server.

### `--protocol` {#protocol}

Environment variable: `FORWARDER_PROTOCOL`
* Environment variable: `FORWARDER_PROTOCOL`
* Value Format: `<http|https|h2>`
* Default value: `http`

The server protocol.
For https and h2 protocols, if TLS certificate is not specified, the server will use a self-signed certificate.

Default value: `http`

### `--read-header-timeout` {#read-header-timeout}

Environment variable: `FORWARDER_READ_HEADER_TIMEOUT`
* Environment variable: `FORWARDER_READ_HEADER_TIMEOUT`
* Value Format: `<duration>`
* Default value: `1m0s`

The amount of time allowed to read request headers.

Default value: `1m0s`

### `--tls-cert-file` {#tls-cert-file}

Environment variable: `FORWARDER_TLS_CERT_FILE`
* Environment variable: `FORWARDER_TLS_CERT_FILE`
* Value Format: `<path or base64>`

TLS certificate to use if the server protocol is https or h2.
Can be a path to a file or "data:" followed by base64 encoded certificate.

### `--tls-key-file` {#tls-key-file}

Environment variable: `FORWARDER_TLS_KEY_FILE`
* Environment variable: `FORWARDER_TLS_KEY_FILE`
* Value Format: `<path or base64>`

TLS private key to use if the server protocol is https or h2.
Can be a path to a file or "data:" followed by base64 encoded key.
Expand All @@ -88,28 +91,29 @@ Can be a path to a file or "data:" followed by base64 encoded key.

### `-p, --pac` {#pac}

Environment variable: `FORWARDER_PAC`
* Environment variable: `FORWARDER_PAC`
* Value Format: `<path or URL>`
* Default value: `file://pac.js`

Proxy Auto-Configuration file to use for upstream proxy selection.
It can be a local file or a URL, you can also use '-' to read from stdin.
The data URI scheme is supported, the format is data:base64,<encoded data>.

Default value: `file://pac.js`

## DNS options

### `--dns-round-robin` {#dns-round-robin}

Environment variable: `FORWARDER_DNS_ROUND_ROBIN`
* Environment variable: `FORWARDER_DNS_ROUND_ROBIN`
* Value Format: `<value>`
* Default value: `false`

If more than one DNS server is specified with the --dns-server flag, passing this flag will enable round-robin selection.


Default value: `false`

### `-n, --dns-server` {#dns-server}

Environment variable: `FORWARDER_DNS_SERVER`
* Environment variable: `FORWARDER_DNS_SERVER`
* Value Format: `<ip>[:<port>]`

DNS server(s) to use instead of system default.
There are two execution policies, when more then one server is specified.
Expand All @@ -119,19 +123,20 @@ The port is optional, if not specified the default port is 53.

### `--dns-timeout` {#dns-timeout}

Environment variable: `FORWARDER_DNS_TIMEOUT`
* Environment variable: `FORWARDER_DNS_TIMEOUT`
* Value Format: `<duration>`
* Default value: `5s`

Timeout for dialing DNS servers.
Only used if DNS servers are specified.


Default value: `5s`

## HTTP client options

### `--cacert-file` {#cacert-file}

Environment variable: `FORWARDER_CACERT_FILE`
* Environment variable: `FORWARDER_CACERT_FILE`
* Value Format: `<path or base64>`

Add your own CA certificates to verify against.
The system root certificates will be used in addition to any certificates in this list.
Expand All @@ -140,65 +145,67 @@ Use this flag multiple times to specify multiple CA certificate files.

### `--http-dial-timeout` {#http-dial-timeout}

Environment variable: `FORWARDER_HTTP_DIAL_TIMEOUT`
* Environment variable: `FORWARDER_HTTP_DIAL_TIMEOUT`
* Value Format: `<duration>`
* Default value: `10s`

The maximum amount of time a dial will wait for a connect to complete.
With or without a timeout, the operating system may impose its own earlier timeout.
For instance, TCP timeouts are often around 3 minutes.


Default value: `10s`

### `--http-idle-conn-timeout` {#http-idle-conn-timeout}

Environment variable: `FORWARDER_HTTP_IDLE_CONN_TIMEOUT`
* Environment variable: `FORWARDER_HTTP_IDLE_CONN_TIMEOUT`
* Value Format: `<duration>`
* Default value: `1m30s`

The maximum amount of time an idle (keep-alive) connection will remain idle before closing itself.
Zero means no limit.


Default value: `1m30s`

### `--http-response-header-timeout` {#http-response-header-timeout}

Environment variable: `FORWARDER_HTTP_RESPONSE_HEADER_TIMEOUT`
* Environment variable: `FORWARDER_HTTP_RESPONSE_HEADER_TIMEOUT`
* Value Format: `<duration>`
* Default value: `0s`

The amount of time to wait for a server's response headers after fully writing the request (including its body, if any).This time does not include the time to read the response body.
Zero means no limit.


Default value: `0s`

### `--http-tls-handshake-timeout` {#http-tls-handshake-timeout}

Environment variable: `FORWARDER_HTTP_TLS_HANDSHAKE_TIMEOUT`
* Environment variable: `FORWARDER_HTTP_TLS_HANDSHAKE_TIMEOUT`
* Value Format: `<duration>`
* Default value: `10s`

The maximum amount of time waiting to wait for a TLS handshake.
Zero means no limit.

Default value: `10s`

### `--insecure` {#insecure}

Environment variable: `FORWARDER_INSECURE`
* Environment variable: `FORWARDER_INSECURE`
* Value Format: `<value>`
* Default value: `false`

Don't verify the server's certificate chain and host name.
Enable to work with self-signed certificates.


Default value: `false`

## Logging options

### `--log-file` {#log-file}

Environment variable: `FORWARDER_LOG_FILE`
* Environment variable: `FORWARDER_LOG_FILE`
* Value Format: `<path>`

Path to the log file, if empty, logs to stdout.

### `--log-http` {#log-http}

Environment variable: `FORWARDER_LOG_HTTP`
* Environment variable: `FORWARDER_LOG_HTTP`
* Value Format: `<none|short-url|url|headers|body|errors>,...`

HTTP request and response logging mode.
Setting this to none disables logging.
Expand All @@ -207,9 +214,9 @@ The error mode logs request line and headers if status code is greater than or e

### `--log-level` {#log-level}

Environment variable: `FORWARDER_LOG_LEVEL`
* Environment variable: `FORWARDER_LOG_LEVEL`
* Value Format: `<error|info|debug>`
* Default value: `info`

Log level.

Default value: `info`

6 changes: 3 additions & 3 deletions docs/content/cli/forwarder_ready.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ You can generate a config file by running `forwarder ready config-file` command.

### `--api-address` {#api-address}

Environment variable: `FORWARDER_API_ADDRESS`
* Environment variable: `FORWARDER_API_ADDRESS`
* Value Format: `<host:port>`
* Default value: `localhost:10000`

The API server address.

Default value: `localhost:10000`

Loading

0 comments on commit 456749e

Please sign in to comment.