caddyfile: Fix import replacing unrelated placeholders#4129
caddyfile: Fix import replacing unrelated placeholders#4129mholt merged 2 commits intocaddyserver:masterfrom
import replacing unrelated placeholders#4129Conversation
See https://caddy.community/t/snippet-issue-works-outside-snippet/12231 So it turns out that `NewReplacer()` gives a replacer with some global defaults (like `{env.*}` and some system and time placeholders), which is not ideal when running `import` because we just want to replace `{args.*}` only, and nothing else.
|
I should probably add a test for this, but it can be merged without. It's on my TODO. |
mholt
left a comment
There was a problem hiding this comment.
Interesting. Thanks for the patch. Can't think of a better way to do it, so let's roll with it.
|
That's working as intended. The |
|
FYI @greenpau make sure you're running the replacer on all config values that are relevant either during |
|
OK, I'll work /w @greenpau under his issue ticket since I'm still seeing errors. https://github.com/greenpau/caddy-auth-portal/issues/122#issuecomment-828481342 |

See https://caddy.community/t/snippet-issue-works-outside-snippet/12231
So it turns out that
NewReplacer()gives a replacer with some global defaults (like{env.*}and some system and time placeholders), which is not ideal when runningimportbecause we just want to replace{args.*}only, and nothing else.