Commit graph

16212 commits

Author SHA1 Message Date
Oneric
631f0e817b Revert "ci: allow docs to build on all runners"
This reverts commit 9f05b19b6b.
We download a amd64 bild of the scaleway CLI.
2025-11-09 00:00:00 +00:00
Oneric
949d641715 Merge pull request 'ci: try to parallelise test jobs' (#1003) from Oneric/akkoma:ci-parallel-testing into develop
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma/pulls/1003
2025-11-09 13:09:31 +00:00
Oneric
9f05b19b6b ci: allow docs to build on all runners
The docker image already offers variants for all our runner arches
2025-11-09 00:00:00 +00:00
Oneric
dcd664ffbc ci: dedupe build+release job definitions
If releasr images provide amd64 and arm64 in the same tag
this can be slightly simplified further.
2025-11-09 00:00:00 +00:00
Oneric
c3195b2011 ci: move one test job to arm64 to allow parallel execution 2025-11-09 00:00:00 +00:00
Oneric
467e75e3b1 Merge pull request 'api: prefer duration param for mute expiration' (#1004) from Oneric/akkoma:mute-expiry-duration into develop
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma/pulls/1004
2025-11-08 13:39:55 +00:00
marcin mikołajczak
8532f789ac api: prefer duration param for mute expiration
Mastodon 3.3 added support for temproary mutes but uses "duration"
instead of our older "expires_in". Even Husky only sets "duration"
nowadays.

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>

Cherry-picked-from: 5d3d6a58f7
2025-11-08 00:00:00 +00:00
Oneric
679c4e1403 Merge pull request 'api: return error when replying to already deleted post' (#1001) from Oneric/akkoma:replying-to-a-ghost into develop
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma/pulls/1001
2025-11-06 16:46:57 +00:00
Oneric
d635a39141 api: return error when replying to already deleted post
Of course the aprent post might still be deleted after the reply was
already created, but in this case the reply will still show up as a
reply and be federated as a reply with a reference to the parent post.
If the parent was already deleted before the reply gets created however
it used to be indistinguishable from a root post both in Masto API and
ActivityPub.

From a UX perspective, users likely will like to know if the post
they’re replying to no longer exists by the time they finished writing.
The natural language error will show up in akkoma-fe without clearing
the post form, meaning users can decide to discard the reply or copy it
to post as a new root post. It seems sensibly to for other clients to
behave like this too, but so far no more clients were actually tested.

Furthermore, this used to allow replying to all sorts of activities not
just posts which was rather non-sensical (and after all processsing
steps turned into a reply to the object referenced by the activity).
In particular this allowed replying to an user object by specifying the
db ID of a follow request activity (if the latter was somehow obtained).

Note: empty-string in_reply_to parameters are explicitly ignored since
45ebc8dd9a to workaround one buggy client;
see: https://git.pleroma.social/pleroma/pleroma/-/issues/355.
It’s not clear if this workaround is still necessary,
but it is preserved by this commit.

Resolves: https://akkoma.dev/AkkomaGang/akkoma/issues/522
2025-11-06 15:58:40 +01:00
Oneric
8da0828b4a Merge pull request 'reload emoji asynchronously and optimise emoji updates' (#998) from Oneric/akkoma:async-emoji-reload into develop
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma/pulls/998
2025-11-06 14:55:56 +00:00
Oneric
ccde26725f Merge pull request 'api_spec/cast: iteratively retry to clean all offending parameters' (#995) from Oneric/akkoma:apispec-cast-multitolerance into develop
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma/pulls/995
2025-11-06 14:55:38 +00:00
Oneric
7e6efb2356 api_spec/cast: iteratively retry to clean all offending parameters
While the function signature allows returning many errors at once,
OpenApiSpex.cast_and_validate currently only ever returns the first
invalid field it encounters. Thus we need to retry multiple times to
clean up all offenders.

Fixes: https://akkoma.dev/AkkomaGang/akkoma/pulls/992#issuecomment-15027
2025-11-05 00:00:00 +00:00
Oneric
bd6dda2cd0 docs: fix multi-paragraph list items
Markdown requires an indentation of 4 for a following paragraph to
continue a list item. Previously, the continuing paragraphs were only
indented by 2 spaces, leading to the list being interrupted and
numbering restarted each time.
2025-11-02 00:00:00 +00:00
Oneric
e7d76bb194 emoji: reload asynchronously
No caller of `reload` actually uses the result in any way
so there’s no need to wait for a response and risk running
into a timeout (by default 5 seconds).

Discovered-by: sn0w <me@sn0w.re>
Based-on: 1fb54d5c2c
2025-10-30 00:00:00 +00:00
Oneric
318ee6ee17 emoji: avoid full reloads when possible
Reloading the entire emoji set from disk, reparsing all pack JSON files,
etc is unnecessarily costly for large emoji sets. We already know which
single or few changes we want to apply, so do just that instead.
2025-10-29 00:00:00 +00:00
Oneric
f86a88ca19 emoji: store in unordered set
No caller cares about the order
(and although, rare with concurrent reads at same time like a write
the table might return unordered results anyway).
Unordered sets have a constant read time,
ordered sets logarithmic times, but there’s no benfit for us
2025-10-29 00:00:00 +00:00
Oneric
d38ca268c4 cosmetic/emoji: fix misleading docs and var names 2025-10-29 00:00:00 +00:00
Oneric
0cb2807667 emoji/pack: fix newly created pack having nil name
At the next reload the name was already set to the directory name,
but if using the created pack directly issues arose.
2025-10-29 00:00:00 +00:00
Oneric
862fba5ac5 Merge pull request 'Do not try to redirect to post display URLs for non-Create activities' (#997) from Oneric/akkoma:fix-non-create-html-redirect into develop
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma/pulls/997
2025-10-26 12:45:22 +00:00
Oneric
47ac4ee817 Do not try to redirect to post display URLs for non-Create activities
Display will fail for all but Create and Announce anyway since
0c9bb0594a. We exclude Announce
activities from redirects here since they are not identical
with the announced post and akkoma-fe stripping the repeat header
on he /notice/ page might lead to confusion about which is which.

In particular those redirects exiting breaks the assumptions from
the above commit’s commit message and made it possible to obtain
database IDs for activities other than one’s own likes allowing
slightly more mischief with the rendering bug it fixed.

Note: while 0c9bb0594a speculated about
public likes also leaking IDs to other users, the public like endpoint
is actually paginated by post id/date not like id/date like the private
endpoint. Thus it does not allow getting database IDs of others’ likes.
2025-10-26 00:00:00 +00:00
Oneric
9d12c7c00c Merge pull request 'Preserve mastodon-style quote-fallback marker' (#977) from mastodon-quotes into develop
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma/pulls/977
Reviewed-by: Oneric <oneric@noreply.akkoma>
2025-10-24 21:51:49 +00:00
Oneric
b7107a9e33 docs: adjust for include_types deprecation
And replace an overlooked usage in tests.
Fixes omissions in b3a0833d30
2025-10-24 00:00:00 +00:00
Oneric
8857c98eaf Merge pull request 'Use types for filtering notifications' (#993) from mkljczk/akkoma:akkoma-notification-types into develop
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma/pulls/993
Reviewed-by: Oneric <oneric@noreply.akkoma>
2025-10-24 19:05:27 +00:00
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
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