Replace ipapi with MaxMind GeoIP2 for geolocation services#917
Merged
Conversation
Migrated from ipapi.co and ip-api.com to MaxMind GeoIP2 Web Services API for more reliable and accurate IP geolocation lookups. Changes: - Added MaxMind.GeoIP2 NuGet package (v5.3.0) to Application project - Removed IGeolocationService interface and GeolocationService implementation - Updated LoginAuditCreatedEventHandler to use MaxMind WebServiceClient directly - Added MaxMind configuration settings (AccountId, LicenseKey, Host) to appsettings.json - Updated DependencyInjection to register MaxMind WebServiceClient with HttpClient - Updated docker-compose.yml to include MaxMind environment variables - Removed dependency on free IP lookup APIs (ipapi.co, ip-api.com) - Updated package references (FluentValidation, QuestPDF, Serilog, MudBlazor) Benefits: - More accurate and reliable geolocation data - Better performance with MaxMind's dedicated service - Support for offline databases (future enhancement) - Professional-grade IP intelligence
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR migrates the geolocation service from free IP lookup APIs (ipapi.co and ip-api.com) to MaxMind GeoIP2 Web Services API for more reliable and accurate IP geolocation lookups.
Changes
Benefits
Configuration Required
Before deploying, ensure the following environment variables are set:
MAXMIND_ACCOUNT_ID: Your MaxMind account IDMAXMIND_LICENSE_KEY: Your MaxMind license keyIn appsettings.json, configure:
Testing
Breaking Changes
Files Changed
src/Application/Application.csprojsrc/Application/Common/Interfaces/IGeolocationService.cs(deleted)src/Application/Features/LoginAudits/EventHandlers/LoginAuditCreatedEventHandler.cssrc/Infrastructure/DependencyInjection.cssrc/Infrastructure/Infrastructure.csprojsrc/Infrastructure/Services/GeolocationService.cs(deleted)src/Server.UI/appsettings.jsonsrc/Server.UI/Server.UI.csprojdocker-compose.yml