Skip to content

Add support for Cloudflare-based geolocation - #2695

Merged
acelaya merged 7 commits into
shlinkio:developfrom
acelaya-forks:cloudflare-location-resolver
Nov 7, 2026
Merged

acelaya merged 7 commits into
shlinkio:developfrom
acelaya-forks:cloudflare-location-resolver

Conversation

@acelaya

@acelaya acelaya commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Closes #2646

Allow geolocation to be configured to use Cloudflare-provided headers instead (or on top of) GeoLite2.

TODO

  • Define new configuration option to determine the geolocation strategies
  • Decouple IpGeolocationMiddleware from GeoLite. It is currently checking for the existence of the database file, and checking if the IP address is localhost.
  • Rename IpGeolocationMiddleware to GeolocationMiddleware
  • Document changes in shlink.io (Document new geolocation strategies system from Shlink 5.2 getshlink.org#1431)

@codecov

codecov Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.09%. Comparing base (743084e) to head (c06dcdd).
⚠️ Report is 3 commits behind head on develop.

Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #2695      +/-   ##
=============================================
- Coverage      94.09%   94.09%   -0.01%     
+ Complexity      1611     1608       -3     
=============================================
  Files            273      273              
  Lines           5033     5031       -2     
=============================================
- Hits            4736     4734       -2     
  Misses           297      297              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@acelaya
acelaya marked this pull request as ready for review November 7, 2026 09:07
@acelaya
acelaya merged commit d56fad6 into shlinkio:develop Nov 7, 2026
31 of 32 checks passed
@acelaya
acelaya deleted the cloudflare-location-resolver branch November 7, 2026 09:12
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.

Support Cloudflare location headers as an alternative to MaxMind

1 participant