antonioribeiro / antonioribeiro/tracker
GeoIP DB Update code is outdated
- Dominant language
- PHP
- Stars
- 2.9k
- Forks
- 594
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
The current code to download and update the GeoIP database is outdated. It seems that the provider of this data has switched from having a publically accessible database to one where you either have to be logged in or (which is the appropriate form to use for this package) use a user-specific download link.
**To Reproduce**
1) php artisan tracker:updategeoip
This generates the following error:
php artisan tracker:updategeoip
ErrorException : file_get_contents(): Filename cannot be empty at /var/www/geotest/vendor/pragmarx/support/src/GeoIp/Updater.php:100
96| * @return bool
97| */
98| private function md5Match()
99| {
> 100| if (! $match = md5_file($this->databaseFile) == file_get_contents($this->md5File)) {
101| $this->addMessage("MD5 is not matching for {$this->databaseFile} and {$this->md5File}.");
102|
103| return false;
104| }
Exception trace:
1 file_get_contents("")
/var/www/geotest/vendor/pragmarx/support/src/GeoIp/Updater.php:100
2 PragmaRX\Support\GeoIp\Updater::md5Match()
/var/www/geotest/vendor/pragmarx/support/src/GeoIp/Updater.php:59
Please use the argument -v to see more details.
**Expected behavior**
The geo-database should be downloaded and imported. I guess this means that somewhere the user-specific DL link would have to be specified in the config file.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by running php artisan tracker:updategeoip and reading vendor/pragmarx/support/src/GeoIp/Updater.php, especially md5Match() and the call at line 59. Trace how the database and MD5 file paths are configured, then verify that the GeoIP database downloads and imports successfully without the empty-filename error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- laravel, php
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100