migrate: aggiorna configurazione a wg-easy v15
Rimuove le variabili d'ambiente obsolete (WG_HOST, PASSWORD_HASH, WG_DEFAULT_DNS) ora gestite dalla web UI. Aggiunge INSECURE=true per accesso HTTP locale. Pulisce i commenti superflui dal compose. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+8
-17
@@ -1,24 +1,19 @@
|
||||
services:
|
||||
wg-easy:
|
||||
image: ghcr.io/wg-easy/wg-easy:15.2.2 # Pinnato — aggiornare deliberatamente con compose pull
|
||||
image: ghcr.io/wg-easy/wg-easy:15.2.2
|
||||
container_name: wg-easy
|
||||
restart: unless-stopped
|
||||
|
||||
# --- Limiti risorse (SBC con 1 GB RAM) ---
|
||||
# mem_limit = memswap_limit disabilita lo swap per il container:
|
||||
# se supera 256 MB Docker lo riavvia pulito invece di mandare in OOM l'host.
|
||||
mem_limit: "${WG_MEM_LIMIT:-256m}"
|
||||
memswap_limit: "${WG_MEMSWAP_LIMIT:-256m}"
|
||||
cpus: "${WG_CPUS:-1.0}"
|
||||
|
||||
# --- Rotazione log: evita che i log riempiano la SD card ---
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "3"
|
||||
|
||||
# --- Health check: riavvio automatico se Node.js si blocca ---
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:51821/"]
|
||||
interval: 60s
|
||||
@@ -27,27 +22,23 @@ services:
|
||||
start_period: 30s
|
||||
|
||||
environment:
|
||||
PASSWORD_HASH: "${PASSWORD_HASH}"
|
||||
TZ: "${TZ}"
|
||||
WG_HOST: "${WG_HOST}"
|
||||
WG_DEFAULT_DNS: "${WG_DEFAULT_DNS:-1.1.1.1,8.8.8.8}"
|
||||
INSECURE: "true"
|
||||
|
||||
# Chiavi e configurazione WireGuard persistite fuori dal container
|
||||
volumes:
|
||||
- ./wg-data:/etc/wireguard
|
||||
|
||||
# File temporanei in RAM invece che sulla SD card
|
||||
tmpfs:
|
||||
- /tmp:size=32m,mode=1777
|
||||
|
||||
ports:
|
||||
- "${WG_PORT:-51820}:51820/udp" # Traffico VPN WireGuard
|
||||
- "${WG_UI_PORT:-51821}:51821/tcp" # Interfaccia web di gestione
|
||||
- "${WG_PORT:-51820}:51820/udp"
|
||||
- "${WG_UI_PORT:-51821}:51821/tcp"
|
||||
|
||||
cap_add:
|
||||
- NET_ADMIN # Necessario per gestire le interfacce di rete (wg0) e le route
|
||||
- SYS_MODULE # Necessario per caricare il modulo kernel wireguard
|
||||
- NET_ADMIN
|
||||
- SYS_MODULE
|
||||
|
||||
sysctls:
|
||||
- net.ipv4.ip_forward=1 # Abilita il routing dei pacchetti IPv4 tra i client VPN e internet
|
||||
- net.ipv6.conf.all.forwarding=1 # Abilita il routing IPv6 (richiesto anche se non si usa IPv6)
|
||||
- net.ipv4.ip_forward=1
|
||||
- net.ipv6.conf.all.forwarding=1
|
||||
|
||||
Reference in New Issue
Block a user