fix: reconcile documentation guarantees and enforcement (OM-15)

This commit is contained in:
Chris Scott committed 2026-10-02 13:00:09 +00:00
1 parent 6c878ae79a
commit dcb50b7e0f
28 files changed
+461 -128

No files matched your search

+15 -6
View File
@@ -33,7 +33,9 @@ When set:
- Admin user is created automatically
- Setup wizard is skipped
- Registration is disabled
- New account registration is rejected server-side, including account creation through OAuth; the registration page is hidden too. Internal startup provisioning can create the configured admin account.
Both variables must be set. This does not revoke existing accounts or sessions, or restrict API access to an admin role: authenticated users can access Manager resources. Without a preconfigured admin, registration remains enabled. Use Manager for trusted personal deployments, not as a multi-user isolation boundary.
## Password Reset
@@ -47,15 +49,19 @@ ADMIN_PASSWORD=new-password
ADMIN_PASSWORD_RESET=true
```
2. Restart the application:
2. Recreate the container so it picks up the new environment variables:
```bash
docker-compose restart
docker compose up -d --force-recreate app
```
3. Log in with new password
4. Remove `ADMIN_PASSWORD_RESET=true` from environment
4. Remove `ADMIN_PASSWORD_RESET=true` from environment and recreate again:
```bash
docker compose up -d --force-recreate app
```
!!! warning
Remove the reset flag after successful reset to prevent accidental password changes.
@@ -82,9 +88,12 @@ Sessions expire after 7 days. A new session is created on each login.
### Secure Cookies
By default, cookies require HTTPS in production:
Outside Docker, secure cookies default to `true` when `NODE_ENV=production` and `false` otherwise. The default `docker-compose.yml` forwards `AUTH_SECURE_COOKIES=${AUTH_SECURE_COOKIES:-false}`, so a Compose deployment defaults to non-secure cookies even though Compose sets `NODE_ENV=production`. Set it explicitly:
```bash
# HTTPS
AUTH_SECURE_COOKIES=true
# For HTTP on trusted networks only
AUTH_SECURE_COOKIES=false
```
@@ -109,7 +118,7 @@ For production with HTTPS:
```bash
AUTH_TRUSTED_ORIGINS=https://yourdomain.com
# AUTH_SECURE_COOKIES defaults to true
AUTH_SECURE_COOKIES=true
```
## Passkeys
+4 -4
View File
@@ -384,7 +384,7 @@ Limit container resources:
```yaml
services:
opencode-manager:
app:
# ... other config
deploy:
resources:
@@ -404,7 +404,7 @@ Create an isolated network:
```yaml
services:
opencode-manager:
app:
networks:
- opencode-net
@@ -419,7 +419,7 @@ Use host networking (Linux only):
```yaml
services:
opencode-manager:
app:
network_mode: host
```
@@ -542,7 +542,7 @@ services:
OpenCode 2 always requires Basic Auth on the managed server, so a password is always in effect. It is resolved in this order:
1. **Via UI:** Use Settings → OpenCode → Server Auth to set a password at runtime
2. **Environment variable:** Set `OPENCODE_SERVER_PASSWORD` in your `.env` file or compose environment
2. **Environment variable:** Set `OPENCODE_SERVER_PASSWORD` in the compose `environment:` block. The default `docker-compose.yml` does not forward it from `.env`, so setting it there alone has no effect in Docker; use `.env` only for local runs outside Docker
3. **Auto-generated:** When neither is configured, OpenCode Manager generates a random password and persists it in its database
**DB-stored passwords take precedence over the environment variable, which takes precedence over the auto-generated password.**
+4 -4
View File
@@ -11,7 +11,7 @@ Complete reference for all configuration options.
| `ADMIN_PASSWORD` | Pre-configured admin password | - |
| `ADMIN_PASSWORD_RESET` | Set to `true` to reset admin password | `false` |
| `AUTH_TRUSTED_ORIGINS` | Comma-separated list of trusted origins (frontend + backend) | `http://localhost:5173,http://localhost:5003` |
| `AUTH_SECURE_COOKIES` | Use secure cookies (HTTPS only) | `true` in prod, `false` in dev |
| `AUTH_SECURE_COOKIES` | Use secure cookies (HTTPS only) | Runtime: `true` in prod, `false` in dev; Compose: `false` unless set |
## OAuth Providers
@@ -73,7 +73,7 @@ When configured, users can enable push notifications in Settings → Notificatio
| `HOST` | Server bind address | `0.0.0.0` |
| `NODE_ENV` | Environment (`development` or `production`) | `development` |
| `CORS_ORIGIN` | CORS origin for frontend | `http://localhost:5173` |
| `LOG_LEVEL` | Logging level | `info` |
| `LOG_LEVEL` | Accepted but currently unused; debug output is controlled by `DEBUG` | `info` |
| `DEBUG` | Enable debug logging | `false` |
## Database
@@ -97,7 +97,7 @@ When configured, users can enable push notifications in Settings → Notificatio
| `OPENCODE_HEALTH_WATCH_ENABLED` | Enable OpenCode health watcher and recovery | `true` (`false` in tests) |
| `OPENCODE_HEALTH_POLL_MS` | OpenCode health watcher poll interval | `30000` |
| `OPENCODE_HEALTH_FAILURE_THRESHOLD` | Failed health checks before recovery starts | `2` |
| `OPENCODE_SERVER_PASSWORD` | Basic Auth password for the managed OpenCode server. OpenCode 2 always requires one: when unset, OpenCode Manager generates and persists a password (override it any time via Settings → OpenCode → Server Auth). DB-stored passwords override this env var. | auto-generated |
| `OPENCODE_SERVER_PASSWORD` | Basic Auth password for the managed OpenCode server. OpenCode 2 always requires one: when unset, OpenCode Manager generates and persists a password (override it any time via Settings → OpenCode → Server Auth). DB-stored passwords override this env var. The default `docker-compose.yml` does not forward this variable from `.env`; add it to the compose `environment:` block or set it via Settings → OpenCode → Server Auth. | auto-generated |
> **Upgrade note:** `OPENCODE_PUBLIC_URL` is no longer used. MCP OAuth redirects now point at the Manager's `/api/mcp-oauth-proxy/callback`, built from the request: the scheme comes from `X-Forwarded-Proto` (first value, `http` or `https` only), then the `Origin` header, then `http`; the host comes from `X-Forwarded-Host` when present, otherwise `Host`. Behind a reverse proxy, forward `X-Forwarded-Proto` and `X-Forwarded-Host` (or preserve `Host`) and remove `OPENCODE_PUBLIC_URL`; the Manager logs a warning at startup while it is still set.
@@ -143,7 +143,7 @@ Sandboxed agent commands run inside a microVM managed by `msb` (see [Agent Sandb
| Variable | Description | Default |
|----------|-------------|---------|
| `VITE_API_URL` | Backend API URL for frontend | `http://localhost:5003` |
| `VITE_API_URL` | Backend API URL for frontend. Empty (the default) means same-origin requests; the Vite dev server proxies `/api` to the backend | empty (same origin) |
| `VITE_SERVER_PORT` | Backend port hint for frontend | `5003` |
| `VITE_OPENCODE_PORT` | OpenCode server port hint | `5551` |
| `VITE_MAX_FILE_SIZE_MB` | File size limit for frontend | `50` |