8 Commits
Author SHA1 Message Date
ginuerzh 84d4d5dbbb p2p/proto: report the relay's liveness and a peer's punch trace
StatusReply gains relay_connected/relay_error: a live hole-punched session keeps
every gauge healthy while the relay is unreachable, so no other field can show an
outage. PeerDiagnostic gains trace, the peer's recent punch steps (oldest first).
Both are what the p2p doctor report reads.
2026-09-30 21:33:05 +08:00
ginuerzh 77755db3e3 p2p/proto: add a per-peer diagnostic to StatusReply
StatusReply gains a repeated PeerDiagnostic (path, reason, state, last punch
error, dialled endpoint, candidates, caps, session and silence ages, and the
punch counters), each keyed by the peer's base64 public key so the list is
attributable.
2026-09-30 20:12:39 +08:00
ginuerzh bbcf8d3588 p2p/proto: add encrypted/plaintext peer gauges to StatusReply 2026-09-30 12:15:57 +08:00
ginuerzh f5e7de73d7 p2p/proto: report transport stats in StatusReply
Add direct_peers/derp_peers gauges and punch_attempts/punch_success/
streams_direct/streams_derp counters, so an operator can tell whether hole
punching works for their peers or traffic is stuck on the relay.
2026-09-20 20:44:31 +08:00
ginuerzh 7000217d4f p2p/proto: replace the endpoint data plane with a Tunnel bidi stream
OpenTunnel now only authorizes the tunnel and returns a random single-use
id (the stream credential); the reserved endpoint field and CloseTunnel
are removed. Tunnel is a bidi stream whose lifetime is the tunnel's
lifetime, bound to the OpenTunnel id via the "id" metadata key. Breaking
change; regenerated with the pinned toolchain.
2026-09-12 08:19:13 +08:00
ginuerzh ee9e947e12 p2p/proto: add network field to OpenTunnelRequest
Selects the endpoint's semantics: "tcp" (a byte stream, the default when
empty) or "udp" (a datagram endpoint, one datagram per write). A datagram
tunnel is what carries a tun link, since a byte-stream endpoint coalesces
and splits packets. Empty defaults to tcp, so existing clients and hosts
are unaffected.
2026-09-11 20:20:29 +08:00
ginuerzh cba3f64b43 namespace proto file registrations to fix global registry collisions
Regenerate all protos from the module root with full relative paths so
descriptors register as e.g. auth/proto/auth.proto instead of bare
auth.proto. The protobuf file registry is process-global, so generic
filenames collided with other libraries and panicked at init
(proto: file "auth.proto" is already registered, #3).

Go API and wire format unchanged.
2026-09-05 22:23:11 +08:00
ginuerzh 45f52ef4bb add p2p plugin control protocol
P2P service with OpenTunnel/CloseTunnel/Status unary RPCs: the client
sends an opaque peer identifier, the plugin replies with an opaque
tunnel handle (v1: locally dialable TCP host:port). Error semantics:
transport/validation failures go through gRPC status; business
failures answer ok:false with a gRPC OK status — clients treat either
as failure. CloseTunnel is idempotent. Generated code checked in.
2026-09-05 20:44:48 +08:00