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

Wrong source country while using Cloudflare #83

Open
vadeeh opened this issue May 1, 2024 · 1 comment
Open

Wrong source country while using Cloudflare #83

vadeeh opened this issue May 1, 2024 · 1 comment

Comments

@vadeeh
Copy link

vadeeh commented May 1, 2024

Hi,

Currently, the source country of users displayed on Aptabase when the app is self-hosted is incorrect. Is it feasible to utilize CF-IPCountry when a domain is using Cloudflare?

Thanks

@cristipufu
Copy link
Member

Hi @vadeeh

Added the CF-IPCountry header here: 9a75d3f

We still need to add an environment variable to make this configurable so you can use CloudGeoClient on self-hosted env:

public static void AddGeoIPClient(this IServiceCollection services, EnvSettings env)
{
    if (env.IsManagedCloud)
    {
        services.AddSingleton<GeoIPClient, CloudGeoClient>();
        return;
    }

    services.AddSingleton<GeoIPClient, DatabaseGeoClient>();
}

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

No branches or pull requests

2 participants