Commit graph

16169 commits

Author SHA1 Message Date
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
Oneric
16d0250c24 mix/database: by default fix replies count after object prune
Even if --keep-threads is used, replies of
pinned posts might still be pruned as documented
for this option.
Thus keep-threads is no reason to skip reply counter recalculation.
2025-08-30 00:00:00 +00:00
Oneric
f754feb67d federation: include required actor fields in minimal user fallback
ActivityPub spec demands each actor has at least an inbox and outbox.
Furthermore, the current representation wouldn’t even be accepted by
ourselves, since our processing requires objects to be flagged with a
sensible type else we don't know what to do with it.
Including the nickname is just a peemptive measure.

There were no reports of this causing problems in real-world deployments
and at least for federation with other Akkoma instances we should have
never run into this, since we _always_ expose the full representation of
the instance actor and atm also always use the latter for fetching
remote content (which prevents us from fetching followers-only content).
Nonetheless, serving something which violates spec and we wouldn’t even
accept ourselves seems obviously bad, so fix it and add tests to prevent
this from reoccuring.

Fixes bug introduced in 8f322456a0
2025-08-27 00:00:00 +00:00
Oneric
fcf4867ddf mix/database: add task to resync inlined array duplicates
Presumably those inlined copies were added to avoid the need for queries
each time the info is needed. However, they tend to desync from the actual
activities for not yet fully understood reasons; see:
https://akkoma.dev/AkkomaGang/akkoma/issues/956

As a workaround until the root cause is identified and fixed and/or
we no longer rely on the inliend copies add a mix task to regenerate
the inlined "cache" from the authorative activity data.

Does not yet deal with inlined emoji reactions
since its format is a pain to deal with.
2025-08-27 00:00:00 +00:00
Oneric
97e1eccf89 mix/database: add task to empty inlined replies lists
Those arrays are only used on first post receipt in side effect processing
and but an useless waste of space and misleading afterwards.
2025-08-27 00:00:00 +00:00
Oneric
ce73239e08 Fix private remote replies changing reply counter
In the ActivityPub module counter changes are already limited to
only publicly-visible replies. Apply the same limitiation here.
2025-08-27 00:00:00 +00:00
Oneric
e8b8941e40 docs: add missing image
Fixes omission in 1924ec08c0
2025-08-24 00:00:00 +00:00
Oneric
f5b2569b4f Merge pull request 'Adjust telemtry buckets for phoeix router and db metrics' (#970) from Oneric/akkoma:telemetry-router-buckets into develop
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma/pulls/970
2025-08-24 11:44:33 +00:00
Oneric
fda5b6551a changelog: add missing entries 2025-08-24 00:00:00 +00:00
Oneric
48c8ec10d8 ci: drop unused conditions 2025-08-24 00:00:00 +00:00
Oneric
157b7e1d97 Fix CI runs on push/merge to develop and stable
This emulates the previous effective behaviour of only
running tests on pull requests and skipping straight
to building artefacts and docs after merge.
Pull requests which do not pass tests shouldn’t be merged in the first place.
2025-08-24 00:00:00 +00:00
Oneric
7f9823258a metrics: adjust router and db buckets
Most HTTPS requests actually fall into the single-digit millisecond
range or below on average. Even the more costly endpoints almost always
average around the lower third of the millisecond magnitude.
Only endpoints doing synchronous remote HTTP fetches (e.g. for signing
keys) occasionally spike into the order of seconds.
As is, the bucket resolution is completely unfit to reason about
anything and even just averages are better indications.

Most database queries take less than a millisecond and even in total
almost all take less than 50ms for me. Decode time is but a tiny
fraction of that and queue time usually only takes a small part of total
time too (but may spike on high load).

Shift the buckets down to be able to
give insight into all relevant cases.
In particular this allows to determine whether high averages
are the result of generally high processing times or just a few
outliers lifting the whole average up (e.g. slow network fetches).

Exact numbers are biased towards my setup for lack of other comparison
data, but at least the order of magnitude should be ok everywhere.
2025-08-24 00:00:00 +00:00
Floatingghost
b8207d929d fix CI conditions 2025-08-23 22:27:45 +01:00
floatingghost
5a7c773ca1 Update .woodpecker/test.yml 2025-08-23 21:23:24 +00:00
floatingghost
20a77b404e Update .woodpecker/test.yml 2025-08-23 21:23:12 +00:00
Oneric
7c1a08913f Merge pull request 'Provide reference Grafana dashboard and improve docs related to monitoring+perf' (#966) from Oneric/akkoma:grafana_ref into develop
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma/pulls/966
2025-08-23 16:27:18 +00:00
Oneric
be2e014c60 Merge pull request 'Allow HTTP2 for outgoing connections and untangle the adapter opt mess' (#969) from Oneric/akkoma:untangle_adapter_opts into develop
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma/pulls/969
2025-08-23 15:54:43 +00:00
Oneric
ca15f8f6c0 Merge pull request 'Don’t retry delivery to explicitly deleted inboxes' (#968) from Oneric/akkoma:delivery_to_gone into develop
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma/pulls/968
2025-08-23 15:52:28 +00:00
Oneric
c62a476289 docs/cli/database/prune_objects: add note about --limit and --prune-pinned interaction 2025-08-23 00:00:00 +00:00
Oneric
acc05ca02f http: avoid failures connecting to HTTP2 servers supporting server push 2025-08-23 00:00:00 +00:00
Oneric
4d008c6bfd docs: add general optimisation and performance advice
And recommend a default config for remote pruning.
Also rewrite misleading note about vacuuming.
2025-08-23 00:00:00 +00:00
Oneric
0dc4b843e7 http: print stacktrace when exceptions occur during fetch
This log shows up very rarely in my history,
but if it does happen it is best to get the full context.
2025-08-23 00:00:00 +00:00