@tsteur opened this Issue on January 18th 2016 Member

Eg when installing Piwik via mydomain:8000, Piwik will probably save trusted_hosts[] = mydomain:8000. As soon as the installation is finished, Piwik will not allow you to log in as the URL does not match. Piwik recommends to set trusted_hosts[] = mydomain in the UI.

I'm not sure what exactly the error is. Either Piwik saves trusted_hosts[] = mydomain:8000 and requires trusted_hosts[] = mydomain or it is the other way around. Or the check whether a host matches doesn't correctly check for the port.

@mattab commented on March 31st 2016 Member

If you install Piwik via mydomain:8000 and then try to open Piwik via mydomain (without port, or with a different port), it is expected that Piwik will ask you to add mydomain to trusted_host (The trusted host must include the same hostname and port.). Did you think this was a bug, or is there really a bug?

@larsnystrom commented on December 12th 2017

I think the description of this ticket is backwards. The problem is that if you install piwik on mydomain:8000 the installation script adds trusted_hosts[]="mydomain" to config/config.ini.php. So when you try to visit piwik at mydomain:8000 piwik will complain loudly, until you manually edit config/config.ini.php to include mydomain:8000 as a trusted host.

So from what I can see, the problem is that the installation script only adds the domain, and not the port, to the trusted_hosts array in the configuration. (Which is also the title of this ticket, i.e "When installing Piwik, the port is not correctly saved for trusted_hosts")

@J0WI commented on January 21st 2019

This can easily be reproduced using Docker:

  1. setup a database container named some-mysql
  2. docker run --rm -p --link some-mysql:mysql matomo
  3. follow the install wizard steps
  4. you can't login on localhost:8080 because Matomo used trusted_hosts[] = "localhost"
@fhaase2 commented on February 28th 2020

Is there any new information here?

@billyjacoby commented on May 3rd 2020

Has anyone found a solution for this with using Docker?

@iam777 commented on September 30th 2020

Same issue here, I have been searching everywhere and no clue. I don't want to manually change the config file and then restart the service. I want to do it from docker-compose.

@epicfaace commented on October 3rd 2020
@izgzhen commented on December 8th 2020

quick hack: if you mount the volume like matomo:/var/www/html, you can probably modify /var/lib/docker/volumes/matomo/_data/config/config.ini.php directly and restarted the container.

Powered by GitHub Issue Mirror