diff --git a/README.md b/README.md index a58bb46..ef9582d 100644 --- a/README.md +++ b/README.md @@ -25,11 +25,13 @@ 6. Open the configured domain in your browser to finish set-up ## Enable Email +**WARNING: Following these steps will overwrite the configuration of your Mattermost instance. Probably only run it on a fresh deployment.** - `abra app config YOURAPPNAME` - Uncomment the section starting with **Email Support** - `abra app secret i chat.justiceexchange.org smtp_pass v1 'yourSMTPpassword'` - `abra app undeploy YOURAPPNAME` - `abra app deploy YOURAPPNAME` +- `abra app command -C YOURAPPNAME app reset_config` <- This will overwrite your configuration ## Enable SSO with Authentik This is how to configure your Mattermost server to accept logins from your Authentik SSO provider. @@ -63,13 +65,14 @@ This is how to configure your Mattermost server to accept logins from your Authe - **Submit** ### Configure Mattermost -**WARNING: Following these steps will overwrite the configuration of your Mattermost instance** +**WARNING: Following these steps will overwrite the configuration of your Mattermost instance. Probably only run it on a fresh deployment.** - `abra app configure YOURAPPNAME` - Uncomment the section starting with `## SSO config` - Set `SSO_ID` to the value you saved when configuring Authentik - `abra app secret insert YOURAPPNAME mattermost_sso_secret v1 ` - `abra app undeploy YOURAPPNAME` - `abra app deploy YOURAPPNAME` +- `abra app command -C YOURAPPNAME app reset_config` <- This will overwrite your configuration ### Disable non-SSO login (Optional) - Ensure that your SSO user has the **System Admin** role: https://YOURAPPNAME/admin_console/user_management/users diff --git a/abra.sh b/abra.sh index 08804b6..4e0136a 100644 --- a/abra.sh +++ b/abra.sh @@ -1,2 +1,7 @@ export ENTRYPOINT_VERSION=v1 -export MATTERMOST_CONFIG_VERSION=v1 \ No newline at end of file +export MATTERMOST_CONFIG_VERSION=v1 + +reset_config() { + cp /config-to-copy.json /mattermost/config/config.json && touch /mattermost/config/CoopCloudManaged + kill 8 +} \ No newline at end of file diff --git a/compose.email.yml b/compose.email.yml index bbd6c65..145099f 100644 --- a/compose.email.yml +++ b/compose.email.yml @@ -2,10 +2,19 @@ version: "3.8" services: app: + configs: + - source: mattermost_config + target: /config-to-copy.json secrets: - smtp_pass secrets: smtp_pass: external: true - name: ${STACK_NAME}_smtp_pass_${SECRET_SMTP_PASS_VERSION} \ No newline at end of file + name: ${STACK_NAME}_smtp_pass_${SECRET_SMTP_PASS_VERSION} + +configs: + mattermost_config: + name: ${STACK_NAME}_mattermost_config_${MATTERMOST_CONFIG_VERSION} + file: ./config.json.tmpl + template_driver: golang \ No newline at end of file