Fixes two critical issues preventing Mac release builds from working: 1. Database encryption key auto-generation: Release builds now auto-generate and persist the SQLCipher encryption key to ~/.../trcaa/.dbkey (mode 0600) instead of requiring the TFTSR_DB_KEY env var. This prevents 'file is not a database' errors when users don't set the env var. 2. Plain SQLite to encrypted migration: When a release build encounters a plain SQLite database (from a previous debug build), it now automatically migrates it to encrypted SQLCipher format using ATTACH DATABASE + sqlcipher_export. Creates a backup at .db.plain-backup before migration. 3. Credential encryption key auto-generation: Applied the same pattern to TFTSR_ENCRYPTION_KEY for encrypting AI provider API keys and integration tokens. Release builds now auto-generate and persist to ~/.../trcaa/.enckey (mode 0600) instead of failing with 'TFTSR_ENCRYPTION_KEY must be set'. 4. Refactored app data directory helper: Moved dirs_data_dir() from lib.rs to state.rs as get_app_data_dir() so it can be reused by both database and auth modules. Testing: - All unit tests pass (db::connection::tests + integrations::auth::tests) - Verified manual migration from plain to encrypted database - No clippy warnings Impact: Users installing the Mac release build will now have a working app out-of-the-box without needing to set environment variables. Developers switching from debug to release builds will have their databases automatically migrated. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| .cargo | ||
| capabilities | ||
| gen/schemas | ||
| icons | ||
| resources/ollama | ||
| src | ||
| target | ||
| build.rs | ||
| Cargo.lock | ||
| Cargo.toml | ||
| tauri.conf.json | ||