# Hosting, access and deployment The front door is `web/serve.mjs`: sign-in, the Flutter web app built from `app/`, and a same-origin proxy to the Pipelines server for `/connect`, `/files`, `/artifacts/` and `/chat-uploads`; it also serves app updates at `/updates/`. The native apps go through it too. ## Password gate `serve.mjs` refuses pages, assets, artifacts and `/connect` without a signed session cookie. The password and signing secret live outside the repository: `~/.config/pipelines/web-auth.json` (mode `600`, `PIPELINES_WEB_AUTH_FILE`) holds an scrypt `password_hash`, the cookie `secret` and a `generation`; a plaintext `password` written there is hashed on load and signs everyone out. The sign-in page is `/login`; **Remember me** keeps a 30-day cookie, otherwise the cookie lives until the browser closes. Wrong passwords are throttled. Tests that start their own `serve.mjs` set `PIPELINES_WEB_AUTH=disabled`; never put that in a service. Change the password with `./password` from the source checkout (signs every device out; `--revoke-all` keeps the password); Settings → Sign-in security → Sign out everywhere revokes sessions without a restart. The proxy reaches the server with `X-Pipelines-Token` from the private `~/.config/pipelines/server-token` (`PIPELINES_SERVER_TOKEN_FILE`), which the installer creates; local CLI calls and server-launched stages and chats read the same file. It is separate from the web password. ## Bind and exposure For an untrusted network, keep the raw ports local: - Pipelines server: `-addr 127.0.0.1:8080`. - Web proxy: `--host 127.0.0.1` (reachable through Tailscale, not the LAN). - OpenCode: `server.hostname = "127.0.0.1"` in `~/.config/opencode/opencode.json`. Tailscale can terminate HTTPS for a tailnet-only name: ```sh tailscale serve --bg --https=8443 http://127.0.0.1:8095 # https://..ts.net:8443/ ``` That gives a valid certificate and a secure context (service worker, installable web app). Only tailnet devices can resolve the name; the password still applies to the app and its WebSocket. Keep the server and web proxy supervised by the platform's service manager so they restart after a reboot. Name the service files for your installation; their labels are local choices, not part of the protocol. The HTTPS proxy rule must also survive a reboot. ## Before exposing anything Check what listens beyond loopback (`lsof -nP -iTCP -sTCP:LISTEN`). The Pipelines server and the agent harness are control APIs without their own login; bind them to localhost and expose only the authenticated web proxy. If an app-managed server cannot bind loopback, a host firewall or tailnet ACLs are the remaining options. Unrelated operating-system services are outside this deployment.