Commit graph

18,112 commits

Author SHA1 Message Date
Phantasm
5709531197
Sec: Bump Phoenix LiveView to 1.2.9
Technically 1.1.33 would also do...

Also updates:
  phoenix_pubsub 2.1.3 => 2.2.0
  ranch 2.2.0 => 2.2.1
  websock_adapter 0.5.8 => 0.5.9
2026-08-19 22:08:21 +02:00
Phantasm
c4ca9b41ad
Sec: Bump Phoenix to version 1.8.11 2026-08-19 22:08:20 +02:00
Phantasm
39d5648447
Sec: Bump bandit to 1.12.4
Also bumps:
  plug 1.20.2 => 1.20.3
  plug_crypto 2.1.1 => 2.2.0
  thousand_island 1.4.3 => 1.5.0
2026-08-19 22:07:22 +02:00
Phantasm
71cb70cd01
Sec: Bump postgrex to 0.22.4 2026-08-19 22:06:26 +02:00
Lain Soykaf
656191bd1e
fix(deps): use released Hackney 4.7.3 2026-08-11 14:16:59 +04:00
Lain Soykaf
498c9ad532
test(http): cover the Hackney connection leak
Serve a response announcing far more than it sends, then close, and
assert the connection process is gone. Fails against stock 4.7.2 with a
conn parked in `closed` holding the bytes it read; passes against the
pinned fix.

Also stop the Hackney tests trusting proxy environment variables.
`no_proxy_env` is not a Hackney option and never was, so a proxy in the
build environment silently turned these into tunnelled requests, which
are never pooled -- exactly the shape several of them mean to exclude.
`proxy: false` is what Hackney actually reads.

That surfaced a matching bug in the reverse proxy client, which treated
`proxy: false` as "a proxy is set" and so declined to mark a pooled
bodyless response as already released.
2026-07-26 10:15:52 +04:00
Lain Soykaf
42c100605e
fix(deps): pin Hackney to the connection-leak fix
An unpooled Hackney 4 connection that ends without a reusable socket -- a
body cut short by the peer, a bodyless 204/304, or a failed read -- parks
in its `closed` state forever, holding every refc binary it read.
read_full_body/2 hands back `socket = undefined`, so it never reaches the
reuse check; `closed(enter)` arms a stop timer only for pooled
connections; and an unpooled connection is owned by hackney_conn_sup, so
the owner-DOWN cleanup never fires.

Nothing here can work around it. Since 4.0 Hackney ignores `with_body`
and always returns a fully read binary, so a synchronous request never
yields a handle to close, and the short read still reports {:ok, body}.
Media proxy warming hits this whenever an attachment fetch is cut short
and the outbound proxy is used as a CONNECT tunnel, since tunnels are
never pooled.

Pin the fix, a single commit on top of the 4.7.2 tag, until it ships in a
release. While it is a git dep Hackney drops out of `mix deps.audit` and
`mix hex.outdated`, so this wants moving back to hex promptly.

benoitc/hackney#918, benoitc/hackney#919
2026-07-26 10:15:52 +04:00
Lain Soykaf
0615025f92
fix(http): enforce max_body again under Hackney 4
Hackney 4 ignores `with_body` and always returns a fully read binary, so
Tesla.Adapter.Hackney never reaches the clause that honours :max_body and
the option became a no-op. Only the gun path still enforced it, through
Pleroma.HTTP.Adapter.Gun. Pleroma.Web.RelMe relies on nothing else, so it
was fetching remote pages unbounded.

Add a middleware that applies the limit for every adapter: reject when
content-length already announces too much, and reject a body that came
back over the limit. Streaming bodies are left alone -- neither adapter
limits those and the caller owns the lease, so failing here on the header
would strand a connection RichMedia is still expected to release.

On the hackney path this bounds what callers are handed rather than peak
memory, since the adapter has read the body before any middleware runs.
2026-07-26 09:29:36 +04:00
Lain Soykaf
7d1cc56a78
Merge remote-tracking branch 'origin/develop' into audit-mix-audit-report
Conflict resolution notes:

- mix.lock: kept this branch's versions for cowlib, h2, hackney and hpax.
  Those upgrades are the point of the branch; develop is still on hackney
  1.20.1.

- .woodpecker/docker-armv7.yaml: accepted develop's deletion. It only
  existed here to build mdex_native on armv7, and mdex was already
  replaced with earmark again.

- lib/pleroma/reverse_proxy.ex: took develop's version. It independently
  grew request_with_constraints/5 and the invalid-status close, which
  supersede the equivalent fixes on this branch. Re-applied this branch's
  recv_timeout seeding, which develop does not have.

- lib/pleroma/gun/connection_pool/worker.ex and
  lib/pleroma/reverse_proxy/client/tesla.ex: took develop's versions. The
  gun pool rework (#7934) already guards the demonitor and makes
  release_conn/cancel_stream exit-safe, and it splits the Tesla client's
  graceful release from its abort path, so this branch's changes there are
  obsolete.

That leaves the client leak fix as a Hackney-only concern, which
stream_body/1 now handles the same way the gun client does.
2026-07-25 19:54:48 +04:00
Lain Soykaf
f985346fe8
fix(gun): tolerate a missing client monitor on release
A client that is already gone leaves no monitor to demonitor. Crashing
the worker takes the shared connection down with it and fails every
other client using it.
2026-07-25 18:46:44 +04:00
Lain Soykaf
24bdd9774a
fix(reverse_proxy): release the HTTP client on every outcome
Three paths obtained a client ref and abandoned it without closing:
the content-length rejection in call/3, the invalid-status clause in
request/4, and the success branch of response/6.

Under Hackney 4 an abandoned ref is a permanent process leak. A conn
that finishes or errors without an explicit stop parks in `closed` or
`connected` and never terminates: closed/3 only arms its stop timer for
pooled conns, `connected` gets no state_timeout when idle_timeout is
infinity, and a non-pooled conn monitors hackney_conn_sup rather than
its caller, so the owner-DOWN cleanup never fires. Each parked process
pins every refc binary it read, which for proxied video is tens of MB.

Releasing on every outcome means the gun client must stop releasing in
stream_body/1, or the ref would be removed twice.

Hackney does reclaim a pooled connection itself for a response that
cannot carry a body (204, 304, HEAD), so those refs are marked and left
alone; stopping one would evict a connection another request may
already hold. The mark is gated on the request actually being pooled,
since a direct or proxy-tunnelled conn is never checked in and leaks
unless we stop it.
2026-07-25 18:46:43 +04:00
lain
e3d15b1b53 Merge pull request 'Fix account favourites ordering' (#7914) from issue-3379-favourites-order into develop
Reviewed-on: https://git.pleroma.social/pleroma/pleroma/pulls/7914
2026-07-25 07:04:39 +00:00
Lain Soykaf
99befcaf1b
fix(activitypub): deduplicate account favourites 2026-07-25 10:51:09 +04:00
Lain Soykaf
9a6c2f909d
Merge remote-tracking branch 'origin/develop' into issue-3379-favourites-order 2026-07-25 10:31:57 +04:00
lain
cc1b95c88e Merge pull request 'Rework Gun connection pooling' (#7934) from issue-2263-gun-validation into develop
Reviewed-on: https://git.pleroma.social/pleroma/pleroma/pulls/7934
2026-07-25 05:44:39 +00:00
lain
4fe567064a Merge pull request 'MediaProxy: detect images when there's no file extension' (#7933) from mediaproxy-content-type into develop
Reviewed-on: https://git.pleroma.social/pleroma/pleroma/pulls/7933
2026-07-25 05:36:16 +00:00
Lain Soykaf
5ddd337045
chore: remove development log 2026-07-25 09:26:26 +04:00
Lain Soykaf
d5f48101b8
fix(media-proxy): safely detect extensionless images 2026-07-25 00:06:03 +04:00
Lain Soykaf
465a81ecf2
Merge remote-tracking branch 'origin/develop' into review-pr-7933 2026-07-24 23:24:11 +04:00
lain
9b8aa2e2ee Merge pull request 'Woodpecker CI: Unify Docker builds, add arm32v7 to multi-arch images' (#7919) from woodpecker-armv7-fixups into develop
Reviewed-on: https://git.pleroma.social/pleroma/pleroma/pulls/7919
2026-07-24 18:12:46 +00:00
lain
c2b8c67808 Merge pull request 'Improve RSS compliance' (#7932) from fix-rss into develop
Reviewed-on: https://git.pleroma.social/pleroma/pleroma/pulls/7932
2026-07-24 17:33:40 +00:00
Lain Soykaf
5d8b5a73d2
style(feed): format Atom fallback assertion 2026-07-24 21:05:16 +04:00
Lain Soykaf
c5230d98c5
fix(feed): complete Atom XML metadata 2026-07-24 21:04:35 +04:00
Lain Soykaf
5f71532442
fix(feed): tighten enclosure metadata 2026-07-24 20:59:13 +04:00
Lain Soykaf
2d667e1d2a
style(feed): format enclosure fixtures 2026-07-24 20:44:58 +04:00
Lain Soykaf
c518319349
fix(feed): correct RSS permalink metadata 2026-07-24 20:43:40 +04:00
Lain Soykaf
ecd8a14435
fix(feed): correct Atom entry links 2026-07-24 20:38:25 +04:00
Lain Soykaf
d1a7e915ce
fix(feed): preserve standard media enclosures 2026-07-24 20:34:33 +04:00
Lain Soykaf
96f471a291
fix(feed): format RSS build dates 2026-07-24 20:21:54 +04:00
Lain Soykaf
d0c8ca92a5
fix(feed): escape self link URLs 2026-07-24 20:11:19 +04:00
Lain Soykaf
85a802282e
fix(feed): hide sensitive media previews 2026-07-24 20:08:04 +04:00
Lain Soykaf
a9bf7212d4
fix(feed): escape fallback content 2026-07-24 19:59:18 +04:00
lain
a790e08a6c Merge pull request 'hashtag-timeline-fix' (#7938) from mkljczk/pleroma:hashtag-timeline-fix into develop
Reviewed-on: https://git.pleroma.social/pleroma/pleroma/pulls/7938
2026-07-24 15:29:25 +00:00
Lain Soykaf
77b5f3f485
test: cover multi-hashtag pagination 2026-07-24 18:49:44 +04:00
Phantasm
ce4e1d4287
ReverseProxy Tesla: Explicitly reformat proxy 2026-07-24 16:40:58 +02:00
Lain Soykaf
b97092a97e
fix: preserve optimized hashtag ordering 2026-07-24 18:36:25 +04:00
lain
ef2b374850 Merge pull request 'Apply architecture review quick wins' (#7941) from architecture-quick-wins into develop
Reviewed-on: https://git.pleroma.social/pleroma/pleroma/pulls/7941
2026-07-24 14:31:39 +00:00
lain
c20c0ee867 Merge branch 'develop' into architecture-quick-wins 2026-07-24 14:09:44 +00:00
Lain Soykaf
0070b13130
test(workers): replace publisher mocks with Mox 2026-07-24 17:43:02 +04:00
lain
9b1721888e Merge pull request 'Allow disabling Chats feature' (#7940) from mkljczk/pleroma:disabling-chats into develop
Reviewed-on: https://git.pleroma.social/pleroma/pleroma/pulls/7940
2026-07-24 13:08:43 +00:00
Lain Soykaf
0862c8b88d
fix: advertise Chats feature flags correctly 2026-07-24 16:53:36 +04:00
Lain Soykaf
1a48466b85
style(tests): sort publisher worker aliases 2026-07-24 16:42:45 +04:00
Lain Soykaf
868723e371
fix(streaming): preserve followed domain exception 2026-07-24 16:01:46 +04:00
Lain Soykaf
3abe4ebfbd
perf(oauth): avoid duplicate user preload 2026-07-24 16:01:34 +04:00
Lain Soykaf
08c8571c59
fix(workers): avoid dynamic publisher atoms 2026-07-24 16:01:24 +04:00
Lain Soykaf
c3fe61c2f5
fix(user): correct cache key invalidation 2026-07-24 16:01:13 +04:00
nicole mikołajczyk
97b94a2f43 Update tests
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
2026-07-24 01:05:12 +02:00
nicole mikołajczyk
6ffa90a42a Include actual accepts_chat_messages in source field
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
2026-07-24 01:00:46 +02:00
nicole mikołajczyk
efb43a02fa changelog
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
2026-07-24 00:59:15 +02:00
nicole mikołajczyk
4aa0d5d709 Allow disabling Chats feature
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
2026-07-24 00:58:58 +02:00