Open trickert76 opened 3 years ago
When I explictly set DEFAULT_MYSQL_PASS
inside the .env file, it works.
I'm not sure, if this is recommended. The /opt/run script is reading the value from that envvar or generates a new one. But the run script never reads the already defined value from inside the container.
Hi @trickert76
Yes, this is the expected behaviour. It won't try to read the password from the config files generated in a prior run, but will try to replace it if DEFAULT_MYSQL_PASS is not set 😃
Am I wrong, or should this be documented? Otherwise nobody could restart the container.
Hi @trickert76
Yes, I'll make sure to do that 👍
I see you documented this in the README but I had to come find this thread to figure out what to do.
I created my secrets_sql.env file and initially put in: MYSQL_ROOT_PASSWORD=myfancyrootpw
I saw your note about setting DEFAULT_MYSQL_PASS, so after the initial startup I added to the secrets_sql.env DEFAULT_MYSQL_PASS=myfancyrootpw
But it would not come up. I has to go find the generated password in conf/icinga/etc/icingaweb2/resources.ini
Then I put that generated password into the secrets_sql.env file as DEFAULT_MYSQL_PASS and it works on restart.
I think you need to make the procedure clearer in the README.
Hey @jasongordon thanks for the update, do you have any suggestions on the wording that might make it easier?
Hey @jasongordon thanks for the update, do you have any suggestions on the wording that might make it easier?
I am not even sure I did the right thing. I would suggest explain the difference between the MYSQL_ROOT_PASSWORD and DEFAULT_MYSQL_PASS variables and where to get the value for each. Now that I took the password I found in conf/icinga/etc/icingaweb2/resources.ini and put it in the config as DEFAULT_MYSQL_PASS, does what I have for MYSQL_ROOT_PASSWORD even matter anymore?
@jasongordon that's right, DEFAULT_MYSQL_PASS is the database password for the icinga user and MYSQL_ROOT_PASSWORD is the database admin user password. By setting MYSQL_ROOT_PASSWORD the container run scripts will attempt to reset the icinga user database password if possible.
Hi, first thanks for this image!
Since some days I have a problem with it inside a docker-compose environment. The environment is:
(I removed all irrelevant parts). The environment file contains:
After the first start (I removed
data/mysql
) I'm getting a running service - but, when I restart the service, I'm getting a:This is strange, because the password for the icinga2 mysql user, which is stored in
conf/icinga/etc/icingaweb2/resources.ini
and inconf/icinga/etc/icinga2/features-enabled/ido-mysql.conf
can be used to log into the mysql container.:Also, when I look into mysql.user, I can see it, and the user is configured as icinga2@%
When I remove the database again, the service runs - so, it works only, when the initialize script generates a new secret during that run.
It seems to me, that the second run doesn't know about the "old" password.