Commit graph

16240 commits

Author SHA1 Message Date
Floatingghost
c3dd582659 Allow mastodon-style quotes 2025-10-24 00:00:00 +00:00
nicole mikołajczyk
b3a0833d30 Use types for filtering notifications
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
2025-10-15 09:06:43 +02:00
Oneric
300302d432 Merge pull request 'Treat known quotes and replies as such even if parent unavailable' (#991) from Oneric/akkoma:replies-unknown into develop
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma/pulls/991
2025-10-13 12:24:27 +00:00
Oneric
0907521971 Treat known quotes and replies as such even if parent unavailable
Happens commonly for e.g. replies to follower-only posts
if no one one your instance follows the replied-to account
or replies/quotes of deleted posts.
Before this change Masto API response would treat those
replies as root posts, making it hard to automatically or
mentally filter them out.

With this change replies already show up sensibly as
recognisable  replies in akkoma-fe.
Quotes of unavailable posts however still show up as if they
weren’t quotes at all, but this can only be improved client-side.

Fixes: https://akkoma.dev/AkkomaGang/akkoma/issues/715
2025-10-13 10:26:57 +00:00
Weblate
4744ae4328 Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 99.0% (106 of 107 strings)

Co-authored-by: Poesty Li <poesty7450@gmail.com>
Co-authored-by: Weblate <noreply@weblate.org>
Translate-URL: http://translate.akkoma.dev/projects/akkoma/akkoma-backend-errors/zh_Hans/
Translation: Pleroma fe/Akkoma Backend (Errors)
2025-10-13 10:01:37 +00:00
Weblate
2b076e59c1 Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 100.0% (1004 of 1004 strings)

Co-authored-by: Poesty Li <poesty7450@gmail.com>
Co-authored-by: Weblate <noreply@weblate.org>
Translate-URL: http://translate.akkoma.dev/projects/akkoma/akkoma-backend-config-descriptions/zh_Hans/
Translation: Pleroma fe/Akkoma Backend (Config Descriptions)
2025-10-13 10:01:37 +00:00
Floatingghost
40ef08d46c bump version 2025-10-13 11:01:10 +01:00
Oneric
01a728464f changelog: add missing entries 2025-10-12 00:00:00 +00:00
Oneric
feef5f7f6f Merge pull request 'Default to HTTP1 again and no pool options for individual requests' (#988) from Oneric/akkoma:no-http2-4u into develop
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma/pulls/988
Reviewed-by: floatingghost <hannah@coffee-and-dreams.uk>
2025-10-10 20:44:54 +00:00
Oneric
62856efb5c Merge pull request 'Delete more unused or useless bits' (#987) from Oneric/akkoma:delete-unused into develop
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma/pulls/987
Reviewed-by: floatingghost <hannah@coffee-and-dreams.uk>
2025-10-10 16:18:13 +00:00
Oneric
6878e4de60 reverse_proxy: don't trust header about body size
Except of course for HEAD requests
2025-10-10 00:00:00 +00:00
Oneric
ed5d609ba4 http: do not add adapter pool options to individual requests
They do nothing. As documented[1] only three specific
options regarding timeouts are parsed for individual request
and none of them is set by AdapterHelper, only pool-specific options.

In particular this means we always relied on Mint’s default CA cert
verification based on queries to the CAStore package (which we include).

[1]: https://hexdocs.pm/finch/Finch.html#request/3-options
2025-10-10 00:00:00 +00:00
Oneric
c94a3b10ee Delete barely used logger mock
It required a bunch of and even call-specific boilerplate
and is not necessary since we can just capture the real logger
as laready done in other tests.
2025-10-10 00:00:00 +00:00
Oneric
203f5a89a2 config: revert to HTTP1-only for outgoing requests
Due to bugs in Finch discussed in
https://akkoma.dev/AkkomaGang/akkoma/issues/978
and https://akkoma.dev/AkkomaGang/akkoma/pulls/980
allowing both HTTP versions ends up breaking
some requests if they have a body.

Fixes: https://akkoma.dev/AkkomaGang/akkoma/issues/978
2025-10-10 00:00:00 +00:00
Oneric
f4e188af0a Delete useless, custom JobQueueMonitor
While its data was included in healthcheck responses,
it was not used to determine the healthy status
and for informational purposes Prometheus metrics,
ObanWeb dashboard or the Phoenix live dashboard are all better fits.
In particular, the data shown in healtcheck responses had no temporal
information, but there’s quite a difference between X failures scattered
across many days of uptime and X failures within a couple minutes.
2025-10-10 00:00:00 +00:00
Oneric
6dc546eda7 Merge pull request 'api: order follow requests by date of request' (#984) from Oneric/akkoma:followreq-order into develop
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma/pulls/984
2025-10-09 23:55:09 +00:00
Oneric
6fbc8330db Merge pull request 'Fix some typos and remove unused code' (#985) from mkljczk/akkoma:akkoma-typos into develop
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma/pulls/985
Reviewed-by: Oneric <oneric@noreply.akkoma>
2025-10-09 21:53:03 +00:00
nicole mikołajczyk
794b2cde45 Fix some typos and remove unused code
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
2025-10-09 15:26:35 +02:00
Oneric
0c9bb0594a Restrict Masto statuses API to Create and Announce activities
If the id of another activity type was used
it would show the post referenced by the activity
but wrongly attributing it to the activity actor
instead of the actual author.

E.g. ids of like activities can be obtained from
pagiantion info of the favourites endpoint.
For all other activity types the id would need to be guessed
which is considered practically infeasible for Flake UUIDs.

This should’ve been mostly harmless in practice, since:
  - since the activity has the same context as the original post,
    both the original and misattributed duplicate will show up in the
    same thread
  - only posts liked by a user can be misattributed to them,
    presumably making it hard/impossible to associate someone with
    content they disagree with
  - by default only the liking user themself can view their like history
    and therefore obtain IDs for their like activities.
    Notably though, there is a user seting to allow anyone to browse
    ones like history and therefore obtain like IDs. However, since
    akkoma-fe has no support for actually displaying those, there might
    be no actual users of this features.
2025-10-09 00:00:00 +00:00
Oneric
06a0cf4278 api: order follow requests by date of request
This is more intuitive for users.
On the flip side, this makes the API more confusing
since now min_id/max_id no longer correspond to ids returned in the
response and only link headers can be used to traverse all response
pages. However, Mastodon already does this according to its
documentation, so clients should already handle this well.

The only other usage of get_follow_requests_query is only interested
in the total count of requests (from active users), thus changing its
select part is safe.
Also gets rid of (outside tests unused) User.get_follow_requests.

Fixes: https://akkoma.dev/AkkomaGang/akkoma/issues/380
2025-10-09 00:00:00 +00:00
Oneric
521dfa4670 Use keyed lists for pagination with foreign id
The old approach required adding a special virtual field
to any table potentially needing such foreign-id pagination and
also still required manually sorting according to pagiantion settings
since the pagination helper does not know whether
this virtual field was set or not.

Using lists with each entry containing the pagination id and the actual
entry insterad allows any table to use this mechanism unchanged and
does not require manually sorting.

Since it was unused, this also drops the pagination mode paramter from
fetch_favourited_with_fav_id.

Furthermore, as a side effect of this change a bug in the favourite
benchmark is fixed. It used to incorrectly attempt to use IDs of
the liked objects for pagination instead of the like IDs as advertised
in Link headers.
2025-10-09 00:00:00 +00:00
Oneric
24d828d9a6 Merge pull request 'telemetry: expose count of currently pending/scheduled jobs per queue' (#982) from Oneric/akkoma:telemetry-job-queue-pending into develop
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma/pulls/982
2025-10-04 22:44:50 +00:00
Oneric
2190f3bede Merge pull request 'Do not federate undo->block activities' (#958) from undo-block-federation into develop
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma/pulls/958
Reviewed-by: Oneric <oneric@noreply.akkoma>
2025-10-04 22:43:50 +00:00
Oneric
8c33eed93e Merge pull request 'Renew HTTP signatures when following redirects' (#973) from Oneric/akkoma:httpsig_redirect_resign into develop
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma/pulls/973
2025-10-04 16:25:49 +00:00
floatingghost
1c74fcb35c Merge pull request 'optimize follow_request_count for own account view' (#981) from mkljczk/akkoma:optimize-follow-request-count into develop
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma/pulls/981
2025-10-04 10:48:12 +00:00
Oneric
43d4716b5a telemetry: expose count of currently pending jobs per queue
Split into scheduled (intentionally delayed until a later trigger date)
and available (eligible for immediate processing but did not yet start).
This will help in diagnosing overloaded instances or too-low queue
limits as well as expose configuration mishaps like
https://akkoma.dev/AkkomaGang/akkoma/issues/924.
(The latter by violently crashing the telemetry poller process while
attempting put_in for a non-configured queue creating well visible logs)
2025-10-03 00:00:00 +00:00
nicole mikołajczyk
545a83a5f1 optimize follow_request_count for own account view
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
2025-09-28 23:59:24 +02:00
Oneric
b1e5dda26a telemetry: reduce polling frequency for periodic measurements
Instancce stats are cached only renewed every 5 minutes anyway
and IO stats are cumulative over the entire runtime so no info
is lost.
Polling those every 10s is wasteful and the next commit will add a
periodic measurement which is (comparetively) more costly to compute.
2025-09-21 00:00:00 +00:00
Oneric
155c939070 mix/database: exempt hashtag cleanup from timeouts
As other prune queries already do. While this one is usually rather
quick, it can still run into the default limit.

Reported by ivy on IRC
2025-09-20 11:39:29 +00:00
Oneric
36ac91b25d Merge pull request 'Update nginx config for HTTP/3 support' (#976) from norm/akkoma:nginx-http3 into develop
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma/pulls/976
Reviewed-by: Oneric <oneric@noreply.akkoma>
2025-09-19 19:10:29 +00:00
norm
da340fd46c Update nginx config for HTTP/3 support
Overall fairly minor changes, but most importantly the Host header passed to the backend is set to `$host` instead of `$http_host` as HTTP/3 no longer uses the Host header, leaving it unset. `$host` will fallback to the `server_name` value in that situation while `$http_host` doesn't.

Ref: https://community.nginx.org/t/proxy-params-by-default-blocks-reverse-proxy-for-http-3/6792
2025-09-19 09:54:57 -04:00
Oneric
b9f79f333f changelog: document changes wrt to http option config keys 2025-09-07 00:00:00 +00:00
Oneric
cb19d3285a Drop superfluous RequestBuilder
It’s only used in one place and there not even all of
its functionality is needed. It’s not only simpler and shorter,
but easier to understand if Tesla’s keyword list is just inlined.

The only useful bit which is now migrated to Pleroma.HTTP is
addition of the user-agent header (except, sometimes, in tests)
2025-09-07 00:00:00 +00:00
Oneric
c607387b4a http: do not mix and duplicate Tesla opts into adapter opts 2025-09-07 00:00:00 +00:00
Oneric
271d7d14d4 media_proxy: use :head atom instead of binary
It automatically uses correct capitalisation and is the preferred form.
2025-09-07 00:00:00 +00:00
Oneric
7f9e898781 reverse_proxy: delete unused dynamic client
Since 364b6969eb the reverse proxy
is fixed to use the default HTTP module and all these modules
have been unused since
2025-09-07 00:00:00 +00:00
Oneric
882d8e0320 http/tzdata: ignore unsupported opts
Tzdata assumes Hackney opt names and only uses it to
enable following redirects which we already do anyway.
2025-09-07 00:00:00 +00:00
Oneric
a95b0a5d61 http/webpush: ignore opts due to incompatible format
The web_push_encryption lib assumes HTTPoison semantics
which is why we also need to convert the header format.
Inspecting the libraries source shows that Tesla won’t
understand the options anyway and its only used to enable TLS/SSL.
2025-09-07 00:00:00 +00:00
Oneric
5d59cb7ac3 rel_me: drop unsupported http option
Enforcing a hard response body limit is currently not possible with
Finch. Presumably a leftover from when multiple backends were supported.
2025-09-07 00:00:00 +00:00
Oneric
d34f6ebcdd rich_media/helpers: drop unsupported http opts
When this was ported from Pleroma in
5da9cbd8a5
we did not take into acount that Akkoma’s and Pleroma’s
HTTP backend take different options.
There’s no need for the :pool option
and enforcing a body limit on download
is currently not possible with Finch
2025-09-07 00:00:00 +00:00
Oneric
6d54bd95bc changelog: add entry for re-sign on redirect 2025-09-07 00:00:00 +00:00
Oneric
2b4b68eba7 Ensure private keys are not logged
Ideally we’d use a single common HTTP request error format handling
for _all_ HTTP requests (including non-ActivityPub requests, e.g. NodeInfo).
But for the purpose of this commit this would create too much noise
and it is significant effort to go through all error pattern matches etc
too ensure it is still all correct or update as needed.
2025-09-07 00:00:00 +00:00
Oneric
ff46e448c8 refactor: move creation of date strings for signatures into plug
The Signature module now handles interaction with the HTTPSignature library
and the plug everything related to HTTP itself. It now also no longer needs to be public.
2025-09-06 00:00:00 +00:00
Oneric
4c4982d611 Re-sign requests when following redirects
To achieve this signatures are now generated by a custom
Tesla Middleware placed after the FollowRedirects Middleware.
Any requests which should be signed needs
to pass the signing key via opts.

This also unifies the associated header logic between fetching and
publishing, notably resolving a divergence wrt the "host" header.
Relevant spec demands the host header shall include a port
identification if not using the protocols standard port.

Fixes: https://akkoma.dev/AkkomaGang/akkoma/issues/731
2025-09-06 00:00:00 +00:00
Oneric
23dfbd491e Merge pull request 'mix: resync inlined data' (#964) from Oneric/akkoma:resync_inlined_copies into develop
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma/pulls/964
2025-08-30 19:39:14 +00:00
Oneric
f07d6f3602 changelog: add inlined cache and remote emoji changes 2025-08-30 00:00:00 +00:00
Oneric
86988e71f0 mix/database/resync_inlined_caches: also resync reactions
Relies on the fixups from preceding commits being applied.
2025-08-30 00:00:00 +00:00
Oneric
7a77e7fbd1 db/migration: tighten prefiltering in emoji fixup 20250806
While the previous version was already plenty fast for smaller instances
there seems to be a more-than-linear slowdown for large instances.
These prefilters should (hopefully) not exclude anything in need of
fixing, but seem to already cut down significantly on the overall
processing time.
2025-08-30 00:00:00 +00:00
Oneric
89801abad5 federation/in: drop remote part from received emoji reactions
The remote part is included in federated emoji names by e.g.
Iceshrimp.NET ever since remote emoji support was added in
4d21aa1670
and as of writing it still continues to do so.
It adds no value for us though; we add the remote part automatically
based on the URL and it makes it more difficult to correctly coalesce
the original reaction (from a user for whom the moji was local)
and the subsequent reactions with the identical emoji from users of
other instances. Additionally the remote part can cause issues when
later used with our REST API.

For non-reactions this is unproblematic and thus
there’s no need to change anything there.

Use a migration to fix up existing activities.
This will cause some (further) desync from the inlined reactions
array, but will be fixable with the resync mix task and avoids
issues when running the resync without first fixing existing activities.
2025-08-30 00:00:00 +00:00
Oneric
4765b79b49 Remove deprecated :warnings_as_errors from startup
This was already removed from mix.exs in
ea5a2a9f21
but as it turns out it was also re-set
during runtime.
Since we never set it outside of CI in
the first place there’s no need to
force-disable it here.
2025-08-30 00:00:00 +00:00