- Caddyfile: drop http:// site prefixes, global acme_dns porkbun block, HTTPS redirects on the bare-IP and legacy vhosts - new dankclaw/caddy/Containerfile: xcaddy build with caddy-dns/porkbun - compose: caddy uses franksdank/caddy-porkbun:latest + Porkbun env vars - deploy.sh: build the image on first deploy if missing - .env.example: rename PORKBUN_API_SECRET -> PORKBUN_API_SECRET_KEY (the name the caddy-dns/porkbun module expects) - tests: 7 new caddyfile/compose seams for the TLS config
193 lines
5.0 KiB
Caddyfile
193 lines
5.0 KiB
Caddyfile
# Homelab Caddyfile — the single Caddy for both hosts.
|
|
#
|
|
# Caddy runs as a container on dankclaw (192.168.0.143, this repo's
|
|
# compose.yaml service 'caddy') and fronts every service on both hosts:
|
|
# - dankclaw services: by container name (compose network) or by the
|
|
# published LAN port (quadlet services on isolated networks)
|
|
# - dankserver services (192.168.0.235): by published LAN port
|
|
#
|
|
# Naming: flat franksdank.cloud scheme (see docs/Infrastructure/LAN-DNS.md).
|
|
# DNS for these names is served by the dnsmasq quadlet on this host
|
|
# (dankclaw/dnsmasq/addn-hosts — every name resolves to 192.168.0.143)
|
|
# and handed to LAN clients by the SURFboard G36 router.
|
|
#
|
|
# The basicauth hash below is a placeholder. deploy.sh renders the real
|
|
# hash (CADDY_BASICAUTH_HASH from the host .env, git-ignored) into
|
|
# /home/dank/Containers/caddy/Caddyfile, which the container mounts.
|
|
#
|
|
# TLS: real Let's Encrypt certs. Site addresses carry no http:// prefix,
|
|
# so Caddy serves HTTPS (and auto-redirects HTTP). Certs are wildcard
|
|
# (dns-01) via the global acme_dns block below, using the Porkbun module
|
|
# built into the franksdank/caddy-porkbun image (caddy/Containerfile).
|
|
# That needs no inbound ports and works from the LAN, where dnsmasq
|
|
# resolves these names to 192.168.0.143.
|
|
{
|
|
admin off
|
|
email admin@franksdank.cloud
|
|
|
|
# Solve ACME challenges for every site via Porkbun DNS (no port 80/443
|
|
# reachability needed). Credentials come from the container environment
|
|
# (compose.yaml, from the host .env — never committed).
|
|
acme_dns porkbun {
|
|
api_key {env.PORKBUN_API_KEY}
|
|
api_secret_key {env.PORKBUN_API_SECRET_KEY}
|
|
}
|
|
}
|
|
|
|
# --- Bare-IP access (health checks, convenience) ---
|
|
:80 {
|
|
redir https://dankclaw.franksdank.cloud/ 302
|
|
}
|
|
|
|
# --- Homepage (password protected) ---
|
|
dankclaw.franksdank.cloud {
|
|
basicauth {
|
|
dank $2a$14$REPLACE_WITH_HASH
|
|
}
|
|
root * /srv/homepage
|
|
file_server
|
|
}
|
|
|
|
# --- Legacy name: the media host has no Caddy of its own anymore ---
|
|
dankserver.franksdank.cloud {
|
|
redir https://dankclaw.franksdank.cloud/ 302
|
|
}
|
|
|
|
# ═══════════════════════════════════════════════════════════════
|
|
# Services on this host (dankclaw, 192.168.0.143)
|
|
# ═══════════════════════════════════════════════════════════════
|
|
|
|
# --- SearXNG (quadlet; behind the Gluetun tunnel, published 8081) ---
|
|
search.franksdank.cloud {
|
|
basicauth {
|
|
dank $2a$14$REPLACE_WITH_HASH
|
|
}
|
|
reverse_proxy 192.168.0.143:8081
|
|
}
|
|
|
|
# --- ComfyUI ---
|
|
comfyui.franksdank.cloud {
|
|
reverse_proxy comfyui:8188
|
|
}
|
|
|
|
# --- OpenWebUI (quadlet on slirp4netns; published 3005) ---
|
|
chat.franksdank.cloud {
|
|
basicauth {
|
|
dank $2a$14$REPLACE_WITH_HASH
|
|
}
|
|
reverse_proxy 192.168.0.143:3005
|
|
}
|
|
|
|
# --- Hermes ---
|
|
hermes.franksdank.cloud {
|
|
basicauth {
|
|
dank $2a$14$REPLACE_WITH_HASH
|
|
}
|
|
reverse_proxy hermes:8090
|
|
}
|
|
|
|
# --- Gitea (quadlet; published 3000) ---
|
|
gitea.franksdank.cloud {
|
|
reverse_proxy 192.168.0.143:3000
|
|
}
|
|
|
|
# --- Grafana ---
|
|
grafana.franksdank.cloud {
|
|
basicauth {
|
|
dank $2a$14$REPLACE_WITH_HASH
|
|
}
|
|
reverse_proxy grafana:3000
|
|
}
|
|
|
|
# --- Prometheus ---
|
|
prometheus.franksdank.cloud {
|
|
basicauth {
|
|
dank $2a$14$REPLACE_WITH_HASH
|
|
}
|
|
reverse_proxy prometheus:9090
|
|
}
|
|
|
|
# --- Loki ---
|
|
loki.franksdank.cloud {
|
|
reverse_proxy loki:3100
|
|
}
|
|
|
|
# ═══════════════════════════════════════════════════════════════
|
|
# Services on dankserver (192.168.0.235) — published LAN ports
|
|
# ═══════════════════════════════════════════════════════════════
|
|
|
|
# --- Plex (existing, kept) ---
|
|
plex.franksdank.casa {
|
|
reverse_proxy 192.168.0.235:32400
|
|
}
|
|
|
|
plex.franksdank.cloud {
|
|
reverse_proxy 192.168.0.235:32400
|
|
}
|
|
|
|
# --- Calibre-Web ---
|
|
books.franksdank.cloud {
|
|
reverse_proxy 192.168.0.235:8083
|
|
}
|
|
|
|
# --- RomM ---
|
|
romm.franksdank.cloud {
|
|
basicauth {
|
|
dank $2a$14$REPLACE_WITH_HASH
|
|
}
|
|
reverse_proxy 192.168.0.235:8085
|
|
}
|
|
|
|
# --- Copyparty ---
|
|
files.franksdank.cloud {
|
|
basicauth {
|
|
dank $2a$14$REPLACE_WITH_HASH
|
|
}
|
|
reverse_proxy 192.168.0.235:3923
|
|
}
|
|
|
|
# --- Jellyfin ---
|
|
jellyfin.franksdank.cloud {
|
|
reverse_proxy 192.168.0.235:8096 {
|
|
transport http {
|
|
versions h2c 1.1
|
|
}
|
|
}
|
|
}
|
|
|
|
# --- *arr Stack ---
|
|
radarr.franksdank.cloud {
|
|
reverse_proxy 192.168.0.235:7878
|
|
}
|
|
|
|
sonarr.franksdank.cloud {
|
|
reverse_proxy 192.168.0.235:8989
|
|
}
|
|
|
|
lidarr.franksdank.cloud {
|
|
reverse_proxy 192.168.0.235:8686
|
|
}
|
|
|
|
readarr.franksdank.cloud {
|
|
reverse_proxy 192.168.0.235:8787
|
|
}
|
|
|
|
prowlarr.franksdank.cloud {
|
|
reverse_proxy 192.168.0.235:9696
|
|
}
|
|
|
|
qbittorrent.franksdank.cloud {
|
|
reverse_proxy 192.168.0.235:8080
|
|
}
|
|
|
|
# --- Optional: Jackett ---
|
|
# jackett.franksdank.cloud {
|
|
# reverse_proxy 192.168.0.235:9117
|
|
# }
|
|
|
|
# --- Optional: Whisparr ---
|
|
# whisparr.franksdank.cloud {
|
|
# reverse_proxy 192.168.0.235:6969
|
|
# }
|