Hosted mode: run the frontend from its own site and pick an instance #3583

Merged
hj merged 3 commits from feat/hosted-mode into develop 2026-10-06 19:45:42 +00:00

With "hosted": true in static/config.json, the frontend can be served from any static host. On first load it asks for an instance, then talks to it directly (CORS):

  • One API base for all requests, the streaming socket, emoji and instance files (src/api/api_base.js). An empty base means the page is the instance, so nothing changes for normal installs.
  • Instance picker before boot. Login goes through the instance's OAuth page, and the login form can change the instance.
  • Pleroma refuses WebSockets from other origins. The hosted app falls back to polling after three failed opens and shows no notice. The shoutbox and web push stay off in hosted mode.

Tested with a build served by vite preview against lain.com and fediffusion.art (picker, boot, timeline, OAuth redirect, change instance), and without hosted mode through the dev proxy.

Known gaps in hosted mode: the admin-fe link in settings points at the hosted site, and web push is off.

With `"hosted": true` in `static/config.json`, the frontend can be served from any static host. On first load it asks for an instance, then talks to it directly (CORS): - One API base for all requests, the streaming socket, emoji and instance files (`src/api/api_base.js`). An empty base means the page is the instance, so nothing changes for normal installs. - Instance picker before boot. Login goes through the instance's OAuth page, and the login form can change the instance. - Pleroma refuses WebSockets from other origins. The hosted app falls back to polling after three failed opens and shows no notice. The shoutbox and web push stay off in hosted mode. Tested with a build served by `vite preview` against lain.com and fediffusion.art (picker, boot, timeline, OAuth redirect, change instance), and without hosted mode through the dev proxy. Known gaps in hosted mode: the admin-fe link in settings points at the hosted site, and web push is off.
Requests, the streaming socket and emoji go through apiUrl/streamingUrl;
empty base (the page is the instance) leaves paths as they were.
With "hosted": true in the site's static config, the boot asks for an
instance first, then runs against it: instance files and paths come from
it, login uses its OAuth page, and the login form can change it.
feat(hosted): poll when the instance refuses sockets; no shout or push
All checks were successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/changelog Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/test-e2e Pipeline was successful
5f7bd67ddd
Pleroma refuses sockets from other sites: after three that never opened
the hosted app stops asking, without notices. The shoutbox socket and web
push stay off on the hosted site.
Member

i'm gonna add some nginx snippets and improve config.json logic (or just make a build argument?) later to make deployment easier

For now it's deployed onto https://fe.pleroma.dev/ and I upload and modify build manually over SFTP

i'm gonna add some nginx snippets and improve config.json logic (or just make a build argument?) later to make deployment easier For now it's deployed onto https://fe.pleroma.dev/ and I upload and modify build manually over SFTP
hj merged commit 2c4192c544 into develop 2026-10-06 19:45:42 +00:00
hj deleted branch feat/hosted-mode 2026-10-06 19:45:43 +00:00
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-fe!3583
No description provided.