Skip to content

Commit

Permalink
Merge pull request #406 from ysugimoto/docs/update-configuration-docs
Browse files Browse the repository at this point in the history
list all configuration fields
  • Loading branch information
ysugimoto authored Feb 6, 2025
2 parents df77fe4 + 9479a9e commit 9659929
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 29 deletions.
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ type TestConfig struct {
Timeout int `cli:"t,timeout" yaml:"timeout"`
Filter string `cli:"f,filter" default:"*.test.vcl"`
IncludePaths []string // Copy from root field
OverrideHost string `yaml:"host"`
OverrideHost string `yaml:"host" cli:"host"`
Watch bool `cli:"watch"` // Enable only in CLI option

// Override Request configuration
Expand Down
73 changes: 45 additions & 28 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ linter:
verbose: warning
rules:
acl/syntax: error
enforce_subroutine_scopes:
fastly_managed_waf: [recv, pass]
ignore_subroutines: [ignore_sub, custom_sub]

## Formatter configurations
format:
Expand Down Expand Up @@ -55,8 +58,14 @@ simulator:
## Testing configuration
testing:
timeout: 100
max_backends: 100
max_acls: 100
host: example.com
filter: *.test.vcl
edge_dictionary:
dict_name:
key1: value1
key2: value2
overrides:
client.as.name: Foobar

## Backend Overrides
override_backends:
Expand All @@ -69,32 +78,40 @@ override_backends:
falco cascades each setting from the order of `Default Setting` -> `Configuration File` -> `CLI Arguments` to override.
All configurations of configuration files and CLI arguments are described following table:

| Configuration Field | Type | Default | CLI Argument | Description |
|:-----------------------------------|:-------------:|:-------:|:------------------:|:--------------------------------------------------------------------------------------------------------------------------------------|
| include_paths | Array<String> | [] | -I, --include_path | Include VCL paths |
| remote | Boolean | false | -r, --remote | Fetch remote resources of Fastly |
| max_backends | Integer | 5 | --max_backends | Override Fastly's backend amount limitation |
| max_acls | Integer | 1000 | --max_acls | Override Fastly's acl amount limitation |
| simulator | Object | null | - | Simulator configuration object |
| simulator.port | Integer | 3124 | -p, --port | Simulator server listen port |
| simulator.key_file | String | - | --key | TLS server key file path |
| simulator.cert_file | String | - | --cert | TLS server cert file path |
| simulator.edge_dictionary | Object | null | - | Local edge dictionary item definitions |
| simulator.edge_dictionary.[name] | Object | - | - | Local edge dictionary name |
| testing | Object | null | - | Testing configuration object |
| testing.timeout | Integer | 10 | -t, --timeout | Set timeout to stop testing |
| linter | Object | null | - | Override linter rules |
| linter.verbose | String | error | -v, -vv | Verbose level, `warning` or `info` is valid |
| linter.rules | Object | null | - | Override linter rules |
| linter.rules.[rule_name] | String | - | - | Override linter error level for the rule name, see [rules](https://github.com/ysugimoto/falco/blob/develop/docs/rules.md) |
| linter.enforce_subroutine_scopes | Array<String> | [] | - | Coerce subroutine scope for specified list of subroutine names. will be usefull for Fastly managed snippet that cannot be modified. |
| linter.ignore_subroutines | Array<String> | [] | - | Ignore subroutine linting for specified list of subroutine names. will be usefull for Fastly managed snippet that cannot be modified. |
| override_backends | Object | - | - | Override backend settings in main VCL which correspond to the name. Key of backend name accepts glob pattern |
| override_backends | Object | - | - | Override backend settings in main VCL which correspond to the name. Key of backend name accepts glob pattern |
| override_backends.[name] | Object | - | - | Backend name to override |
| override_backends.[name].host | String | - | - | Backend host to override |
| override_backends.[name].ssl | Boolean | true | - | Use HTTPS when set `true` |
| override_backends.[name].unhealthy | Boolean | false | - | Override backend to be unhealthy when set `true` |
| Configuration Field | Type | Default | CLI Argument | Description |
|:----------------------------------------|:-------------------:|:-----------:|:------------------:|:--------------------------------------------------------------------------------------------------------------------------------------|
| include_paths | Array<String> | [] | -I, --include_path | Include VCL paths |
| remote | Boolean | false | -r, --remote | Fetch remote resources of Fastly |
| max_backends | Integer | 5 | --max_backends | Override Fastly's backend amount limitation |
| max_acls | Integer | 1000 | --max_acls | Override Fastly's acl amount limitation |
| linter | Object | null | - | Override linter rules |
| linter.verbose | String | error | -v, -vv | Verbose level, `warning` or `info` is valid |
| linter.rules | Object | null | - | Override linter rules |
| linter.rules.[rule_name] | String | - | - | Override linter error level for the rule name, see [rules](https://github.com/ysugimoto/falco/blob/develop/docs/rules.md) |
| linter.enforce_subroutine_scopes | Object | null | - | Coerce subroutine scope for specified list of subroutine names. will be usefull for Fastly managed snippet that cannot be modified. |
| linter.enforce_subroutine_scopes.[name] | Array<String> | [] | - | `name` is subroutine name and specify acceptable scope as an array. |
| linter.ignore_subroutines | Array<String> | [] | - | Ignore subroutine linting for specified list of subroutine names. will be usefull for Fastly managed snippet that cannot be modified. |
| linter.generated | Boolean | false | --generated | Lint VCL as **generated** VCL. generated means that VCL comes from `show VCL` data in Fastly management console. |
| simulator | Object | null | - | Simulator configuration object |
| simulator.port | Integer | 3124 | -p, --port | Simulator server listen port |
| simulator.key_file | String | - | --key | TLS server key file path |
| simulator.cert_file | String | - | --cert | TLS server cert file path |
| simulator.edge_dictionary | Object | null | - | Local edge dictionary item definitions |
| simulator.edge_dictionary.[name] | Map<String, String> | - | - | Local edge dictionary name |
| testing | Object | null | - | Testing configuration object |
| testing.timeout | Integer | 10 | -t, --timeout | Set timeout to stop testing |
| testing.filter | String | \*.test.vcl | -f, --filter | Provide filter (glob) pattern to find the testing VCL files. |
| testing.host | String | - | --host | Provide virtual hostname to override the `req.http.Host` header value. |
| testing.watch | Boolean | false | -w, --watch | If true, watch and run test when VCL files have changed. |
| testing.edge_dictionary | Object | null | - | Local edge dictionary item definitions |
| testing.edge_dictionary.[name] | Object | - | - | Local edge dictionary name |
| testing.overrides | Map<String, String> | - | - | Override predefined variable value |
| override_backends | Object | - | - | Override backend settings in main VCL which correspond to the name. Key of backend name accepts glob pattern |
| override_backends | Object | - | - | Override backend settings in main VCL which correspond to the name. Key of backend name accepts glob pattern |
| override_backends.[name] | Object | - | - | Backend name to override |
| override_backends.[name].host | String | - | - | Backend host to override |
| override_backends.[name].ssl | Boolean | true | - | Use HTTPS when set `true` |
| override_backends.[name].unhealthy | Boolean | false | - | Override backend to be unhealthy when set `true` |



Expand Down

0 comments on commit 9659929

Please # to comment.