Skip to content
This repository has been archived by the owner on May 20, 2022. It is now read-only.

Support in-database configuration #536

Closed

Conversation

paddatrapper
Copy link
Contributor

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
Copy link
Contributor

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.

@hanzei hanzei added the 2: Dev Review Requires review by a core committer label Jun 1, 2021
@hanzei hanzei requested review from cpanato and metanerd and removed request for stylianosrigas June 1, 2021 09:45
@mattermod
Copy link
Contributor

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
Copy link
Contributor Author

Any update here?

@metanerd metanerd removed their request for review September 9, 2021 18:25
@jasonblais
Copy link
Contributor

jasonblais commented Sep 9, 2021

@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: #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
Copy link
Contributor Author

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
Copy link
Member

mrckndt commented Sep 10, 2021

@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
Copy link
Contributor Author

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

@mrckndt
Copy link
Member

mrckndt commented Sep 10, 2021

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

@paddatrapper
Copy link
Contributor Author

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

@paddatrapper paddatrapper deleted the feature/config-in-db branch September 10, 2021 09:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
2: Dev Review Requires review by a core committer Lifecycle/1:stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants