1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-01 17:38:37 +00:00

Add feed option to disable HTTP/2 to avoid fingerprinting

This commit is contained in:
Frédéric Guillot 2024-02-24 22:08:23 -08:00
parent 420a3d4d95
commit eae4cb1417
36 changed files with 90 additions and 10 deletions

View file

@ -174,8 +174,8 @@ func (s *Storage) WeeklyFeedEntryCount(userID, feedID int64) (int, error) {
FROM
entries
WHERE
entries.user_id=$1 AND
entries.feed_id=$2 AND
entries.user_id=$1 AND
entries.feed_id=$2 AND
entries.published_at BETWEEN (now() - interval '1 week') AND now();
`
@ -235,10 +235,11 @@ func (s *Storage) CreateFeed(feed *model.Feed) error {
hide_globally,
url_rewrite_rules,
no_media_player,
apprise_service_urls
apprise_service_urls,
disable_http2
)
VALUES
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24)
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25)
RETURNING
id
`
@ -268,6 +269,7 @@ func (s *Storage) CreateFeed(feed *model.Feed) error {
feed.UrlRewriteRules,
feed.NoMediaPlayer,
feed.AppriseServiceURLs,
feed.DisableHTTP2,
).Scan(&feed.ID)
if err != nil {
return fmt.Errorf(`store: unable to create feed %q: %v`, feed.FeedURL, err)
@ -339,9 +341,10 @@ func (s *Storage) UpdateFeed(feed *model.Feed) (err error) {
hide_globally=$24,
url_rewrite_rules=$25,
no_media_player=$26,
apprise_service_urls=$27
apprise_service_urls=$27,
disable_http2=$28
WHERE
id=$28 AND user_id=$29
id=$29 AND user_id=$30
`
_, err = s.db.Exec(query,
feed.FeedURL,
@ -371,6 +374,7 @@ func (s *Storage) UpdateFeed(feed *model.Feed) (err error) {
feed.UrlRewriteRules,
feed.NoMediaPlayer,
feed.AppriseServiceURLs,
feed.DisableHTTP2,
feed.ID,
feed.UserID,
)

View file

@ -163,7 +163,8 @@ func (f *FeedQueryBuilder) GetFeeds() (model.Feeds, error) {
c.hide_globally as category_hidden,
fi.icon_id,
u.timezone,
f.apprise_service_urls
f.apprise_service_urls,
f.disable_http2
FROM
feeds f
LEFT JOIN
@ -172,7 +173,7 @@ func (f *FeedQueryBuilder) GetFeeds() (model.Feeds, error) {
feed_icons fi ON fi.feed_id=f.id
LEFT JOIN
users u ON u.id=f.user_id
WHERE %s
WHERE %s
%s
`
@ -230,6 +231,7 @@ func (f *FeedQueryBuilder) GetFeeds() (model.Feeds, error) {
&iconID,
&tz,
&feed.AppriseServiceURLs,
&feed.DisableHTTP2,
)
if err != nil {
@ -274,9 +276,9 @@ func (f *FeedQueryBuilder) fetchFeedCounter() (unreadCounters map[int64]int, rea
count(*)
FROM
entries e
%s
%s
WHERE
%s
%s
GROUP BY
e.feed_id, e.status
`