The following plugins were included in the build:
- Caddy-TLSConsul (stores certificates in a distributed system using Consul TLS K/V): caddy-tlsconsul
- Caddy-RateLimit (limits the number of requests): caddy-ratelimit.
- Prepare
git clone https://github.com/mihsergeev/caddy-consul.git /tmp/caddy-consul-install
cd /tmp/caddy-consul-install
- Generate secret key for consul sync
docker run -it hashicorp/consul consul keygen
- replace CONSULKEY to secret in file install.sh (one on all servers) - 142 line
Each server must have a unique hostname (replace SERVERNAME with your name)
hostname=SERVERNAME
hostname $(echo $hostname)
hostnamectl set-hostname $(echo $hostname)
echo $(hostname -I | cut -d' ' -f1) $(echo $hostname) >> /etc/hosts
- Install
bash install.sh
Need to configure the firewall, so it was allowed only ports 80 and 443 for 0.0.0.0/0, and all others are blocked. Allow everything for your white ip or your vpn
# cd /app/caddyconsul && docker compose stop
# cd / && rm -rf /app/caddyconsul
# docker system prune -a