auth param

This commit is contained in:
MeexReay 2025-02-12 03:20:39 +03:00
parent 9d087d315b
commit 5dd56bbb28
2 changed files with 4 additions and 3 deletions

View File

@ -58,6 +58,7 @@ max_messages: 100 # chat messages limit
-i, --disable-ip-hiding Disable ip hiding -i, --disable-ip-hiding Disable ip hiding
-v, --enable-users-ip-viewing Enable users IP viewing -v, --enable-users-ip-viewing Enable users IP viewing
-C, --configure Configure client -C, --configure Configure client
-a, --disable-auth Disable authentication
-h, --help Print help -h, --help Print help
-V, --version Print version -V, --version Print version
``` ```

View File

@ -173,9 +173,9 @@ pub struct Args {
#[arg(short='C', long)] #[arg(short='C', long)]
pub configure: bool, pub configure: bool,
/// Authentication password /// Disable authentication
#[arg(short='a', long)] #[arg(short='a', long)]
pub auth: bool, pub disable_auth: bool,
} }
pub struct Context { pub struct Context {
@ -209,7 +209,7 @@ impl Context {
max_messages: config.max_messages, max_messages: config.max_messages,
enable_ip_viewing: args.enable_users_ip_viewing || config.enable_ip_viewing, enable_ip_viewing: args.enable_users_ip_viewing || config.enable_ip_viewing,
scroll: Arc::new(AtomicUsize::new(0)), scroll: Arc::new(AtomicUsize::new(0)),
auth: args.auth auth: !args.disable_auth
} }
} }
} }