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

GeoIp location #2465

Merged
merged 82 commits into from
May 6, 2024
Merged

GeoIp location #2465

merged 82 commits into from
May 6, 2024

Conversation

ptesavol
Copy link
Collaborator

@ptesavol ptesavol commented Apr 2, 2024

  • Add geoip-location package that can map an ip address to latitude and longitude using MaxMind's GeoLite City database

  • If "geoIpDatabaseFolder" config variable is given to DhtNode, use geoip-location package server-side in DhtNode's ConnectivityRequest handler to add latitude and longitude to each ConnectivityReply

  • Add function to cdn-location package for mapping coordinates to a local region number

  • In DHTNode client-side, calculate local region number based on the latitude and longitude contained in ConnectivityReply. If ConnectivityReply does not contain latitude and longitude, fallback to using cdn-location.

  • Take geoip-location server into use in Broker

@ptesavol ptesavol requested a review from juslesan April 2, 2024 09:10
@github-actions github-actions bot added ci Related to CI configuration dht Related to DHT package labels Apr 2, 2024
Copy link
Contributor

@juslesan juslesan left a comment

Choose a reason for hiding this comment

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

Some comments

packages/dht/src/dht/DhtNode.ts Outdated Show resolved Hide resolved
packages/geoip-location/tsconfig.jest.json Outdated Show resolved Hide resolved
packages/geoip-location/src/downloadGeoIpDatabase.ts Outdated Show resolved Hide resolved
packages/geoip-location/src/downloadGeoIpDatabase.ts Outdated Show resolved Hide resolved
packages/geoip-location/src/downloadGeoIpDatabase.ts Outdated Show resolved Hide resolved
@github-actions github-actions bot added the docs label May 6, 2024
@juslesan juslesan merged commit 28250da into main May 6, 2024
24 checks passed
@juslesan juslesan deleted the geoip-location branch May 6, 2024 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
broker Related to Broker Package ci Related to CI configuration client Related to Client Package dht Related to DHT package docs utils
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants