Skip to content
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: Fixes for prefer_wildcard mode #6636

Merged
merged 3 commits into from
Oct 30, 2024
Merged

httpcaddyfile: Fixes for prefer_wildcard mode #6636

merged 3 commits into from
Oct 30, 2024

Conversation

francislavoie
Copy link
Member

@francislavoie francislavoie commented Oct 17, 2024

Followup to #6146

Two fixes:

  • When assembling the HTTP app, the wildcard hosts need to be collected first, then considered after, because there's no guarantee that all non-wildcards will appear after all wildcards when looping. Also we should not add a domain to Skip if it doesn't qualify for TLS anyway. But I realized we should actually add it to SkipCerts, not Skip because we do want them to still get HTTP->HTTPS redirects, just not have certs issued.

  • The automation policy consolidation misbehaved if there was more than one wildcard configured, because it was comparing wildcards against eachother. This would cause all APs to disappear in some cases. Instead of handling wildcard coverage in consolidation, I reworked it to avoid adding the AP altogether if it would be covered by a wildcard. Should be more robust.

The wildcard hosts need to be collected first, then considered after, because there's no guarantee that all non-wildcards will appear after all wildcards when looping. Also we should not add a domain to Skip if it doesn't qualify for TLS anyway.
@francislavoie francislavoie added the bug 🐞 Something isn't working label Oct 17, 2024
@francislavoie francislavoie added this to the v2.9.0-beta.3 milestone Oct 17, 2024
@francislavoie francislavoie requested a review from mholt October 17, 2024 00:14
@francislavoie francislavoie changed the title httpcaddyfile: Fixes for prefer_wildcard mode httpcaddyfile: Fixes for prefer_wildcard mode Oct 17, 2024
@coandco
Copy link

coandco commented Oct 20, 2024

I built with this branch and can confirm that the problem is now fixed, at least for me. I can define multiple *.one.example.com/*.two.example.com wildcard domains and it handles them all as it should.

@mholt
Copy link
Member

mholt commented Oct 21, 2024

Will look at this again soon!

@coandco
Copy link

coandco commented Oct 30, 2024

Looking forward to being able to build with an official beta, rather than just pointing at this branch!

Copy link
Member

@mholt mholt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this, Francis. Sorry for my delay!

@mholt mholt enabled auto-merge (squash) October 30, 2024 17:02
@mholt mholt merged commit b129ed6 into master Oct 30, 2024
33 checks passed
@mholt mholt deleted the prefer-wildcard branch October 30, 2024 17:09
@mholt
Copy link
Member

mholt commented Nov 1, 2024

This will go out with the next beta in a few days or less

@mholt
Copy link
Member

mholt commented Nov 11, 2024

@coandco This has been released in the beta a few days ago just FYI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants