Command Palette
Search for a command to run...

Running the server

The backend is a single Go binary. On first start it creates its SQLite database (and parent directory, mode 0700), runs migrations, and binds a port.

Build and run

Build

cd backend
make build        # → bin/open-secret-server

Run

The one flag you must set is -server-url, the deployment's canonical public URL (it's bound into session tokens, so it can't be guessed at boot):

./bin/open-secret-server -server-url=https://vault.example.com

For local development, point it at where you open the app, the Vite dev server:

./bin/open-secret-server -server-url=http://localhost:5173

Verify

curl -fsS http://localhost:8080/healthz   # → 200 ok

A fuller production invocation:

./bin/open-secret-server \
  -server-url=https://vault.example.com \
  -addr=:8080 \
  -db=/data/open-secret.db \
  -cors=https://vault.example.com \
  -audit-db=/data/audit.db

Flags and environment variables

FlagEnv varDefaultWhat it does
-server-urlOPENSECRET_SERVER_URLrequiredCanonical public URL of this deployment. Bound into the session-token audience so a token can't be replayed against another instance.
-addr-:8080HTTP listen address.
-db-data/open-secret.dbSQLite path. Parent dir created 0700 on first run.
-corsOPENSECRET_CORS(localhost dev origins)Comma-separated browser origin allow-list. See Configuration.
-audit-dbOPENSECRET_AUDIT_DB<dir of -db>/audit.dbSQLite path for the audit log.
-disable-audit-falseTurns the audit log off entirely. Intended for dev/test; logged as a warning at boot.
-auth-modeOPENSECRET_AUTH_MODEstandaloneidp switches the deployment to SSO onboarding. Immutable after first boot. See Enterprise SSO.
-OPENSECRET_OIDC_*-OIDC issuer, client id, provider kind, scopes, and per-provider params (IDP mode only). Full list in Enterprise SSO.

Storage

  • Engine, SQLite via modernc.org/sqlite (pure Go, no CGO), a single connection in WAL mode.
  • Migrations, applied automatically on startup (Goose). There's no separate migration step to run.
  • Backups, because it's a SQLite file, an operational backup is a consistent copy of the DB file(s). (That's distinct from vault recovery, which is covered in Backup & recovery.)

Hardening defaults

The server ships with conservative HTTP limits so you don't have to add them at the proxy:

SettingValueWhy
Request body cap16 MiBBounds a Create/Update carrying many device shares.
ReadHeaderTimeout10 sSlow-loris defense.
ReadTimeout / WriteTimeout5 minRoom for large legitimate writes.
IdleTimeout120 sReaps idle keep-alives.
Signup rate limit5 burst, ~1/min per IPThrottles account-creation abuse.

Put it behind TLS (a reverse proxy is fine) and point -server-url at the public HTTPS URL.