mattermost / mattermost-docker

Deprecated
Apache License 2.0
964 stars 575 forks source link

Support in-database configuration #536

Closed paddatrapper closed 3 years ago

paddatrapper commented 3 years ago

Summary

Adds a flag to support in-database configuration through the CONFIG_USE_DB environment variable. If this is true, the configuration file will not be created if it does not exist. It supports using the custom MM_SQLSETTINGS_DATASOURCE if that exists.

On new deployments with CONFIG_USE_DB enabled, none of the defaults written into the configuration file are created. Further, it assumes existing installations migrate their configuration over before enabling CONFIG_USE_DB as described in the documentation

mattermod commented 3 years ago

Hello @paddatrapper,

Thanks for your pull request! A Core Committer will review your pull request soon. For code contributions, you can learn more about the review process here.

mattermod commented 3 years ago

This PR has been automatically labelled "stale" because it hasn't had recent activity. A core team member will check in on the status of the PR to help with questions. Thank you for your contribution!

/cc @jasonblais @jfrerich @emilyacook

paddatrapper commented 3 years ago

Any update here?

jasonblais commented 3 years ago

@paddatrapper Sorry for missing your contribution until now, appreciate your thoughtfulness here.

We are in fact making some changes to the Mattermost Docker repository, and moving to a new project available at https://github.com/mattermost/docker. You can find additional context behind this move here: https://github.com/mattermost/mattermost-docker/issues/548

With that said, would you be open to contributing your changes to the new repository at mattermost/docker instead, and we can have your changes reviewed?

Sorry for additional work for you. Alternatively we can also open an issue in mattermost/docker to have your changes here migrated to the new repository.

paddatrapper commented 3 years ago

There is no entrypoint or docker image builds in https://github.com/mattermost/docker... So this patch will not fit there. It isn't clear where those images are built from. According to Docker Hub, it is here, but that has none of the config creation logic, so it appears that the new images do not create any config?

mrckndt commented 3 years ago

@paddatrapper the Mattermost binary itself creates a configuration or reads in an existing one. In fact the https://github.com/mattermost/docker setup supports configuration in database. Just export MM_CONFIG=${MM_SQLSETTINGS_DATASOURCE} in the enviromnent variables. There is no need to override the entrypoint.

paddatrapper commented 3 years ago

@mrckndt so the new images do not require this patch?

mrckndt commented 3 years ago

No, and this wasn't needed here too. It should have work by exporting MM_CONFIG with the datasource too.

paddatrapper commented 3 years ago

No, and this wasn't needed here too. It should have work by exporting MM_CONFIG with the datasource too.

From experience, it did not work here. That attempted to create the config file the datasource as the filepath, inevitably failing