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

fix(provider): avoid static IPs such as 1.1.1.1 #484

Merged
merged 3 commits into from
May 18, 2023
Merged

Conversation

favonia
Copy link
Owner

@favonia favonia commented May 17, 2023

Some ISPs are still blocking 1.1.1.1, unfortunately. The new mechanism manually resolves the host cloudflare-dns.com as an IPv4 or IPv6 address, skipping the dual-stack switching in the Go standard library.

@favonia favonia force-pushed the force-ip-network branch 3 times, most recently from b20e8ca to e1cb7b9 Compare May 17, 2023 18:40
@favonia
Copy link
Owner Author

favonia commented May 17, 2023

For the CI: it seems the security hardening prevents resolving the domain one.one.one.one to an IPv6 address after resolving it to an IPv4 address. I understand why there's such a restriction but I'm not sure how to elegantly work around it. ☹️ Solved with another hack!

Some ISPs are still blocking 1.1.1.1, unfortunately. The new mechanism
manually resolves the host `cloudflare-dns.com` as an IPv4 or IPv6
address, skipping the dual-stack switching in the Go standard library.
@favonia favonia linked an issue May 18, 2023 that may be closed by this pull request
@codecov
Copy link

codecov bot commented May 18, 2023

Codecov Report

Merging #484 (3f38be9) into main (6a1e2f4) will increase coverage by 0.24%.
The diff coverage is 95.40%.

@@            Coverage Diff             @@
##             main     #484      +/-   ##
==========================================
+ Coverage   87.84%   88.08%   +0.24%     
==========================================
  Files          35       36       +1     
  Lines        2098     2166      +68     
==========================================
+ Hits         1843     1908      +65     
- Misses        247      249       +2     
- Partials        8        9       +1     
Flag Coverage Δ
unittests 88.08% <95.40%> (+0.24%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
internal/ipnet/forceresolve.go 93.02% <93.02%> (ø)
internal/provider/protocol/httpcore.go 88.88% <93.75%> (+2.22%) ⬆️
internal/ipnet/ipnet.go 100.00% <100.00%> (ø)
internal/provider/cloudflare_doh.go 100.00% <100.00%> (ø)
internal/provider/cloudflare_trace.go 100.00% <100.00%> (ø)
internal/provider/protocol/doh.go 95.96% <100.00%> (+0.03%) ⬆️
internal/provider/protocol/field.go 100.00% <100.00%> (ø)
internal/provider/protocol/http.go 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@favonia favonia merged commit fea5146 into main May 18, 2023
@favonia favonia deleted the force-ip-network branch May 18, 2023 05:49
favonia added a commit that referenced this pull request May 18, 2023
favonia added a commit that referenced this pull request May 18, 2023
Revert "fix(provider): avoid static IPs such as 1.1.1.1 (#484)"

This reverts commit fea5146.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Configurable Cloudflare IPs
1 participant