arizuko › components › vited
vited
vited serves the web tree of the instance, the docs site and the pages of each group, from one mounted directory.
vited serves the static web tree behind proxyd
vited is a Vite static-file server behind proxyd. It serves the web tree of the instance: the docs site under /pub/, web assets, and the static pages that each group publishes.
vited is not a Go daemon. The vited/ directory in the repo holds only a README. Compose generation writes the service into the docker-compose file with the vitedService function in compose/compose.go. The container runs the arizuko-vite:latest image, which is plain Vite in dev mode that serves a mounted directory. Every served page shows that it is Vite: Vite injects a /@vite/client script.
proxyd serves no files, so vited is the origin
proxyd is a reverse proxy: it routes requests but serves no files. A program behind it must be the origin for static content, and that program is vited. In the route table, /* matches the web_routes table in the store by longest prefix. A request that matches no row goes to vited, behind the auth check. The section “A request through proxyd” of proxyd/README.md shows the order.
Without vited, those routes have no backend. The public docs at /pub/ would return 502, pages that groups publish would have no source, and the default web route would point at nothing. proxyd would still verify JWTs and sign headers, but no backend would answer the request.
vited serves one mounted directory
browser
│ HTTP request for a static path
▼
proxyd auth check, longest-prefix route match
│ ( /pub/* public ; default auth-gated )
▼
vited arizuko-vite:latest, serves the mounted dir
▲
│ bind mount <data-dir>/web : /web
<data-dir>/web/pub/ (the docs + group pages)
The vitedService function in compose/compose.go is the configuration source. It writes a service named vited with the container name <app>_vited_<flavor> and the image arizuko-vite:latest. The service has one volume: the web/ folder of the instance data directory, mounted at /web. The service publishes no ports, because proxyd reaches it over the docker network. It has no environment block, and vited reads no arizuko configuration.
Vite has no /health route, so the healthcheck reads /@vite/client, which Vite always answers with 200 in dev mode.
- Inputs
- HTTP from proxyd.
- Outputs
- File bytes from
<data-dir>/web. - Dependencies
- proxyd in front of it. Alone, vited serves files, but nothing routes to it.
vited alone is Vite serving a directory
vited is Vite that serves a directory. To run it outside arizuko, run Vite and point proxyd, or any reverse proxy, at it. It is a static origin and nothing more.
Its configuration is generated, not written by hand. The vitedService function in compose/compose.go writes the compose block. The Vite configuration is part of the arizuko-vite image, and you do not edit it per instance. To serve another tree, change what is mounted at /web, not the configuration.
# the shape of what the container runs: Vite serving a static dir
vite --host 0.0.0.0 --port 8080
# the dir comes from the bind mount <data-dir>/web : /web
vited reads no arizuko environment variables, because the vitedService compose block declares no environment. reference/env lists the variables of the daemons in front of it and beside it.
Four sources cover the details
- components/proxyd: the reverse proxy that routes to vited and checks its auth.
- components/webd: the other web backend, for chat and not for static files.
- [proxyd/README.md]: the route table where
/*goes to vited. - [compose/compose.go]:
vitedService, the source for the container, the image and the mount.