Keep STUN-only nodes in tailcat addresses
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 40/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- go
- Ambito
- networking
Direzione di ricerca
Read wireNode, wireRegionOf and wireRegion.derpRegion in the tailcfg wire file (wire.go around lines 57-88 in v0.8.0) and confirm which fields are copied in each direction. The issue already includes a diff adding an omitempty STUNOnly field and dropping the skip, so start by running the existing wire encode/decode tests to see the current byte output. Done means a STUN-only node round-trips through the address, a region without one encodes to identical bytes, and old addresses still parse. Note the reporter says they already have a patch and tests ready.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I run a private DERP relay that can't answer STUN. It's a Cloudflare Worker, so it has no UDP: https://github.com/cnupy/derp-worker. To give clients STUN I want a region with the relay as a relay-only node plus a couple of STUN-only nodes.
tailcfg already expresses that with STUNOnly. The tailcat address format drops it, though. wireNode has no field for the flag (wire.go:57 in v0.8.0) and wireRegionOf skips STUN-only nodes (wire.go:88), so a client that gets the address never sees the STUN servers. main is the same.
My workaround is to list the STUN servers as plain nodes after the relay. derphttp tries the nodes in order and the relay comes first, so it works today. But those entries now look like DERP servers, and if the relay is down a client tries to dial the STUN hosts as DERP.
Could the wire format carry STUNOnly instead of dropping those nodes? It's one omitempty field in wireNode and removing the skip, so addresses without STUN-only nodes keep the same bytes. derphttp already skips STUN-only nodes when it dials (derp/derphttp/derphttp_client.go:717) and netcheck probes every node in the region, so nothing else needs to change.
Another option would be a STUN server list on Client and Server, kept out of the address. That keeps addresses short, but each side has to be configured.
The change in wire.go:
@@ type wireNode struct {
InsecureForTests bool `cbor:"x,omitempty" json:"InsecureForTests,omitempty"`
+
+ // STUNOnly marks a node that only answers STUN, such as a public
+ // STUN server listed next to a relay that can't do UDP. derphttp
+ // never dials it for DERP; netcheck still probes it. Clients that
+ // predate this field ignore it and see a node whose DERP dial fails.
+ STUNOnly bool `cbor:"o,omitempty" json:"STUNOnly,omitempty"`
}
@@ func wireRegionOf(r *tailcfg.DERPRegion) *wireRegion {
for _, n := range r.Nodes {
- if n.STUNOnly {
- continue
- }
w.Nodes = append(w.Nodes, &wireNode{
@@
InsecureForTests: n.InsecureForTests,
+ STUNOnly: n.STUNOnly,
})
@@ func (w *wireRegion) derpRegion() *tailcfg.DERPRegion {
InsecureForTests: n.InsecureForTests,
+ STUNOnly: n.STUNOnly,
})
The tests check that an address made by current main still parses, that a region without STUN-only nodes encodes to the same bytes as before, and that a STUN-only node survives the round trip.
I have a patch with tests for this approach and can open a PR if it looks right.
- Lingua principale
- Go
- Stelle
- 10.1k
- Fork
- 470
- Merge medio
- 1g 14h
- PR unite (30g)
- 19
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di tailscale/tailcat
-
Update Tailscale dependency for Android cgo fallback fixForse già presa @lozbrown l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
Shring the homebrew binariesAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
A client that restarts with the same node key takes about 5 s to connectForse già presa @cnupy l’ha presa 1 giorno fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 24/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
tailscale/tailcat#190 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di tailscale/tailcat
Issue simili
-
[bug] Explorer trims leading spaces on file namesForse già presa @unshade l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
mickael-kerjean/filestash#1033 · 1 commento ·
-
[BUG] HTTP remote call timeouts can be returned as 500Forse già presa @XnLemon l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
apache/dubbo-go-pixiu#1096 ·
I maintainer di solito rispondono entro 1 giorno
-
conversation: ConverseAlpha1 and ConverseAlpha2 panic on empty choices or nil function call and return misleading error on scrubber failureForse già presa @patelshivani2283-lab l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
meta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
last9/last9-mcp-server#640 ·
I maintainer di solito rispondono entro 1 giorno