aboutsummaryrefslogtreecommitdiffstats
path: root/cmd_linux.go
Commit message (Collapse)AuthorAgeFilesLines
* Show file count before initial sync startsBernhard Guillon2026-07-071-4/+11
|
* Add sync_done handshake: server signals when ready, client waits before watchingBernhard Guillon2026-07-071-0/+4
|
* Add heartbeat ping/pong to detect disconnectsBernhard Guillon2026-07-071-0/+7
| | | | | | Windows client sends ping every 10s. Linux server responds with pong. If write fails, client detects disconnect and reconnects.
* Disable read timeout after manifest sync completesBernhard Guillon2026-07-071-0/+1
| | | | | | The 30s timeout was firing during idle event monitoring when no file changes were happening. Now reset to no timeout after manifest_done is received.
* Add robust error handling for TCP communicationBernhard Guillon2026-07-071-5/+14
| | | | | | | | | | | 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-4/+17
| | | | | Avoids bufio.Scanner token limit by sending manifest in batches. Each batch is a separate JSON line with up to 1000 files.
* Increase scanner buffer to 64MB for 479k+ file manifestsBernhard Guillon2026-07-071-1/+1
|
* Increase scanner buffer to 1MB for large manifestsBernhard Guillon2026-07-071-0/+1
|
* Switch from Unix sockets to TCP for Docker Desktop compatibilityBernhard Guillon2026-07-071-26/+29
| | | | | | | | | | | | | | 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).
* Set default socket path to /run/sourcewatch.sockBernhard Guillon2026-07-071-1/+1
|
* Fix undefined logLevel: move shared flags to flags.goBernhard Guillon2026-07-071-2/+0
|
* Add Windows-assisted initial sync for faster startupBernhard Guillon2026-07-071-55/+200
| | | | | | | | | | | | | | | | | | | | | 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/+131
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