Allow protected to be set from cli
This commit is contained in:
parent
2749f3d1cf
commit
8a628d51a6
10
src/ssh.rs
10
src/ssh.rs
|
@ -167,8 +167,11 @@ impl Handler {
|
||||||
#[command(version, about, long_about = None)]
|
#[command(version, about, long_about = None)]
|
||||||
struct Args {
|
struct Args {
|
||||||
/// Make all tunnels public by default instead of private
|
/// Make all tunnels public by default instead of private
|
||||||
#[arg(short, long)]
|
#[arg(long, group = "access")]
|
||||||
public: bool,
|
public: bool,
|
||||||
|
|
||||||
|
#[arg(long, group = "access")]
|
||||||
|
protected: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl russh::server::Handler for Handler {
|
impl russh::server::Handler for Handler {
|
||||||
|
@ -244,6 +247,11 @@ impl russh::server::Handler for Handler {
|
||||||
self.set_access_all(TunnelAccess::Public).await;
|
self.set_access_all(TunnelAccess::Public).await;
|
||||||
self.redraw().await?;
|
self.redraw().await?;
|
||||||
}
|
}
|
||||||
|
if args.protected {
|
||||||
|
trace!("Making tunnels protected");
|
||||||
|
self.set_access_all(TunnelAccess::Protected).await;
|
||||||
|
self.redraw().await?;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
trace!("Sending help message and disconnecting");
|
trace!("Sending help message and disconnecting");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user