@james-callahan opened this Issue on September 10th 2020

As far as I can tell, an installation of matomo should have the same salt forever (and across multiple running instances). Please correct me if wrong.

If so, it seems odd that the salt is not configurable via environment variable (#13676). Could this feature be added? e.g. MATOMO_SALT.

@tsteur commented on September 10th 2020 Member

Hi @james-callahan this should be possible using https://plugins.matomo.org/EnvironmentVariables Let me know if that doesn't work.

@james-callahan commented on September 10th 2020

Let me know if that doesn't work.

It didn't work: when using MATOMO_GENERAL_SALT it generated a new salt.

@tsteur commented on September 10th 2020 Member

@james-callahan I suppose the server is restarted and everything? How did you check the value was not used? Cause the config file itself might still show the old value but the value is actually applied

@james-callahan commented on September 10th 2020

@james-callahan I suppose the server is restarted and everything? How did you check the value was not used? Cause the config file itself might still show the old value but the value is actually applied

Yes I'm running inside of docker: I killed the container and recreated it (allowing matomo to generate a new config.php.ini)
Once it started I cat'd the file and saw the salt was not equal to the one in my env var.

@james-callahan commented on September 10th 2020

@tsteur how can I check what matomo is using as the current salt?

@tsteur commented on September 10th 2020 Member

That's a great question @james-callahan . Because the salt is anonymised in our diagnostics config screen in our Admin section for security reasons it's actually not that easy. Created for now https://github.com/matomo-org/plugin-EnvironmentVariables/issues/8
image

The only thing I could think of right now would be to trigger an action that would force the update of the config file in which case the salt from the environment variable would be written to disc.

  • You could log in as a super user
  • Go to admin section (cog icon in top right)
  • Go to "General settings"
  • In the section "Trusted Matomo Hostname" temporarily add a new hostname
  • Click save
  • Check if the salt was updated.

I haven't tested this but thinking this procedure should work. Let me know.

image

@james-callahan commented on September 11th 2020
  • In the section "Trusted Matomo Hostname" temporarily add a new hostname

  • Click save

  • Check if the salt was updated.

Yep that seems to have worked; thanks!
Should there be an easier way to check this?

@tsteur commented on September 11th 2020 Member

Yes definitely. there should be an easier way. That's why I created https://github.com/matomo-org/plugin-EnvironmentVariables/issues/8 so it hopefully will help with this in the future.

This Issue was closed on September 10th 2020
Powered by GitHub Issue Mirror