From 3ada077429c27a0ec37cc3ed3dd52ef5cd9457a8 Mon Sep 17 00:00:00 2001 From: kaichaosun Date: Thu, 16 Apr 2026 09:14:26 +0800 Subject: [PATCH] chore: use encrypted db with default db pass --- bin/chat-cli/README.md | 1 + bin/chat-cli/src/app.rs | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/chat-cli/README.md b/bin/chat-cli/README.md index fc89e4a..5ae5367 100644 --- a/bin/chat-cli/README.md +++ b/bin/chat-cli/README.md @@ -78,6 +78,7 @@ Data is stored in the `tmp/chat-cli-data/` directory: | `_state.json` | CLI state: username↔chat mappings, message history, active chat | | `transport//` | Inbox directory for receiving messages | +The sqlite tables can be viewed with app `DB Browser for SQLite`, password is `123456`, config use `SQLCipher 4 defaults`. ## Example Session diff --git a/bin/chat-cli/src/app.rs b/bin/chat-cli/src/app.rs index 0f8a484..6285c34 100644 --- a/bin/chat-cli/src/app.rs +++ b/bin/chat-cli/src/app.rs @@ -68,7 +68,10 @@ impl ChatApp { // Open or create the chat manager with file-based storage let manager = ChatManager::new_from_store( user_name, - ChatStorage::new(StorageConfig::File(db_path.to_string_lossy().to_string()))?, + ChatStorage::new(StorageConfig::Encrypted { + path: db_path.to_string_lossy().to_string(), + key: "123456".to_string(), + })?, ) .context("Failed to open ChatManager")?;