fix(calculate-version): 修復 AI 審查的安全與健全性問題

- Dockerfile 移除 --no-check-certificate,恢復 TLS 憑證檢查以防中間人攻擊
- config 對 GITEA_SERVER_URL 加入 http/https URL 格式驗證
- logger.fail 改為 logger.error(僅輸出不終止行程),退出移至 index 頂層處理
- index.main 改用相依注入並於頂層攔截錯誤後 exit 1,避免 library 內呼叫 process.exit
- releases 將 response.text() 包入 try-catch 並附帶頁碼

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jeffery
2026-06-26 10:52:19 +08:00
co-authored by Claude Opus 4.8
parent f71d2cc35c
commit fdf33b41d8
5 changed files with 72 additions and 51 deletions
+6 -1
View File
@@ -47,7 +47,12 @@ async function fetchReleases(baseUrl, options = {}) {
throw new Error(`release API 請求失敗 (page=${page})`);
}
const text = await response.text();
let text;
try {
text = await response.text();
} catch (error) {
throw new Error(`release API 回應讀取失敗 (page=${page}): ${error.message}`);
}
// 空字串或 null 代表已無更多資料
if (!text || text === 'null') {