juanluisbaptiste / docker-otrs

The unofficial Znuny/OTRS Ticketing System docker image
https://www.juanbaptiste.tech/category/otrs
GNU Lesser General Public License v3.0
173 stars 101 forks source link

Add parameter to disable mysqladmin ping #55

Closed d307473 closed 5 years ago

d307473 commented 5 years ago

This PR adds a new parameter OTRS_CHECK_DATABASE=yes|no which allows for mysqladmin ping to be disabled. Currently it's not possible to use the container with already existing OTRS databases.

juanluisbaptiste commented 5 years ago

Hi,

Can you explain your self better ? I have successfully connected to existing OTRS databases, both in outside servers or running containers with no issue.

The point of mysqlping is just to monitor the database until it is available, so the OTRS container can connect to it and continue setting up/strting everything. If you are connecting to an already existing database then mysqlping will return true, the OTRS container setup will continue.

d307473 commented 5 years ago

Hi @juanluisbaptiste, sure. In our case we cannot provide the container with our MYSQL_ROOT_PASSWORD, therefore we would like allow for skipping mysqlping optionally. The second problem as mentioned in #34 is related to the Sendmail:: params which are currently statically set in Config.pm. Due to OTRS's inheritance model, all settings set in Config.pm are persistent and have priority over the other settings from OTRS sysconfig (database). As a result, currently it's not possible to use other Sendmail settings (other Sendmail::Method, SMTP Server, Port, etc.) within OTRS. Thanks

juanluisbaptiste commented 5 years ago

Hi @juanluisbaptiste, sure. In our case we cannot provide the container with our MYSQL_ROOT_PASSWORD, therefore we would like allow for skipping mysqlping optionally.

The problem doing this is that the container will not be able to know when the database is available and will try to setup the container regardless. Could you explain why you cannot provide MYSQL_ROOT_PASSWORD ? I'm not going to add a feature that I don't understand its purpose.

The second problem as mentioned in #34 is related to the Sendmail:: params which are currently statically set in Config.pm. Due to OTRS's inheritance model, all settings set in Config.pm are persistent and have priority over the other settings from OTRS sysconfig (database). As a result, currently it's not possible to use other Sendmail settings (other Sendmail::Method, SMTP Server, Port, etc.) within OTRS. Thanks

Please keep the conversation about this on its own issue, and as I said over there, PR's are welcome.

juanluisbaptiste commented 5 years ago

Any comments ? or may I proceed to close this issue ?

hos-ftv commented 5 years ago

I provided a new pull request #62 which should address the issue @schadom stated. But except of handling the symptom I tried to fix the cause.

juanluisbaptiste commented 5 years ago

Please don't continue to mix both issues, this one is about disabling mysqlping, pull request #62 is about SendmailModule configuration.

d307473 commented 5 years ago

Any comments ? or may I proceed to close this issue ?

Sure. Let me explain a bit more in detail. We are running a mariadb galera-cluster for all our production databases including the otrs db. The otrs app container is running on our docker hosts. We would like to use our existing, external otrs database but do not want to expose the database clusters root user to the container. Currently this does not work because the container requires mysql root for mysqlping, otherwise the otrs container won't start ([INFO] Database server is not available. Waiting 2 seconds...).

With this PR and the newly introduced parameter OTRS_CHECK_DATABASE=no, mysqlping can optionally be disabled (default is yes). Does this make sense?

juanluisbaptiste commented 5 years ago

Well, for this you could just set _MYSQL_ROOTUSER to whatever non-root user you want that also has create database privileges.

hos-ftv commented 5 years ago

do not want to expose the database clusters root user to the container

This is where docker secrets come into place. Support for it got implemented some weeks ago.

Manage sensitive data with Docker secrets

juanluisbaptiste commented 5 years ago

I know what docker secrets are, but that has more to do with where your container secrets are stored rather than how those secrets are sent to the db server.

I think you can as I said use _MYSQL_ROOTUSER to setup a non-root user that can create the otrs database when the container starts, there's no need to disable the db container ping.