From 556eaa133e9cfe7f4c8e542708119fdfd311357e Mon Sep 17 00:00:00 2001 From: Doan Luu Duc Tai Date: Fri, 30 Oct 2026 21:39:57 -0500 Subject: Implement experimental file-based encrypted private chat Add fixed-suite Rust/WASI identity files, signed challenge authentication, ciphertext-only SQLite storage, a minimal LibreJS-compatible interface, and consistent backup snapshots. Keep production unchanged and document the local workflow, limits, source distribution, and browser recovery tests. --- src/main.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index beba5b0..08c88f5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -49,6 +49,11 @@ struct Cli { #[derive(Debug, Subcommand)] enum Action { + #[command(about = "Run the experimental local chat or initialize its single .env")] + Chat { + #[arg(long)] + init: bool, + }, #[command(about = "Start the local development services")] Dev { #[arg(long, default_value_t = 8080)] @@ -127,6 +132,16 @@ fn execute(arguments: Cli) -> Result<()> { return archive::restore(&absolute(archive)?, &absolute(destination)?); } let project = Project::discover(arguments.root.as_deref())?; + if let Action::Chat { init } = arguments.command { + let mut command = project.command("cargo")?; + command + .args(["run", "--locked", "-p", "stack-chat-server", "--", "--root"]) + .arg(&project.root); + if init { + command.arg("--init"); + } + return process::run(&mut command); + } let _operation = project.lock()?; match arguments.command { Action::Dev { port } => { @@ -186,6 +201,7 @@ fn execute(arguments: Cli) -> Result<()> { Action::Activate { archive } => release::activate(&absolute(&archive)?, &project), Action::Check => check(&project), Action::Licenses => licenses(&project), + Action::Chat { .. } => anyhow::bail!("Chat action was not handled"), Action::Restore { .. } => anyhow::bail!("Restore action was not handled"), } } -- cgit v1.2.3