- Refactored HAProxy configuration files, templates, and paths to use `/etc/easyhaproxy` instead of `/etc/haproxy`. - Updated Dockerfile to generate DH params and placeholder certificates in the new configuration directory. - Added health check support with timeout to `DockerComposeFixture` in E2E test utilities. - Adjusted tests, templates, and plugins to use the new `Consts`-based configuration paths. - Introduced pytest fixtures for environment isolation and temporary directory management.
82 lines
2.2 KiB
YAML
82 lines
2.2 KiB
YAML
# Certbot/Let's Encrypt Configuration Example
|
|
#
|
|
# Demonstrates:
|
|
# - Automatic SSL certificate generation with Let's Encrypt
|
|
# - HTTP to HTTPS redirect
|
|
# - Certificate renewal
|
|
#
|
|
# Prerequisites:
|
|
# 1. Public IP address with ports 80 and 443 accessible
|
|
# 2. DNS records pointing to your server:
|
|
# example.com -> your-server-ip
|
|
# www.example.com -> your-server-ip
|
|
#
|
|
# 3. Set environment variable:
|
|
# EASYHAPROXY_CERTBOT_EMAIL=your-email@example.com
|
|
#
|
|
# 4. Mount this config:
|
|
# -v ./conf/config-certbot.yml:/etc/easyhaproxy/static/config.yml
|
|
#
|
|
# 5. Persist certificates:
|
|
# -v ./etc/easyhaproxy/certs/certbot:/etc/easyhaproxy/certs/certbot
|
|
#
|
|
# How it works:
|
|
# - EasyHAProxy requests certificates from Let's Encrypt via HTTP-01 challenge
|
|
# - Certificates are stored in /etc/easyhaproxy/certs/certbot/
|
|
# - Certificates auto-renew when needed
|
|
#
|
|
# Note: Let's Encrypt has rate limits. Use staging environment for testing:
|
|
# EASYHAPROXY_CERTBOT_AUTOCONFIG=staging
|
|
|
|
stats:
|
|
username: admin
|
|
password: password
|
|
port: 1936
|
|
|
|
customerrors: true
|
|
|
|
containers:
|
|
# HTTP Port 80
|
|
# Required for ACME HTTP-01 challenge and redirect
|
|
|
|
# Domain with certbot enabled
|
|
"example.com:80":
|
|
ip: ["webapp:8080"]
|
|
# Enable certbot for this domain
|
|
certbot: true
|
|
# Redirect HTTP to HTTPS after cert is issued
|
|
redirect_ssl: true
|
|
|
|
# Additional domain with certbot
|
|
"app.example.com:80":
|
|
ip: ["app:3000"]
|
|
certbot: true
|
|
redirect_ssl: true
|
|
|
|
# Domain without certbot (uses custom certificate)
|
|
"custom.example.com:80":
|
|
ip: ["custom-app:8080"]
|
|
# No certbot - expects certificate at /etc/easyhaproxy/certs/haproxy/custom.example.com.pem
|
|
|
|
# HTTPS Port 443
|
|
# Serves HTTPS traffic with auto-generated certificates
|
|
|
|
"example.com:443":
|
|
ip: ["webapp:8080"]
|
|
ssl: true
|
|
# Certificate path (auto-generated by certbot)
|
|
# /etc/easyhaproxy/certs/certbot/example.com/fullchain.pem
|
|
|
|
"app.example.com:443":
|
|
ip: ["app:3000"]
|
|
ssl: true
|
|
|
|
# Custom certificate example
|
|
"custom.example.com:443":
|
|
ip: ["custom-app:8080"]
|
|
ssl: true
|
|
# Place your certificate at:
|
|
# /etc/easyhaproxy/certs/haproxy/custom.example.com.pem
|
|
|
|
# Multiple domains with different backends
|
|
# Certbot will request separate certificates for each domain
|