From 43aebdeb6fdefcf19024d487ca41c1dc8dc63800 Mon Sep 17 00:00:00 2001 From: Chris Bury Date: Fri, 31 Oct 2025 23:03:54 +0000 Subject: [PATCH 1/2] Added listen port option to the install command. --- client/src/main.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/client/src/main.rs b/client/src/main.rs index cf6ae9cb..ffb2343c 100644 --- a/client/src/main.rs +++ b/client/src/main.rs @@ -84,6 +84,10 @@ enum Command { #[clap(flatten)] hosts: HostsOpt, + /// The listen port you'd like to set for the interface + #[clap(short, long)] + listen_port: Option, + #[clap(flatten)] install_opts: InstallOpts, @@ -276,10 +280,14 @@ fn install( invite: &Path, hosts_file: Option, install_opts: InstallOpts, + listen_port: Option, nat: &NatOpts, ) -> Result<(), Error> { innernet_shared::ensure_dirs_exist(&[&opts.config_dir])?; - let config = InterfaceConfig::from_file(invite)?; + let config = InterfaceConfig::from_file(invite).map(|mut config| { + config.interface.listen_port = listen_port; + config + })?; let iface = if install_opts.default_name { config.interface.network_name.clone() @@ -420,7 +428,7 @@ fn redeem_invite( iface, &config.interface.private_key, config.interface.address, - None, + config.interface.listen_port, Some(( &config.server.public_key, config.server.internal_endpoint.ip(), @@ -1289,8 +1297,9 @@ fn run(opts: &Opts) -> Result<(), Error> { invite, hosts, install_opts, + listen_port, nat, - } => install(opts, &invite, hosts.into(), install_opts, &nat)?, + } => install(opts, &invite, hosts.into(), install_opts, listen_port, &nat)?, Command::Show { short, tree, From a052ae9d460cf95a770b97f0e5a70e974cf48cae Mon Sep 17 00:00:00 2001 From: Hwatwasthat Date: Tue, 2 Dec 2025 15:43:22 +0000 Subject: [PATCH 2/2] Update client/src/main.rs Remove the short option, only allow using --listen-port. Co-authored-by: Jen --- client/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/main.rs b/client/src/main.rs index ffb2343c..427da7a1 100644 --- a/client/src/main.rs +++ b/client/src/main.rs @@ -85,7 +85,7 @@ enum Command { hosts: HostsOpt, /// The listen port you'd like to set for the interface - #[clap(short, long)] + #[clap(long)] listen_port: Option, #[clap(flatten)]