diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index 10b6812..17e4654 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -173,8 +173,14 @@ ufw_allow_ssh_from_anywhere: false ufw_lan_tcp_ports: - { port: 22, comment: "SSH" } - - { port: 80, comment: "Landing (Caddy)" } + - { port: 80, comment: "Caddy HTTP / ACME" } + - { port: 443, comment: "Caddy HTTPS" } - { port: 8080, comment: "qBittorrent" } + - { port: 21115, comment: "RustDesk" } + - { port: 21116, comment: "RustDesk" } + - { port: 21117, comment: "RustDesk relay" } + - { port: 21118, comment: "RustDesk" } + - { port: 21119, comment: "RustDesk" } - { port: 8096, comment: "Jellyfin" } - { port: 8989, comment: "Sonarr" } - { port: 7878, comment: "Radarr" } diff --git a/docker-compose.yml b/docker-compose.yml index 0ac1d3f..341a04c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -187,8 +187,11 @@ services: # devices: # - /dev/dri:/dev/dri - # ----------------------------------------------------- LAN landing (Caddy) # - # Dark-mode map of services for other PCs on the network: http://server/ + # -------------------------------- Caddy: landing + HTTPS reverse proxy --- # + # LAN map: http://192.168.8.123/ + # Public: https://forgejo.devopshomelab.com https://jellyfin.devopshomelab.com + # https://rustdesk.devopshomelab.com (info page) https://devopshomelab.com + # Let's Encrypt HTTP-01 needs WAN :80/:443 → this host and grey-cloud DNS. landing: image: caddy:2-alpine container_name: landing @@ -196,9 +199,17 @@ services: networks: [arr-net] ports: - "${LANDING_PORT:-80}:80" + - "${LANDING_HTTPS_PORT:-443}:443" + environment: + CADDY_EMAIL: ${CADDY_EMAIL:-admin@devopshomelab.com} volumes: - ./landing/Caddyfile:/etc/caddy/Caddyfile:ro - ./landing/site:/srv:ro + - ${CONFIG_DIR}/caddy-data:/data + - ${CONFIG_DIR}/caddy-config:/config + depends_on: + - forgejo + - jellyfin # ---------------------------------------------- Cloudflare dynamic DNS (A) # # Updates apex + subdomains to the host's public IPv4. Secrets from secrets/.env @@ -380,9 +391,10 @@ services: FORGEJO__server__START_SSH_SERVER: "false" FORGEJO__server__DISABLE_SSH: "false" FORGEJO__server__SSH_PORT: ${FORGEJO_SSH_PORT:-2222} - FORGEJO__server__SSH_DOMAIN: ${FORGEJO_DOMAIN:-192.168.8.123} - FORGEJO__server__DOMAIN: ${FORGEJO_DOMAIN:-192.168.8.123} - FORGEJO__server__ROOT_URL: ${FORGEJO_ROOT_URL:-http://192.168.8.123:3002/} + FORGEJO__server__SSH_DOMAIN: ${FORGEJO_DOMAIN:-forgejo.devopshomelab.com} + FORGEJO__server__DOMAIN: ${FORGEJO_DOMAIN:-forgejo.devopshomelab.com} + # Public HTTPS via Caddy (see landing/Caddyfile). LAN still works on :3002. + FORGEJO__server__ROOT_URL: ${FORGEJO_ROOT_URL:-https://forgejo.devopshomelab.com/} FORGEJO__server__HTTP_PORT: "3000" # SQLite by default (no extra DB container) FORGEJO__database__DB_TYPE: sqlite3 @@ -392,6 +404,40 @@ services: - ${CONFIG_DIR}/forgejo:/data - /etc/localtime:/etc/localtime:ro + # ------------------------------------------------------------------------- + # RustDesk server (OSS) — rustdesk.devopshomelab.com + # Clients use TCP/UDP 21115–21119 (not HTTP). Open those ports on the router. + # Public key: docker exec rustdesk-hbbs cat /root/id_ed25519.pub + # ------------------------------------------------------------------------- + rustdesk-hbbr: + image: rustdesk/rustdesk-server:latest + container_name: rustdesk-hbbr + restart: unless-stopped + networks: [arr-net] + command: hbbr + volumes: + - ${CONFIG_DIR}/rustdesk:/root + ports: + - "21117:21117" + - "21119:21119" + + rustdesk-hbbs: + image: rustdesk/rustdesk-server:latest + container_name: rustdesk-hbbs + restart: unless-stopped + networks: [arr-net] + # -r = relay host:port advertised to clients + command: hbbs -r ${RUSTDESK_DOMAIN:-rustdesk.devopshomelab.com}:21117 + volumes: + - ${CONFIG_DIR}/rustdesk:/root + ports: + - "21115:21115" + - "21116:21116" + - "21116:21116/udp" + - "21118:21118" + depends_on: + - rustdesk-hbbr + # ------------------------------------------------------------------------- # OpenHands — always deployed (this stack always brings up every service) # UI: http://host:3001 · LLM via bonsai OpenAI API diff --git a/landing/Caddyfile b/landing/Caddyfile index e52e810..323fa13 100644 --- a/landing/Caddyfile +++ b/landing/Caddyfile @@ -1,7 +1,81 @@ -# Homelab landing page — LAN only (UFW allows 80 from LAN) -:80 { - root * /srv +# Reverse proxy + LAN landing + automatic HTTPS (Let's Encrypt HTTP-01). +# +# Prerequisites: +# 1. cloudflare-ddns points A records at this host's public IPv4 +# 2. Router port-forwards WAN :80 and :443 → this host +# 3. DNS-only (grey cloud) for names used here — orange-cloud breaks HTTP-01 to origin +# 4. Domain is devopshomelab.com (Cloudflare zone). If you meant .org, change all hostnames. +# +# Email for ACME registration (set in compose): CADDY_EMAIL + +{ + email {$CADDY_EMAIL} +} + +# --- HTTPS reverse proxies --------------------------------------------------- + +forgejo.devopshomelab.com { encode gzip + reverse_proxy forgejo:3000 +} + +jellyfin.devopshomelab.com { + encode gzip + reverse_proxy jellyfin:8096 +} + +# Info page only — RustDesk clients use TCP/UDP 21115–21119, not this site +rustdesk.devopshomelab.com { + encode gzip + header Content-Type "text/html; charset=utf-8" + respond `
ID / rendezvous server: rustdesk.devopshomelab.com
Relay server: rustdesk.devopshomelab.com (port 21117)
In the RustDesk client: Network → ID server = hostname above. Paste the server public key from the host admin.
+Open ports on the router/firewall: 21115–21119 TCP and 21116 UDP.