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

Incorrect country flag displayed (GB) for VPN IP in Switzerland #2375

Open
scottnzuk opened this issue Feb 1, 2025 · 3 comments
Open

Incorrect country flag displayed (GB) for VPN IP in Switzerland #2375

scottnzuk opened this issue Feb 1, 2025 · 3 comments
Labels
enhancement New feature or request

Comments

@scottnzuk
Copy link

Description:
I have encountered a bug where the stats software displays my public IP address alongside the country flag (GB). However, this IP is actually provided by my VPN, which is based in Switzerland. I am wondering where the country information is being sourced from, as it appears to be inaccurate.

Steps to Reproduce:
1. Connect to a VPN service with an exit node in Switzerland.
2. Launch the stats software.
3. Observe that your public IP is shown with the country code (GB) instead of (CH) or the correct flag for Switzerland.
4. Confirm using an external IP lookup that the VPN IP is indeed from Switzerland.

Expected Behaviour:
The software should display the correct country flag/code (e.g. (CH) for Switzerland) corresponding to the actual location of the IP.

Actual Behaviour:
The stats software shows the public IP with the (GB) flag, which is misleading given that the VPN is based in Switzerland.

Additional Information:
• It’s unclear where the country information is being retrieved from – whether it’s via a third-party API or a local database.
• Please could you clarify the source of the country data in the code?

Image
@exelban
Copy link
Owner

exelban commented Feb 1, 2025

it's a data from macOS system.

@exelban exelban closed this as not planned Won't fix, can't repro, duplicate, stale Feb 1, 2025
@scottnzuk
Copy link
Author

1.	MaxMind’s GeoLite2 Country Database

This database is free (registration is required) and it comes in CSV format. It includes IPv4 and IPv6 blocks assigned to countries. Note that MaxMind updates the data periodically so you may want to set up a process to update your copy.
2. IP2Location LITE Database
This is another free database that maps IP ranges to countries and is available in a couple of formats including CSV.

semi easy fix, use one of free geoip local db files.

it has me worried my VPN was not working correctly. or perhaps remove it if false data?

@exelban
Copy link
Owner

exelban commented Feb 1, 2025

thx for sharing these dbs. I will take a look and maybe will change from native solution to this one.

@exelban exelban reopened this Feb 1, 2025
@exelban exelban added the enhancement New feature or request label Feb 1, 2025
@exelban exelban added this to Stats Feb 1, 2025
@exelban exelban moved this to Todo in Stats Feb 1, 2025
@exelban exelban moved this from Todo to In Progress in Stats Feb 3, 2025
@exelban exelban moved this from In Progress to Ready to deploy in Stats Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Ready to deploy
Development

No branches or pull requests

2 participants