Skip to main content

Module config_check

Module config_check 

Source
Expand description

rws --check: validate rws.config.toml without starting the server — the counterpart of nginx -t / caddy validate.

Reports unknown keys (in settings and in proxy sections), values of the wrong type, TLS files that can’t be loaded, proxy routes pointing at undeclared upstreams, auth secrets that aren’t set, and similar mistakes that would otherwise surface as a warning in the startup log or as a 503 at request time. Nothing is bound and the environment is not modified.

rws --check                      # the file rws would load (RWS_CONFIG_FILE or ./rws.config.toml)
rws --check=/etc/rws/site.toml   # a specific file

Structs§

ConfigReport
Errors and warnings found in a configuration file.

Functions§

check_file
Check the configuration file at path.
check_str
Check configuration text. Relative file paths in it (certificates, htpasswd files, static roots) are resolved against the working directory, as the server resolves them.
check_str_offline
check_str without looking at this machine: no file is opened or tested for existence (certificates, keys, CA bundles, htpasswd files, static roots, programs) and no environment variable is read (auth secrets, DNS API credentials). For configuration text from someone else, e.g. the docs MCP server’s check_config tool, where those answers would describe the server, not the caller’s deployment.
check_target_from_args
The path --check targets in args (the process arguments), or None when --check is absent. --check=<path> and --check <path> name a file; a bare --check checks the file the server would load.
default_config_path
RWS_CONFIG_FILE if set, else rws.config.toml in the working directory.
wants_json_output
Whether the arguments ask for machine-readable output (--format=json).