Fix preferred frontends #7911

Open
phnt wants to merge 6 commits from phnt/pleroma:fix-preferred-frontend into develop
Owner

After InstanceStatic plug was modified to return 404 on missing static media instead of returning FE, preferred frontends stopped working. This moves the missing static media logic into a separate plug at the end of the static chain.

Checklist

  • Adding a changelog: In the changelog.d directory, create a file named <code>.<type>.

Closes #7922

After InstanceStatic plug was modified to return 404 on missing static media instead of returning FE, preferred frontends stopped working. This moves the missing static media logic into a separate plug at the end of the static chain. ### Checklist - [x] Adding a changelog: In the `changelog.d` directory, create a file named `<code>.<type>`. <!-- `<code>` can be anything, but we recommend using a more or less unique identifier to avoid collisions, such as the branch name. `<type>` can be `add`, `change`, `remove`, `fix`, `security` or `skip`. `skip` is only used if there is no user-visible change in the PR (for example, only editing comments in the code). Otherwise, choose a type that corresponds to your change. In the file, write the changelog entry. For example, if a PR adds group functionality, we can create a file named `group.add` and write `Add group functionality` in it. If one changelog entry is not enough, you may add more. But that might mean you can split it into two PRs. Only use more than one changelog entry if you really need to (for example, when one change in the code fix two different bugs, or when refactoring). --> Closes #7922
StaticNotFoundPlug: Move 404 on non-existing static files to a new plug
Some checks failed
ci/woodpecker/pr/changelog Pipeline failed
ci/woodpecker/pr/lint Pipeline failed
ci/woodpecker/pr/unit-testing-elixir-1.18 unknown status
ci/woodpecker/pr/unit-testing-elixir-1.15 unknown status
f6cda465e1
This fixes preferred frontends not working (returning 404 on most static
frontend files).
phnt force-pushed fix-preferred-frontend from f6cda465e1
Some checks failed
ci/woodpecker/pr/changelog Pipeline failed
ci/woodpecker/pr/lint Pipeline failed
ci/woodpecker/pr/unit-testing-elixir-1.18 unknown status
ci/woodpecker/pr/unit-testing-elixir-1.15 unknown status
to 3373d90a1d
Some checks failed
ci/woodpecker/pr/changelog Pipeline failed
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/unit-testing-elixir-1.18 Pipeline was canceled
ci/woodpecker/pr/unit-testing-elixir-1.15 Pipeline was canceled
2026-05-23 22:57:26 +00:00
Compare
phnt force-pushed fix-preferred-frontend from 3373d90a1d
Some checks failed
ci/woodpecker/pr/changelog Pipeline failed
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/unit-testing-elixir-1.18 Pipeline was canceled
ci/woodpecker/pr/unit-testing-elixir-1.15 Pipeline was canceled
to 20d05f1a3f
All checks were successful
ci/woodpecker/pr/changelog Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/unit-testing-elixir-1.15 Pipeline was successful
ci/woodpecker/pr/unit-testing-elixir-1.18 Pipeline was successful
2026-05-23 23:03:23 +00:00
Compare
StaticNotFoundPlug: Remove unused plug options
Some checks failed
ci/woodpecker/pr/changelog Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/unit-testing-elixir-1.15 Pipeline was successful
ci/woodpecker/pr/unit-testing-elixir-1.18 Pipeline was canceled
76c5953df1
phnt changed title from WIP: Fix preferred frontends to Fix preferred frontends 2026-06-01 19:34:36 +00:00
Owner

#7922 might be related?

https://git.pleroma.social/pleroma/pleroma/issues/7922 might be related?
Author
Owner

Note: The last Plug.Static call at "/" is still needed. Without it the TOS override and cache header tests fail.

Note: The last Plug.Static call at "/" is still needed. Without it the TOS override and cache header tests fail.
InstanceStaticPlug: Add more override and fallback tests
Some checks failed
ci/woodpecker/pr/lint Pipeline is pending
ci/woodpecker/pr/unit-testing-elixir-1.15 Pipeline is pending
ci/woodpecker/pr/unit-testing-elixir-1.18 Pipeline is pending
ci/woodpecker/pr/changelog Pipeline was canceled
3c66aad51b
phnt force-pushed fix-preferred-frontend from 3c66aad51b
Some checks failed
ci/woodpecker/pr/lint Pipeline is pending
ci/woodpecker/pr/unit-testing-elixir-1.15 Pipeline is pending
ci/woodpecker/pr/unit-testing-elixir-1.18 Pipeline is pending
ci/woodpecker/pr/changelog Pipeline was canceled
to ac25af7b29
Some checks failed
ci/woodpecker/pr/unit-testing-elixir-1.18 Pipeline is pending
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/docker-armv7 Pipeline was canceled
ci/woodpecker/pr/changelog Pipeline was canceled
ci/woodpecker/pr/unit-testing-elixir-1.15 Pipeline was canceled
2026-06-01 19:55:32 +00:00
Compare
phnt force-pushed fix-preferred-frontend from ac25af7b29
Some checks failed
ci/woodpecker/pr/unit-testing-elixir-1.18 Pipeline is pending
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/docker-armv7 Pipeline was canceled
ci/woodpecker/pr/changelog Pipeline was canceled
ci/woodpecker/pr/unit-testing-elixir-1.15 Pipeline was canceled
to 6ec30bbba2
Some checks failed
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/unit-testing-elixir-1.15 Pipeline was successful
ci/woodpecker/pr/changelog Pipeline was canceled
ci/woodpecker/pr/unit-testing-elixir-1.18 Pipeline was canceled
2026-06-01 20:00:58 +00:00
Compare
phnt force-pushed fix-preferred-frontend from 6ec30bbba2
Some checks failed
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/unit-testing-elixir-1.15 Pipeline was successful
ci/woodpecker/pr/changelog Pipeline was canceled
ci/woodpecker/pr/unit-testing-elixir-1.18 Pipeline was canceled
to a71ee6c86a
All checks were successful
ci/woodpecker/pr/changelog Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/unit-testing-elixir-1.15 Pipeline was successful
ci/woodpecker/pr/unit-testing-elixir-1.18 Pipeline was successful
ci/woodpecker/pr/docker-armv7 Pipeline was successful
2026-06-02 07:17:28 +00:00
Compare
All checks were successful
ci/woodpecker/pr/changelog Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/unit-testing-elixir-1.15 Pipeline was successful
ci/woodpecker/pr/unit-testing-elixir-1.18 Pipeline was successful
ci/woodpecker/pr/docker-armv7 Pipeline was successful
This pull request can be merged automatically.
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 fix-preferred-frontend:phnt-fix-preferred-frontend
git switch phnt-fix-preferred-frontend

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch develop
git merge --no-ff phnt-fix-preferred-frontend
git switch phnt-fix-preferred-frontend
git rebase develop
git switch develop
git merge --ff-only phnt-fix-preferred-frontend
git switch phnt-fix-preferred-frontend
git rebase develop
git switch develop
git merge --no-ff phnt-fix-preferred-frontend
git switch develop
git merge --squash phnt-fix-preferred-frontend
git switch develop
git merge --ff-only phnt-fix-preferred-frontend
git switch develop
git merge phnt-fix-preferred-frontend
git push origin develop
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 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
pleroma/pleroma!7911
No description provided.