Security, Upgrades & Recovery
Operating Stravia safely requires protecting where plaintext credentials live, treating diagnostic exports carefully, and knowing how admin recovery and schema upgrades behave in v0.7.8.
Prerequisites
- Shell access to the host for Server recovery commands and pre-upgrade file/database backups.
Steps
1. Secure instance secret boundaries
- Admin surface: Never expose Server's admin interface without HTTPS and exact
--admin-origin/--trusted-proxysettings. Keep/setuplogs private—they contain the one-time setup token. - Database, Backups, and Redis:
- Upstream provider credentials, API key material, and reversible Credential Protection plaintexts (
reversible_redaction_mappings.secret) live in your database (and mapping snapshots enter Redis under PostgreSQL). - Protect
<data-dir>, database dumps, S3 buckets, and Redis (network isolation, ACLs, TLS) with strict secret-level permissions.
- Upstream provider credentials, API key material, and reversible Credential Protection plaintexts (
- Browser Console Chat storage: Conversations and pasted/dropped images in Chat (
/) live unencrypted in browserIndexedDB(stravia-console-chat); clear browser site data on shared workstations.
2. Distinguish Performance Exports from Debug Bundles
| Export | Location | Contents & security warning |
|---|---|---|
Performance export (stravia-performance.zip) | Settings → Diagnostics → Download performance data (GET /api/v1/performance/export) | Contains stravia-performance-metrics.prom (Prometheus text) and stravia-performance-trace.json (Chrome Trace). Download before turning Debug off—disabling Debug clears the timeline. |
| Debug Bundle | Per interaction or rejected request in Request history (/logs) | Raw application-layer wire events across all four directions. Redacts only HTTP Authorization header values; bodies, tool payloads, attached media, other secrets, and download tokens may still be present. Never share publicly without manual review. |
3. Recover Server admin access (SQLite limitation in v0.7.8)
If you lose your Server admin password (or migrate a Desktop SQLite directory to Server):
- Stop the running Stravia Server instance sharing that
--data-dir. - Run:
./stravia-server recover-admin --data-dir /var/lib/straviash - Enter a new username and password when prompted. Successful recovery revokes all previous web sessions.
PostgreSQL limitation in v0.7.8
In v0.7.8, recover-admin reads [database] without forwarding [cache] into Gateway::prepare, so standard PostgreSQL deployments fail the cache.redis_url requirement during recover-admin. Do not rely on recover-admin for PostgreSQL instances on v0.7.8.
4. Upgrade safely without data loss
- Back up first: Stop Stravia and back up
<data-dir>and any external PostgreSQL / S3 storage before replacing binaries. - Never open a migrated DB with an older binary: Roll back only by restoring your pre-upgrade backup.
- Verify proxy migration, plugins & routes: After upgrading to v0.7.8, verify migrated named proxies under Settings → Network → Proxy and per-provider
proxy_mode(0060), refresh standalone Wasm vendor plugins to v0.7.8 from System → Vendor plugins, and if upgrading from v0.7.5 or earlier, inspect Models for thinking-level mappings (0059) and purpose alignment (0057) plus Web search for External Route / registered Web Provider extensions (0058). Startup upgrades report localizedhistory_indexprogress when rebuilding thestravia-generation-history-v6:prefix index while keepingsynchronous=FULLand foreign-key enforcement intact.
Verify
After recovery or upgrade, start Stravia, confirm GET /readyz returns 200, and log in with your admin credentials (Server) or verify the native console loads (Desktop).
Troubleshooting
DataPaths::preparerefuses startup after upgrade or restore: Ensure you did not point v0.7.8 at an ancient pre-migration layout, or check for stale permissions/ownership on.instance.lock.- Expected performance trace file is empty: Export
stravia-performance.zipbefore toggling Debug off in Settings → Diagnostics.
Next
- What's New & Upgrading to v0.7.8 — complete migration list (
0032–0042,0055,0057–0060). - Troubleshooting — symptom-driven diagnosis for startup, auth, and routing issues.