the HTML generated by the excellent Piwik email report generator contains References to the Piwik installation (e.g. some Icons and a Link to the Piwik installation).
On our HTTPS-Only accessible Piwik installation these URLs cannot be resolved because the URLs use the IP address of the Piwik instance instead of a valid hostname and the SSL certificate is only valid for the Hostname.
Should be resolvable easily because you have to configure the "Trusted Piwik Hostname" anyways in the Settings section (also for security reasons). I suppose the Path part of the Links is handled somehow (can't test that because my piwik is running in the root folder).
Keywords: email HTML
@nkuehn thanks for report. What is the content of your config.ini.php | grep trusted_host ?
Is the hostname in the trusted_hosts?
Maybe the IP address is first in the list of trusted_hosts ?
sure, could have included that in the first place. Heres's the setup:
less config.ini.php | grep trusted_hosts->
trusted_hosts = "piwik.excentos.com"(entered via conf settings page)
what looks bogus to me is the fact that the
trusted_hosts value is not an array. But: it works (I don't get the "untrusted hostname" warning when logging in to the piwik interface)
Can you run SQL query and what is the result?
SELECT * FROM piwik_option WHERE option_name = 'piwikUrl';
mysql> SELECT * FROM piwik_option WHERE option_name = 'piwikUrl'; +-------------+---------------------+----------+ | option_name | option_value | autoload | +-------------+---------------------+----------+ | piwikUrl | https://188.8.131.52/ | 1 | +-------------+---------------------+----------+ 1 row in set (0.01 sec) mysql>
I tried a search for "piwikUrl" in the github codebase, but couldn't see where the value is written into the database. I can imagine that the value is written at installation time (install wizard), but I installed this piwik installation directly on the real domain. (can't access it via IP adress because it's a name based server in nginx).
argh, it gets even weirder: today in the early morning I received two "weekly" reports for the same website:
The piwikUrl in the database is still the IP address.
Any ideas where to start researching?
let's investigate this issue as part of the broader set of bugs in #6880 -> our goal will be to make Piwik work perfectly in this special use case which many users have reported issues with.
Hi @nkuehn - do you still experience this issue in Piwik 3.1.0 ?
Hi @mattab I am working in a different company for a while already and don't have an up to date setup available any more (and have no status and access to the one that we experienced this issue in). Sorry to say I can't help you out at the moment (don't have the spare private time any more too unfortunately).
If nobody else has come up with the issue since 2014 I personally would consider it irrelevant no matter if fixed or not.
But in any case I can recommend to test solely via an SSL-terminating reverse proxy and do not give the test runner direct access to the PHP IP / Host at all.
@mattab Are you forwarding from NGINX using
I ask because we had this issue when I used
proxy_pass http://localhost:someport but identifying the virtual host
proxy_pass http://somepiwik.somedomain.tld:someport fixed the HTML email reports.
@krispii that could well be the reason but is a weird setup - you "hide" behind a reverse proxy to not make the internal URL / IP / Hostname accessible to the outside - proxying to the public external hostname is not the point of a proxy - you want to decouple internal deployment from external URL.