Commit Graph

3002 Commits

Author SHA1 Message Date
Olivier Meunier
742480b39e Added forms.SplitLines validator
This validator splits every line (on LF) of a given value and append
the result to the ListField values.
It only works on ListField[string] and trims spaces (and CR) on each
item.
2025-12-15 20:00:24 +01:00
Olivier Meunier
bc4bb0b76f Added textAreaField block to the form library
Nothing special except that the elements in .field-h are now aligned
to the start instead of baseline. That way, textarea labels are aligned
to the textarea first line instead of its bottom.
2025-12-15 20:00:24 +01:00
Olivier Meunier
fafed7a749 Improved dialog styling
They don't need to be in a fixed position with a z-index; the
backdrop pseudo-element already takes care of that.

.dialog is now centered on the page using flexbox on the backdrop with
a default to 100% and 100vh but it can be overridden when needed.

body:has(.dialog:open) would not work on webkit and is replaced by
body:has(.dialog[open]) (same for .dialog-image and .dialog-video)

dialogs always receive the default font (face and size) and a background
and foreground color so they don't inherit from the element they're in.

All dialog classes are components so we can override their properties.
2025-12-15 20:00:24 +01:00
Olivier Meunier
eea6695837 Extend bookmark update API
This adds the following fields to PATCH /api/bookmarks/{id}:

- description
- site_name
- authors
- published
- language
- text direction

Resolves #932
2025-12-15 20:00:24 +01:00
Olivier Meunier
72ed07fa83 Some a11y on reader options
Labels and roles were missing from the display options menu
2025-12-15 12:56:23 +01:00
Olivier Meunier
11da2c6c1c Fixed migration 25_totp for postgresql 2025-12-10 11:57:55 +01:00
Olivier Meunier
13dc869de1 Merge branch 'release' 2025-12-10 11:32:19 +01:00
Olivier Meunier
b34d5b8310 Minor improvement with TOTP code generation
Suggested by @mislav
https://codeberg.org/readeck/readeck/pulls/952#issuecomment-8828568
2025-12-10 08:49:56 +01:00
Olivier Meunier
3c149de734 Version 0.21.4 0.21.4 2025-12-09 16:02:22 +01:00
Olivier Meunier
54bf078a60 Updated changelog 2025-12-09 16:00:27 +01:00
Olivier Meunier
58b5ecc081 Merge branch 'release' 2025-12-09 15:11:22 +01:00
olivier
699da63b1f Merge pull request 'Dependencies update [2025-12-09]' (#991) from chore/updates into release
Reviewed-on: https://codeberg.org/readeck/readeck/pulls/991
2025-12-09 15:07:32 +01:00
Readeck Bot
172008d8b6 Updated Site Config files 2025-12-09 14:04:03 +00:00
Readeck Bot
44ac8c6b1d Updated JS dependencies 2025-12-09 14:04:02 +00:00
Readeck Bot
5d06a7083d Updated Go dependencies 2025-12-09 14:03:42 +00:00
Olivier Meunier
c93ef9d294 Split dependency update schedule and manual job.
The scheduler must run on the release branch but you can't
specify a branch on the schedule event.
2025-12-09 15:01:23 +01:00
olivier
7c9029d5db Merge pull request 'Support saving math generated with MathJax and KaTeX' (#976) from mathjax-support into release
Reviewed-on: https://codeberg.org/readeck/readeck/pulls/976
2025-12-09 14:37:13 +01:00
olivier
6e3b115481 Merge pull request 'chore/forms-str-len' (#990) from chore/forms-str-len into main
Reviewed-on: https://codeberg.org/readeck/readeck/pulls/990
2025-12-09 14:30:13 +01:00
Olivier Meunier
86e760971d Enforcing some forms.MaxLen on string inputs
Based on the schema for varchar columns or sensible defaults for other
values.

Updated the API schemas with the new values.
2025-12-09 14:18:23 +01:00
Olivier Meunier
20360ba06d Replace forms.StrLen with forms.MinLen, forms.MaxLen and forms.Len
These new validators give more flexibility and better error messages.
2025-12-09 13:57:23 +01:00
olivier
d66ca994ab Merge pull request 'TOTP authentication' (#952) from feature/totp into main
Reviewed-on: https://codeberg.org/readeck/readeck/pulls/952
2025-12-09 08:14:43 +01:00
Olivier Meunier
19d6cab881 Remove TOTP from readeck user -user name -remove-totp 2025-12-09 07:50:15 +01:00
Olivier Meunier
9d3715513c TOTP tests
- totp activation and deactivation in user profile
- totp requirement during sign-in
2025-12-09 07:50:15 +01:00
Olivier Meunier
e6ff0756c9 TOTP management in user profile
- Renamed "Password" to "Security" in user profile
- Added a section about totp in profile/password
- TOTP activation page
- TOTP removal from profile/password
- Sign out is always possible when any MFA is enabled
2025-12-09 07:50:15 +01:00
Olivier Meunier
822d78d57d TOTP authentication
This is only the first part. When a totp_secret exists for a user, the
authentication then asks for the code and carries on.

The totp lib can handle 6 or 8 letter codes and sha1, sha256 and sha512.
For maximum compatibility with Google Authenticator though, it sticks
to 6 character and sha1.
2025-12-09 07:23:13 +01:00
Olivier Meunier
3f5f50ed5d Removed deprecated API routes
- PUT /api/profile/password (was undocumented and not used)
- POST /api/auth

With the introduction of MFA, you can't authenticate with a username
and password anymore. OAuth is now the only way to obtain an access
token.

The password update through the API was not documented so quite safe
to remove.
2025-12-08 18:36:34 +01:00
olivier
f380e5068d Merge pull request 'Forwarded Authentication' (#989) from feature/forwarded-auth into main
Reviewed-on: https://codeberg.org/readeck/readeck/pulls/989
2025-12-08 18:36:04 +01:00
Olivier Meunier
b350de82bd Minor improvement with authentication
- removed log noise (not authenticated)
- on /login, go to redirect when a session already exists
- in SessionAuthProvider, clear session when external while forwarded
  authentication is disabled
2025-12-08 17:34:06 +01:00
Olivier Meunier
3cd1f7de86 Limit some actions of externally authenticated users
When externally authenticated, a session gains an "External" flag,
which is used to lock the request's user. When locked, the following
is disabled:

- sign-out
- username, email and password update

Note: the password page becomes empty but it will gain some content
once TOTP is merged.
2025-12-08 13:57:49 +01:00
Olivier Meunier
88d0ce6d15 Render the group optional in forwarded auth
If no group is given, the user group is used when it exists, otherwise
it's provisioned with the "user" group.
2025-12-08 11:34:17 +01:00
Olivier Meunier
6624de7b9f Forwarded Authentication provider
- new auth configuration section, with auth.forwarded
- renamed server.ca_file to server.client_ca_file
- provisioning form in internal/auth/users
- use crypto/rand in internal/auth/users to generate the seed
- added a password generator for users
- ForwardedAuthProvider in internal/server
- tests for TokenAuthProvider and ForwardedAuthProvider
2025-12-08 11:13:56 +01:00
Olivier Meunier
e2b377b5cf A null remote IP address is always trusted.
A request made through a socket has a RemoteAddr "@", which is parsed
as a nil net.IP. This address is trusted when setting the real IP
address.
2025-12-08 07:01:54 +01:00
Olivier Meunier
6921e97741 Moved the authentication providers to internal/server
Authentication providers are very much tied to server operations and
function and having them in internal/auth made it impossible to deal
with the session cookie handler when we need it.

internal/auth depended on the request ID for logging, removed this as
well with a specific logger interface.

Introducing a server.SessionHandler function to retrieve the cookie
handler so we can create cookies from scratch when needed.
2025-12-07 12:23:06 +01:00
olivier
f6666e3d35 Merge pull request 'Added support for mTLS with CA certificate.' (#986) from feature/mtls into main
Reviewed-on: https://codeberg.org/readeck/readeck/pulls/986
2025-12-05 22:52:21 +01:00
Olivier Meunier
aab882d71b Added support for mTLS with CA certificate.
This adds a new server.ca_file entry that can target a CA file for
requests with a client certificate.
The client certificate is only verified when provided and it will be up
to middlewares to make it mandatory when needed.
2025-12-05 22:50:34 +01:00
olivier
7f36f00004 Merge pull request 'Refactored internal/auth' (#985) from feature/auth-handlers into main
Reviewed-on: https://codeberg.org/readeck/readeck/pulls/985
2025-12-05 22:50:11 +01:00
Olivier Meunier
95843bfbe3 Refactored internal/auth
Instead of authentication providers having a method to indicate when
they're active or not, we compose a chain of HTTP handlers where
providers need to add themselves based on their own conditions.

This lets us do a few interesting things like:
- stop when a provider meets some conditions (ie. an HTTP header)
- prepare information for the next provider to pick up (for a forwarded auth)
- return an HTTP response and terminate everything if we need to.

The public internal/auth API remains unchanged.
2025-12-05 16:32:39 +01:00
Olivier Meunier
b8b8dbb249 Apply DejaVu Math to "math" elements
- fallback to sans-serif
- added license information (font and treeblood)
2025-12-04 10:46:01 +01:00
Olivier Meunier
a51aab16da Updated changelog 2025-12-04 10:46:00 +01:00
Mislav Marohnić
c1d0a2fef5 Support saving math generated with MathJax and KaTeX
MathJax v2 outputs HTML+CSS and MathML together. Since we're satisfied with
just MathML, this strips the HTML+CSS part since that would look bad if ever
viewed in Readeck.

MathJax v3 supports CHTML and SVG output modes, but neither outputs MathML.
However, MathJax does expose the original LaTeX expression via the "data-latex"
attribute. Fetch the value of that attribute and use a 3rd-party library to
render LaTeX to MathML when archiving the bookmark.

KaTeX does output MathML, but it also outputs its own HTML-CSS format that is
marked with `aria-hidden="true"`. Ensure that this is stripped even in the
mode when Readability is disabled.
2025-12-04 10:45:37 +01:00
Olivier Meunier
f5cff70bc9 Updated changelog 2025-12-04 10:45:28 +01:00
Olivier Meunier
c5a9500049 Merge branch 'main' into release 2025-12-04 10:44:19 +01:00
olivier
f942725ea0 Merge pull request 'Translations update from Codeberg Translate' (#970) from translate/readeck:weblate-readeck-application into main
Reviewed-on: https://codeberg.org/readeck/readeck/pulls/970
2025-12-04 10:43:07 +01:00
Codeberg Translate
db0fbfef83 Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 100.0% (533 of 533 strings)

Translated using Weblate (Chinese (Simplified Han script))

Currently translated at 100.0% (533 of 533 strings)

Translated using Weblate (Chinese (Simplified Han script))

Currently translated at 100.0% (142 of 142 strings)

Co-authored-by: Codeberg Translate <translate@codeberg.org>
Co-authored-by: Outbreak2096 <outbreak2096@noreply.codeberg.org>
Co-authored-by: linsui <linsui@noreply.codeberg.org>
Co-authored-by: olivier <olivier@noreply.codeberg.org>
Translate-URL: https://translate.codeberg.org/projects/readeck/application/zh_Hans/
Translate-URL: https://translate.codeberg.org/projects/readeck/documentation/zh_Hans/
Translation: Readeck/Application
Translation: Readeck/Documentation
2025-12-04 09:41:33 +00:00
Codeberg Translate
70a8b5e92d Translated using Weblate (Ukrainian)
Currently translated at 100.0% (533 of 533 strings)

Co-authored-by: Codeberg Translate <translate@codeberg.org>
Co-authored-by: SomeTr <sometr@noreply.codeberg.org>
Translate-URL: https://translate.codeberg.org/projects/readeck/application/uk/
Translation: Readeck/Application
2025-12-04 09:41:33 +00:00
Codeberg Translate
c0e936d9c0 Translated using Weblate (Russian)
Currently translated at 100.0% (533 of 533 strings)

Translated using Weblate (Russian)

Currently translated at 100.0% (533 of 533 strings)

Co-authored-by: Codeberg Translate <translate@codeberg.org>
Co-authored-by: olivier <olivier@noreply.codeberg.org>
Co-authored-by: γλωσσολαλιά <glossolalia@noreply.codeberg.org>
Translate-URL: https://translate.codeberg.org/projects/readeck/application/ru/
Translation: Readeck/Application
2025-12-04 09:41:33 +00:00
Codeberg Translate
a68b221483 Translated using Weblate (Portuguese (Portugal))
Currently translated at 100.0% (533 of 533 strings)

Co-authored-by: Codeberg Translate <translate@codeberg.org>
Co-authored-by: henriquetguedes <henriquetguedes@noreply.codeberg.org>
Translate-URL: https://translate.codeberg.org/projects/readeck/application/pt_PT/
Translation: Readeck/Application
2025-12-04 09:41:33 +00:00
Codeberg Translate
3ef82cc3da Translated using Weblate (Galician)
Currently translated at 100.0% (533 of 533 strings)

Translated using Weblate (Galician)

Currently translated at 100.0% (533 of 533 strings)

Co-authored-by: Codeberg Translate <translate@codeberg.org>
Co-authored-by: ghose <ghose@noreply.codeberg.org>
Co-authored-by: olivier <olivier@noreply.codeberg.org>
Translate-URL: https://translate.codeberg.org/projects/readeck/application/gl/
Translation: Readeck/Application
2025-12-04 09:41:33 +00:00
Codeberg Translate
315ba654aa Translated using Weblate (French)
Currently translated at 100.0% (533 of 533 strings)

Co-authored-by: Codeberg Translate <translate@codeberg.org>
Co-authored-by: olivier <olivier@noreply.codeberg.org>
Translate-URL: https://translate.codeberg.org/projects/readeck/application/fr/
Translation: Readeck/Application
2025-12-04 09:41:33 +00:00
Codeberg Translate
38037af8ed Translated using Weblate (Spanish)
Currently translated at 100.0% (533 of 533 strings)

Co-authored-by: Codeberg Translate <translate@codeberg.org>
Co-authored-by: imposible01 <imposible01@noreply.codeberg.org>
Translate-URL: https://translate.codeberg.org/projects/readeck/application/es/
Translation: Readeck/Application
2025-12-04 09:41:33 +00:00