caddy/caddyconfig/httpcaddyfile
WeidiDeng 8bc05e598d
caddyfile: Implement variadics for import args placeholders (#5249)
* implement variadic placeholders
imported snippets reflect actual lines in file

* add import directive line number for imported snippets
add tests for parsing

* add realfile field to help debug import cycle detection.

* use file field to reflect import chain

* Switch syntax, deprecate old syntax, refactoring

- Moved the import args handling to a separate file
- Using {args[0:1]} syntax now
- Deprecate {args.*} syntax
- Use a replacer map for better control over the parsing
- Add plenty of warnings when invalid placeholders are detected
- Renaming variables, cleanup comments for readability
- More tests to cover edgecases I could think of
- Minor cleanup to snippet tracking in tokens, drop a redundant boolean field in tokens

---------

Co-authored-by: Francis Lavoie <lavofr@gmail.com>
2023-02-16 17:08:36 -07:00
..
addresses_fuzz.go core: Windows service integration (#4790) 2022-07-29 14:06:54 -06:00
addresses_test.go httpcaddyfile: Preserve IPv6 addresses through normalization (fix #4381) 2021-10-20 10:27:59 -06:00
addresses.go httpcaddyfile: Fix bind when IPv6 is specified with network (#4950) 2022-09-15 08:03:24 -06:00
builtins_test.go caddyfile: Implement variadics for import args placeholders (#5249) 2023-02-16 17:08:36 -07:00
builtins.go httpcaddyfile: Fix handle grouping inside route (#5315) 2023-01-18 16:04:41 -05:00
directives_test.go tests: Clean up redundant type declarations 2020-04-10 08:48:21 -06:00
directives.go httpcaddyfile: Fix handle grouping inside route (#5315) 2023-01-18 16:04:41 -05:00
httptype_test.go caddyfile: Introduce basic linting and fmt check (#3923) 2021-01-04 11:11:36 -07:00
httptype.go httpcaddyfile: Add persist_config global option (#5339) 2023-01-27 23:31:37 -05:00
options_test.go caddyconfig: add global option for configuring loggers (#4028) 2021-03-12 13:00:02 -07:00
options.go httpcaddyfile: Add persist_config global option (#5339) 2023-01-27 23:31:37 -05:00
pkiapp.go acme_server: Configurable default lifetime for issued certificates (#5232) 2022-12-06 00:12:26 -07:00
serveroptions.go caddyhttp: Pluggable trusted proxy IP range sources (#5328) 2023-02-06 12:44:11 -07:00
tlsapp_test.go httpcaddyfile: Revise automation policy generation (#3824) 2020-10-28 20:36:00 -06:00
tlsapp.go httpcaddyfile: Improve detection of indistinguishable TLS automation policies (#5120) 2022-10-13 11:30:57 -06:00