Skip to content

mihsergeev/caddy-consul

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Caddy high availability with Consul (docker compose)

Description

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.

INSTALL

  1. Prepare
git clone https://github.com/mihsergeev/caddy-consul.git /tmp/caddy-consul-install
cd /tmp/caddy-consul-install
  1. Generate secret key for consul sync
docker run -it hashicorp/consul consul keygen
  1. 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
  1. Install
bash install.sh

Important!!!

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

Uninstall

# cd /app/caddyconsul && docker compose stop
# cd / && rm -rf /app/caddyconsul
# docker system prune -a

About

Caddy high availability with Consul (Docker)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published