add `index_directories`

main
_ 2022-04-29 01:07:00 +00:00
parent da581f452d
commit ed660f3432
2 changed files with 7 additions and 0 deletions

View File

@ -224,6 +224,8 @@ pub struct ConfigFile {
pub client_keys: HashSet <String>,
pub allow_any_client: bool,
pub index_directories: bool,
}
impl ConfigFile {
@ -238,6 +240,7 @@ impl ConfigFile {
throttle_upload: false,
client_keys: Default::default (),
allow_any_client: true,
index_directories: true,
}
}
@ -281,6 +284,7 @@ impl Builder {
throttle_upload: false,
client_keys: Default::default (),
allow_any_client: true,
index_directories: true,
};
Self {
@ -559,6 +563,7 @@ pub mod executable {
throttle_upload: opt.throttle_upload,
allow_any_client: true,
client_keys: Default::default (),
index_directories: config_file.index_directories.unwrap_or (true),
};
if opt.print_tripcode {
@ -612,6 +617,7 @@ pub mod executable {
pub relay_url: Option <String>,
pub file_server_root: Option <PathBuf>,
pub file_server_roots: Option <BTreeMap <String, PathBuf>>,
pub index_directories: Option <bool>,
}
fn gen_and_save_key (path: &Path) -> anyhow::Result <()> {

View File

@ -103,6 +103,7 @@ fn main ()
throttle_upload: false,
client_keys: Default::default (),
allow_any_client: true,
index_directories: true,
};
let hit_tx = hit_tx.clone ();