diff --git a/CHANGELOG-2.1.263-c.md b/CHANGELOG-2.1.263-c.md new file mode 100644 index 0000000..9520671 --- /dev/null +++ b/CHANGELOG-2.1.263-c.md @@ -0,0 +1,33 @@ +# CHANGELOG 2.1.263-c — 手動リリース(ホットフィックス) + +## 修正 + +- **gateway の nginx が起動時にクラッシュループする不具合** + + ``` + nginx: [emerg] pcre2_compile() failed: missing closing parenthesis + in "^/s/(?[a-f0-9]" in /tmp/nginx/nginx.conf + ``` + + `files/gateway.conf.template` の + + ```nginx + location ~ ^/s/(?[a-f0-9]{10})(?/.*)?$ { + ``` + + で、正規表現中の `{10}` に含まれる `{` `}` を nginx の設定パーサーがブロック区切りと + 解釈し、`location` の正規表現が `^/s/(?[a-f0-9]` で途切れていた。 + nginx は `{` `}` `;` を含む正規表現を **クォート必須** とする。 + + 修正: 正規表現全体をダブルクォートで囲む。 + + ```nginx + location ~ "^/s/(?[a-f0-9]{10})(?/.*)?$" { + ``` + + `envsubst` の置換対象は `${GATEWAY_PORT}` など 6 変数のみで `{10}` には影響しないことを + 確認済み(レンダリング後のブレース対応もローカル検証)。 + +## バージョン + +`version` = `2.1.263-c` / `appVersion` = `"2.1.263"`。 diff --git a/CLAUDE.md b/CLAUDE.md index 8b109f6..83daeaa 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -57,6 +57,23 @@ Git リポジトリ(GitHub / Gitea など互換 Git 全般)をチェック ## 改修履歴 +### gateway nginx クラッシュループ修正(location 正規表現のクォート)(2026-09-08, v2.1.263-c) + +**症状**: gateway コンテナが起動直後に +`nginx: [emerg] pcre2_compile() failed: missing closing parenthesis in "^/s/(?[a-f0-9]"` +で終了し、CrashLoopBackOff。 + +**原因**: `files/gateway.conf.template` の +`location ~ ^/s/(?[a-f0-9]{10})(?/.*)?$ { ... }` で、正規表現中の `{10}` の +`{` `}` を nginx の設定パーサーがブロック区切りと解釈し、`location` の regex が +`^/s/(?[a-f0-9]` で切れていた(nginx は `{` `}` `;` を含む正規表現のクォートを必須とする)。 + +**修正内容**: `location ~ "^/s/(?[a-f0-9]{10})(?/.*)?$" { ... }` と +正規表現全体をダブルクォートで囲んだ。envsubst の対象は `${...}` の 6 変数のみで +`{10}` には影響しないことを確認済み。 + +**対象ファイル**: `files/gateway.conf.template`, `README.md`, `Chart.yaml`, `CHANGELOG-2.1.263-c.md` + ### 認証情報の credentials モード + トークン自動リフレッシュ(2026-09-08, v2.1.263-b) **背景**: サブスクリプションのアクセストークンは定期的に失効・ローテーションする。単発 diff --git a/Chart.yaml b/Chart.yaml index c03c5eb..619f3f3 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -6,7 +6,7 @@ description: >- 使い捨てコンテナで Git リポジトリ(GitHub / Gitea など)をチェックアウト・編集・ 検証・プッシュする。一定時間アイドルなセッションは自動破棄される。 type: application -version: 2.1.263-b +version: 2.1.263-c appVersion: "2.1.263" keywords: - claude-code diff --git a/README.md b/README.md index 84ec68a..08cef52 100644 --- a/README.md +++ b/README.md @@ -525,6 +525,7 @@ docker buildx build --platform linux/amd64,linux/arm64 \ | バージョン | Claude Code | 変更内容 | |---|---|---| +| 2.1.263-c | 2.1.263 | 修正: gateway の nginx が起動時 `pcre2_compile() failed: missing closing parenthesis` でクラッシュループ。`location ~` の正規表現に `{10}` が含まれ、nginx がブロック区切りの `{}` と解釈していた。正規表現全体をダブルクォートで囲んで解消 | | 2.1.263-b | 2.1.263 | `anthropic.authMode: credentials`(既定)を追加。`~/.claude/.credentials.json` 全体を注入し、セッション内 `claude` の自己更新に加え、クラスタ内 refresher CronJob(`refreshToken` で Secret を定期更新)でトークン失効に自動追従。→ トークンが変わっても再デプロイ不要。refresher の RBAC は認証情報 Secret 1 個の get/patch に限定 | | 2.1.263-a | 2.1.263 | Service を `LoadBalancer` 対応(kube-vip 等でローカル LB の IP から管理画面へアクセス、`loadBalancerSourceRanges` で接続元制限、既定を `LoadBalancer` に変更)。Ingress は従来どおり併用可。API を使わないサブスクリプション認証(`claude setup-token` → `authMode: oauth`)の手順を README に追記 | | 2.1.263 | 2.1.263 | 自動更新 | diff --git a/files/gateway.conf.template b/files/gateway.conf.template index 12e5e37..e17df2e 100644 --- a/files/gateway.conf.template +++ b/files/gateway.conf.template @@ -72,7 +72,8 @@ http { } # ---- セッションへのリバースプロキシ(WebSocket 対応)---- - location ~ ^/s/(?[a-f0-9]{10})(?/.*)?$ { + # 正規表現に { } を含むため location 全体をクォートする(nginx 必須) + location ~ "^/s/(?[a-f0-9]{10})(?/.*)?$" { include /tmp/nginx/auth_basic.conf; include /tmp/nginx/auth_request.conf; error_page 401 = @needlogin;