SSE streaming with long-poll fallback; encrypted unicast profile; registry enc keys

This commit is contained in:
George Coles
2026-09-15 06:58:35 -04:00
parent 2c97fd523f
commit ec98275613
15 changed files with 1117 additions and 320 deletions
+20 -3
View File
@@ -28,7 +28,7 @@ enum Command {
#[arg(long, default_value = "127.0.0.1:7701")]
listen: String,
#[arg(long, default_value = "http://127.0.0.1:7700")]
relay: String,
relay: Vec<String>,
#[arg(long, default_value = "./frx-data")]
data_dir: String,
#[arg(long)]
@@ -125,6 +125,7 @@ enum MemberCommand {
#[derive(Subcommand)]
enum KeyCommand {
Show,
ShowEnc,
Rotate,
}
@@ -140,6 +141,12 @@ enum RegistryCommand {
not_before: Option<u64>,
#[arg(long)]
not_after: Option<u64>,
#[arg(long)]
enc_key: Option<String>,
},
SetEncKey {
id: String,
enc_key: String,
},
AddKey {
id: String,
@@ -197,7 +204,7 @@ async fn main() -> Result<()> {
if registry.is_some() && ma_key.is_none() {
bail!("--ma-key is required with --registry");
}
let mut config = Config::new(&name, &listen, &relay, &data_dir);
let mut config = Config::new(&name, &listen, relay, &data_dir);
config.node.id = id;
config.node.registry = registry;
config.node.ma_key = ma_key;
@@ -209,10 +216,13 @@ async fn main() -> Result<()> {
}
let key = Keypair::generate();
config.save_key(&key)?;
let (enc_secret, enc_public) = frxd::crypto::generate_enc_keypair();
config.save_enc_key(&enc_secret)?;
config.save(&cli.config)?;
println!("wrote config {}", cli.config.display());
println!("wrote key {}", config.key_path().display());
println!("pubkey {}", key.public_hex());
println!("enc pubkey {enc_public}");
println!("data dir {}", config.data_dir().display());
}
Command::Add {
@@ -279,6 +289,7 @@ async fn main() -> Result<()> {
},
Command::Key { command } => match command {
KeyCommand::Show => commands::key_show(&cli.config)?,
KeyCommand::ShowEnc => commands::key_show_enc(&cli.config)?,
KeyCommand::Rotate => commands::key_rotate(&cli.config)?,
},
Command::Registry { dir, command } => match command {
@@ -289,7 +300,13 @@ async fn main() -> Result<()> {
class,
not_before,
not_after,
} => commands::registry_add(&dir, &id, &pubkey, &class, not_before, not_after)?,
enc_key,
} => {
commands::registry_add(&dir, &id, &pubkey, &class, not_before, not_after, enc_key)?
}
RegistryCommand::SetEncKey { id, enc_key } => {
commands::registry_set_enc_key(&dir, &id, &enc_key)?
}
RegistryCommand::AddKey {
id,
pubkey,