aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorDoan Luu Duc Tai <doan@luuduct.ai>2026-10-30 21:39:57 -0500
committerDoan Luu Duc Tai <doan@luuduct.ai>2026-10-30 21:39:57 -0500
commite6b350a1d48ca0490b7a3447bb8d0a4235514b76 (patch)
tree57ae2a9c5455f335e8c34b293f4f13975cb3d09e /src/main.rs
parent0a4da3b86eb69f0f09b802a55e36fa9cf1bbf38c (diff)
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.
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs16
1 files changed, 16 insertions, 0 deletions
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"),
}
}