logs.gokuls.in

1 pull request merged across 1 repo

bahdotsh/zp

  • Add P2P sync system with HTTP and SSH tunnel support
  • Implement REST API server for sync operations (/sync, /history, /health)
  • Add timestamp-based conflict resolution and merge algorithm
  • Support local network (HTTP) and remote (SSH) peer connections
  • Implement automatic config migration for backward compatibility
  • Add comprehensive CLI commands for sync management
  • Include peer management (add/remove/test connections)
  • Add sync daemon with periodic auto-sync functionality
  • Support cross-platform sync (local, remote, virtual machines)

New dependencies:

  • tokio: async runtime for HTTP server and sync operations
  • warp: HTTP server framework for sync API
  • reqwest: HTTP client for peer communication
  • hostname: peer ID generation
  • fastrand: random suffix generation

New modules:

  • src/config.rs: sync configuration management
  • src/sync/: complete P2P sync implementation
  • handler.rs: high-level sync operations
  • protocol.rs: sync protocol and SSH tunneling
  • server.rs: HTTP API server
  • mod.rs: sync data structures and types

CLI additions:

--sync-daemon, --sync-now, --sync-config, --sync-enable, --sync-disable, --add-peer, --remove-peer, --test-peer

Files modified:

  • Cargo.toml: add async and HTTP dependencies
  • src/main.rs: async main + sync command handlers
  • src/query.rs: new CLI arguments for sync
  • src/history.rs: add Clone trait to ClipboardHistoryEntry
  • src/lib.rs: expose new config and sync modules

Documentation: SYNC_USAGE.md with setup and usage examples