Configuration, CLI & Paths

This reference lists the startup flags, subcommands, environment variables, and directory layout used by Stravia Server and Stravia Desktop.

Server CLI & subcommands

Command / FlagDescriptionDefault
stravia-serverStart the gateway and admin HTTP serverListens 127.0.0.1:23471
stravia-server recover-adminReset Server admin username/password & revoke sessions (SQLite only in v0.7.8)Interactive prompt
--data-dir <PATH>Override instance data root~/.stravia (Server release)
--config <PATH>Override server.toml config file path<data-dir>/server.toml
--listen <ADDR>Bind host and port127.0.0.1:23471
--admin-origin <ORIGIN>Allowed admin web origin behind reverse proxy (repeatable)Same-origin / loopback
--trusted-proxy <CIDR>Trusted reverse proxy IP/CIDR for forwarded headersNone
--updater-url <URL>Override release/updater check endpointhttps://updater.stravia.cn
--versionPrint binary version and exit—

Key environment variables

VariableEffect
STRAVIA_DATA_DIROverride default data root (--data-dir takes precedence).
STRAVIA_UPDATER_URLOverride default product update check URL.
HTTP_PROXY / HTTPS_PROXY / ALL_PROXY / NO_PROXYRead by Stravia Server when a provider, web provider, or updater uses proxy_mode = "system" (Desktop reads OS proxy settings instead).
MIMALLOC_PURGE_DELAYLinux Server builds use mimalloc with MIMALLOC_PURGE_DELAY=0 by default to return unused memory promptly; override if tuning allocator behavior.

Data directory layout (<data-dir>)

Stravia enforces exclusive access on <data-dir> via .instance.lock:

PathContents
server.tomlServer [database] and [cache] configuration (backend, url, redis_url, capacity_mb).
db/gateway.dbSQLite database (when backend = "sqlite").
plugins/Installed third-party / marketplace Wasm vendor plugins.
artifacts/Local artifact files (when not using S3).
diagnostics/observation-debug/Captured debug traces when Debug is enabled.
logs/Instance startup and runtime logs.
cache/Rebuildable wasmtime-images/ and plugin-admissions/ caches (safe to exclude from backups).
  • Stravia Desktop default root: OS Tauri app_data_dir() for cn.stravia.agent-infra (e.g., ~/.local/share/cn.stravia.agent-infra on Linux, ~/Library/Application Support/cn.stravia.agent-infra on macOS, %APPDATA%\cn.stravia.agent-infra on Windows), overrideable via --data-dir or STRAVIA_DATA_DIR.

server.toml schema (PostgreSQL + Redis example)

[database]
backend = "postgres"
url = "postgresql://stravia@127.0.0.1:5432/stravia"
max_connections = 10
min_connections = 1

[cache]
capacity_mb = 16
redis_url = "redis://127.0.0.1:6379/0"
toml

Runtime settings stored in DB (Settings page)

  • artifact_settings: { client_base_url, external_signed_downloads, file_public_base_url, upload_prompt_injection, s3 }
  • outbound_proxy: {"proxies": [{"id", "name", "url"}]} (http://, https://, socks5://, socks5h://; explicit port required, no path/query/fragment; bypass and force_http1 removed in v0.7.8). Companion admin endpoints: GET /api/v1/settings/outbound-proxy/system (sanitized detected env/os proxy) and POST /api/v1/settings/outbound-proxy/probe (exit IP probe across 10 AI domains).
  • update_proxy_mode: "none" | "system" | "<proxy_id>" (defaults to "system"; replaces removed update_use_proxy)
  • Update channel: Managed via PUT /api/v1/updates/channel with {"channel": "release" | "beta"} (persisted in DB; rejected on generic /api/v1/settings/*)
  • reversible_redaction_enabled: boolean
  • log_retention_days: integer days (default 7, minimum 1)