Documentation
¶
Overview ¶
Package lansync implements cct's experimental device-to-device session sync over a local network. It is the project's only feature that sends session data off the machine, so it is strictly opt-in, peer-to-peer (no server/relay/cloud), refuses non-private addresses by default, and authenticates the peer with a high-entropy pairing code before any data moves.
Security model (stdlib only, no PAKE/mDNS dependency):
- The channel is TLS with per-process self-signed certificates (mutual auth). Trust is NOT delegated to a CA.
- The pairing code is a freshly generated ~96-bit secret shown by the serving side. Both sides derive a key from it and exchange an HMAC confirmation bound to BOTH TLS certificate fingerprints (channel binding). A man-in-the- middle terminates TLS separately with each side, so the fingerprints it presents differ from the real ones; without the code it cannot forge the confirmation, and the code's entropy makes offline guessing infeasible.
The actual session transfer reuses the existing, tested bundle export/import (+ --merge) path verbatim, so all checksum/manifest/conflict/mtime guarantees carry over unchanged.
Index ¶
Constants ¶
const ExperimentalNotice = "EXPERIMENTAL: cct sync sends your sessions over the local network to a paired device.\n" +
"It talks only to a peer you confirm with a one-time code, never to a server or the internet,\n" +
"and refuses non-private addresses. Re-run with --i-understand to proceed."
ExperimentalNotice is shown before every run because sync sends data off-machine.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
Tool agent.Kind // codex or claude
ClaudeHome claudehome.Home // used to scan when Tool == claude
ProjectPath string // absolute; "" means all in-scope sessions
Port int // serve: listen port (0 = OS-assigned)
Code string // connect: the pairing code shown by the peer
AllowPublic bool // override the private-address guard
PullOnly bool // do not send my sessions
PushOnly bool // do not apply received sessions
DryRun bool // exchange manifests and preview only; write nothing
Confirmed bool // the experimental --i-understand gate
Out io.Writer // progress/UX output
}
Options configures one LAN sync run.