diff --git a/.env.sample b/.env.sample index a085ec8..3ab326e 100644 --- a/.env.sample +++ b/.env.sample @@ -7,6 +7,8 @@ DOMAIN=maubot.example.com LETS_ENCRYPT_ENV=production +ENABLE_BACKUPS=true + HOMESERVER_HOST=matrix.org # Client-server API URL HOMESERVER_URL=https://matrix-client.matrix.org @@ -15,4 +17,5 @@ ADMIN_USER_NAME=admin ## Secrets SECRET_ADMIN_PASSWORD_VERSION=v1 -SECRET_HOMESERVER_REGISTRATION_VERSION=v1 \ No newline at end of file +SECRET_HOMESERVER_REGISTRATION_VERSION=v1 + diff --git a/compose.yml b/compose.yml index f8caabe..486506d 100644 --- a/compose.yml +++ b/compose.yml @@ -30,16 +30,23 @@ services: - "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure" - "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}" ## Redirect from EXTRA_DOMAINS to DOMAIN - #- "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.SSLHost=${DOMAIN}" + - "traefik.http.middlewares.${STACK_NAME}-redirecthostname.redirectregex.regex=^http[s]?://([^/]*)/(.*)" + - "traefik.http.middlewares.${STACK_NAME}-redirecthostname.redirectregex.replacement=https://${DOMAIN}/$${2}" + - "traefik.http.middlewares.${STACK_NAME}-redirecthostname.redirectregex.permanent=true" + ## Redirect HTTP to HTTPS + - "traefik.http.middlewares.${STACK_NAME}-redirectscheme.redirectscheme.scheme=https" + - "traefik.http.middlewares.${STACK_NAME}-redirectscheme.redirectscheme.permanent=true" + ## When you're ready for release, run "abra recipe sync " to set this - "coop-cloud.${STACK_NAME}.version=1.1.0+v0.6.0" - #healthcheck: - #test: ["CMD", "curl", "-f", "http://localhost"] - #interval: 30s - #timeout: 10s - #retries: 10 - #start_period: 1m + ## Enable backups: https://docs.coopcloud.tech/maintainers/handbook/#how-do-i-configure-backuprestore + - "backupbot.backup=${ENABLE_BACKUPS:-true}" + + healthcheck: + test: ["CMD", "wget", "--spider", "-q", "http://0.0.0.0:29316/_matrix/maubot/"] + interval: 30s + timeout: 10s + retries: 10 + start_period: 1m networks: proxy: