[Bug]: RSS feed reuses guids and ignores PATCHCALL_URL

未關閉
#12 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

@amroquqa99-art 已經在處理了。

開始於 2026年11月29日。

  • #13 來自 @amroquqa99-art —— 未關閉

評估

難度
3/5
預估耗時
半天
新手友好度
35/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
停滯
技術堆疊
docker, go, xml
領域
backend

研究方向

Start with internal/web/web.go and internal/check/check.go, where the issue identifies the guid, channel link, and early-return paths. Review open PR #13 before starting to avoid duplicating work. Done means each feed item has a unique app/version/advisory guid, the channel uses the configured public URL when available, saved alerts populate the feed despite Docker startup failures, and the existing web and check tests cover all three cases.

由索引模型根據 Issue 內容生成。

描述

bug good first issue
What happened?

Three small slips in the RSS feed at /feed.xml:

  1. When an app moves to another version that's still caught by the same advisory, the new item gets the same guid as the old one, so feed readers think they've seen it and drop it. The guid is app plus advisory, but an alert is per app, version and advisory
  2. The channel link is http:// plus whatever Host header the request came in with, not the PATCHCALL_URL you set, so it's always http:// even when you're on https, and it's whatever host the request happened to use
  3. If Docker can't be listed when Patchcall starts, the feed's empty until Docker answers, even though the saved alerts are there
Steps to reproduce
  1. Set PATCHCALL_URL=https://patchcall.example.com, then open http://localhost:<port>/feed.xml - the channel <link> is http://localhost:<port>/
  2. For the guid, have an app caught by an advisory, then move it to another version that's also affected - the second alert's <guid> matches the first
  3. For the empty start, stop Docker (or point Patchcall at a socket that isn't there), restart Patchcall, and open /feed.xml
Version

1.0.0, and still there on main at 31c39ef

How are you running it?

Docker

Environment

Linux, Docker Engine

Relevant log output

None, nothing's logged for any of them.

Before submitting
  • I have searched existing issues for duplicates
  • I am running the latest version
  • I agree to follow this project's Code of Conduct
Fix
  1. Guid: internal/web/web.go:301 uses it.App + " " + it.Hit.ID. Add the version, to match the alert key in internal/check/check.go:263 (app, version, advisory)
  2. Link: internal/web/web.go:193 passes "http://"+r.Host+"/". Use the public URL (opts.PublicURL, which the alerts already use in internal/check/report.go:97) when it's set, and only fall back to the Host header without it
  3. Empty start: Run in internal/check/check.go:112-116 returns before report.Feed = c.state.Feed (line 151) when listing fails. Set the feed before that early return

A test for each in the existing web and check tests would be neat.

主要語言
Go
星號
3
分支
1
平均合併
1 小時 11 分鐘
30 天內合併 PR
10

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

NotAFlightRisk/patchcall 的其他 Issue

查看 NotAFlightRisk/patchcall 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。