Commit Graph

7 Commits

Author SHA1 Message Date
darroyo 25a31af64c Make ExecStartPre chown non-fatal to prevent service start failures 2026-07-08 17:42:28 -04:00
darroyo f5f3b2263e fix(postinst): robust service restart on upgrade
- Always enable service (not conditional on is-enabled)
- try-restart: reinicia si ya estaba corriendo
- start fallback: arranca si quedó inactive después del try-restart
- Covers: fresh install, running disabled, stopped manual, failed
- Like baby-nas but handles the "running-but-not-enabled" edge case
2026-07-07 23:54:08 -04:00
darroyo 1e516cb746 simplify postinst: use try-restart like baby-nas
- Replace if/restart/else/enable with is-enabled && enable; try-restart
- Consistent with baby-nas approach
- Handles failed services gracefully (no auto-recover)
2026-07-07 23:49:52 -04:00
darroyo a79bb29699 fix: service restart on upgrade and no-cache headers for SPA assets
- postinst: restart instead of start if service already enabled (upgrade case)
- embed.go: no-cache/no-store on index.html, immutable cache on hashed assets
- Fixes web not refreshing after dpkg upgrade
2026-07-07 23:41:16 -04:00
darroyo 68592bd119 Fix version in DEBIAN/control and Makefile default to 1.0.1 2026-07-07 15:52:33 -04:00
darroyo 4cc93c7747 fix: self-healing permissions on /var/lib/syncserver
- systemd: add ExecStartPre to chown -R the data dir before every start
- postinst: add chown -R after creating dirs to fix ownership on upgrades

This prevents the service from failing if dirs were created by root or
drifted ownership after a manual run.
2026-07-07 15:41:10 -04:00
darroyo 8e08c73f60 feat: complete SyncServer implementation
Full-stack Go monolith with embedded React frontend for orchestrating
rsync-over-SSH file synchronization with Wake-on-LAN support.

Features:
- JWT auth (HS256) with bcrypt password hashing
- CRUD for machines (with WoL config) and sync_pairs
- Ed25519 SSH key generation and known_hosts management
- WoL magic packet sender + TCP-connect waiter with backoff
- Sync engine: rsync subprocess, per-pair job queue, progress parsing
- Homebrew cron parser for scheduled syncs
- SSE stream for live job status (queued/waking_up/running/success/failed)
- React+TS+Vite+Tailwind SPA embedded via embed.FS
- Debian packaging with systemd unit, postinst/prerm/postrm

Tech stack:
- Go 1.22+ (CGO_ENABLED=0, pure SQLite via modernc.org/sqlite)
- chi router for HTTP API
- TypeScript + React 18 + Tailwind CSS frontend
- Cross-compiled to Linux amd64 for Proxmox LXC deployment

Tests: wol (MAC parsing, magic packet), syncengine/queue, scheduler/cron
2026-07-07 15:03:22 -04:00