Compare commits
3 Commits
backups
...
backup-tro
Author | SHA1 | Date | |
---|---|---|---|
80d21a411b | |||
6485852ae0 | |||
5f6b845212 |
@ -33,7 +33,4 @@ ORG_NAME="My Organization"
|
|||||||
#SSO_DOMAIN=accounts.example.com
|
#SSO_DOMAIN=accounts.example.com
|
||||||
#SSO_APP=mattermost
|
#SSO_APP=mattermost
|
||||||
#SSO_ID=
|
#SSO_ID=
|
||||||
#SECRET_MATTERMOST_SSO_SECRET_VERSION=v1
|
#SECRET_MATTERMOST_SSO_SECRET_VERSION=v1
|
||||||
|
|
||||||
## Enable enterprise version (requires a valid license)
|
|
||||||
#COMPOSE_FILE="$COMPOSE_FILE:compose.license.yml"
|
|
@ -79,13 +79,6 @@ This is how to configure your Mattermost server to accept logins from your Authe
|
|||||||
- Go to https://YOURAPPNAME/admin_console/authentication/email
|
- Go to https://YOURAPPNAME/admin_console/authentication/email
|
||||||
- Set **Enable sign-in with email** and **Enable sign-in with username** to `false`
|
- Set **Enable sign-in with email** and **Enable sign-in with username** to `false`
|
||||||
|
|
||||||
## Use a Mattermost Enterprise License
|
|
||||||
**NOTE: This deploys non-FOSS code and requires you to pay Mattermost for a license to enable features. Not recommended unless you know what you're doing.**
|
|
||||||
- `abra app config YOURAPPNAME`
|
|
||||||
- Uncomment the section which starts with `## Enable enterprise version`
|
|
||||||
- `abra app undeploy YOURAPPNAME`
|
|
||||||
- `abra app deploy YOURAPPNAME`
|
|
||||||
|
|
||||||
|
|
||||||
[`abra`]: https://git.coopcloud.tech/coop-cloud/abra
|
[`abra`]: https://git.coopcloud.tech/coop-cloud/abra
|
||||||
[`coop-cloud/traefik`]: https://git.coopcloud.tech/coop-cloud/traefik
|
[`coop-cloud/traefik`]: https://git.coopcloud.tech/coop-cloud/traefik
|
||||||
|
2
abra.sh
2
abra.sh
@ -1,7 +1,5 @@
|
|||||||
export ENTRYPOINT_VERSION=v1
|
export ENTRYPOINT_VERSION=v1
|
||||||
export MATTERMOST_CONFIG_VERSION=v1
|
export MATTERMOST_CONFIG_VERSION=v1
|
||||||
export BACKUP_MATTERMOST_VERSION=v1
|
|
||||||
export BACKUP_POSTGRES_VERSION=v1
|
|
||||||
|
|
||||||
reset_config() {
|
reset_config() {
|
||||||
cp /config-to-copy.json /mattermost/config/config.json && touch /mattermost/config/CoopCloudManaged
|
cp /config-to-copy.json /mattermost/config/config.json && touch /mattermost/config/CoopCloudManaged
|
||||||
|
@ -8,14 +8,9 @@ fi
|
|||||||
|
|
||||||
if [ "$1" == "pre-restore" ]; then
|
if [ "$1" == "pre-restore" ]; then
|
||||||
# kill the running plugins that need to be overwritten
|
# kill the running plugins that need to be overwritten
|
||||||
pkill -f '.*plugins'
|
pkill plugins
|
||||||
sleep 40
|
|
||||||
pkill -f '.*plugins'
|
|
||||||
sleep 40
|
|
||||||
pkill -f '.*plugins'
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$1" == "post-restore" ]; then
|
if [ "$1" == "post-restore" ]; then
|
||||||
# kill mattermost so that the container restarts
|
mmctl config reload --local
|
||||||
pkill -f mattermost
|
|
||||||
fi
|
fi
|
@ -1,12 +1,8 @@
|
|||||||
if [ "$1" == "pre-backup" ]; then
|
if [ "$1" == "pre-backup" ]; then
|
||||||
# Remove any existing db dump and then create a new one
|
|
||||||
rm -rf /var/lib/postgresql/data/postgres-backup
|
|
||||||
PGPASSWORD=$(cat ${POSTGRES_PASSWORD_FILE}) pg_dump -U ${POSTGRES_USER} ${POSTGRES_DB} --format=directory -f /var/lib/postgresql/data/postgres-backup
|
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$1" == "post-backup" ]; then
|
if [ "$1" == "post-backup" ]; then
|
||||||
rm -rf /var/lib/postgresql/data/postgres-backup
|
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
version: "3.8"
|
|
||||||
|
|
||||||
services:
|
|
||||||
app:
|
|
||||||
image: mattermost/mattermost-enterprise-edition:10.5.0
|
|
33
compose.yml
33
compose.yml
@ -28,22 +28,16 @@ services:
|
|||||||
- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirect"
|
- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirect"
|
||||||
- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLForceHost=true"
|
- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLForceHost=true"
|
||||||
- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}"
|
- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}"
|
||||||
- "coop-cloud.${STACK_NAME}.version=2.1.0+10.5.0"
|
- "coop-cloud.${STACK_NAME}.version=1.5.3+9.11.8"
|
||||||
- "coop-cloud.${STACK_NAME}.timeout=${TIMEOUT:-120}"
|
- "coop-cloud.${STACK_NAME}.timeout=${TIMEOUT:-120}"
|
||||||
- "backupbot.backup=true"
|
- "backupbot.backup=true"
|
||||||
- "backupbot.backup.path=/mattermost,/etc/ssl"
|
- "backupbot.backup.path=/mattermost,/etc/ssl"
|
||||||
- "backupbot.restore.pre-hook=/backup.sh pre-restore"
|
- "backupbot.restore.pre-hook=/restore.sh pre"
|
||||||
- "backupbot.restore.post-hook=/backup.sh post-restore"
|
- "backupbot.restore.post-hook=/restore.sh post"
|
||||||
configs:
|
configs:
|
||||||
- source: abra_mattermost_entrypoint
|
- source: abra_mattermost_entrypoint
|
||||||
target: /abra-mattermost-entrypoint.sh
|
target: /abra-mattermost-entrypoint.sh
|
||||||
mode: 0555
|
mode: 0555
|
||||||
- source: backup-mattermost
|
|
||||||
target: /backup.sh
|
|
||||||
mode: 0777
|
|
||||||
- source: mattermost-config
|
|
||||||
target: /config-to-copy.json
|
|
||||||
mode: 0555
|
|
||||||
secrets:
|
secrets:
|
||||||
- postgres_password
|
- postgres_password
|
||||||
entrypoint: /abra-mattermost-entrypoint.sh
|
entrypoint: /abra-mattermost-entrypoint.sh
|
||||||
@ -57,10 +51,6 @@ services:
|
|||||||
- POSTGRES_USER=mattermost
|
- POSTGRES_USER=mattermost
|
||||||
- POSTGRES_PASSWORD_FILE=/run/secrets/postgres_password
|
- POSTGRES_PASSWORD_FILE=/run/secrets/postgres_password
|
||||||
- POSTGRES_DB=mattermost
|
- POSTGRES_DB=mattermost
|
||||||
configs:
|
|
||||||
- source: backup-postgres
|
|
||||||
target: /backup.sh
|
|
||||||
mode: 0777
|
|
||||||
secrets:
|
secrets:
|
||||||
- postgres_password
|
- postgres_password
|
||||||
networks:
|
networks:
|
||||||
@ -68,10 +58,10 @@ services:
|
|||||||
deploy:
|
deploy:
|
||||||
labels:
|
labels:
|
||||||
backupbot.backup: "true"
|
backupbot.backup: "true"
|
||||||
|
backupbot.backup.pre-hook: "PGPASSWORD=$$(cat $${POSTGRES_PASSWORD_FILE}) pg_dump -U $${POSTGRES_USER} $${POSTGRES_DB} --format=directory -f /var/lib/postgresql/data/postgres-backup"
|
||||||
|
backupbot.backup.post-hook: "rm -rf /var/lib/postgresql/data/postgres-backup"
|
||||||
backupbot.backup.path: "/var/lib/postgresql/data/"
|
backupbot.backup.path: "/var/lib/postgresql/data/"
|
||||||
backupbot.backup.pre-hook: "/backup.sh pre-backup"
|
backupbot.restore.post-hook: "/backup-postgres.sh post"
|
||||||
backupbot.backup.post-hook: "/backup.sh post-backup"
|
|
||||||
backupbot.restore.post-hook: "/backup.sh post-restore"
|
|
||||||
|
|
||||||
secrets:
|
secrets:
|
||||||
postgres_password:
|
postgres_password:
|
||||||
@ -82,16 +72,7 @@ configs:
|
|||||||
abra_mattermost_entrypoint:
|
abra_mattermost_entrypoint:
|
||||||
name: ${STACK_NAME}_entrypoint_${ENTRYPOINT_VERSION}
|
name: ${STACK_NAME}_entrypoint_${ENTRYPOINT_VERSION}
|
||||||
file: ./entrypoint.sh
|
file: ./entrypoint.sh
|
||||||
backup-mattermost:
|
|
||||||
name: ${STACK_NAME}_backup-mattermost_${BACKUP_MATTERMOST_VERSION}
|
|
||||||
file: ./backup-mattermost.sh
|
|
||||||
backup-postgres:
|
|
||||||
name: ${STACK_NAME}_backup-postgres_${BACKUP_POSTGRES_VERSION}
|
|
||||||
file: ./backup-postgres.sh
|
|
||||||
mattermost-config:
|
|
||||||
name: ${STACK_NAME}_mattermost_config_${MATTERMOST_CONFIG_VERSION}
|
|
||||||
file: ./config.json.tmpl
|
|
||||||
template_driver: golang
|
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
proxy:
|
proxy:
|
||||||
|
12
gitlab_config_patch.json.tmpl
Normal file
12
gitlab_config_patch.json.tmpl
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"Enable": true,
|
||||||
|
"Secret": "${MATTERMOST_SSO_SECRET}",
|
||||||
|
"Id": "${SSO_ID}",
|
||||||
|
"Scope": "",
|
||||||
|
"AuthEndpoint": "https://${SSO_DOMAIN}/application/o/authorize/",
|
||||||
|
"TokenEndpoint": "https://${SSO_DOMAIN}/application/o/token/",
|
||||||
|
"UserAPIEndpoint": "https://${SSO_DOMAIN}/application/o/userinfo/",
|
||||||
|
"DiscoveryEndpoint": "https://${SSO_DOMAIN}/application/o/${SSO_APP}/.well-known/openid-configuration",
|
||||||
|
"ButtonText": "${ORG_NAME}",
|
||||||
|
"ButtonColor": "#ff0000"
|
||||||
|
}
|
@ -1 +0,0 @@
|
|||||||
Note that the first time you enable the email or sso configurations it will reset your existing Mattermost configuration.
|
|
Reference in New Issue
Block a user