Skip to content

Releases: notoriouslab/gmail-statement-fetcher

v1.0.3

17 Mar 04:57

Choose a tag to compare

安全強化

  • PDF/ZIP 密碼改由 env var 管理:新增 {BANKID}_PDF_PASSWORD / {BANKID}_ZIP_PASSWORD 支援,優先於 config.json 中的設定。密碼不再需要寫入設定檔。詳見 .env.example
  • 修正:寫入失敗時同時清除 temp 檔與 resolve_save_path 留下的 0-byte placeholder,不再殘留空檔。
  • 修正:date header 寫入 debug log 前先 sanitize,防止 log injection。
  • 修正prune_processed_uids(retention_days=0) 改為回傳副本,行為與有 retention 時一致。
  • 改善--dry-run 遇到同名檔時 log 會提示實際存檔名稱可能帶 _N 後綴。

文件

  • README 改為繁體中文主版,新增 README.en.md 英文版
  • SECURITY.mdSKILL.md.env.example 同步更新

測試

新增 tests/test_fetcher.py,51 個單元測試涵蓋核心邏輯。

v1.0.1 — Security Hardening / 安全強化

10 Mar 04:53

Choose a tag to compare

What's Changed / 變更內容

Security / 安全性

  • Privacy-safe dedup / 隱私安全去重: .processed_uids.json now stores SHA-256 subject hashes instead of raw email subjects — no PII on disk
    去重記錄改存主旨雜湊(SHA-256),不再儲存原始郵件主旨,磁碟上零 PII
  • Atomic PDF writes / 原子寫入: all file saves use tempfile.mkstemp() + os.replace() — no partial files on crash or interruption
    所有檔案寫入改用臨時檔 + 原子替換,中斷不會產生半殘檔案
  • Username masking / 帳號遮蔽: Gmail address masked in logs (first 3 chars + ***)
    日誌中 Gmail 帳號只顯示前 3 字元
  • IMAP socket timeout: 300s timeout on IMAP socket to prevent indefinite hangs on network failure
    IMAP 連線加入 300 秒逾時,防止網路中斷時無限等待
  • Sender domain boundary / 寄件人域名邊界: sender matching now requires @ or . boundary — prevents partial domain false positives (e.g. notsinopac.com no longer matches sinopac.com)
    寄件人比對加入域名邊界檢查,避免部分域名誤匹配
  • Log path sanitisation / 日誌路徑清理: file paths in log output use os.path.basename() only — no full paths leaked
    日誌中的檔案路徑只顯示檔名,不洩漏完整路徑
  • Config password warning / 密碼警告: startup warns if plaintext pdf_password or zip_password found in config
    啟動時警告設定檔中的明文密碼

Improvements / 改善

  • Python 3.9+ check: clear error message on unsupported Python versions
    不支援的 Python 版本會顯示明確錯誤訊息
  • SKILL.md: added OpenClaw agent integration file for AI agent frameworks
    新增 OpenClaw agent 整合檔,供 AI agent 框架使用
  • Docs refresh / 文件更新: README, SECURITY.md, CONTRIBUTING.md updated to reflect all v1.0.1 changes
    README、SECURITY.md、CONTRIBUTING.md 同步更新

Upgrading / 升級方式

cd gmail-statement-fetcher && git pull

No config changes needed. Existing .processed_uids.json files remain compatible — new entries use hashed subjects, old entries are still recognized.

不需要改設定。現有的 .processed_uids.json 相容——新條目使用雜湊主旨,舊條目仍可辨識。

Full Changelog: v1.0.0...v1.0.1