Add Caddy reverse proxy support to HOPS

### New Features
- Added Caddy reverse proxy as a service option
- Proper Docker container configuration with ports 80, 443, 2019
- Health check monitoring via Caddy admin API
- Volume mounts for Caddyfile, site content, and data persistence
- Integration with existing service selection and categorization

### Configuration Scope
- HOPS provides: Container setup, volume mounts, networking, health checks
- User provides: Caddyfile configuration, routing rules, SSL settings
- Clear documentation about configuration responsibilities
- Example Caddyfile provided in README

### Documentation Updates
- Updated README.md with Caddy service listing and configuration guide
- Updated CLAUDE.md with Caddy in supported services
- Added comprehensive configuration scope documentation
- Updated version references to 3.2.0

### Technical Implementation
- Added generate_caddy() function to services file
- Integrated Caddy into service selection switch
- Added port mapping for conflict detection (80, 443, 2019)
- Categorized under proxy & security services
- Added to available services listing

This addition provides users with another reverse proxy option while
maintaining HOPS' philosophy of providing infrastructure while allowing
users to maintain control over their specific configuration needs.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Stephen Klein
2025-07-18 05:29:25 -04:00
parent 60bf2054bd
commit cd30d45fbf
5 changed files with 73 additions and 7 deletions
+39 -4
View File
@@ -2,7 +2,7 @@
# HOPS Service Definitions
# Contains all Docker Compose service configurations
# Version: 3.1.0-beta
# Version: 3.2.0
# This script provides functions to generate Docker Compose service definitions
# Usage: Source this script and call generate_service_definition <service_name>
@@ -722,6 +722,39 @@ $(get_homelab_network)
EOF
}
generate_caddy() {
cat <<EOF
# Caddy Reverse Proxy
# NOTE: HOPS provides the container only - Caddyfile configuration is user responsibility
# Place your Caddyfile in \${CONFIG_ROOT}/caddy/Caddyfile
# Documentation: https://caddyserver.com/docs/
caddy:
image: caddy:latest
container_name: caddy
$(get_restart_policy)
ports:
- "80:80"
- "443:443"
- "2019:2019" # Admin API
environment:
- TZ=\${TZ}
volumes:
- \${CONFIG_ROOT}/caddy/Caddyfile:/etc/caddy/Caddyfile
- \${CONFIG_ROOT}/caddy/site:/srv
- \${CONFIG_ROOT}/caddy/data:/data
- \${CONFIG_ROOT}/caddy/config:/config
$(get_web_healthcheck 2019 "/config/")
$(get_homelab_network)
labels:
- "traefik.enable=true"
- "traefik.http.routers.caddy.rule=Host(\`caddy.\${DOMAIN:-localhost}\`)"
- "traefik.http.routers.caddy.entrypoints=websecure"
- "traefik.http.routers.caddy.tls.certresolver=letsencrypt"
- "traefik.http.services.caddy.loadbalancer.server.port=2019"
EOF
}
generate_authelia() {
cat <<EOF
authelia:
@@ -924,6 +957,7 @@ generate_service_definition() {
# Reverse Proxy & Security
"traefik") generate_traefik ;;
"nginx-proxy-manager") generate_nginx-proxy-manager ;;
"caddy") generate_caddy ;;
"authelia") generate_authelia ;;
# Monitoring & Management
@@ -1199,6 +1233,7 @@ get_service_ports() {
"ombi") echo "3579" ;;
"traefik") echo "80 443 8080" ;;
"nginx-proxy-manager") echo "80 443 81" ;;
"caddy") echo "80 443 2019" ;;
"authelia") echo "9091" ;;
"portainer") echo "9000 9443" ;;
"uptime-kuma") echo "3001" ;;
@@ -1237,7 +1272,7 @@ print_service_summary() {
media_servers+=("$service") ;;
overseerr|jellyseerr|ombi)
request_mgmt+=("$service") ;;
traefik|nginx-proxy-manager|authelia)
traefik|nginx-proxy-manager|caddy|authelia)
proxy_security+=("$service") ;;
portainer|watchtower|uptime-kuma)
monitoring+=("$service") ;;
@@ -1302,7 +1337,7 @@ list_available_services() {
echo " overseerr jellyseerr ombi"
echo
echo "🔒 PROXY & SECURITY:"
echo " traefik nginx-proxy-manager authelia"
echo " traefik nginx-proxy-manager caddy authelia"
echo
echo "📈 MONITORING:"
echo " portainer watchtower uptime-kuma"
@@ -1314,7 +1349,7 @@ list_available_services() {
# Usage information
show_usage() {
cat <<EOF
HOPS Service Definitions Script v3.1.0
HOPS Service Definitions Script v3.2.0
Usage:
source services