| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
Windows client sends ping every 10s.
Linux server responds with pong.
If write fails, client detects disconnect and reconnects.
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
| |
Avoids bufio.Scanner token limit by sending manifest in batches.
Each batch is a separate JSON line with up to 1000 files.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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).
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
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
|