🚧 maybe HTTP Basic Auth?

main
_ 2021-08-29 20:56:32 -05:00
parent 5376e8bba0
commit 1abf1d194c
3 changed files with 11 additions and 4 deletions

View File

@ -107,6 +107,8 @@ async fn main () -> Result <(), anyhow::Error> {
relay_url: opt.relay_url.or (config_file.relay_url).ok_or (anyhow::anyhow! ("`--relay-url` must be provided in command line or `relay_url` in config file"))?,
file_server_root: opt.file_server_root.or (config_file.file_server_root).unwrap_or_else (|| PathBuf::from (".")),
throttle_upload: opt.throttle_upload,
client_keys: Default::default (),
allow_any_client: true,
};
if opt.print_tripcode {

View File

@ -221,8 +221,9 @@ pub struct ConfigFile {
/// For debugging.
pub throttle_upload: bool,
// Clients don't need to auth if this is None
// pub client_tripcodes: HashMap <String, BlakeHashWrapper>,
pub client_keys: HashSet <String>,
pub allow_any_client: bool,
}
impl ConfigFile {
@ -234,7 +235,8 @@ impl ConfigFile {
relay_url,
file_server_root: PathBuf::from ("."),
throttle_upload: false,
// client_tripcodes: HashSet::new (),
client_keys: Default::default (),
allow_any_client: true,
}
}
@ -275,7 +277,8 @@ impl Builder {
relay_url,
file_server_root: PathBuf::from ("."),
throttle_upload: false,
// client_tripcodes: HashMap::new (),
client_keys: Default::default (),
allow_any_client: true,
};
Self {

View File

@ -59,6 +59,8 @@ fn main ()
relay_url: gui.input_relay_url.value ().to_string (),
file_server_root: std::path::PathBuf::from (gui.input_file_server_root.value ()),
throttle_upload: false,
client_keys: Default::default (),
allow_any_client: true,
};
let task = rt.spawn (async {