Add /wipe, /wipe-all, and threat model docs.
/wipe overwrites the message log and VACUUMs; identity and friends stay. /wipe-all deletes the data dir after confirm so the next open is a new person. Neither runs without a typed confirm screen.
This commit is contained in:
parent
07aa97711c
commit
5412e020bb
7 changed files with 415 additions and 18 deletions
13
src/main.rs
13
src/main.rs
|
|
@ -1,3 +1,5 @@
|
|||
use onionwire::tui::AppExit;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
if let Err(e) = boot().await {
|
||||
|
|
@ -9,9 +11,14 @@ async fn main() {
|
|||
async fn boot() -> Result<(), String> {
|
||||
let home = onionwire::Store::home_dir().map_err(|e| e.to_string())?;
|
||||
eprintln!("onionwire: bootstrapping Arti…");
|
||||
let node = onionwire::node::Node::start(home).await?;
|
||||
let node = onionwire::node::Node::start(home.clone()).await?;
|
||||
let handle = tokio::runtime::Handle::current();
|
||||
tokio::task::spawn_blocking(move || onionwire::tui::run(node, handle))
|
||||
let exit = tokio::task::spawn_blocking(move || onionwire::tui::run(node, handle))
|
||||
.await
|
||||
.map_err(|e| e.to_string())?
|
||||
.map_err(|e| e.to_string())??;
|
||||
if exit == AppExit::WipeAll {
|
||||
onionwire::Store::wipe_all(&home).map_err(|e| e.to_string())?;
|
||||
eprintln!("onionwire: all local data wiped");
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue