Keep STUN-only nodes in tailcat addresses
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 40/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- go
- 領域
- networking
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Go
- スター
- 10.1k
- フォーク
- 470
- 平均マージ
- 1日 14時間
- マージ済み PR(30日)
- 19
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
tailscale/tailcat のほかの issue
-
Update Tailscale dependency for Android cgo fallback fix対応中かも @lozbrown が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
A client that restarts with the same node key takes about 5 s to connect対応中かも @cnupy が 2 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 24/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
tailscale/tailcat#190 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
tailscale/tailcat の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
slavakurilyak/awesome-ai-agents#1041 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
goreleaser/nfpm#1199 ·
メンテナーはふだん 1 日以内に返信
-
edit fails on projects without a Dockerfile対応中かも @weirong-ui が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
kubernetes-sigs/kubebuilder#6209 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 半日 初心者へのやさしさ 72/100
hiero-ledger/hiero-sdk-go#1911 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 4 日以内に返信