security/tailscale: pre-auth key not used on first start of a fresh install (regression from 248ef719)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 83/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 領域
- backend, networking
調査の方向性
security/tailscale/src/opnsense/service/templates/OPNsense/Tailscale/rc.conf.d テンプレートを読み、認証キーの条件を tailscaled.state ファイルがない場合に説明されている動作と比較してください。可能であれば、新規インストールで初回起動と再起動のケースを再現してください。初回起動時に pre-auth key が渡され、状態に _current-profile が含まれると渡されなくなれば完了です。
索引モデルが 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
On a fresh install, os-tailscale does not log in with the configured pre-auth key on the first start. It only logs in after the service is restarted once.
The cause is the auth-key condition in security/tailscale/src/opnsense/service/templates/OPNsense/Tailscale/rc.conf.d:
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
--auth-key is only added when tailscaled.state already exists. On a fresh install that file does not exist yet (tailscaled creates it on its first start), so the first tailscale up runs without a key and the node never authenticates. On the next start the file exists without _current-profile, so the key is added and login works.
The original fix in #5047 (commit 351090da) handled this correctly: it added the key unless the file existed and contained a profile. The follow-up commit 248ef719 ("simplify previous a little") nested the checks, which dropped the "file does not exist" case.
To Reproduce
- Fresh OPNsense install, install os-tailscale.
- VPN > Tailscale > Authentication: set a pre-auth key. Settings: enable.
- Apply / start the service.
tailscale statusshows the node logged out (needs login)./var/db/tailscale/tailscaled.statenow exists.- Restart the service: it now logs in with the same key.
Expected behavior
The node authenticates with the pre-auth key on the first start.
Suggested fix
if [ ! -f /var/db/tailscale/tailscaled.state ] || ! grep -q '"_current-profile"' /var/db/tailscale/tailscaled.state; then
tailscaled_up_args_ext="--auth-key={{ OPNsense.tailscale.authentication.preAuthKey }}"
fi
This keeps the intent of #5047 (no key once authenticated) and also covers the first start.
Additional context
Last version without the bug: the template as of commit 351090da (#5047), before 248ef719. The template on master is unchanged.
Environment
OPNsense 26.7.10 (amd64), os-tailscale 1.4, tailscale 1.104.7.
- 主要言語
- 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 日以内に返信
-
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 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/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 ·