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-proxy settings. Keep /setup logs 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.
  • Browser Console Chat storage: Conversations and pasted/dropped images in Chat (/) live unencrypted in browser IndexedDB (stravia-console-chat); clear browser site data on shared workstations.

2. Distinguish Performance Exports from Debug Bundles

ExportLocationContents & 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 BundlePer 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):

  1. Stop the running Stravia Server instance sharing that --data-dir.
  2. Run:
    ./stravia-server recover-admin --data-dir /var/lib/stravia
    sh
  3. 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

  1. Back up first: Stop Stravia and back up <data-dir> and any external PostgreSQL / S3 storage before replacing binaries.
  2. Never open a migrated DB with an older binary: Roll back only by restoring your pre-upgrade backup.
  3. 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 localized history_index progress when rebuilding the stravia-generation-history-v6: prefix index while keeping synchronous=FULL and 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::prepare refuses 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.zip before toggling Debug off in Settings → Diagnostics.

Next