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
+2 -2
View File
@@ -9,8 +9,8 @@
FROM node:lts-alpine
# entrypoint.sh 以 bash 撰寫,Alpine 預設無 bash 需另行安裝
# --no-cache 不保留 apk 索引快取以縮小映像;--no-check-certificate 略過憑證檢查 (需人工確認:略過憑證驗證有安全風險)
RUN apk add --no-cache --no-check-certificate bash
# --no-cache 不保留 apk 索引快取以縮小映像(保留 TLS 憑證檢查以防中間人攻擊)
RUN apk add --no-cache bash
# 複製容器進入點腳本至根目錄。
COPY entrypoint.sh /entrypoint.sh