10 Commits

Author SHA1 Message Date
davide 9016605f0d security: harden wg-init and wg-easy container isolation
- wg-init: isolate with network_mode:none, drop repo mount, use
  explicit PUID/PGID env vars instead of stat trick
- wg-easy: add read_only filesystem, /run tmpfs, no-new-privileges
- .env.example: simplify and document PUID/PGID

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 08:32:20 +02:00
davide fc5d6209c1 docs: add resource limits guide for low-RAM devices
- README: new section explaining WG_MEM_LIMIT / WG_MEMSWAP_LIMIT with
  per-RAM-tier values and host swap configuration for SBC boards
- CLAUDE.md: simplify resource limits table, drop device-specific
  measurements, reference README for per-board guidance
- .env.example: update comments with per-tier values and OOM warning

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 08:22:43 +02:00
davide 4d8eb01e4c fix: set wg-data ownership to repo user in wg-init
Mount the repo root read-only (/repo) in wg-init and use
`stat -c '%u:%g' /repo` to detect the host user automatically.
chown is applied before chmod 700, so the directory is accessible
without sudo on any machine regardless of UID.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 08:16:35 +02:00
davide 19d03ea624 docs(claude): document hardware compatibility and SBC constraints
Add a dedicated section covering:
- tested architectures: arm64 (RPi 3/4/5, Orange Pi, Rock Pi), armv7,
  amd64 (x86_64 servers, VMs, Intel NUC)
- known ip6tables boot issue on hosts with BSP/minimal kernels and how
  wg-init solves it automatically across all architectures
- resource limit variables (WG_MEM_LIMIT, WG_MEMSWAP_LIMIT, WG_CPUS)
  with guidance for boards under 1 GB RAM

Also corrects stale wg0.json reference to wg-easy.db in constraints list.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 08:10:43 +02:00
davide df78675198 docs: update README and .gitignore for automated setup
- .gitignore: remove .gitkeep exception, ignore wg-data/ entirely and
  fix stale comment (directory is generated by the container, not
  created manually)
- README: document init container behaviour in setup step 4, update
  project structure (wg0.json -> wg-easy.db), align security section

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 08:07:57 +02:00
davide 8c56e2fc9f feat: add wg-init service and pin image to minor tag
Introduce a wg-init container (Alpine) that runs before wg-easy and:
- loads ip6_tables and ip6table_nat kernel modules (silently skipped if
  already built-in or unavailable), fixing startup on hosts that do not
  auto-load these modules (e.g. Raspberry Pi)
- sets chmod 700 on wg-data/ so private keys are protected from the
  moment the container writes them

wg-easy now depends on wg-init completing successfully, making the setup
portable across hardware without any manual host configuration.

Also pins the image tag from 15.2.2 to the minor tag (15) to receive
patch updates automatically while avoiding breaking changes across majors.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 08:07:50 +02:00
davide e177300864 docs: aggiorna documentazione per wg-easy v15
Rimuove le istruzioni per generare PASSWORD_HASH, aggiorna la tabella
variabili, descrive il wizard di setup al primo avvio e aggiunge
la raccomandazione di aggiornamento mensile per la sicurezza.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 23:58:36 +02:00
davide 2b38127156 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>
2026-05-04 23:58:30 +02:00
davide 78e1c37a9e feat: ottimizzazione SBC e miglioramento documentazione
- Aggiunge limiti di memoria, CPU e swap al container per prevenire crash
  dell'host su SBC (la causa principale era log illimitati + OOM senza cgroup)
- Aggiunge rotazione log (max 30 MB totali) per evitare riempimento SD card
- Aggiunge health check con riavvio automatico in caso di blocco Node.js
- Monta /tmp come tmpfs per ridurre scritture sulla SD card
- Pinna l'immagine a 15.2.2 invece di latest
- Semplifica README: unico metodo per generare la password, guida passo-passo
- Aggiunge variabili opzionali WG_MEM_LIMIT / WG_MEMSWAP_LIMIT / WG_CPUS in .env.example

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 22:41:38 +02:00
davide e321dd312b chore: initial project setup
Configurazione Docker per WireGuard VPN con wg-easy.
Include docker-compose.yml, .env.example, .gitignore e README.
2026-04-12 23:15:02 +02:00