docs: 首席架構師審查 - 前端內網 IP 禁令 (90/100)
Some checks failed
E2E Health Check / e2e-health (push) Has been cancelled
CD Pipeline / build-and-deploy (push) Has been cancelled

審查結果:
- P0 安全修復: sudo 密碼改用 secret 
- P1 識別: Sentry DSN build-arg 待處理
- P2 識別: 3 項次要問題已記錄

已更新:
- Skills 01 v1.5: 前端建置禁止內網 IP
- Skills 04 v2.1: CD 安全規範 + 內網 IP 禁令
- ADR-022: 新增前端內網 IP 禁令章節
- MEMORY.md: 新增審查記錄索引

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
OG T
2026-03-30 01:32:48 +08:00
parent 3c3294de4b
commit 4f06115497
3 changed files with 99 additions and 0 deletions

View File

@@ -136,9 +136,39 @@ SENTRY_AUTH_TOKEN: str = "" # K8s Secret
- 多一個服務需維護 (Sentry Self-Hosted)
- 額外的 API 呼叫延遲
## 🔴 前端內網 IP 禁令 (2026-03-30 補充)
### 問題
前端 Sentry DSN 使用內網 IP (`192.168.0.110:9000`) 會觸發瀏覽器「存取區域網路」權限對話框。
### 解決方案
**已採用**: Sentry Tunnel (方案 A)
```
前端 → /api/sentry-tunnel → Sentry Server (192.168.0.110:9000)
↑ 公網域名 ↑ Server-Side 內網
```
**配置位置**:
- `apps/web/src/app/api/sentry-tunnel/route.ts` - Tunnel 實作
- `apps/web/sentry.client.config.ts` - `tunnel: '/api/sentry-tunnel'`
### CD Pipeline 規範
```yaml
# ❌ 禁止 (即使有 Tunnel也不應暴露內網 IP)
--build-arg NEXT_PUBLIC_SENTRY_DSN=http://...@192.168.0.110:9000/2
# ✅ 不設定 (依賴 Tunnel 機制)
# 或使用公網域名反向代理
```
## 相關文件
- `project_phase10_arch_review.md` - 架構審查報告
- `project_sentry_full_integration.md` - 整合計畫
- `feedback_sentry_local_network.md` - 區域網路權限問題
- ADR-005: BFF Architecture
- ADR-006: AI Fallback Strategy