From b9a00c8a8ad9d63cf4e650ab52720e343d623baa Mon Sep 17 00:00:00 2001 From: root Date: Fri, 9 Oct 2026 13:56:50 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=BF=BD=E7=95=A5=E6=89=80=E6=9C=89=20?= =?UTF-8?q?TLS=20=E6=AA=A2=E6=9F=A5=EF=BC=88tea=20insecure=E3=80=81git=20s?= =?UTF-8?q?slVerify=3Dfalse=EF=BC=8C0.0.9=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 5.5 --- .claude-plugin/plugin.json | 2 +- .codex-plugin/plugin.json | 2 +- plugin.json | 2 +- skills/herdr-issue/SKILL.md | 2 +- skills/herdr-issue/scripts/lib.sh | 12 ++++++++++-- skills/herdr-issue/scripts/start.sh | 1 + 6 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index 60c5623..0a6a712 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "herdr-issue", - "version": "0.0.8", + "version": "0.0.9", "description": "透過 Herdr 讓 Claude agent 逐一實作 Gitea 議題(每個議題一個 worktree 與 tab)。", "skills": "./skills", "author": { diff --git a/.codex-plugin/plugin.json b/.codex-plugin/plugin.json index 94c02da..095c9b8 100644 --- a/.codex-plugin/plugin.json +++ b/.codex-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "herdr-issue", - "version": "0.0.8", + "version": "0.0.9", "description": "透過 Herdr 讓 Claude agent 逐一實作 Gitea 議題(每個議題一個 worktree 與 tab)。", "skills": "./skills" } diff --git a/plugin.json b/plugin.json index 88cefeb..08ca6b8 100644 --- a/plugin.json +++ b/plugin.json @@ -1,6 +1,6 @@ { "name": "herdr-issue", - "version": "0.0.8", + "version": "0.0.9", "description": "透過 Herdr 讓 Claude agent 逐一實作 Gitea 議題(每個議題一個 worktree 與 tab)。", "skills": "./skills/" } \ No newline at end of file diff --git a/skills/herdr-issue/SKILL.md b/skills/herdr-issue/SKILL.md index 16ece8e..b7308e3 100644 --- a/skills/herdr-issue/SKILL.md +++ b/skills/herdr-issue/SKILL.md @@ -59,6 +59,6 @@ Gitea 一律以 tea 的預設 login(`tea login list` 中 default 為 true 的 | `tick.sh` | 子 agent | 勾議題內文第 k 個核取方塊 | | `pr-wait.sh` | 子 agent(背景) | 等 PR 衝突、關閉或合併 | -TLS/憑證錯誤:`lib.sh` 的 tea 包裝會自動重試(預設 5 次、間隔 3 秒),輪詢中的 `watch-issue.sh`、`pr-wait.sh` 因此不會被一次性的連線問題打斷;不會關閉憑證驗證。若憑證長期有問題,請修正伺服器或系統 CA,而不是略過驗證。 +TLS/憑證錯誤:`lib.sh` 的 tea 包裝會自動重試(預設 5 次、間隔 3 秒),輪詢中的 `watch-issue.sh`、`pr-wait.sh` 因此不會被一次性的連線問題打斷;另外**一律忽略 TLS 憑證檢查**:`lib.sh` 會把 tea 設定檔(`~/.config/tea/config.yml`)所有 login 的 `insecure` 設為 `true`,git 則用 `GIT_SSL_NO_VERIFY` 與 worktree 的 `http.sslVerify=false`。 環境變數:`HERDR_ISSUE_TLS_RETRIES`(TLS 重試次數,預設 5)、`HERDR_ISSUE_INTERVAL`(pr-wait 輪詢秒數,預設 300)、`HERDR_ISSUE_WATCH_INTERVAL`(watch-issue 輪詢秒數,預設 5)、`HERDR_ISSUE_BLOCKED_AFTER`(blocked 多久才通知,預設 60 秒)、`HERDR_ISSUE_MODEL`(預設 `claude-sonnet-5-5`)。 diff --git a/skills/herdr-issue/scripts/lib.sh b/skills/herdr-issue/scripts/lib.sh index b609c18..3b8b4a9 100755 --- a/skills/herdr-issue/scripts/lib.sh +++ b/skills/herdr-issue/scripts/lib.sh @@ -20,11 +20,19 @@ fi [ -n "$HERDR_ISSUE_LOGIN" ] || { echo "herdr-issue: tea 沒有預設 login,請先 tea login default " >&2; exit 1; } export HERDR_ISSUE_LOGIN +# 忽略所有 TLS 檢查:tea 的 insecure 只能寫在設定檔(沒有環境變數),所以把所有 login 設成 insecure: true(冪等); +# git 用 GIT_SSL_NO_VERIFY。agent 的 tea/git 也會吃到同一份設定。 +TEA_CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/tea/config.yml" +if [ -f "$TEA_CONFIG" ] && grep -qE '^\s*insecure:\s*false' "$TEA_CONFIG"; then + sed -i -E 's/^(\s*insecure:\s*)false/\1true/' "$TEA_CONFIG" +fi +export GIT_SSL_NO_VERIFY=true + # git 走 HTTPS 時沒有帳密又不能互動輸入會失敗,所以腳本內的 git 一律用 tea 預設 login 的 token(git-credential.sh)。 export GIT_TERMINAL_PROMPT=0 -git() { command git -c credential.helper= -c "credential.helper=$SCRIPTS/git-credential.sh" "$@"; } +git() { command git -c http.sslVerify=false -c credential.helper= -c "credential.helper=$SCRIPTS/git-credential.sh" "$@"; } # TLS/憑證錯誤多半是暫時的(連線被重置、代理、時鐘),遇到就重試幾次,不要讓輪詢中的腳本因此中斷; -# 其他錯誤原樣回傳。不關閉憑證驗證。重試次數 HERDR_ISSUE_TLS_RETRIES(預設 5),間隔 3 秒。 +# 其他錯誤原樣回傳。(憑證驗證已關閉,仍保留重試以處理連線被重置等暫時性錯誤。)重試次數 HERDR_ISSUE_TLS_RETRIES(預設 5),間隔 3 秒。 tea() { local out err rc=0 try max="${HERDR_ISSUE_TLS_RETRIES:-5}" ef; ef="$(mktemp)" for ((try = 1; try <= max; try++)); do diff --git a/skills/herdr-issue/scripts/start.sh b/skills/herdr-issue/scripts/start.sh index babf093..dd4feb6 100755 --- a/skills/herdr-issue/scripts/start.sh +++ b/skills/herdr-issue/scripts/start.sh @@ -65,6 +65,7 @@ GIT_HOST_URL="$(command tea login list --output json | jq_py "print(next((l['url if [ -n "$GIT_HOST_URL" ]; then git -C "$CLONE" config --local --replace-all "credential.$GIT_HOST_URL.helper" "$SCRIPTS/git-credential.sh" fi +git -C "$WT" config --worktree http.sslVerify false git -C "$WT" config --worktree user.name "$GIT_USER" [ -z "$GIT_EMAIL" ] || git -C "$WT" config --worktree user.email "$GIT_EMAIL" -- 2.53.0