-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
httpcaddyfile: Only append TLS conn policy if it's non-empty #3319
Conversation
This can lead to nicer, smaller JSON output for Caddyfiles like this: a { tls internal } b { tls foo@bar.com } i.e. where the tls directive only configures automation policies, and is merely meant to enable TLS on a server block (if it wasn't implied). This helps keeps implicit config implicit. Needs a little more testing to ensure it doesn't break anything important.
Is this to fix the |
@francislavoie Not exactly, no (that empty policy is definitely there for a reason, but I think there are some cases where we can remove it). I updated my post with the before/after. |
@henrocker Would you have a chance to try this PR soon, perchance? (Build artifacts are available for download.) Just want to make sure we don't repeat #3249. I don't think we will but then again my mind is mush today. And then after that, could you also help us make sure things are working by testing then deploying the latest HEAD on master with your sites? We're getting ready to tag 2.0 next week. |
UPDATE: Same result with HEAD on master :-) @mholt I've just deployed https://github.com/caddyserver/caddy/suites/633332206/artifacts/5178946 and it is working as expected for all of my sites! PHP, as well as static sites work fine, and customized cert path sites in combination with LE cert sites work, too 👍 Caddyfile: https://gist.github.com/Henrocker/b8abff26447e2c65fadb66bdca6e949c Logs:
|
@henrocker Awesome, thank you very much for trying both! I feel a little more confident now, thanks to your help. :) |
This can lead to nicer, smaller JSON output for Caddyfiles like this:
i.e. where the tls directive only configures automation policies, and
is merely meant to enable TLS on a server block (if it wasn't implied).
This helps keeps implicit config implicit.
Needs a little more testing to ensure it doesn't break anything
important.
Diff: https://www.diffchecker.com/U9uyyjkT
JSON before:
JSON after:
17 line savings in this case.