clean up of caddy
This commit is contained in:
1 parent
56f93456cd
commit
8dcbd3bf6c
3 files changed
+96
-67
No files matched your search
+5
-4
@@ -23,10 +23,11 @@ these cases where the source subdir and `~/.config` target differ.
|
||||
| `hl-fws1/hypr/` | Hyprland config for `hl-fws1` (remote slim desktop); **baked into the build** via `mountAsSource`, linked to `~/.config/hypr` |
|
||||
| `hl-pi1/quickshell/` | Quickshell configs for `hl-pi1` (full-screen clock + calendar); linked to `~/.config/quickshell` |
|
||||
| `fwbook/quickshell/` | Quickshell configs for `fwbook` (scrolling overview); linked to `~/.config/quickshell` |
|
||||
| `extra.nu` | Extra NuShell config sourced at shell startup |
|
||||
| `fwbook.knsv` | fwbook-specific Kanshi display profile |
|
||||
| `hypr-types/hl.lua` | Shared EmmyLua type stubs for the `hl` global; each host's Hyprland `.luarc.json` points here via `workspace.library` |
|
||||
| `pki/` | Public certs of the lab internal CA (`lab-ca.crt` + issued leaves), managed by `skyg ca`; **not** symlinked to `~/.config` — see `pki/ABOUTME.md` |
|
||||
|
||||
| `extra.nu` | Extra NuShell config sourced at shell startup |
|
||||
| `fwbook.knsv` | fwbook-specific Kanshi display profile |
|
||||
| `hypr-types/hl.lua` | Shared EmmyLua type stubs for the `hl` global; each host's Hyprland `.luarc.json` points here via `workspace.library` |
|
||||
| `pki/` | Public certs of the lab internal CA (`lab-ca.crt` + issued leaves), managed by `skyg ca`; **not** symlinked to `~/.config` — see `pki/ABOUTME.md` |
|
||||
|
||||
## Notes
|
||||
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
{
|
||||
layer4 {
|
||||
:22 {
|
||||
route {
|
||||
proxy {$GITEA_IP}:22
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Common: the wildcard cert.
|
||||
(shared) {
|
||||
tls /etc/caddy/tls/fullchain.pem /etc/caddy/tls/key.pem
|
||||
}
|
||||
|
||||
# Only LAN (10/8) + Tailscale clients. Others get dropped.
|
||||
(lan_only) {
|
||||
import shared
|
||||
@notlan not remote_ip 10.0.0.0/8 100.64.0.0/10
|
||||
abort @notlan
|
||||
}
|
||||
|
||||
# Open to anyone who can reach caddy.
|
||||
(public_access) {
|
||||
import shared
|
||||
}
|
||||
|
||||
nvr.home.sosnovsky.ca {
|
||||
import lan_only
|
||||
reverse_proxy {$NVR_IP}:11080
|
||||
}
|
||||
|
||||
jellyfin.home.sosnovsky.ca {
|
||||
import public_access
|
||||
reverse_proxy bigbox1.lab.internal:8096
|
||||
}
|
||||
|
||||
castle.home.sosnovsky.ca {
|
||||
import public_access
|
||||
reverse_proxy castle.hub.internal
|
||||
}
|
||||
|
||||
immich.home.sosnovsky.ca {
|
||||
import lan_only
|
||||
reverse_proxy {$IMMICH_IP}:2283
|
||||
}
|
||||
|
||||
portainer.home.sosnovsky.ca {
|
||||
import lan_only
|
||||
reverse_proxy {$PORTAINER_IP}:9000
|
||||
}
|
||||
|
||||
gitea.skyg.ca {
|
||||
tls /etc/caddy/tls/gitea/fullchain.pem /etc/caddy/tls/gitea/key.pem
|
||||
reverse_proxy {$GITEA_IP}:80
|
||||
}
|
||||
|
||||
# Buzz: straight to its own caddy, LAN only.
|
||||
buzz.home.sosnovsky.ca {
|
||||
import lan_only
|
||||
reverse_proxy https://{$BUZZ_IP}:443 {
|
||||
header_up Host {http.request.host}
|
||||
transport http {
|
||||
tls
|
||||
tls_server_name {http.request.host}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Fallback: any other *.home.sosnovsky.ca host goes to the k8s Traefik.
|
||||
# Host + SNI are preserved so Traefik routes on the original hostname.
|
||||
*.home.sosnovsky.ca {
|
||||
import lan_only
|
||||
reverse_proxy https://{$K8S_INGRESS}:443 {
|
||||
header_up Host {http.request.host}
|
||||
transport http {
|
||||
tls
|
||||
tls_server_name {http.request.host}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -25,69 +25,16 @@ in
|
||||
};
|
||||
command = [ "run" "--config" "/etc/caddy/Caddyfile" "--adapter" "caddyfile" ];
|
||||
networks.lan.ipv4_address = app.ip;
|
||||
files."/etc/caddy/Caddyfile" = ''
|
||||
{
|
||||
layer4 {
|
||||
:22 {
|
||||
route {
|
||||
proxy ${publicGitea.ip}:22
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
# Reusable: only LAN (10/8) + Tailscale clients. Others get dropped.
|
||||
(lan_only) {
|
||||
@notlan not remote_ip 10.0.0.0/8 100.64.0.0/10
|
||||
abort @notlan
|
||||
}
|
||||
nvr.home.sosnovsky.ca {
|
||||
tls /etc/caddy/tls/fullchain.pem /etc/caddy/tls/key.pem
|
||||
import lan_only
|
||||
reverse_proxy ${nvr.ip}:11080
|
||||
}
|
||||
jellyfin.home.sosnovsky.ca {
|
||||
tls /etc/caddy/tls/fullchain.pem /etc/caddy/tls/key.pem
|
||||
reverse_proxy bigbox1.lab.internal:8096
|
||||
}
|
||||
immich.home.sosnovsky.ca {
|
||||
tls /etc/caddy/tls/fullchain.pem /etc/caddy/tls/key.pem
|
||||
import lan_only
|
||||
reverse_proxy ${immich.ip}:2283
|
||||
}
|
||||
portainer.home.sosnovsky.ca {
|
||||
tls /etc/caddy/tls/fullchain.pem /etc/caddy/tls/key.pem
|
||||
import lan_only
|
||||
reverse_proxy ${portainer.ip}:9000
|
||||
}
|
||||
gitea.skyg.ca {
|
||||
tls /etc/caddy/tls/gitea/fullchain.pem /etc/caddy/tls/gitea/key.pem
|
||||
reverse_proxy ${publicGitea.ip}:80
|
||||
}
|
||||
# Buzz: straight to its own caddy, LAN only.
|
||||
buzz.home.sosnovsky.ca {
|
||||
tls /etc/caddy/tls/fullchain.pem /etc/caddy/tls/key.pem
|
||||
import lan_only
|
||||
reverse_proxy https://${buzz.ip}:443 {
|
||||
header_up Host {http.request.host}
|
||||
transport http {
|
||||
tls
|
||||
tls_server_name {http.request.host}
|
||||
}
|
||||
}
|
||||
}
|
||||
# Fallback: any other *.home.sosnovsky.ca host goes to the k8s Traefik.
|
||||
# Host + SNI are preserved so Traefik routes on the original hostname.
|
||||
*.home.sosnovsky.ca {
|
||||
tls /etc/caddy/tls/fullchain.pem /etc/caddy/tls/key.pem
|
||||
reverse_proxy https://${k8sIngress}:443 {
|
||||
header_up Host {http.request.host}
|
||||
transport http {
|
||||
tls
|
||||
tls_server_name {http.request.host}
|
||||
}
|
||||
}
|
||||
}
|
||||
'';
|
||||
# Routes live in ./Caddyfile; IPs come in as env vars.
|
||||
files."/etc/caddy/Caddyfile" = builtins.readFile ./Caddyfile;
|
||||
environment = {
|
||||
GITEA_IP = publicGitea.ip;
|
||||
NVR_IP = nvr.ip;
|
||||
IMMICH_IP = immich.ip;
|
||||
PORTAINER_IP = portainer.ip;
|
||||
BUZZ_IP = buzz.ip;
|
||||
K8S_INGRESS = k8sIngress;
|
||||
};
|
||||
volumes = [
|
||||
"/var/lib/acme/${certDomain}/fullchain.pem:/etc/caddy/tls/fullchain.pem:ro"
|
||||
"/var/lib/acme/${certDomain}/key.pem:/etc/caddy/tls/key.pem:ro"
|
||||
|
||||
Reference in new issue
Block a user