# Self-hosted dashboard

> Serve the Osevel panel from your own domain and pin that origin on your team bridge, so you do not have to trust the page we serve.

Source: https://osevel.com/docs/guides/self-hosted-dashboard/

The panel is a static page; whoever
serves it decides what code runs in the browser that holds your passkeys. Our hosted panel is
built so it cannot act for you on its own (every action is signed on your device and checked by
your bridge), but a lying page could still show one thing and ask you to sign another. A team that
does not want to trust the page we serve can serve the panel itself, from its own domain, and pin
that origin on its team bridge.

## What pinning does

`osevel connect pin-origin https://panel.team.example` (at the bridge host, terminal only):

| While pinned, the bridge…                                         | So                                              |
| ----------------------------------------------------------------- | ----------------------------------------------- |
| pairs new devices only from passkeys made on that origin          | a page from anywhere else cannot add a device   |
| unlocks, runs actions and takes approvals only from those devices | devices paired on the hosted panel stop working |
| counts strong-action signatures only when made on that origin     | the hosted panel cannot produce a strong action |

A passkey is bound to the site it was made on (its RP ID), and only pages on that site can use it.
Our servers cannot serve a page on your domain, so with the pin a page we serve can neither
create a device your bridge accepts nor sign anything it counts.

The watcher (`watcher export`) carries the pin too: in `witness` mode it cancels a strong decision
whose signatures were not made on the pinned origin, even if the bridge host was taken over.

`connect pin-origin off` lowers protection and is terminal only, like everything that does.
A `witness` database whose waiting period was turned off (allowed only with a pinned panel)
should get a waiting period back first.

## Serving it

1. Take the published panel build of the release you run (the panel archive, or
   `packages/panel/dist` built from the release tag) and its `build-hashes.json`.
2. Serve it with the security headers of `deploy/panel/Caddyfile`, forwarding `/api/*` and
   `/ws` to the dashboard server (`deploy/panel/compose.yaml` does both).
3. Ask the dashboard server's operator to add your origin to `PANEL_ORIGINS` (on a server you run
   yourself, set it). Requests and sockets from any other origin stay refused. A sign-in email
   asked from your panel links back to your panel, so the session cookie is set on your domain.
   Social sign-in needs your provider applications to allow your domain; the email link always
   works.
4. Check it: `osevel panel verify https://panel.team.example`. Every file is fetched and
   compared with the release's published SHA-256 list (shipped with the CLI; `--hashes` takes
   another release's file). It also warns when the page's Content-Security-Policy allows scripts
   from anywhere but itself.
5. Pin it on the team bridge: `osevel connect pin-origin https://panel.team.example`, then
   pair your devices again from your panel.

`panel verify` works against our hosted panel too: anyone can check that what we serve is the
published build.
