Runtime placeholders for selected TLS and HTTP matchers#6480
Merged
mholt merged 5 commits intocaddyserver:masterfrom Aug 7, 2024
Merged
Runtime placeholders for selected TLS and HTTP matchers#6480mholt merged 5 commits intocaddyserver:masterfrom
mholt merged 5 commits intocaddyserver:masterfrom
Conversation
- remove IPs validation in UnmarshalCaddyfile
- add placeholder replacement for IPs in Provision
- add placeholder replacement for other strings
- add placeholder replacement for IPs in Provision
mohammed90
reviewed
Jul 26, 2024
Member
mohammed90
left a comment
There was a problem hiding this comment.
I think the caddy.Context available in Provision contains a replacer already, and it may have some values set already. Try using the existing replacer.
Contributor
Author
So did I think, but I checked the context, and it's basically empty at provision. I use the existing replacer at match. |
- move PrivateRandesCIDR under internal
mholt
approved these changes
Aug 7, 2024
Member
mholt
left a comment
There was a problem hiding this comment.
This LGTM. Nice idea to move the PrivateRangesCIDR function into an internal package.
vnxme
added a commit
to vnxme/caddy
that referenced
this pull request
Aug 11, 2024
…r (e.g. in TestDefaultSNI)
vnxme
added a commit
to vnxme/caddy
that referenced
this pull request
Aug 11, 2024
mohammed90
pushed a commit
that referenced
this pull request
Aug 12, 2024
vnxme
added a commit
to vnxme/caddy
that referenced
this pull request
Aug 12, 2024
1 task
46 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR follows mholt/caddy-l4#224 and deals with the following mainline matchers only:
These changes allow to use runtime placeholders with TLS and HTTP IP matchers, e.g.
remote_ip {env.VAR}. Such placeholders, if present, are evaluated once at provision due to the existing optimisations.In addition, this PR adds runtime placeholders support for TLS SNI matcher, e.g.
sni {env.VAR}. Contrary to the above, such placeholders are evaluated each time at match.