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

Documentation for manual GeoIP updates needs more info #15638

Closed
rick-pri opened this issue Feb 28, 2020 · 6 comments
Closed

Documentation for manual GeoIP updates needs more info #15638

rick-pri opened this issue Feb 28, 2020 · 6 comments
Labels
c: Documentation For issues related to in-app product help messages, or to the Matomo knowledge base. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.

Comments

@rick-pri
Copy link

From the documentation on this page:

If you are installing the databases manually, then once you get the database you want to use copy it to Matomo’s path/to/matomo/misc/ subdirectory.

But it doesn't tell you what filename to extract it out as. I tried to read the php but the code is highly obfuscated making it impossible for me to determine what is an acceptable DB name. Extacting the file from the gz gives today, for example, dbip-city-lite-2020-02.mmdb.

@sgiehl
Copy link
Member

sgiehl commented Feb 28, 2020

Ok. Actually it would be expected to have those files working directly.
Will have a quick look why that doesn't work and if we can fix that at least for Matomo 4.
Till then try renaming to DBIP-City.mmdb

@rick-pri
Copy link
Author

rick-pri commented Feb 28, 2020

Hmmm. Okay, I think that this was because I didn't have the GeoIP2 plugin enabled. On activating this it found the file, but the legacy pear plugin didn't see it (because it's an mmdb file now rather than the .dat file that I was replacing?)

edit: Actually, you're right, it has to be a specific name, even with the GeoIP2 plugin activate. This should certainly be in the docs if it's not just going to load any mmdb file from the directory.

@rick-pri
Copy link
Author

rick-pri commented Feb 28, 2020

On the subject of activating plugins via the UI.


I would have thought that the Plugins and PluginsInstalled would be better placed in the DB or something. I'm configuring matomo with puppet and because our production infrastructure is a load balanced trio of servers, and a separate DB, these interface changes get wiped out by puppet because the file has changed. Matomo have made some concessions to this with the multi_server_environment and enable_general_settings_admin settings in the config file but I think that you need to think you need to go back to the drawing board on this.

Here's an example of what changes in the config file after a puppet run after activating GeoIP2 via the UI:

Notice: /Stage[main]/Profiles::Matomo::Prerequisites/File[config.ini.php]/content: 
--- /usr/local/www/matomo/config/config.ini.php 2020-02-28 14:55:47.165356000 +0000
+++ /tmp/puppet-file20200228-70086-1s4ero4      2020-02-28 15:44:12.727449000 +0000
@@ -8,6 +8,9 @@
 tables_prefix = "matomo_"
 adapter = "MYSQLI"
 
+[Tracker]
+record_statistics = 1
+
 [log]
 log_writers[] = "file"
 
@@ -15,15 +18,20 @@
 disable_merged_assets = 1
 
 [General]
-force_ssl = 1
-multi_server_environment = 1
+maintenance_mode = 0
 enable_trusted_host_check = 0
-enable_general_settings_admin = 0
 proxy_client_headers[] = "HTTP_X_FORWARDED_FOR"
 proxy_host_headers[] = "HTTP_X_FORWARDED_HOST"
 trusted_hosts[] = "piwik.domain.com"
 salt = ""
+force_ssl = 1
+enable_load_data_infile = 1
+session_save_handler = dbtable
+; These settings prevent inconsistent configuration from happening across servers
+multi_server_environment = 1
+enable_general_settings_admin = 0
 
+
 [Plugins]
 Plugins[] = "CorePluginsAdmin"
 Plugins[] = "CoreAdminHome"
@@ -34,6 +42,7 @@
 Plugins[] = "CoreVisualizations"
 Plugins[] = "Proxy"
 Plugins[] = "API"
+Plugins[] = "ExamplePlugin"
 Plugins[] = "Widgetize"
 Plugins[] = "Transitions"
 Plugins[] = "LanguagesManager"
@@ -48,11 +57,11 @@
 Plugins[] = "SEO"
 Plugins[] = "Events"
 Plugins[] = "UserCountry"
-Plugins[] = "GeoIp2"
 Plugins[] = "VisitsSummary"
 Plugins[] = "VisitFrequency"
 Plugins[] = "VisitTime"
 Plugins[] = "VisitorInterest"
+Plugins[] = "ExampleAPI"
 Plugins[] = "RssWidget"
 Plugins[] = "Feedback"
 Plugins[] = "Monolog"
@@ -85,9 +94,8 @@
 Plugins[] = "UserId"
 Plugins[] = "CustomPiwikJs"
 Plugins[] = "DBStats"
-Plugins[] = "ExamplePlugin"
-Plugins[] = "ExampleAPI"
 Plugins[] = "QueuedTracking"
+Plugins[] = "GeoIp2"
 
 [PluginsInstalled]
 PluginsInstalled[] = "Login"

@tsteur
Copy link
Member

tsteur commented Feb 29, 2020

@rick-pri glad it works now if I understand your comment directly. Re plugins in DB we have an issue here: #6063

Can we close this issue or is there anything left?

@rick-pri
Copy link
Author

rick-pri commented Mar 3, 2020

Hi @tsteur I think that the documentation needs updating to let us know what to name the files. It seems that not just any .mmdb will work, it has to have a specific name. I just extracted mine to be DBIP-City.mmdb which just works, but I wouldn't have known this without the reply from @sgiehl

edit: Although I might have got this working if I had known about the GeoIP2 plugin earlier as I did find references in the code to this and some other names

@Findus23
Copy link
Member

I updated the FAQ entry to be more explicit and the rest should be already in #6063, so we can close this.

@Findus23 Findus23 added the c: Documentation For issues related to in-app product help messages, or to the Matomo knowledge base. label Apr 20, 2020
@mattab mattab added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Apr 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Documentation For issues related to in-app product help messages, or to the Matomo knowledge base. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

No branches or pull requests

5 participants