Skip to content

Releases

v1.4.7 — 案件查詢存取控制、Gemini 模型更新與文件稽核 (Case-Lookup Access Control, Gemini Model Refresh & Docs Audit)

Choose a tag to compare

@chinglin-k chinglin-k released this 22 Oct 15:42
47edc6b

v1.4.7 — 案件查詢存取控制、Gemini 模型更新與文件稽核

發布日期 / Release Date:2026-10-22
上一版本 / Previous:v1.4.6
完整比對 / Full Diff:v1.4.6...v1.4.7

內容與 CHANGELOG.md 的 [v1.4.7] 條目一致,另加上「升級須知」供部署參考。


🔑 重點摘要 / TL;DR

  • 🔒 案件查詢須「學號+手機末 4 碼」並通過 reCAPTCHA,修復任何人只要猜學號就能查到他人房號、床號與問題描述的個資外洩(SEC-QUERY-01)
  • 🔗 查詢結果不再能被塞入釣魚連結(SEC-QUERY-02)
  • 🔑 Gemini API Key 改以 header 傳送,不再出現在 URL(SEC-GEMINI-01)
  • 🤖 Gemini 備援模型 6 → 5 個:移除已棄用模型,新增 gemini-3.8-flash
  • 📦 開發依賴 2 個 high 等級弱點已修補(npm audit:0 vulnerabilities)
  • 📄 全站文件與程式碼逐項比對修正,移除 2 個過時檔案,版本號統一為 v1.4.7
  • ✅ 單元測試 55 → 60 項全數通過,ESLint 0 error / 0 warning

🔒 資安修正

SEC-QUERY-01:查詢案件須學號+手機末 4 碼+reCAPTCHA

修正前 修正後
查詢條件 只要學號 學號+報修時填寫的手機末 4 碼
機器人防護 無(僅依前端可偽造的 clientId 限流) reCAPTCHA v3(action query_report,門檻 0.5)
學號不存在 vs 末 4 碼錯誤 — 回傳完全相同的空結果,不洩漏學號是否存在

學號格式可預測(1 英文字母 + 7 位數字),舊版等於提供一個可列舉全體住宿生房號與報修內容的介面。

SEC-QUERY-02:查詢結果 Markdown 連結注入

查詢結果經 _renderMarkdown() 渲染,報修描述填入 [點我](https://…) 會變成機器人訊息中可點擊的連結。js/query.js 的 _esc() 現另轉義 [ ] ( ) * _。

SEC-GEMINI-01:API Key 改以 header 傳送

classifyIntent() 改用 x-goog-api-key header,避免 Key 出現在 URL 被代理或存取記錄留存。

開發依賴

npm audit fix:brace-expansion 1.1.20 → 1.1.21(GHSA-q2hr-2g5m-vwhr、GHSA-qhr7-859c-m2p7、GHSA-6j4f-fj2g-mc7p)、js-yaml 4.3.1 → 4.3.2(GHSA-2883-xcg3-v3hh)。皆為 ESLint 間接依賴,不會部署至線上。


🤖 Gemini 模型清單(依官方 deprecations 頁面,2026-10)

變更 模型 原因
➖ 移除 gemini-3.5-flash 已棄用,API 請求自動導向 gemini-3.6-flash(留著只會重複呼叫)
➖ 移除 gemini-3-flash-preview 官方建議改用 gemini-3.6-flash
➕ 新增 gemini-3.8-flash 最新 Stable Flash 模型
⏳ 保留 gemini-3.1-flash-lite 官方預告 2027-05-07 下架,屆時移除

新清單:gemini-3.5-flash-lite → gemini-3.1-flash-lite → gemini-3.8-flash → gemini-3.6-flash → gemini-3.1-pro-preview


📄 文件稽核

  • 修正 reCAPTCHA 適用範圍、模型數、測試數、UNKNOWN 子主題(應為 NONE)、去重程式碼片段、CI 觸發條件、Pages 部署方式等過時描述
  • gas/Code.gs 部署步驟補上 RECAPTCHA_SECRET_KEY
  • README 新增「測試」章節(各測試檔項數與涵蓋範圍)
  • 移除 VIBECODING_PROMPT_v1.4.6.md、RELEASE_NOTES_v1.4.6.md(發布說明改以 GitHub Release 為準)

⚠️ 升級須知 / Upgrade Notes

  1. GitHub Pages 前端:合併至 main 後自動更新。
  2. GAS 後端須手動部署:將 gas/Code.gs 全文貼入 GAS 專案 → 部署 → 管理部署 → 編輯 → 新版本。在此之前,SEC-QUERY-01 防護不會生效。
  3. Script Properties 不需新增項目(沿用 GEMINI_API_KEY、SPREADSHEET_ID、RECAPTCHA_SECRET_KEY)。

English Summary

  • SEC-QUERY-01: case lookup now requires the student ID plus the last 4 digits of the mobile number on the report, and reCAPTCHA v3 (query_report). An unknown ID and a wrong last-4 return the identical empty result.
  • SEC-QUERY-02: Markdown characters are escaped in query results, so report descriptions can no longer render as phishing links.
  • SEC-GEMINI-01: Gemini API key moved from the ?key= URL parameter to the x-goog-api-key header.
  • Gemini fallback list 6 → 5 models (removed deprecated gemini-3.5-flash, gemini-3-flash-preview; added gemini-3.8-flash).
  • Dev dependencies patched (npm audit: 0 vulnerabilities); docs audited; tests 55 → 60.
  • Redeploy gas/Code.gs manually; the frontend updates automatically via GitHub Pages.

v1.4.6

Choose a tag to compare

@chinglin-k chinglin-k released this 05 Sep 05:22
0561d30

v1.4.6 — 重複送出防護、房號床號驗證對齊與文件稽核

發布日期 / Release Date:2026-09-05
上一版本 / Previous:v1.4.5
完整比對 / Full Diff:v1.4.5...v1.4.6

本文件為 GitHub Release 頁面用文字,內容與 CHANGELOG.md 的 [v1.4.6] 條目一致,
另加上「升級須知」與「稽核方法」兩節,供閱讀 Release 頁面的使用者快速掌握重點。


🔑 重點摘要 / TL;DR

  • 🛡️ 新增報修表單 120 秒重複送出防護,避免手滑或腳本造成試算表重複案件(DUPLICATE_REPORT)
  • 🔒 房號/床號後端格式驗證收緊為與前端完全一致,修復可被繞過前端直接送出不合規格資料的問題
  • 📄 修復 7 處文件與程式碼不一致之處(BUG-52 ~ BUG-58),包含一處文件內部自相矛盾的高風險項目(BUG-54)
  • ✅ 單元測試由 53 項增至 55 項全數通過,ESLint 維持 0 error / 0 warning
  • 🔢 全站版本號統一升級為 v1.4.6
  • ℹ️ 一則資訊性附註:Gemini 模型清單現況查核(未變更程式碼,供專案擁有者參考)

✨ 新功能(回補文件)

這兩項功能已於 2026-09-04 合併上線(PR #27、#28),但發布時未同步更新文件;本次版本一併補齊文件並正式收錄進 CHANGELOG.md:

報修表單 120 秒重複送出防護

gas/Code.gs 的 writeReport() 新增去重機制:

  1. 以「學號 + 房號 + 問題描述前 50 字」組成字串
  2. 取 MD5 雜湊後編碼為 CacheService 的 key
  3. 120 秒內若命中相同指紋,直接拒絕並回傳 DUPLICATE_REPORT
  4. 僅於格式驗證通過、且實際寫入試算表成功後才存入快取,避免驗證失敗的請求誤佔用去重配額

前端 report.js 已備妥對應的雙語友善錯誤訊息。新增 2 組迴歸測試。

房號/床號後端格式驗證對齊前端

欄位 修復前(後端) 修復後(前後端一致)
房號 /^[A-Za-z0-9-]{1,8}$/(僅檢查英數字與連字號) /^(H|I|G|F[ABCDEF])[0-9]{1,4}(-[0-9]+)?$/i(須以 H、I、G、FA~FF 開頭)
床號 /^[0-9]{1,3}$/(允許 1–3 位數字) /^[0-9]$/(僅 1 位數字)

修復前,後端正則式比前端寬鬆,代表任何人繞過前端、直接呼叫 GAS Web App,都能送出前端表單根本不允許的格式並成功寫入試算表——這正是後端驗證存在的意義被架空的典型案例。


🛠️ 本次稽核修復(BUG-52 ~ BUG-58)

本次針對全專案原始碼與文件進行逐行一致性稽核,範圍涵蓋全部 js/*.js、gas/Code.gs、css/style.css、index.html、test/*.js、AGENTS.md、README.md、CHANGELOG.md、doc/*.md,並實際執行 npm test、npm run lint、git log/git blame 歷史比對。未發現任何生產程式碼缺陷;css/style.css 經比對後無需修改。

編號 嚴重度 問題 影響範圍
BUG-52 中 床號格式描述全站過時(仍寫「1–3 位數字」) 6 份文件
BUG-53 中 房號格式描述全站過時,且範例「A123」在新規則下不合法 6 份文件
BUG-54 高 報修成功畫面描述與 v1.4.5(BUG-50)已移除的實作直接矛盾,其中一處甚至與同一文件下方的決策記錄自相矛盾 3 份文件
BUG-55 低 單元測試數量過時(53 → 應為 55) 2 份文件
BUG-56 低 index.html 腳本載入順序註解遺漏 wifi-modal.js 1 個檔案
BUG-57 低 測試檔獨立維護的意圖白名單漏掉 BUTTON_QUERY,自 v1.4.0 起未同步 1 個檔案
BUG-58 低 文件內查詢驗證程式碼片段與實際雙錯誤代碼邏輯不符,且與同段文字說明矛盾 1 個檔案

BUG-54 特別說明:doc/project-memory.md 的「已確認業務規則」章節寫著「報修成功介面僅保留『報修成功!』與進度條,隱藏標題列 Header」——但同一份文件再往下 30 行的「v1.4.4/v1.4.5 決策記錄」卻明確記載這個畫面已於 v1.4.5 當作死碼移除。這代表文件在同一個檔案內就自相矛盾,且該過時描述還擴散到了 doc/requirements.md 與 doc/architecture.md。這類「新程式碼已上線、但描述舊行為的文字散落在文件各處未被清乾淨」的情況,正是本次逐行稽核要抓的重點。


📄 文件同步

以下檔案已更新內容並統一升版為 v1.4.6:

README.md・AGENTS.md・CHANGELOG.md・doc/architecture.md・doc/data-model.md・doc/requirements.md・doc/project-memory.md・doc/todo.md・package.json・package-lock.json

另修正 test/validation.test.js(BUG-57)與 index.html(BUG-56)。

doc/architecture.md 新增 §5.4.3 重複送出防護 小節;doc/todo.md 新增 J 輪 記錄本次工作,A~I 輪等既有歷史紀錄維持原樣不予更動(與本專案一貫做法一致:修正現況描述,但不竄改歷史紀錄本身)。


🧪 測試

npm test    →  55 pass / 0 fail(原 53 項,新增 2 組去重迴歸測試)
npm run lint → 0 error / 0 warning

ℹ️ 資訊性附註(未變更程式碼)

以網路搜尋查證 Google 官方文件(2026-09 現況),確認 GEMINI_MODELS_FALLBACK 現有 6 個模型(gemini-3.5-flash-lite、gemini-3.1-flash-lite、gemini-3.6-flash、gemini-3.5-flash、gemini-3.1-pro-preview、gemini-3-flash-preview)目前皆仍有效、正常運作,無任何一個已被官方宣告下架日期。

僅供專案擁有者參考,本次稽核未代為決定:

  • Google 已於 2026-08-13 發布 gemini-3.7-flash,官方描述為目前程式碼/Agent 任務表現最佳的 Flash 模型
  • gemini-3.1-flash-lite 已有預告下架日期 2027-05-07(尚有 8 個月餘裕,非急迫)

是否將 gemini-3.7-flash 納入備援清單、或調整既有模型的優先順序,屬於成本/RPM 配額層面的產品決策,建議由專案擁有者評估後另行處理。


⬆️ 升級須知

  • 本版本不需要任何手動遷移步驟或環境變數變更
  • 房號/床號後端驗證收緊不影響任何透過正規前端表單送出的請求——前端從一開始就套用相同(甚至更早生效)的規則;唯一受影響的是繞過前端、直接呼叫 GAS Web App 且送出不合規格資料的請求(無論是誤用或惡意嘗試),這些請求現在會被後端正確拒絕,這正是本次修復的目的
  • 若你的 GAS 部署是手動複製貼上 gas/Code.gs(而非透過 clasp 等工具同步),請記得重新部署最新版程式碼,才能套用重複送出防護與房號/床號驗證修復
  • 建議部署後執行一次 npm test && npm run lint 確認本地環境結果與本文件記載的 55/0 一致

📎 相關連結

v1.4.5 — Wi-Fi Setup Guide, Post-Release Audit & CI Fix

Choose a tag to compare

@chinglin-k chinglin-k released this 29 Aug 17:20

v1.4.5 — Wi-Fi 設定教學、上線後全面稽核與 CI 修復

CI 驗證 ✅

pm test: 53/53 pass

pm run lint: 0 errors / 0 warnings (BUG-44 修復,CI 重回綠燈)


✨ 新功能(回補文件)

  • Wi-Fi 機設定教學 Modal:教學選單新增第三選項「📡 Wi-Fi 機」,與 Windows / Mac 並列。純前端 4 步驟圖文教學,不呼叫 GAS 後端,Modal 支援 X 按鈕 / 關閉按鈕 / 遮罩點擊 / ESC 四種關閉方式,完整繁中英文雙語。
  • 查詢案件完成後顯示後續按鈕:查詢結果顯示後補上「🏠 回主選單 / 🔧 報修」按鈕,避免對話中斷。

🛠️ 稽核修復(BUG-44 ~ BUG-51)

Bug 嚴重度 說明
BUG-44 🔴 高 eslint.config.js 漏列 WifiModal 全域宣告,npm run lint 步驟失敗
BUG-45 🟡 中 報修表單房號 / 床號 / 手機號碼欄位 placeholder 寫死英文,中文介面不切換
BUG-46 🟡 中 打字指示器 aria-label 建立時寫死中文,英文介面螢幕閱讀器仍朗讀中文
BUG-47 🟡 中 Wi-Fi Modal 焦點管理失效(h2 標題缺 tabindex=-1,.focus() 靜默無效);補上背景捲動鎖定
BUG-48 🟢 低 註解錯字:「無限迄迴」→「無限循環」、「查詢完是」→「查詢完成後」
BUG-49 🟢 低 GAS classifyIntent() 的 GEMINI_API_KEY 未設定時改回傳固定大寫代碼
BUG-50 🟢 低 移除死碼:#modal-success-view HTML / CSS / JS / i18n(自 v1.1.0 起即無觸發路徑)
BUG-51 🟢 低 README 多語系備援分類器表格第 19 列缺漏西班牙文範例關鍵字

📄 文件同步

  • AGENTS.md、CHANGELOG.md、README.md 版本號升至 v1.4.5
  • doc/architecture.md §3.1 前端模組表補上 wifi-modal.js
  • doc/requirements.md §3.1 更新教學按鈕說明,新增 §3.7 Wi-Fi 機設定教學需求
  • doc/project-memory.md 補上決策記錄,並遮蔽舊 Spreadsheet ID 明碼(符合 AGENTS.md 規範 5)
  • doc/todo.md 新增「I 輪」章節
  • package.json + package-lock.json 版本號同步為 1.4.5

English Summary

Two-part release: (1) retroactively documenting the Wi-Fi router setup guide and post-query follow-up buttons shipped after v1.4.3; (2) a full post-release audit fixing a broken CI pipeline (BUG-44), i18n coverage gaps (BUG-45/46), an accessibility focus defect (BUG-47), comment typos (BUG-48), a backend error-code inconsistency (BUG-49), dead code removal (BUG-50), and a README table formatting issue (BUG-51). Also redacted a previously-rotated Spreadsheet ID from doc/project-memory.md to comply with AGENTS.md Rule 5.

v1.4.3 (Query Feature Documentation Consistency Sweep)

Choose a tag to compare

@chinglin-k chinglin-k released this 22 Aug 13:15

v1.4.3 - Query Feature Documentation Consistency Sweep

本版本針對「查詢案件」功能(於 v1.4.0 新增)在各文件頂層總覽與摘要章節是否同步更新,進行了全庫的精確掃描與修正。確保所有架構圖、計數摘要與系統角色描述皆與實際程式碼行為完全一致。

This release focuses on a comprehensive codebase scan and correction of the "Query Report" feature (introduced in v1.4.0) across all high-level overview and summary sections in the documentation. It ensures that all architecture diagrams, counter summaries, and system role descriptions are perfectly synchronized with the actual codebase behavior.


📄 文件正確性修復 (Documentation Correctness Fixes)

  • [BUG-41] 系統架構概覽圖修正 (System Architecture Diagram Update)

    • ZH: 修正了 doc/architecture.md 中 §1 的頂層系統架構圖(Mermaid)。原本 GAS -> Sheet 的資料流箭頭僅標示「報修寫入」,現已精確補上 queryReport() 實際執行「學號比對後讀取」的查詢行為,使頂層架構圖與 §4.4 的細節資料流描述保持一致。
    • EN: Updated the top-level system architecture diagram (Mermaid) in §1 of doc/architecture.md. The data flow arrow for GAS -> Sheet previously only indicated "report writing". It has now been accurately updated to include the query behavior of queryReport() (reading after student ID matching), ensuring consistency with the detailed data flow description in §4.4.
  • [BUG-42] 端點計數自相矛盾修正 (Correction of Contradictory Endpoint Counts)

    • ZH: 修正了 README.md 功能特色章節中的計數矛盾。原先宣稱雙層流量限制僅涵蓋四個端點(漏列 query),現已更正為「五個端點」(包含 classify、report、query、counter_get、counter_increment),使其與同份文件下方的「已知安全性說明」表格完全吻合。
    • EN: Fixed a contradictory endpoint count in the features section of README.md. The text originally claimed the dual-layer rate limiting covered only four endpoints (omitting query). It has been corrected to "five endpoints" (including classify, report, query, counter_get, and counter_increment), perfectly aligning with the "Known Security Implementations" table further down in the same document.
  • [BUG-43] 補齊系統角色與背景描述 (Completion of System Roles and Background Descriptions)

    • ZH: 在 doc/requirements.md 的 §1 專案背景與 §2 系統角色說明中,除了原有的「教學查詢與發起報修」外,正式補上了「查詢自己的報修案件進度」的描述。確保了 v1.4.0 的核心查詢功能在頂層需求總覽中不再缺席。
    • EN: In §1 Project Background and §2 System Roles of doc/requirements.md, the ability to "query the progress of one's own repair requests" was formally added alongside the existing tutorial lookup and report submission features. This ensures the core query functionality introduced in v1.4.0 is no longer absent from the top-level requirements overview.

✅ 本次掃描確認無問題的項目 (Verified Clean — No Action Needed)

  • ZH: 其餘文件包含 doc/data-model.md、doc/project-memory.md、doc/todo.md 以及 AGENTS.md,經查驗皆已正確涵蓋查詢功能,未發現同類疏漏。全數 53 項單元測試與 ESLint 檢查均維持 100% 通過。
  • EN: Other documents, including doc/data-model.md, doc/project-memory.md, doc/todo.md, and AGENTS.md, were verified to correctly cover the query feature with no similar omissions found. All 53 unit tests and ESLint checks remain 100% passing.

v1.4.2 (Documentation Audit & Bug Fixes)

Choose a tag to compare

@chinglin-k chinglin-k released this 22 Aug 12:58

v1.4.2 - Documentation Audit & Bug Fixes

本版本為全專案「程式碼 vs. 文件」逐行一致性稽核的修補更新,範圍涵蓋全部原始碼、各項說明文件(doc/*.md)、專案設定檔(package.json 等)。本次稽核過程執行了完整單元測試(53/53 通過)、ESLint(0 error/0 warning)、git blame/git log 歷史追蹤,並對 GitHub 遠端 PR 參照的歷史機密殘留進行了實測驗證,以確保全站程式、文件與版本號的精確對齊。

This release is a comprehensive "Code vs. Documentation" line-by-line consistency audit and patch update. The audit covers the entire codebase, all documentation (doc/*.md), and project configuration files (e.g., package.json). During this process, full unit tests (53/53 passed), ESLint (0 errors/0 warnings), git blame/git log historical tracking, and empirical verification of historical secret residuals in GitHub remote PR references were executed to ensure precise alignment across the codebase, documentation, and version numbers.


🛡️ 安全性修復與釐清 (Security Fixes & Clarifications)

  • [BUG-34] Git 歷史機密殘留範圍釐清 (Clarification on Git History Secret Residuals)

    • ZH: 實測以 git ls-remote + git fetch refs/pull/*/head 驗證,確認舊版 Spreadsheet ID 目前仍可透過 GitHub 已關閉/已合併 PR 的參照取得(這是 git-filter-repo + force push 無法觸及 PR ref 的已知限制)。經專案擁有者確認,該 Spreadsheet ID 已完成輪替、舊 ID 已失效,故目前殘留的參照已無實質風險。相關說明文件(README.md、doc/architecture.md、doc/project-memory.md)已更新為如實反映此現況。
    • EN: Empirically verified via git ls-remote + git fetch refs/pull/*/head that the old Spreadsheet ID is still accessible through references of closed/merged PRs on GitHub (a known limitation of git-filter-repo + force push, which cannot reach PR refs). As confirmed by the project owner, the Spreadsheet ID has been successfully rotated and the old ID is invalidated, neutralizing any substantive risk. Relevant documentation (README.md, doc/architecture.md, doc/project-memory.md) has been updated to accurately reflect this current status.
  • [BUG-35] CSP connect-src 移除不必要的網域 (Removal of Unnecessary Domains in CSP connect-src)

    • ZH: index.html 的 Content-Security-Policy 原本將 generativelanguage.googleapis.com 列入白名單,但前端 JavaScript 從未直接呼叫 Gemini API(僅由後端 gas/Code.gs 呼叫)。依循最小權限原則,已將此不必要的權限放寬移除。
    • EN: The Content-Security-Policy in index.html originally whitelisted generativelanguage.googleapis.com. Since the frontend JavaScript never directly calls the Gemini API (only the backend gas/Code.gs does), this unnecessary permission relaxation has been removed in accordance with the principle of least privilege.
  • [BUG-36] .env.example 補上遺漏的 RECAPTCHA_SECRET_KEY (Added Missing RECAPTCHA_SECRET_KEY to .env.example)

    • ZH: AGENTS.md 與 gas/Code.gs 皆將 RECAPTCHA_SECRET_KEY 列為必要的 Script Property,但 .env.example 範本先前漏列。現已補上並特別註明其為不可公開的 Secret Key。
    • EN: Both AGENTS.md and gas/Code.gs list RECAPTCHA_SECRET_KEY as a required Script Property, but it was previously missing from the .env.example template. It has now been added with a specific note distinguishing it as a non-public Secret Key.

🐛 文件與介面正確性修復 (Documentation & UI Correctness Fixes)

  • [BUG-37] CSS 亂碼註解全面修復 (Comprehensive Fix for Garbled CSS Comments)

    • ZH: 稽核發現 css/style.css 仍有 14 處編碼損毀的中文註解殘留(源自較早的 commit)。現已依上下文語意,重新建立為可讀的繁體中文註解(如 /* ── Reset 基礎設定 ── */、/* ── 表單錯誤訊息 ── */ 等),不影響任何 CSS 選擇器或樣式規則。
    • EN: An audit revealed 14 residual instances of corrupted encoding in Chinese comments within css/style.css (stemming from an earlier commit). These have now been reconstructed into readable Traditional Chinese comments based on context (e.g., /* ── Reset 基礎設定 ── */, /* ── 表單錯誤訊息 ── */), without affecting any CSS selectors or styling rules.
  • [BUG-38] 前端模組表補上 js/query.js (Added js/query.js to Frontend Modules Table)

    • ZH: doc/architecture.md 的前端模組總覽表(§3.1)先前遺漏了 js/query.js,現已補齊,確保與檔案結構圖完全一致。
    • EN: The frontend modules overview table (§3.1) in doc/architecture.md previously omitted js/query.js. It has now been added to ensure complete consistency with the file structure diagram.
  • [BUG-39] maximum-scale=1.0 過時敘述修正 (Correction of Outdated maximum-scale=1.0 Statements)

    • ZH: doc/architecture.md 與 doc/todo.md 原先仍記載使用 maximum-scale=1.0 防止 iOS 自動縮放,但該設定早因無障礙需求(WCAG 1.4.4)被移除。現已更新文件,正確描述為「改由 css/style.css 於窄螢幕下強制 input/textarea 使用 16px 字體」的無障礙友善做法。
    • EN: doc/architecture.md and doc/todo.md originally still documented the use of maximum-scale=1.0 to prevent iOS auto-zooming, although this setting was previously removed to comply with accessibility requirements (WCAG 1.4.4). The documentation has now been updated to accurately describe the accessibility-friendly approach of "forcing input/textarea to use a 16px font size on narrow screens via css/style.css."
  • [BUG-40] 全站版本號統一升級 (Unified Version Upgrade Across the Entire Project)

    • ZH: 全專案所有包含版本號的檔案(如 package.json、README.md、CHANGELOG.md 及所有 doc/*.md)已全數一致對齊至 v1.4.2,消除原先文件中版本號互相矛盾的問題。
    • EN: All files containing version numbers across the project (such as package.json, README.md, CHANGELOG.md, and all doc/*.md) have been consistently aligned to v1.4.2, eliminating previously contradictory version numbers in the documentation.

✅ 本次稽核確認無問題的項目 (Verified Clean — No Action Needed)

  • chat.js 與 query.js 的 XSS 防護模式(轉義與 Markdown 渲染順序)邏輯正確,無注入風險。
  • 目前工作目錄與 main / tag 分支歷史中無其他明碼機密。
  • 雙層速率限制、reCAPTCHA v3 驗證、一次性 Token 機制、後端三段式驗證均正確實作且與文件描述一致。
  • 測試套件(53/53)與 ESLint 均運作正常。

v1.3.1 - 核心安全性更新與全面體驗優化 (Core Security Update & Comprehensive Experience Optimization)

Choose a tag to compare

@chinglin-k chinglin-k released this 09 Aug 13:37
1adba57

🚀 版本概覽 / Release Overview

本次更新(v1.3.1)針對系統進行了深度的安全性與穩定性修補,解決了包含驗證繞過、資訊洩漏及計數器濫用等多項潛在風險。同時,我們全面優化了多語系支援(i18n)機制,並將內部程式碼品質與專案文件進行了高度對齊,確保未來維護的可靠性。

This release (v1.3.1) introduces critical security and stability patches, resolving potential risks including validation bypass, information disclosure, and rate limit abuse. Furthermore, we have comprehensively optimized the multi-language (i18n) support and strictly aligned the codebase quality with project documentation for enhanced future maintainability.


🛡️ 安全性與隱私修復 / Security & Privacy Fixes

  • [BUG-01] 強化後端表單驗證:修補必填欄位可透過空字串繞過前端直接寫入的問題。
    Hardened backend form validation to prevent mandatory field bypass using empty strings.
  • [BUG-02] 清理 Git 歷史紀錄:徹底清除並覆寫歷史紀錄中不慎外流的 Google Spreadsheet ID,避免機敏資料外洩。
    Scrubbed Git history and force-pushed to permanently remove a leaked Google Spreadsheet ID.
  • [BUG-03] 防範資訊洩漏 (CWE-209):隱藏後端發生例外錯誤時回傳的原始細節,統一轉換為安全的 INTERNAL_ERROR。
    Prevented information disclosure by masking raw backend exceptions with a generic INTERNAL_ERROR.

⚙️ 核心邏輯與功能優化 / Core Logic & Functional Enhancements

  • [BUG-04] 錯誤訊息在地化遮蔽:優化前端顯示邏輯,自動攔截全大寫內部錯誤代碼,並轉換為友善的在地化提示。
    Optimized frontend error handling to intercept internal error codes and translate them into user-friendly localized messages.
  • [BUG-08] 升級流量限制防護:計數器(Counter)API 現已支援基於 clientId 的個別限流機制,並適度調升全域速率上限以容納新生入住等尖峰流量。
    Upgraded rate-limiting defenses for the Counter API by implementing clientId-based individual quotas and appropriately raising the global limit for peak traffic.
  • [BUG-06 & BUG-07] 多語系與平台相容性修復:修正韓語意圖判斷引擎的關鍵字亂碼,並調整 Teams 客服按鈕的深連結喚起方式,以繞過 iOS/Safari 的彈跳視窗阻擋機制。
    Fixed corrupted Korean keywords in the intent engine and modified the Teams contact button deep-linking strategy to bypass iOS/Safari pop-up blockers.

🎨 介面與文件對齊 / UI & Documentation Alignment

  • [BUG-05, BUG-09, BUG-10] 程式碼品質與無障礙設計:補齊前端遺漏的 .aria 多語系標籤、統一 CSS 註解格式,並全面導入 CSS 變數以取代硬編碼色碼。
    Improved code quality and accessibility by completing missing .aria i18n tags, standardizing CSS comments, and replacing hardcoded hex colors with CSS variables.
  • [DOC-01, DOC-02] 全面文件同步:更新並對齊了包含 CHANGELOG.md、AGENTS.md 及 doc/ 目錄下的所有架構與需求文件,確保與 v1.3.1 程式碼狀態完全一致。
    Synchronized all architectural and requirement documentation to ensure strict alignment with the v1.3.1 codebase.

v1.2.0 — 雙語介面分離 + reCAPTCHA 徽章隱藏與合規揭露

Choose a tag to compare

@chinglin-k chinglin-k released this 08 Aug 13:20

🌟 v1.2.0 重點更新說明

🌐 雙語介面分離與即時切換 (i18n Interface Separation)

  • 輕量 i18n 模組 (js/i18n.js):DOM 靜態外殼掃描器 (data-i18n*),支援 localStorage ( cu_ne_lang) 偏好持久化與 切換。
  • 圓形懸浮切換按鈕 (#lang-toggle-btn):相對
    em 定位與 44px WCAG 觸控大小,支援 640px/360px 響應式切換。
  • 鏡像雙語結構 (js/config.js):RESPONSES、SETTING_ITEMS、INTENT_LABELS、BUTTON_LABELS 重構為 { zh, en } 結構。

🛡️ reCAPTCHA 合規揭露 (reCAPTCHA ToS Compliance)

  • CSS 隱藏浮動徽章:.grecaptcha-badge 設定隱藏。
  • 頁尾條款揭露:依據 Google ToS 硬性規定,頁尾新增雙語揭露段落 .recaptcha-disclosure(含隱私權政策與服務條款官方連結)。

v1.1.0 - Google reCAPTCHA v3 & Comprehensive Security & Test Suite Upgrade

Choose a tag to compare

@chinglin-k chinglin-k released this 08 Aug 12:13

🚀 Release Highlights

  • reCAPTCHA v3 Support: Invisible bot protection for report submission.
  • Client-Side & Global Rate Limiting: Multi-tier frequency control using client-side unique IDs & GAS CacheService.
  • Multi-Environment ESLint Config: ESLint 9 flat config for browser, GAS backend, and Node test suite.
  • Comprehensive Unit Testing: 34 unit tests with mock GAS services for Node test runner.
  • GitHub Actions CI/CD & Pages: Automated test run & pages build deployment.

v1.0.0 - 逢甲福星宿舍網路報修助理正式發布

Choose a tag to compare

@chinglin-k chinglin-k released this 08 Aug 09:38

🚀 Release v1.0.0 專案重大更新亮點

🔒 系統資安與架構強化 (Security & Architecture Hardening)

  • POST Body 資料傳輸:classify 與
    eport 改由 POST 送出,敏感資料(報修姓名、學號、電話、問題描述)不暴露於 URL。
  • 全域 Rate Limiting 防護:GAS 後端設置每分鐘請求上限(意圖辨識 30 次/分、報修送出 10 次/分),防止惡意刷請求。
  • 一次性 Token 驗證:前端每次請求需先取得記憶體層級一次性 Token (get_token),防止跨站或未授權偽造請求。
  • Content-Security-Policy (CSP):啟用 strict CSP 政策,防止 XSS 攻擊與非授權內容載入。
  • 後端欄位格式驗證:後端新增學號、電話、床號格式雙重驗證與長度限制截斷。

🌐 雙語 UI 與 19 語系備援分類器 (Bilingual UI & Multilingual NLU)

  • 介面完整雙語化:靜態 HTML、動態彈出視窗、報修表單、快速回覆按鈕與 Bot 回覆訊息全面支援繁中與英文並列展示。
  • 19 語系 Rule-based 關鍵字備援:當 Gemini API 達到額度或連線異常時,備援分類器可支援 19 種語言/地區(台灣繁中、香港粵語、澳門粵語、簡體中文、英文、日文、馬來文、韓文、印尼文、菲律賓文、泰文、南非荷蘭文、法文、史瓦帝尼文、越南文、墨西哥西班牙文、摩西文、蒙古文、埃及阿拉伯文/厄瓜多西班牙文)。

📱 視覺與 UI 體驗優化 (UX Improvements)

  • 無障礙 Viewport 修正:移除限制手勢放大 maximum-scale=1.0,全站完全支援二指縮放。
  • 冷氣電費意圖精準識別:修復關鍵字衝突,冷氣電費與儲值查詢由專屬分類處理。