Add caddy

This commit is contained in:
Tobias Reisinger 2022-08-22 23:05:13 +02:00
parent 73c6b454fa
commit dfe87690d7
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
25 changed files with 162 additions and 6 deletions

1
caddy/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/config/conf-hidden.d/

12
caddy/config/Caddyfile Normal file
View file

@ -0,0 +1,12 @@
{
email tobias@msrg.cc
}
db.serguzim.me:80,
dns.serguzim.me:80 {
reverse_proxy host.docker.internal:4444
}
import /etc/caddy/snippets
import /etc/caddy/conf.d/*.conf
import /etc/caddy/conf-hidden.d/*.conf

View file

@ -0,0 +1,3 @@
analytics.serguzim.me {
reverse_proxy umami:3000
}

View file

@ -0,0 +1,3 @@
auth.serguzim.me {
reverse_proxy authentik:9000
}

View file

@ -0,0 +1,3 @@
ci.serguzim.me {
reverse_proxy woodpecker:8000
}

View file

@ -0,0 +1,11 @@
cloud.serguzim.me {
reverse_proxy host.docker.internal:3015
redir /.well-known/host-meta /public.php?service=host-meta 301
redir /.well-known/host-meta.json /public.php?service=host-meta-json 301
redir /.well-known/webfinger /public.php?service=webfinger 301
redir /.well-known/carddav /remote.php/dav/ 301
redir /.well-known/caldav /remote.php/dav/ 301
header Strict-Transport-Security "max-age=15552000; includeSubdomains;"
}

View file

@ -0,0 +1,3 @@
faas.serguzim.me {
reverse_proxy host.docker.internal:8080
}

View file

@ -0,0 +1,5 @@
git.serguzim.me {
header /attachments/* Access-Control-Allow-Origin *
reverse_proxy gitea:3000
}

View file

@ -0,0 +1,3 @@
graph.serguzim.me {
reverse_proxy grafana:3000
}

View file

@ -0,0 +1,3 @@
hook.serguzim.me {
reverse_proxy host.docker.internal:3002
}

View file

@ -0,0 +1,16 @@
matrix.msrg.cc {
reverse_proxy /_matrix/* synapse:8008
reverse_proxy /_synapse/* synapse:8008
handle_path /admin/* {
rewrite * {path}
reverse_proxy synapse-admin:80
}
}
msrg.cc:8008,
msrg.cc:8448,
matrix.msrg.cc:8008,
matrix.msrg.cc:8448 {
reverse_proxy synapse:8008
}

View file

@ -0,0 +1,3 @@
media.serguzim.me {
reverse_proxy host.docker.internal:3014
}

View file

@ -0,0 +1,8 @@
msrg.cc {
header /.well-known/openpgpkey/* Access-Control-Allow-Origin *
rewrite * /function/webpage-msrg-cc{uri}
reverse_proxy https://faas.serguzim.me {
header_up Host {http.reverse_proxy.upstream.hostport}
}
}

View file

@ -0,0 +1,9 @@
prometheus.serguzim.me {
import auth_serguzim_me
reverse_proxy host.docker.internal:9090
}
prometheus.internal.serguzim.net:80 {
reverse_proxy host.docker.internal:9090
}

View file

@ -0,0 +1,3 @@
recipies.serguzim.me {
reverse_proxy tandoor:80
}

View file

@ -0,0 +1,4 @@
registry.serguzim.me {
reverse_proxy /metrics host.docker.internal:3029
reverse_proxy host.docker.internal:3021
}

View file

@ -0,0 +1,3 @@
rss.serguzim.me {
reverse_proxy tt-rss:80
}

View file

@ -0,0 +1,11 @@
serguzim.me {
header Strict-Transport-Security "max-age=31536000; includeSubdomains; preload"
redir https://www.serguzim.me{uri}
}
www.serguzim.me {
rewrite * /function/webpage-serguzim-me{uri}
reverse_proxy https://faas.serguzim.me {
header_up Host {http.reverse_proxy.upstream.hostport}
}
}

View file

@ -0,0 +1,6 @@
xn--sder-5qa.stream {
rewrite * /function/webpage-soeder-stream{uri}
reverse_proxy https://faas.serguzim.me {
header_up Host {http.reverse_proxy.upstream.hostport}
}
}

View file

@ -0,0 +1,5 @@
stream.serguzim.me {
import auth_serguzim_me
reverse_proxy host.docker.internal:8888
}

View file

@ -0,0 +1,3 @@
tick.serguzim.me {
reverse_proxy host.docker.internal:8086
}

View file

@ -0,0 +1,3 @@
wiki.serguzim.me {
reverse_proxy wiki-js:3000
}

15
caddy/config/snippets Normal file
View file

@ -0,0 +1,15 @@
(auth_serguzim_me) {
# always forward outpost path to actual outpost
reverse_proxy /outpost.goauthentik.io/* authentik:9000
# forward authentication to outpost
forward_auth authentik:9000 {
uri /outpost.goauthentik.io/auth/caddy
# capitalization of the headers is important, otherwise they will be empty
copy_headers X-Authentik-Username X-Authentik-Groups X-Authentik-Email X-Authentik-Name X-Authentik-Uid X-Authentik-Jwt X-Authentik-Meta-Jwks X-Authentik-Meta-Outpost X-Authentik-Meta-Provider X-Authentik-Meta-App X-Authentik-Meta-Version
# optional, in this config trust all private ranges, should probably be set to the outposts IP
trusted_proxies private_ranges
}
}

26
caddy/docker-compose.yml Normal file
View file

@ -0,0 +1,26 @@
version: "3.7"
services:
app:
image: caddy:2-alpine
restart: always
ports:
- "80:80"
- "443:443"
- "443:443/udp"
- "8008:8008"
- "8448:8448"
volumes:
- ./config:/etc/caddy/
- data:/data
extra_hosts:
- host.docker.internal:host-gateway
networks:
services:
volumes:
data:
networks:
services:
external: true

View file

@ -4,8 +4,6 @@ services:
app:
image: cthulhoo/ttrss-fpm-pgsql-static
restart: always
labels:
com.centurylinklabs.watchtower.enable: true
env_file:
- .env
- .secret.env
@ -19,8 +17,6 @@ services:
updater:
image: cthulhoo/ttrss-fpm-pgsql-static
restart: always
labels:
com.centurylinklabs.watchtower.enable: true
env_file:
- .env
- .secret.env
@ -35,8 +31,6 @@ services:
web-nginx:
image: cthulhoo/ttrss-web-nginx
restart: always
labels:
com.centurylinklabs.watchtower.enable: true
volumes:
- app:/var/www/html:ro
- ./nginx.conf:/etc/nginx/nginx.conf