Repository navigation
feat(reports): add feedback portal and admin roles - #39
Merged
Merged
Conversation
This was referenced Nov 12, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
使用者可以從提醒確認卡的「回報問題」進入 Bot 私聊,選原因、預覽選填附件與回報者資訊,再確認送出。SQLite 依草稿去重,保存送出時的 Telegram user ID 與已設定的 username。回報 schema 更新至 v12,舊回報仍可查閱。
後台使用 Telegram OIDC 登入,部署者以
ADMIN_TELEGRAM_IDS指定後台管理者。管理者可查閱回報、新增/移除維護者及編輯人員備註;維護者只能查閱、篩選回報。每次請求重新檢查權限,被移除的維護者即使已登入,下次請求也會失去存取權。人員列表以 Telegram 名稱或管理者備註辨識,名稱旁以藥丸顯示 username 與數字 ID。名稱與 username 於本人成功登入時更新,權限始終依數字 ID 判斷。窄螢幕下,人員資訊使用整列寬度,移除按鈕另列,藥丸各自換行。人員資訊各行使用 8px 間距,備註與授權紀錄的行高為 1.7。
維護者白名單、備註及登入身分資料保存於獨立 SQLite。Compose 新增
remindly-admin-data持久化 volume,原提醒資料庫仍唯讀掛載。README 與環境變數範例已同步;舊MAINTAINER_TELEGRAM_IDS改由管理者設定與後台白名單取代,既有維護者需在後台重新加入。回報詳情可複製單筆問題資料;列表可勾選多筆、全選本頁,複製所選或下載 Markdown。換頁、變更篩選與返回頁面會清除選取,複製失敗時提供手動複製文字框。單筆與多筆共用相同格式,保留解析當下、時區、原句及解析結果;缺少資料與使用者期望明確標示未提供,排除回報者 ID/username 欄位。原句本身可能包含人名。
Markdown 下載每次重新檢查登入與白名單,最多 50 筆、以參數化查詢讀取選定紀錄;維護者撤權後立即失去下載權限。輸出保留選取順序並去重,使用動態程式碼區塊圍欄避免回報內容破壞文件結構。CSP 僅新增
connect-src 'self',允許複製功能取得同源 Markdown。文件整理:
docs/usage.md、docs/deployment.md、docs/admin.md、docs/development.md。驗證:
make check通過:434 個測試、Ruff 與 smoke flow。Telegram OIDC 會將驗證後的數字字串 user ID 正規化為整數,再套用原有白名單;避免 Telegram 回傳字串 ID 時,管理者被誤判為未授權。回歸測試涵蓋整數/字串 ID、未授權帳號、無效格式、超出範圍,以及拒絕登入時不新增或覆寫人員資料。
已在 RPi5 的獨立假資料測試後台,透過既有 Tunnel 與 HTTPS 完成真實 Telegram 登入;確認可進入 12 筆假資料回報列表及人員權限頁,名稱、username、數字 ID 與管理者角色均正確。測試容器未取得 Bot token,回報資料庫唯讀、權限資料庫獨立;正式 Bot 與正式資料庫未變更。
此 PR 不包含正式環境部署、Token 用量或獨立 Telegram 身分查詢 Bot。