-
Notifications
You must be signed in to change notification settings - Fork 807
feat(integrations): automatically disable googlereader/fever when not used #3543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm getting a 500 when no integration is enabled in the DB: store: unable to check if fever is used: sql: no rows in result set. Please test your changes and/or add some tests.
… used miniflux#3543 When there is no user of Fever/GoogleReader, there is no need to expose their endpoints. This reduces quite a bit the exposition surface of miniflux, while not breaking any existing deployments, and is pretty self-contained.
|
You're right, I should have tested this more thoroughly. I played with it locally, with fever/google reader enabled/disabled, and it seems to be working properly now. |
… used miniflux#3543 When there is no user of Fever/GoogleReader, there is no need to expose their endpoints. This reduces quite a bit the exposition surface of miniflux, while not breaking any existing deployments, and is pretty self-contained.
… used miniflux#3543 When there is no user of Fever/GoogleReader, there is no need to expose their endpoints. This reduces quite a bit the exposition surface of miniflux, while not breaking any existing deployments, and is pretty self-contained.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR automatically disables Fever and Google Reader API endpoints when no users have these integrations enabled, reducing the attack surface of Miniflux without breaking existing deployments.
- Adds database queries to check if Fever and Google Reader integrations are actively used
- Implements middleware to return unauthorized responses when integrations are disabled
- Integrates the new middleware into both Fever and Google Reader API routing
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/storage/integration.go | Adds IsFeverUsed() and IsGoogleReaderUsed() methods to check if integrations are enabled |
| internal/fever/middleware.go | Adds middleware to return 401 when Fever is not used by any user |
| internal/fever/handler.go | Integrates the new authorization middleware into Fever routing |
| internal/googlereader/middleware.go | Adds middleware to return 401 when Google Reader is not used by any user |
| internal/googlereader/handler.go | Integrates the new authorization middleware into Google Reader routing |
… used miniflux#3543 When there is no user of Fever/GoogleReader, there is no need to expose their endpoints. This reduces quite a bit the exposition surface of miniflux, while not breaking any existing deployments, and is pretty self-contained.
… used miniflux#3543 When there is no user of Fever/GoogleReader, there is no need to expose their endpoints. This reduces quite a bit the exposition surface of miniflux, while not breaking any existing deployments, and is pretty self-contained.
… used miniflux#3543 When there is no user of Fever/GoogleReader, there is no need to expose their endpoints. This reduces quite a bit the exposition surface of miniflux, while not breaking any existing deployments, and is pretty self-contained.
… used miniflux#3543 When there is no user of Fever/GoogleReader, there is no need to expose their endpoints. This reduces quite a bit the exposition surface of miniflux, while not breaking any existing deployments, and is pretty self-contained.
When there is no user of Fever/GoogleReader, there is no need to expose their endpoints. This reduces quite a bit the exposition surface of miniflux, while not breaking any existing deployments, and is pretty self-contained.