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

Allow using and auto-updating dbip databases and default to db-ip.com lite in the UI #15319

Merged
merged 14 commits into from Jan 8, 2020

Conversation

diosmosis
Copy link
Member

@diosmosis diosmosis commented Dec 27, 2019

refs #15308

sgiehl and others added 3 commits December 24, 2019 11:03
@diosmosis diosmosis added the Needs Review PRs that need a code review label Dec 27, 2019
@diosmosis diosmosis added this to the 3.13.1 milestone Dec 27, 2019
@sgiehl
Copy link
Member

sgiehl commented Dec 28, 2019

@mattab could you maybe get in touch with DB-IP, to get access to their paid databases? maybe also the one including ISP data? Would be good if we could test those as well.

@tsteur
Copy link
Member

tsteur commented Dec 29, 2019

BTW haven't looked at the code but do we want to auto update the URL for people using the free maxmind DB?

@sgiehl
Copy link
Member

sgiehl commented Dec 29, 2019

guess it would make sense to do that in an update script

@mattab
Copy link
Member

mattab commented Dec 29, 2019

could you maybe get in touch with DB-IP, to get access to their paid databases? maybe also the one including ISP data? Would be good if we could test those as well.

Just requested to db-ip team if they're willing to send us a commercial DB set, will let you know when we hear back. Btw i noticed the commercial DBs are quite large, see:
Screenshot from 2019-12-30 09-49-09

Would this still work fine even though the DB can be up to 4DB large?

@diosmosis
Copy link
Member Author

diosmosis commented Dec 29, 2019

Looks like those are for the CSV files, the mmdb files are smaller. Though they still seem to be quite large (~350mb for city db). The download might take a while but for once a month it should be ok?

EDIT: I'm also not sure if that's gzipped or not.

@diosmosis
Copy link
Member Author

Updated the PR

@mattab mattab changed the title Allow using and auto-updating dbip databases and default to dbip lite in the UI Allow using and auto-updating dbip databases and default to db-ip.copm lite in the UI Jan 1, 2020
@mattab mattab changed the title Allow using and auto-updating dbip databases and default to db-ip.copm lite in the UI Allow using and auto-updating dbip databases and default to db-ip.com lite in the UI Jan 1, 2020
@mattab
Copy link
Member

mattab commented Jan 1, 2020

FYI @diosmosis our affiliate link for db-ip.com is https://db-ip.com/?refid=mtm or especially appending ?refid=mtm to all links to db-ip.com. With maxmind we had a similar affiliate link. Can you check and add the parameter to all links within the app to db-ip.com?

…pe of database is going to be downloaded, add support for other db-ip DBs, use enterprise geoip db for ISP detection if present, add db-ip referrer query param.
@diosmosis
Copy link
Member Author

@sgiehl @tsteur updated to work w/ purchased dbip urls. tested w/ all of them and tested w/ geolite2 city just to make sure it still works.

@tsteur
Copy link
Member

tsteur commented Jan 2, 2020

BTW: Not sure if important... once it failed for me and then I got this notice:

Notice: Undefined index: region_code in plugins/GeoIp2/LocationProvider/GeoIp2.php on line 101

@diosmosis
Copy link
Member Author

@tsteur should be fixed, let me know if you still get it

{
static $result = null;
if (is_null($result)) {
$expected = array(self::COUNTRY_CODE_KEY => 'FR',
self::REGION_CODE_KEY => 'BFC',
self::REGION_CODE_KEY => 'BFC',
Copy link
Member

Choose a reason for hiding this comment

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

The DB-IP Lite database returns no region for this IP, so the provider is reported as broken.
In relation to #15317 we maybe shouldn't use only one IP to check if the results are ok. Maybe we could have one IP per continent and go through the list until one matches exactly? Any idea where to get some IPs with static results?

Copy link
Member

@sgiehl sgiehl Jan 3, 2020

Choose a reason for hiding this comment

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

Or we might use different ips/results depending on the provider / database type

Copy link
Member Author

Choose a reason for hiding this comment

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

What about using the test database we include for system tests? Could we load that so we can control the IP/location? I started on supporting multiple ip addresses, but we'd have to have quite a few and they might change...

Copy link
Member Author

Choose a reason for hiding this comment

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

I guess that wouldn't work for server modules... though it looks like servermodule overrides isWorking(). If we move that logic to the Php class it might work I think.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think I'm going to make the check less strict and just check that there's at least some data in the provider. Users can always see their own IP geolocated to check for accuracy.

@mattab
Copy link
Member

mattab commented Jan 8, 2020

@diosmosis @sgiehl As soon as this is merged we'll release another beta for testing, looking forward to getting it merged today or tomorrow 🚀

@tsteur tsteur merged commit 4ad9f4a into 3.x-dev Jan 8, 2020
@tsteur tsteur deleted the dbip branch January 8, 2020 02:30
@mattab mattab added the Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical. label Jan 16, 2020
jonasgrilleres pushed a commit to 1024pix/pix-analytics that referenced this pull request Sep 22, 2020
jbuget pushed a commit to 1024pix/pix-analytics that referenced this pull request Sep 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical. Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants