Skip to content

Commit fd9a3a5

Browse files
author
FreeSynergy
committed
feat(G1.5+G1.6): fs-node-server + fsn node command
G1.5 — Node Grundstruktur (fs-node-server crate): - NodeLayer trait: start/stop/name lifecycle fuer alle Schichten - AuthGateway: OAuthProvider + PamProvider + SsoProvider (fs-auth Traits) - S3Provider: StorageLayer wrapping fs-s3 (opendal) - ServiceProxy: Capability-Lookup via fs-registry - FederationGate: Trait + disabled placeholder (bis Phase P) - NodeServer: komposes alle Layers, startet axum HTTP API G1.6 — Einladungs-System: - InviteToken: fsn1. HMAC-signierter Token (node_id|address|expires|nonce) - InviteBundle: age-verschluesseltes TOML-Paket (passphrase-basiert) - PortPool: port-per-invitation Allokation aus konfigurierbarem Range - InviteSystem: create / verify / accept CLI-Integration (fsn node): - fsn node serve -- startet NodeServer - fsn node invite create -- generiert Token + verschluesseltes Bundle - fsn node invite accept -- nimmt Einladung an
1 parent 128d87b commit fd9a3a5

19 files changed

Lines changed: 1630 additions & 2 deletions

File tree

cli/Cargo.lock

Lines changed: 63 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli/Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ members = [
1111
"crates/fs-container",
1212
"crates/fs-builder",
1313
"crates/fs-template",
14+
"crates/fs-node-server",
1415
]
1516
resolver = "2"
1617

@@ -40,8 +41,10 @@ fs-help = { path = "../../fs-help" }
4041
fs-pkg = { path = "../../fs-packages/fs-pkg" }
4142
fs-plugin-sdk = { path = "../../fs-packages/fs-plugin-sdk" }
4243
fs-plugin-runtime = { path = "../../fs-packages/fs-plugin-runtime" }
44+
fs-registry = { path = "../../fs-registry" }
4345
# Internal crates
44-
fs-node-core = { path = "crates/fs-node-core" }
46+
fs-node-core = { path = "crates/fs-node-core" }
47+
fs-node-server = { path = "crates/fs-node-server" }
4548
fs-deploy = { path = "crates/fs-deploy" }
4649
fs-dns = { path = "crates/fs-dns" }
4750
fs-host = { path = "crates/fs-host" }

cli/crates/fs-node-cli/Cargo.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ tower-http = { workspace = true }
3636
serde_json = { workspace = true }
3737
reqwest = { workspace = true }
3838
uuid = { workspace = true }
39-
fs-pkg = { workspace = true }
39+
fs-pkg = { workspace = true }
40+
fs-registry = { workspace = true }
41+
fs-node-server = { workspace = true }
42+
fs-auth = { workspace = true }
43+
async-trait = { workspace = true }
4044

4145
[dev-dependencies]
4246
tempfile = { workspace = true }

cli/crates/fs-node-cli/src/cli.rs

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,12 @@ pub enum Command {
195195
cmd: BusCommand,
196196
},
197197

198+
/// Node server management (orchestration layers + invite system)
199+
Node {
200+
#[command(subcommand)]
201+
cmd: NodeCommand,
202+
},
203+
198204
/// Show system information (OS, features, disk, memory, CPU temperature)
199205
Sysinfo {
200206
/// Show live on-demand data (disk, memory, temperature) instead of cached static info
@@ -568,6 +574,61 @@ pub enum ConfigCommand {
568574
},
569575
}
570576

577+
#[derive(Subcommand)]
578+
pub enum NodeCommand {
579+
/// Start the full Node server (Auth, S3, `ServiceProxy`, Federation, API)
580+
Serve {
581+
/// HTTP bind address
582+
#[arg(long, default_value = "127.0.0.1")]
583+
bind: String,
584+
585+
/// HTTP port for the Node API
586+
#[arg(long, default_value = "8080")]
587+
port: u16,
588+
589+
/// Public domain name of this node (e.g. "node.example.com")
590+
#[arg(long)]
591+
domain: Option<String>,
592+
},
593+
594+
/// Node invitation management
595+
Invite {
596+
#[command(subcommand)]
597+
cmd: InviteCommand,
598+
},
599+
}
600+
601+
#[derive(Subcommand)]
602+
pub enum InviteCommand {
603+
/// Generate a new invite token and encrypted bundle
604+
Create {
605+
/// Token lifetime in hours (default: 24)
606+
#[arg(long, default_value = "24")]
607+
ttl_hours: u64,
608+
609+
/// Optional label for this invite (e.g. recipient name)
610+
#[arg(long)]
611+
label: Option<String>,
612+
613+
/// First port in the invite port range
614+
#[arg(long, default_value = "9100")]
615+
port_min: u16,
616+
617+
/// Last port (exclusive) in the invite port range
618+
#[arg(long, default_value = "9200")]
619+
port_max: u16,
620+
},
621+
622+
/// Accept an invite from another node (decrypt bundle + connect)
623+
Accept {
624+
/// The invite token string
625+
token: String,
626+
627+
/// The encrypted bundle string
628+
bundle: String,
629+
},
630+
}
631+
571632
#[derive(Subcommand)]
572633
pub enum InstallRootCommand {
573634
/// Show all current installation base paths
@@ -801,6 +862,7 @@ pub async fn run() -> Result<()> {
801862
payload,
802863
} => commands::bus::publish_event(&topic, &source, payload.as_deref()).await,
803864
},
865+
Command::Node { cmd } => commands::node::run(&root, cmd).await,
804866
Command::Sysinfo {
805867
live,
806868
refresh,

cli/crates/fs-node-cli/src/commands/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ pub mod init;
99
pub mod install;
1010
pub mod install_root;
1111
pub mod logs;
12+
pub mod node;
1213
pub mod remove;
1314
pub mod restart;
1415
pub mod serve;

0 commit comments

Comments
 (0)