This integrates a feature that was previously reserved for enterprise
users, according to https://github.com/caddyserver/caddy/issues/2786.
The /config and /id endpoints make granular config changes possible as
well as the exporting of the current configuration.
The /load endpoint has been modified to wrap the /config handler so that
the currently-running config can always be available for export. The
difference is that /load allows configs of varying formats and converts
them using config adapters. The adapted config is then processed with
/config as JSON. The /config and /id endpoints accept only JSON.
* v2: introduce CI for v2 branch
* v2-ci: split test report generation from test pass to preserve exit code
* v2-ci: spilt lint results from unit test results
* v2-ci: fix testRunTitle name
* v2-ci: break up the steps for more accurate status indicators
* v2-ci: break steps into different jobs
* v2-ci: revert back to single-job pattern
* v2-ci: reflect the true result by coercing SucceededWithIssues into Failed in the last step
* v2-ci: don't fail the build on lint errors
* cli: Change command structure, add help subcommand (#328)
* cli: improve subcommand structure
- make help command as normal subcommand
- add flag usage message for each command
* cmd: Refactor subcommands and command line help; make commands pluggable
Modules that return an error during provisioning should still be cleaned
up so that they don't leak any resources they may have allocated before
the error occurred. Cleanup should be able to run even if Provision does
not complete fully.
Making them pointers makes for cleaner JSON when adapting configs, if
the struct is empty now it will be omitted entirely.
The x/time/rate package was updated to support changing the burst, so
we've incorporated that here and removed a TODO.
Newlines (\n) can be escaped outside of quoted areas and the newline
will be treated as whitespace but not as an actual line break. Escaping
newlines inside a quoted area is not necessary, and because quotes
trigger literal interpretation of the contents, the escaping backslash
will be parsed as a literal backslash, and the newline will not be
escaped.
Caveat: When a newline is escaped, tokens after it until an unescaped
newline will appear to the parser be on the same line as the initial
token after the last unescaped newline. This may technically lead to
some false line numbers if errors are given, but escaped newlines are
counted so that the next token after an unescaped newline is correct.
See #2766