docs: clarify max_request_size limiting federation #1706

Open
grgergo wants to merge 3 commits from grgergo/continuwuity:docs-max_request_size into main
First-time 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
clarify max_request_size limiting federation
Some checks failed
Auto Labeler / Apply labels based on changed files (pull_request_target) Successful in 4s
Checks / Changelog / Check changelog is added (pull_request_target) Has been cancelled
Documentation / Build and Deploy Documentation (pull_request) Has been cancelled
Checks / Prek / Pre-commit & Formatting (pull_request) Has been cancelled
Checks / Prek / Check changed files (pull_request) Has been cancelled
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been cancelled
600b330656
Signed-off-by: grgergo <csakbek@freemail.hu>
chore: news fragment for #1706
Some checks failed
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 9s
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 1m11s
Checks / Prek / Check changed files (pull_request) Successful in 29s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 10m40s
f4c19f07c1
Contributor

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
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
chore: update example config
Some checks are pending
Documentation / Build and Deploy Documentation (pull_request) Blocked by required conditions
Checks / Prek / Pre-commit & Formatting (pull_request) Blocked by required conditions
Checks / Prek / Check changed files (pull_request) Blocked by required conditions
Checks / Prek / Clippy and Cargo Tests (pull_request) Blocked by required conditions
Update flake hashes / update-flake-hashes (pull_request) Blocked by required conditions
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 12s
f1ce3034ef
Some checks are pending
Documentation / Build and Deploy Documentation (pull_request) Blocked by required conditions
Checks / Prek / Pre-commit & Formatting (pull_request) Blocked by required conditions
Required
Details
Checks / Prek / Check changed files (pull_request) Blocked by required conditions
Required
Details
Checks / Prek / Clippy and Cargo Tests (pull_request) Blocked by required conditions
Required
Details
Update flake hashes / update-flake-hashes (pull_request) Blocked by required conditions
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 12s
Required
Details
This pull request has changes requested by an official reviewer.
Some workflows are waiting to be reviewed.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u docs-max_request_size:grgergo-docs-max_request_size
git switch grgergo-docs-max_request_size
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.