[OzzModz] Country Flags by IP Address

[OzzModz] Country Flags by IP Address 2.2.1 Patch Level 3

No permission to download
Beyond your control?
They didn't close the site, they just switched the methods of delivering the database.

1577820848039.png

So, all what we need to do is to create an account, get a license key and put that key into the addon.
You have to provide a way for us to be able to insert a key, and then the mechanism connects through their update program.
Not sure what the significant change here is? You need to switch the accessing to the database, but the addon would work just like before. So it doesn't need a re-write.
 
No, that is not all there is to it. A key would be required during setup and I don't think you can prompt for an input during setup.

Sure rewriting it so users get their own key would conceivably work for existing users, but no new installs could occur.

Anyway, for now I stand by my decision to not update the addon.
 
Why would a key be needed during the setup? Just let the addon install just like normal and until we provide a key, the flags don't show up.

Why is it significantly important that the key must be provided during the installation?

And even then, so be it, warn the people to acquire a key before they run the setup and done?

It is really frustrating that you block any kind of suggestions.
 
Because it needs to download from their website.

It's frustrating that you think it is a simple fix to get the addon in a usable state again.

This was not a decision I came to lightly not is it something I care to do. But it is what it is.
 
I kind of have to LoL out here, because there are other solutions available for IP-based location checking. Not to mention other add-ons that do pretty much the same darn thing.

One example: @AndyB's add-on that uses the solution from IPstack that limits registrations from admin-specified countries, based on IP of the registrant. As mentioned, the user just obtains a free access key and enters it up front.


It would be a simple matter to change over to this IP geolocation provider "IPStack" from the old "CrapMind" that the @Snog add-on uses.

Or better yet, perhaps @AndyB can tweak his existing add-on, into one that displays flags.

Problem solved.
 
Can't the download from the website be done at a later point? Why does it need to be done during the addon installation? It should be possible to trigger the download after the addon installation after we provided a key. And no key, no download.

Anyway, I am not saying that it is a simple fix, I just find it very frustrating that you take this decision very lightly, on the contrary what you say. The report that the addon does not work came today, and according to MaxMind they switched their methods since yesterday, and you published your decision an hour ago. How is this not taken very lightly? You didn't even try and decided to close the addon. I think I am using this addon since 2013 if I am not mistaken. Snog always found a workaround for the MaxMind database issues and never quit the addon. For all I care make the addon a paid addon if you want to make some bucks out of it, but don't abandon it just like that, please.
 
I may look at it at some time, but I have no intention of doing anything soon. At this time I have nothing further to add to this.
 
Probably best to stick a fork in this add-on, from what I'm seeing. I'm going to disable it, as @ozzy47 recommends.

I know that someone is going to throw out there that IPStack's "free" plan limits to 10,000 (actually 12,000) API calls monthly, which may only suffice for smaller forums with fewer API calls.

However, @AndyB implemented a lookup table in the latest version of his IP-based registration ban add-on as a workaround, so that repeated API calls are not needed. Seems this could be easy to do if he wanted to tweak this add-on into a "Flag" add-on....
 
So for those folks who have the add-on installed ... will it stop working after today?

What is your official recommended course of action -- disable or remove the add-on?

I would simply disable the update feature for MaxMinds.

Even the outdated, already downloaded GeoIP2 database will be sufficient for years of further use.
 
For those interested:

The update of the MaxMind database is controlled by a cron, “ Update MaxMind GeoIP database file”

Disabling that should ensure the addon continues to work as is in its current state.
 
I would simply disable the update feature for MaxMinds.

Even the outdated, already downloaded GeoIP2 database will be sufficient for years of further use.

... although technically, this is a breach of Maxmind's license agreement - they specify that old database files should be purged no more than 30 days after a new database is released.
 
Interesting, but I would hope they are not going to be going around and enforcing that.

That requirement would be largely due to two factors:
  1. IP address location data can go stale fairly quickly as ranges are moved around or sold to other providers
  2. the new "Do Not Sell" requirements of CCPA would require them to remove some data from their database (possibly GDPR as well) - so they need to be able to push out updates in a timely manner to remain compliant with the law
I'm sure they don't have the resources to chase up every site that uses their data.

If they are aware of people using old versions of databases, they would likely send a "cease and desist" letter as part of their own legal obligations, but practically, they are unlikely to be able to identify every user given it was a completely free download until the other day.

"Destructions of GeoLite2 Database and GeoLite2 Data. From time to time, MaxMind will release an updated version of the GeoLite2 Databases, and you agree to promptly use the updated version of the GeoLite2 Databases. You shall cease use of and destroy (i) any old versions of the Services within thirty (30) days following the release of the updated GeoLite2 Databases; and (ii) all Services immediately upon termination of the license under this Agreement. Upon request, you shall provide MaxMind with written confirmation of such destruction."​
 
Perhaps with what you come up with for your addon can help me update this and my other addon to the new system.

Hardest part I see is when installing a new instance of the addon.
 
  • Like
Reactions: Sim
@ozzy47 & @Sim

Since this add-on is an integral part of one of my sites, I'm going to give you what I feel is a good kick start for the problem at hand. This is what will be required to extract the tar.gz file. I've given both an example using PHAR and the shell_exec method (commented out)..

Code:
if(file_exists($tempPath))
{
    // IMPORTANT: XENFORO UNREGISTERS THE STREAM WRAPPER
    stream_wrapper_restore('phar');

    $dataDir = FILE::canonicalizePath(\XF::app()->config('externalDataPath'));
    $destDir = $dataDir . DIRECTORY_SEPARATOR . 'countryflags';
    $finalPath = 'data://countryflags/GeoLite2-Country.mmdb';

    $archive = new \PharData($tempPath);
    $archive->decompressFiles();

    // GET REAL NAME OF DIRECTORY IN tar FILE
    foreach ($archive as $file)
    {
        $dataFolderName = $file->getFileName();
        break;
    }

    $archive->extractTo($destDir);

    $newArchiveDir =  $destDir . DIRECTORY_SEPARATOR . $dataFolderName;
    $dataFile =  $newArchiveDir . DIRECTORY_SEPARATOR . 'GeoLite2-Country.mmdb';

    FILE::copyFileToAbstractedPath($dataFile, $finalPath);
    FILE::deleteDirectory($newArchiveDir);
    unlink($tempPath);

    //shell_exec("cd {$destDir}; tar zxvf {$tempPath} --strip-components=1 --wildcards --no-anchored '*.mmdb';");
    //unlink($tempPath);
}
What you do with that is up to you. And if you have a better way to do it, feel free. Both methods are tested and work.
 
Last edited:
Since this add-on is an integral part of one of my sites, I'm going to give you what I feel is a good kick start for the problem at hand. This is what will be required to extract the tar.gz file. I've given both an example using PHAR and the shell_exec method (commented out)..

Extracting the Phar file was never the issue - current version of the addons would have had to do that anyway.

What is new is that you can no longer simply download the database from Maxmind - you need to register an account provide a license key key in the URL to download it.

I've been working on an update to my Geoblocking addon which includes support for the new database download mechanism. Once it's posted, I'll point people to the class I created that you might want to use for database downloads.
 
Currently -as per info from MaxMind support- it looks like you can use a common key (created by yourself) and include it in your code to have your customers download the databases.

So all you need to update this add-on is to include the download key and change the download url in your script. Can be done very easily.
No need to delete this resource.
 
Top Bottom