Refactor
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-05-05 22:44:28 +02:00
parent 86e52be5e1
commit 5a8416fcdf
113 changed files with 456 additions and 649 deletions

View File

@ -0,0 +1 @@
COMPOSE_PROJECT_NAME=caddy

View File

@ -0,0 +1,14 @@
{
auto_https off
}
{% for rule in redirect.hosts %}
http://{{ rule.from }} {
{% if rule.keepUri %}
redir https://{{ rule.to }}{uri} permanent
{% else %}
redir https://{{ rule.to }} permanent
{% endif %}
}
{% endfor %}

View File

@ -0,0 +1,21 @@
---
version: "3.4"
services:
redirect:
image: caddy:2
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile:ro,z
labels:
- "traefik.enable=true"
- "traefik.http.routers.caddyredir.rule={{ redirect.hosts | map(attribute='from') | map('regex_replace', '^(.*)$', 'Host(`\\1`)') | join(' || ') }}"
- "traefik.http.routers.caddyredir.entryPoints=websecure"
- "traefik.http.services.caddyredir.loadbalancer.server.port=80"
restart: always
networks:
- gateway
networks:
gateway:
external: true
...