aboutsummaryrefslogtreecommitdiffstats
path: root/cmd_windows.go
Commit message (Collapse)AuthorAgeFilesLines
* Normalize Windows backslashes to forward slashes in manifest and event pathsBernhard Guillon2026-07-071-2/+6
|
* Add sync_done handshake: server signals when ready, client waits before watchingBernhard Guillon2026-07-071-0/+33
|
* Add -bufsize flag, resilient walk, and diagnostic logging for Windows watcherBernhard Guillon2026-07-071-11/+32
|
* Add directory count logging for recursive watcher setupBernhard Guillon2026-07-071-2/+9
|
* Add heartbeat ping/pong to detect disconnectsBernhard Guillon2026-07-071-0/+21
| | | | | | Windows client sends ping every 10s. Linux server responds with pong. If write fails, client detects disconnect and reconnects.
* Remove unused bufio import from cmd_windows.goBernhard Guillon2026-07-071-1/+0
|
* Add robust error handling for TCP communicationBernhard Guillon2026-07-071-12/+33
| | | | | | | | | | | Windows side: - sendManifest/sendEvent now return errors - Callers log errors and reconnect on failure Linux side: - 30s read timeout to detect dead connections - Better batch counting and logging - Proper error logging on disconnect
* Chunk manifest transfer: 1000 files per batchBernhard Guillon2026-07-071-8/+34
| | | | | Avoids bufio.Scanner token limit by sending manifest in batches. Each batch is a separate JSON line with up to 1000 files.
* Switch from Unix sockets to TCP for Docker Desktop compatibilityBernhard Guillon2026-07-071-61/+44
| | | | | | | | | | | | | | Architecture: - Container acts as TCP server (listens on :5151) - Windows binary connects as TCP client - Same protocol: newline-delimited JSON Usage: docker run -p 5151:5151 -v C:\src:/host:ro -v data:/data sourcewatch sourcewatch.exe -dir C:\src -connect localhost:5151 This avoids Docker Desktop's inability to mount Windows Unix sockets into Linux containers (they become directories instead of files).
* Add Windows-assisted initial sync for faster startupBernhard Guillon2026-07-071-28/+137
| | | | | | | | | | | | | | | | | | | | | New protocol: - Windows binary scans directory (fast native NTFS) and sends manifest - Container receives manifest, compares with local /data state - Only copies files that differ (size, modtime, mode, symlink) Protocol messages: - manifest: sends full file metadata from Windows - manifest_done: signals manifest transfer complete - event_create/write/remove: file change events Flow: 1. Container connects to socket 2. Windows binary sends manifest (file metadata) 3. Container scans /data (fast local volume) 4. Container copies only changed files from /host (9P bind mount) 5. Container enters event-waiting loop This dramatically speeds up initial sync by avoiding slow 9P scans.
* Add Windows native watcher with Unix socket IPCBernhard Guillon2026-07-071-0/+250
Architecture: - Windows binary: watches files via ReadDirectoryChangesW (fsnotify), sends events as newline-delimited JSON over Unix domain socket - Container: performs initial sync, then listens on socket for events from Windows watcher New files: - cmd_windows.go: Windows serve command (watcher + socket server) - cmd_linux.go: Linux socket client + event listener - types.go: shared FileEvent, FileMeta, Manifest types - watcher_test_helper.go: inotify-based watcher for integration tests Changes: - main.go: simplified to just call run() - watcher.go: removed fsnotify dependency, extracted Watcher interface - sync.go: removed duplicate type definitions - watcher_test.go: uses watchForTests() helper Usage: sourcewatch.exe -dir C:\myproject -socket D:\sourcewatch.sock docker run -v D:\sourcewatch.sock:/run/sourcewatch.sock \ -v C:\myproject:/host:ro -v mydata:/data sourcewatch