Skip to content

Fix RSS feed bugs, enhance security, and add unit tests - #50

Merged
danfeldmann merged 4 commits into
mainfrom
fix/rss-security-and-tests
Aug 31, 2026
Merged

danfeldmann merged 4 commits into
mainfrom
fix/rss-security-and-tests

Conversation

@danfeldmann

Copy link
Copy Markdown
Member

No description provided.

- updateRSSFeeds no longer appends a duplicate entry when a feed with the
  same URL is re-processed, it now updates the existing entry in place
- RemoveFeedFromList now scans all records instead of aborting with an
  error on the first name/channel mismatch
- AddUrlToList/RemoveFeedFromList validate the feed name and channel id
  to prevent path traversal via crafted Discord messages (the values end
  up in the on-disk record filename)
- !rss add/del now require the Discord 'Manage Server' permission,
  previously any guild member could manage RSS feeds
- config: New/Load happy path and panic-on-missing-file
- rss: AddUrlToList/RemoveFeedFromList/LoadFeeds against a temp
  simple-json-db instance, plus the internal updateRSSFeeds/
  updateMessageQueue helpers and the new input validation
- messagehandler: Manage Server permission check against a seeded
  discordgo state cache (no network calls), plus the no-op branches of
  ReplyCommands
- moritzhandler/emojihandler: no-op branches of ReplyCommands (own
  messages, no match / no custom emoji)
- add .dockerignore excluding data/ (contains config.yml with the bot
  token and the RSS database), .git and .github from the build context
- docker-compose.yml now bind-mounts ./data:/app/data at runtime instead
  of relying on COPY . . to include it in the image, which also fixes
  the RSS database not persisting across image rebuilds
- README: document that data/config.yml must exist on the host before
  running via docker compose
code-coverage.yml:
- add pull-requests: read, required by upload-code-coverage to look up
  the PR on push-triggered runs
- pin gocover-cobertura to v1.5.0 instead of @latest
- run tests with -race, the rss package uses mutexes to guard shared
  state

docker-build-push.yaml:
- bump and pin docker/login-action, docker/metadata-action and
  docker/build-push-action to their latest release by commit SHA,
  actions/checkout to v6
- drop the id-token: write permission, nothing in the workflow uses it
- remove dead pull_request conditionals, this workflow never triggers
  on pull_request
@danfeldmann danfeldmann self-assigned this Aug 31, 2026
@github-code-quality

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: Go

Go / code-coverage/go-test

The overall line coverage in commit 4b24ce1 in the fix/rss-security-and... branch is 41%. The line coverage in commit 850fa83 in the main branch is 0%.

Show a line coverage summary of the most impacted files.
File main 850fa83 fix/rss-security-and... 4b24ce1 +/-
handler/message...eplycommands.go 0% 21% +21%
handler/emojiha...eplycommands.go 0% 25% +25%
handler/moritzh...eplycommands.go 0% 56% +56%
extension/rss/rss.go 0% 62% +62%
config/load.go 0% 89% +89%
config/config.go 0% 100% +100%
handler/emojiha...dler/handler.go 0% 100% +100%
handler/message...dler/handler.go 0% 100% +100%
handler/moritzh...dler/handler.go 0% 100% +100%

@danfeldmann
danfeldmann merged commit c66781a into main Aug 31, 2026
2 checks passed
@danfeldmann
danfeldmann deleted the fix/rss-security-and-tests branch August 31, 2026 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant