From d566060e5cf30976ecfac22564cc959ff260dfe2 Mon Sep 17 00:00:00 2001 From: Roxie Gibson Date: Sun, 9 May 2021 22:40:49 +0100 Subject: [PATCH] tried but still failing redirect --- .env.sample | 20 +++++++++++++++++--- compose.yml | 12 ++++++++---- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/.env.sample b/.env.sample index f9b528b..6796ad2 100644 --- a/.env.sample +++ b/.env.sample @@ -1,6 +1,10 @@ TYPE=mastodon DOMAIN=mastodon.swarm-test.autonomic.zone +# Enables WEB_DOMAIN if set (FOR FUTURE USE) +# USER_DOMAIN= + + ## Domain aliases #EXTRA_DOMAINS=', `www.mastodon.example.com`' LETS_ENCRYPT_ENV=production @@ -13,8 +17,18 @@ LETS_ENCRYPT_ENV=production # Federation # ---------- # DO NOT CHANGE DOMAIN VARIABLES AFTER DEPLOYMENT! WILL BREAK FEDERATION!! + +# if [ -z "$USER_DOMAIN" ] +# then +# LOCAL_DOMAIN=$DOMAIN +# else +# LOCAL_DOMAIN=$USER_DOMAIN +# WEB_DOMAIN=$DOMAIN +# fi + LOCAL_DOMAIN=$DOMAIN -#WEB_DOMAIN= +#WEB_DOMAIN=$DOMAIN + #ALTERNATE_DOMAINS=$EXTRA_DOMAINS AUTHORIZED_FETCH=false LIMITED_FEDERATION_MODE=false @@ -56,8 +70,8 @@ ES_ENABLED=false # StatsD (CURRENTLY NOT SUPPORTED) # ------------------------------- -STATSD_ADDR -STATSD_NAMESPACE +# STATSD_ADDR +# STATSD_NAMESPACE # Secrets # ======= diff --git a/compose.yml b/compose.yml index b2e7c4c..786009a 100644 --- a/compose.yml +++ b/compose.yml @@ -60,11 +60,15 @@ services: - "traefik.http.routers.${STACK_NAME}_web.rule=Host(`${DOMAIN}`)" - "traefik.http.routers.${STACK_NAME}_web.entrypoints=web-secure" - "traefik.http.routers.${STACK_NAME}_web.tls.certresolver=${LETS_ENCRYPT_ENV}" + # WEB_DOMAIN redirect + #- "traefik.http.routers.${STACK_NAME}_web.rule=(Host(`${DOMAIN}`) || (Host(`${LOCAL_DOMAIN}`) && Path(`/.well-known/webfinger`)))" + # - "traefik.http.middlewares.mastodon-webfinger.redirectregex.regex=^https?://${LOCAL_DOMAIN}/.*" #^(http|https)://${LOCAL_DOMAIN}/.well-known/webfinger" + # # - "traefik.http.middlewares.mastodon-webfinger.redirectregex.permanent=true" + # - "traefik.http.middlewares.mastodon-webfinger.redirectregex.replacement=https://${WEB_DOMAIN}/.well-known/webfinger" + # - "traefik.http.routers.${STACK_NAME}_hack.rule=(Host(`${LOCAL_DOMAIN}`) && Path(`/.well-known/`))" + # - "traefik.http.routers.${STACK_NAME}_hack.entrypoints=websecure" + # - "traefik.http.routers.${STACK_NAME}_hack.middlewares=mastodon-webfinger@docker" - ## 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}" depends_on: - db - redis