Repository navigation
feat(daemons): reach a P2P daemon over EasyTier, through the nodes it names - #545
Merged
Merged
Conversation
… names An EasyTier daemon now names its nodes, `peers`: at least one tcp|udp|ws|wss|quic|wg://host:port, listed by GET /api/daemons. Reaching one downloads easytier-core where needed (installing), joins the network of its secret on a free loopback port, waits until the server's hmz web answers with the derived key, refuses a server older than this hmz, and asks it every few seconds whether it still answers; a server lost is reached again with the same backoff as ssh, and closing reaps easytier-core. The secret is never on a command line or said.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Unit 6 of the daemon-connection-modes batch: the EasyTier client transport, and
peersin the registry.easytierentry needspeers, at least one EasyTier node (tcp|udp|ws|wss|quic|wg://host:port). Without one the write is refused withAn EasyTier daemon needs at least one node., and a malformed node is refused by name.peersis listed byGET /api/daemonsand refused on ssh entries. A replace that gives no secret still keeps the secret._Remote._joins): downloadseasytier-coreonly where it is missing, reportinginstalling/Downloading EasyTier <v>while it does. It then startseasytier.joining(secret, <free port>, port=easytier.PORT, peers=entry peers)and waits (up to 60 s) until the farhmz webanswers/api/daemons/local/statewith the derived key. A far hmz older than this one is refused, which fails the daemon. Onceup, it asks the far web every 5 s and treats 3 misses in a row, or a change of version, as lost. A lost daemon is retried with the same backoff as ssh, andcloseterminates and reapseasytier-core. The secret never appears in argv, details or exceptions.easytiermocked. A newtests/integration/test_web_p2p.pyuses the fake easytier and a farhmz webin its own home with the derived key; it covers reading through/d/far/api/..., refusing an older server, and a drop followed by a reconnect and a reap. Existing web daemon tests now includepeers.peersadded to user/web, reference/settings and reference/web.Notes:
peersare now invalid, so the next write drops them. The page has no P2P form yet, so this is unlikely to affect anyone.hmz server) must meet through the same nodes. Unit 7/8 own that, and the specs.hmz webhas no key flag (unit 7 owns the CLI).Checks: ruff, ruff format, pyright and the full
uv run pytest. A manual e2e with the fake easytier also passed: nearhmz web→ POST daemon → connect →up→/d/far/api/daemons.