docs: clarify max_request_size limiting federation #1706

Merged
nex merged 4 commits from grgergo/continuwuity:docs-max_request_size into main 2026-05-04 14:17:32 +00:00
Contributor

Clarifies in the config that max_request_size affects federated media as well.
Mostly because it took me 20 minutes to figure out why Firefox was opening a .flac file in vim...

Pull request checklist:

  • This pull request targets the main branch, and the branch is named something other than
    main.
  • I have written an appropriate pull request title and my description is clear.
  • I understand I am responsible for the contents of this pull request.
  • I have followed the contributing guidelines:
Clarifies in the config that `max_request_size` affects federated media as well. Mostly because it took me 20 minutes to figure out why Firefox was opening a `.flac` file in `vim`... **Pull request checklist:** - [x] This pull request targets the `main` branch, and the branch is named something other than `main`. - [x] I have written an appropriate pull request title and my description is clear. - [x] I understand I am responsible for the contents of this pull request. - I have followed the [contributing guidelines][c1]: - [x] My contribution follows the [code style][c2], if applicable. - [x] I ran [pre-commit checks][c1pc] before opening/drafting this pull request. - [x] I have [tested my contribution][c1t] (or proof-read it for documentation-only changes) myself, if applicable. This includes ensuring code compiles. - [x] My commit messages follow the [commit message format][c1cm] and are descriptive. - [x] I have written a [news fragment][n1] for this PR, if applicable<!--(can be done after hitting open!)-->. [c1]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/CONTRIBUTING.md [c2]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/docs/development/code_style.mdx [c1pc]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/CONTRIBUTING.md#pre-commit-checks [c1t]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/CONTRIBUTING.md#running-tests-locally [c1cm]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/CONTRIBUTING.md#commit-messages [n1]: https://towncrier.readthedocs.io/en/stable/tutorial.html#creating-news-fragments
Member

Question is whether that is what is actually intended or not (

.max_request_size

?!)

Should max_request_size be concerned with incoming media too and not only uploads? It is not an intuitive behaviour, I would say.

Question is whether that is what is actually intended or not (https://forgejo.ellis.link/continuwuation/continuwuity/src/commit/754959e80d4865cfcfd9c0de10ab9391b11bac39/src/service/media/remote.rs#L293 ?!) Should max_request_size be concerned with incoming media too and not only uploads? It is not an intuitive behaviour, I would say.
Owner

@spaetz wrote in #1706 (comment):

Should max_request_size be concerned with incoming media too and not only uploads? It is not an intuitive behaviour, I would say.

This is a docs clarification request, but it is indeed intended that "a" request size limit applies everywhere. Without a limit, it's a security vulnerability.

@spaetz wrote in https://forgejo.ellis.link/continuwuation/continuwuity/pulls/1706#issuecomment-28564: > Should max_request_size be concerned with incoming media too and not only uploads? It is not an intuitive behaviour, I would say. This is a docs clarification request, but it is indeed intended that "a" request size limit applies everywhere. Without a limit, it's a security vulnerability.
Owner

For context: This max size was applied to all remote responses, excluding the federated send_join endpoint, to mitigate an attack vector that was actively being exploited, albeit unintentionally: 37888fb670

The intention was not that this would then cap remote media size too, however the followup change that allowed overriding it for media specifically was never made. For now, noting this restriction in the docs is probably the easiest solution.

For context: This max size was applied to *all* remote responses, excluding the federated `send_join` endpoint, to mitigate an attack vector that was actively being exploited, albeit unintentionally: https://forgejo.ellis.link/continuwuation/continuwuity/commit/37888fb67098c7dfba680cea122bc72c3a970406 The intention was not that this would then cap remote media size too, however the followup change that allowed overriding it for media specifically was never made. For now, noting this restriction in the docs is probably the easiest solution.
nex requested changes 2026-04-28 02:25:29 +00:00
Dismissed
nex left a comment

Example config file needs regenerating (run cargo build), otherwise looks fine

Example config file needs regenerating (run `cargo build`), otherwise looks fine
nex approved these changes 2026-05-04 13:55:34 +00:00
nex force-pushed docs-max_request_size from 7985a2e4b3
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Check changed files (pull_request) Successful in 6s
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 36s
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been cancelled
Checks / Prek / Pre-commit & Formatting (pull_request) Has been cancelled
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m54s
to 4c1638e495
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Check changed files (pull_request) Successful in 6s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m21s
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 31s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 19m45s
Checks / Prek / Check changed files (push) Successful in 6s
Documentation / Build and Deploy Documentation (push) Successful in 1m34s
Checks / Prek / Pre-commit & Formatting (push) Successful in 2m37s
Release Docker Image / Build linux-amd64 (release) (push) Successful in 14m57s
Release Docker Image / Build linux-arm64 (release) (push) Successful in 15m16s
Release Docker Image / Create Multi-arch Release Manifest (push) Successful in 39s
Release Docker Image / Build linux-amd64 (max-perf) (push) Failing after 3m34s
Checks / Prek / Clippy and Cargo Tests (push) Successful in 23m54s
Release Docker Image / Build linux-arm64 (max-perf) (push) Successful in 34m29s
Release Docker Image / Create Max-Perf Manifest (push) Has been skipped
Release Docker Image / Mirror Images (push) Has been skipped
Release Docker Image / Release Binaries (push) Has been skipped
2026-05-04 13:57:27 +00:00
Compare
nex scheduled this pull request to auto merge when all checks succeed 2026-05-04 14:11:48 +00:00
nex merged commit 4c1638e495 into main 2026-05-04 14:17:32 +00:00
nex referenced this pull request from a commit 2026-05-04 14:17:32 +00:00
Sign in to join this conversation.
No reviewers
nex
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
continuwuation/continuwuity!1706
No description provided.