Cette configuration utilise une installation syncthing basée sur docker-compose et Traefik comme reverse proxy. L’authentification HTTP basic est utilisée pour empêcher l’accès non autorisé à l’interface web syncthing. Alternativement, vous pouvez utiliser la protection par mot de passe intégrée.
Voir Configuration simple Traefik docker-compose avec challenges Lets Encrypt Cloudflare DNS-01 & TLS-ALPN-01 & HTTP-01 pour ma configuration HTTPS pour Traefik.
docker-compose.syncthing.yml
services:
syncthing:
image: syncthing/syncthing
hostname: Syncthing-Myserver
environment:
- PUID=1000
- PGID=1000
volumes:
- ./syncthing_data:/var/syncthing
ports: # NOTE : 8384 non transféré, ceci est géré par traefik
- "22000:22000"
- "21027:21027/udp"
restart: unless-stopped
labels:
- "traefik.enable=true"
- "traefik.http.routers.syncthing.rule=Host(`syncthing.myserver.net`)"
- "traefik.http.routers.syncthing.entrypoints=websecure"
- "traefik.http.routers.syncthing.tls.certresolver=cloudflare"
- "traefik.http.routers.syncthing.tls.domains[0].main=myserver.net"
- "traefik.http.routers.syncthing.tls.domains[0].sans=*.myserver.net"
- "traefik.http.services.syncthing.loadbalancer.server.port=8384"
- "traefik.http.routers.syncthing.middlewares=syncthing-auth"
# Auth (ceci est partagé avec le serveur). NOTE : générez avec "htpasswd -n admin" et REMPLACEZ CHAQUE "$" par "$$" DANS LA SORTIE !
- "traefik.http.middlewares.syncthing-auth.basicauth.users=admin:$$apr1$$ehr8oqEZ$$tHoOVLG19oHdUe81IeePo1
"Si cet article vous a aidé, pensez à m'offrir un café ou à faire un don via PayPal pour soutenir la recherche et la publication de nouveaux articles sur TechOverflow