1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-26 18:21:01 +00:00
Commit graph

888 commits

Author SHA1 Message Date
Frédéric Guillot
e8f5c2446c fix(config): FORCE_REFRESH_INTERVAL duration should be in minutes
Regression introduced in commit c6536e8
2025-08-25 15:46:10 -07:00
Matthaiks
737f25f441 feat(locale): update Polish translation 2025-08-24 13:04:25 -07:00
Frédéric Guillot
f83d66769d fix(api): do not return removed entries
Since Miniflux 2.2.12, the content of removed entries is cleared.
2025-08-23 15:17:37 -07:00
jvoisin
af149e46df Revert "refactor(storage): simplify feed.go by using min(), inline errors, and use idiomatic conditions"
This reverts commit b1cbaae71c.
2025-08-22 12:51:54 -07:00
jvoisin
4f252b33c9 refactor(template): rename noescape to safeHTML
This makes the code more consistent, since all the other escaping escape
hatches have a `safe` prefix.
2025-08-22 12:51:21 -07:00
jvoisin
da9c3a4032 feat(js): tighten the trusted types policy
- Implement a better/simpler polyfill for web browsers that don't supported
  trusted types yet
- Use two separate policies: one to create HTML, another to create/use script
  urls
- Instead of having the policy live in the top-level scope, they're now
  declared at the lowest possible scope, right before they're used, making them
  inaccessible outside of it. This puts their usage completely out of reach of
  an attacker unable to gain some control outside of those two (small) scopes,
  and thus removes the need to tighten the policies.
- Remove the now-unused tt.js file

This has been tested on Firefox (doesn't support trusted types) and on Chromium
(does support trusted types).
2025-08-21 19:41:45 -07:00
Benedikt Hopmann
8e1d0bb693
fix(locale): Update de_DE translation to match changes from 'bookmark' to 'starred'
Updated strings to match changes from 'bookmark' to 'starred'. Also renamed some strings from 'Einträge' to 'Artikel' for more consistency.
2025-08-21 16:59:54 -07:00
Steven vanZyl
60cd7ffe88 refactor: Replace "Bookmarks" with "Starred"
Replaces usage of the word "bookmark" with "star"/"starred" in order to be more
consistent with the UI and database models, and to reduce confusion with
"bookmarklet" and integration features.

This is in preparation of future work on read-it-later features.
Which are also not called "bookmarks" to prevent any further confusion.
https://github.com/orgs/miniflux/discussions/3719

Related-to: https://github.com/miniflux/v2/pull/2219
2025-08-20 20:49:45 -07:00
Peter Sanchez
4d656d2739
feat(integration): add LinkTaco service for saving articles 2025-08-20 20:35:33 -07:00
gudvinr
983291c78b refactor(cli): use time.Duration for cleanup tasks 2025-08-20 19:45:24 -07:00
gudvinr
7060ecc163 refactor(cli): use time.Duration for scheduler frequency
Polling frequency is undocumented so it's not exacly clear what units were.
2025-08-20 19:45:24 -07:00
gudvinr
4af12a4129 refactor(metric): use time.Duration for refresh duration 2025-08-20 19:45:24 -07:00
gudvinr
c6536e8d90 refactor(http): use time.Duration for refresh interval
It's not clear which units of time used for refresh interval.
Convert to time.Duration for clarity.
2025-08-20 19:45:24 -07:00
gudvinr
30453ad7ec refactor(fetcher): use time.Duration for client timeout values
All functions use time.Duration, so instead of converting everywhere, do it once.
2025-08-20 19:45:24 -07:00
gudvinr
71af68becd refactor(server): use time.Duration for timeout values
Instead of converting at the very last moment,
it's simpler and more readable to use time.Duration ASAP.
2025-08-20 19:45:24 -07:00
gudvinr
ed3bf59356 refactor(reader): use time.Duration instead of minutes count
In general, duration is used as time unit representation.

At some places when int is returned, there's no documentation which unit is used.

So just convert to time.Duration ASAP.
2025-08-20 19:45:24 -07:00
gudvinr
03021af53c feat(config): time interval parser
Simplifies handling of time intervals in config values.
2025-08-20 19:45:24 -07:00
gudvinr
83254a1f26 refactor(model): replace Sprintf("%d") in tests
This is just Itoa but weird.
2025-08-20 19:45:24 -07:00
Julien Voisin
3acb888309
refactor(response): simplify switch-case and remove unnecessary defer
- b.body can never be of type error, so let's remove it from the switch-case
  construct.
- there is no need to use defer when the only return statement is two lines
  after.
2025-08-20 19:31:28 -07:00
Julien Voisin
7c29166ef9
refactor(ui): move inline SVG to sprite.svg
There is no need to have an inline svg when we can have it in the sprite.svg
file.
2025-08-20 19:26:47 -07:00
Julien Voisin
71105bec56
refactor(template): improve consistency in layout.html (meta tags, whitespace, comments)
- Group the `<meta>` tags together
- Trim some superfluous whitespace
- Remove an obvious and thus useless comment
2025-08-20 19:24:13 -07:00
Julien Voisin
2a372674a2
refactor(icon): avoid calling AbsoluteURL twice for the feed icon URL
The url of a feed's icon is always absolute.
2025-08-20 19:01:59 -07:00
Julien Voisin
9d32b23ab0
perf(sanitizer): make sanitizer ~10% faster by using slices.Contains instead of nested maps
```console
$ go test -bench=. -count=25 > old.txt
$ go test -bench=. -count=25 > new.txt
$ benchstat old.txt new.txt
goos: linux
goarch: arm64
pkg: miniflux.app/v2/internal/reader/sanitizer
           │   old.txt   │            new.txt            │
           │   sec/op    │   sec/op     vs base          │
Sanitize-8   21.55m ± 5%   19.64m ± 9%  ~ (p=0.059 n=25)
```

Almost a 10% improvement, yay.
2025-08-20 18:54:49 -07:00
jvoisin
da8bf3890c refactor(templates): be explicit about dependencies
Instead of blindly compiling all the common/ templates for every view/ ones,
let's be explicit about the dependencies. This should significantly decrease
the resident memory consumption, as ParseTemplate is responsible for ~10M of
the current 11M of heap memory on my instance, so any win there is interesting.
This will also allow better factorization of templates, now that everything is
explicit. Another side-effect is that it'll make testing easier, as we now have
a comprehensive list of views/ templates affected by a change in a file in
common/
2025-08-20 18:51:51 -07:00
Frédéric Guillot
459b1bf1ee test(icon): add tests for finding icon URLs in HTML documents 2025-08-19 20:14:34 -07:00
Frédéric Guillot
fdc12bf18c fix(icon): improve logging messages in resizeIcon function 2025-08-19 20:14:34 -07:00
Frédéric Guillot
1b1ceaf8b4 test(icon): add test case to verify SVG minification with error 2025-08-19 20:14:34 -07:00
jvoisin
cad40cc158 feat(icon): minify svg favicons 2025-08-19 20:14:34 -07:00
Frédéric Guillot
c105b14f58 test(api): add integration test for fetching categories with counters 2025-08-18 20:08:31 -07:00
Frédéric Guillot
49575c8902 test(version): add a test to enforce the version format 2025-08-18 19:51:09 -07:00
Frédéric Guillot
b25f9651fe test(fetcher): add unit tests for RequestBuilder 2025-08-18 19:38:14 -07:00
Frédéric Guillot
953ea885e0 fix(mediaproxy): always forward the browser Accept header
Tumblr CDN is blocking the Accept header used to fetch feeds
2025-08-18 18:08:21 -07:00
Frédéric Guillot
9536ce7dbc fix(version): change development version naming to avoid breaking some clients
Some Miniflux clients expect a specific version format.
For example, Flux News converts the string version to an integer.

Using `Development Version` will break some clients.
2025-08-18 17:41:17 -07:00
Frédéric Guillot
84ae1d5dc0 fix(storage): index only the first 500K characters of the article contents to avoid tsvector limits
The length of a tsvector (lexemes + positions) must be less than 1 megabyte.

We don't need to index the entire content, and we need to keep a buffer for the positions.
2025-08-17 19:32:56 -07:00
Frédéric Guillot
5403ca09f6 feat(storage): add limit parameter to ClearRemovedEntriesContent
Without the limit, this query is going to hangs forever on large
databases with millions of entries.
2025-08-17 17:39:04 -07:00
gudvinr
905d652511 refactor(ui): use request builder in media proxy handler
builder is used seemingly everywhere but media proxy uses manual
transport construction
2025-08-17 13:09:32 -07:00
Frédéric Guillot
a16ac51326 refactor(storage): split DeleteContentRemovedEntries into 2 functions and fix condition
- Add `content IS NOT NULL` to avoid clearing the same entries over and over
- Create `DeleteRemovedEntriesEnclosures` and `ClearRemovedEntriesContent` that report individual counts
2025-08-16 21:19:28 -07:00
jvoisin
5c26e06780 feat(entry): keep only metadata for removed entries
This should significantly shrink the space taken by miniflux' database:

```sql
miniflux=#
SELECT
  relname, pg_size_pretty(pg_total_relation_size(relname::regclass))
FROM
  pg_catalog.pg_statio_user_tables
ORDER BY
  pg_total_relation_size(relname::regclass)
DESC;

       relname        | pg_size_pretty
----------------------+----------------
 entries              | 158 MB
 icons                | 3312 kB
 enclosures           | 1568 kB
 sessions             | 1048 kB
 feeds                | 288 kB
 feed_icons           | 72 kB
 users                | 64 kB
 user_sessions        | 64 kB
 categories           | 48 kB
 integrations         | 32 kB
 api_keys             | 32 kB
 webauthn_credentials | 24 kB
 schema_version       | 16 kB
 acme_cache           | 16 kB
(14 rows)

miniflux=#
```

This should close #3524
2025-08-16 20:57:59 -07:00
Frédéric Guillot
9e4248c7c1 fix(templates): remove non-breaking space in about page 2025-08-16 16:51:39 -07:00
Frédéric Guillot
a654a5f710 feat(template): show GitHub links in about page only when tag and commit are available 2025-08-16 13:08:38 -07:00
Frédéric Guillot
6bf3b3c464 fix(version): allow build info to be set with LDFLAGS and fallback to VCS metadata when available 2025-08-16 12:41:45 -07:00
Frédéric Guillot
a010544200 fix(version): be explicit when VCS info is unavailable 2025-08-16 12:21:40 -07:00
Frédéric Guillot
c1af510ead feat(version): use Golang's builtin vcs feature to get commit and build date 2025-08-16 12:05:53 -07:00
gudvinr
ce6cadc176 refactor(mediaproxy): use *url.URL for MEDIA_PROXY_CUSTOM_URL
Same behaviour as for HTTP_CLIENT_PROXY.
2025-08-15 18:12:44 -07:00
Julien Voisin
40fa77851c
refactor(locale): avoid code duplication in Printer.Printf() function 2025-08-15 18:02:25 -07:00
jvoisin
dd8011a4aa refactor(template): remove some useless attributes
When `target="_blank"` is used, it has the same effect than rel="noopener",
so we can remove the latter. Moreover, since we're already setting `<meta
name="referrer" content="no-referrer" />` in the `<head>`, there is no need to
set it on every single link in the HTML, as we're rendering everything in the
same origin.

Note that we need to keep adding those in the sanitizer, the entry content HTML
can be consumed by third-party clients via the Miniflux/GoogleReader/Fever API.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/rel/noopener
and https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Referrer-Policy#integration_with_html
2025-08-15 17:55:49 -07:00
Julien Voisin
3955df43f5
perf(js): don't load webauthn,js when disabled
This saves around 1kB of data, yay.
2025-08-15 17:11:12 -07:00
Julien Voisin
6f2ec8b3e9
refactor(ui): rename the small favicons to icons
There is no need to distinguish between "Android icons" and favicons.
2025-08-15 16:37:39 -07:00
jvoisin
2fa813fe01 refactor(fetcher): use errors.New when possible instead of fmt.Errorf 2025-08-15 16:25:58 -07:00
gudvinr
7c1602c2c0 refactor(internal): fix doc comments 2025-08-15 16:24:48 -07:00