os-tailscale: pre-auth key is not used when tailscaled.state is missing or holds a stale profile
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start by reading the rc.conf.d/tailscaled logic described in the issue and compare its state-file check with the proposed tailscale status --json check after the daemon starts. Trace how service startup builds the tailscale up arguments for missing state and a logged-out profile. Done means a configured pre-auth key is used in both cases, while an already logged-in node does not reuse it.
索引モデルが issue の本文から書いたものです。
説明
Important notices
Before you add a new report, we ask you kindly to acknowledge the following:
- I have read the contributing guide lines at https://github.com/opnsense/plugins/blob/master/CONTRIBUTING.md
- I have searched the existing issues, open and closed, and I'm convinced that mine is new.
- The title contains the plugin to which this issue belongs
Describe the bug
Since #5047, rc.conf.d/tailscaled passes --auth-key only when tailscaled.state exists and has no "_current-profile":
if [ -f /var/db/tailscale/tailscaled.state ]; then
if ! grep -q '"_current-profile"' /var/db/tailscale/tailscaled.state; then
tailscaled_up_args_ext="--auth-key=..."
fi
fi
That fixed the key being reused at boot (#4661), but leaves two cases where a valid, unused pre-auth key is never passed to tailscale up:
- No state file yet. The rc script reads its config before tailscaled creates
tailscaled.state, so the first start runstailscale upwithout--auth-key. It prints a login URL and times out ("timeout waiting for Tailscale service to enter a Running state"). A second start then passes the key and joins. - Stale profile. Removing the plugin leaves
/var/db/tailscalein place. If the node was then deleted from the tailnet, the old profile is still intailscaled.state. After reinstalling the plugin and setting a new pre-auth key, the key is never passed;tailscale statusshowsLogged out., and Services start/restart returnsError (1). Recovery needs a shell: stop tailscaled, movetailscaled.stateandprofile-dataaside, then start twice (case 1).
To Reproduce
Case 2:
- Install os-tailscale, set a pre-auth key, enable, and let the node join.
- Delete the node from the tailnet in the admin console.
- Remove the os-tailscale plugin, then install it again.
- Generate a new, unused pre-auth key, set it under VPN › Tailscale › Authentication, enable and apply.
tailscale statusshowsLogged out.; the node never joins.
Case 1:
- With tailscaled stopped, move
/var/db/tailscale/tailscaled.stateaside. - Start the service:
tailscale upruns without--auth-keyand prints a login URL. - Start it again: it joins with the configured key.
Expected behavior
When a pre-auth key is configured and tailscaled is not logged in, tailscale up uses the key. That includes a missing state file, and a profile that is logged out or whose node no longer exists. For example, decide on tailscale status --json (BackendState = NeedsLogin) after tailscaled starts, instead of grepping the state file before it starts.
Describe alternatives you considered
- Keep the grep, but also pass the key when the state file does not exist (fixes case 1 only).
- Remove
/var/db/tailscalewhen the plugin is removed, or offer a "reset node state" action (helps case 2).
Environment
OPNsense 26.1.11_10 (amd64)
os-tailscale 1.4
tailscale 1.98.5_1
- 主要言語
- PHP
- スター
- 1.2k
- フォーク
- 932
- 平均マージ
- 1日 11時間
- マージ済み PR(30日)
- 22
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
opnsense/plugins のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
www/squid: configctl proxy stop returns before Squid exits, so stop+start (e.g. Monit restart) failsオープンsupport
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
opnsense/plugins#5983 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 1 日以内に返信
-
net/haproxy: IPv6 literal in real server "Source address" generates an invalid `source` directive対応中かも @fraenki が 6 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
opnsense/plugins#5973 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
[dns/ddclient] Support hiding unused standard fields per service (optional_hiding)対応中かも @bringha1 が 9 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
opnsense/plugins の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
Automattic/blocks-engine#7881 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
iruzen-dono/workless#117 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
magicsunday/webtrees-docker#285 ·
メンテナーはふだん 1 日以内に返信
-
area/tests type/bug when/soon
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
WP-CLI 3.0 fixes the cron lock and core download bugs described in the handbook対応中かも @mayankmajeji が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
WordPress/hosting-handbook#521 ·