fix(traefik): redirect root domain to Free Flow
Redirect requests made to the root domain to Free Flow.
This commit is contained in:
parent
032c080b99
commit
9e24f50653
3 changed files with 22 additions and 1 deletions
|
@ -2,6 +2,8 @@ FROM traefik:{{ .Traefik.Version }}
|
||||||
|
|
||||||
ADD traefik.yaml /flow/traefik/
|
ADD traefik.yaml /flow/traefik/
|
||||||
|
|
||||||
|
ADD dynamic_root_domain_redirect.yaml /tmp/dynamic_root_domain_redirect.yaml
|
||||||
|
|
||||||
ADD entrypoint.sh /
|
ADD entrypoint.sh /
|
||||||
|
|
||||||
RUN chmod +x /entrypoint.sh
|
RUN chmod +x /entrypoint.sh
|
||||||
|
|
18
templates/traefik/dynamic_root_domain_redirect.yaml.gotmpl
Normal file
18
templates/traefik/dynamic_root_domain_redirect.yaml.gotmpl
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
---
|
||||||
|
http:
|
||||||
|
routers:
|
||||||
|
root-domain:
|
||||||
|
entryPoints:
|
||||||
|
- "https"
|
||||||
|
rule: "Host(`{{ .RootDomain }}`)"
|
||||||
|
middlewares:
|
||||||
|
- "redirect-root-to-freeflow"
|
||||||
|
service: noop@internal
|
||||||
|
tls:
|
||||||
|
certResolver: resolver
|
||||||
|
middlewares:
|
||||||
|
redirect-root-to-freeflow:
|
||||||
|
redirectRegex:
|
||||||
|
regex: "^(.*)"
|
||||||
|
replacement: "https://{{ .GoToSocial.Subdomain }}.{{ .RootDomain }}"
|
||||||
|
permanent: true
|
|
@ -8,7 +8,8 @@ chgrp {{ .FlowGID }} {{ .Traefik.SharedMountPoint }}/dynamic
|
||||||
chmod a-rwx,u+rwx,g+rwx {{ .Traefik.SharedMountPoint }}/dynamic
|
chmod a-rwx,u+rwx,g+rwx {{ .Traefik.SharedMountPoint }}/dynamic
|
||||||
|
|
||||||
# Move any dynamic config to the new directory.
|
# Move any dynamic config to the new directory.
|
||||||
for f in $( find /tmp -mindepth 1 -maxdepth 1 -type f -iname '*dynamic*.yaml' -exec basename {} \; ); do
|
for f in $( find /tmp -mindepth 1 -maxdepth 1 -type f -iname 'dynamic*.yaml' -exec basename {} \; ); do
|
||||||
|
echo "INFO: Moving /tmp/${f} to {{ .Traefik.SharedMountPoint }}/dynamic/${f}..."
|
||||||
mv -f /tmp/${f} {{ .Traefik.SharedMountPoint }}/dynamic/${f}
|
mv -f /tmp/${f} {{ .Traefik.SharedMountPoint }}/dynamic/${f}
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue