From ed660f3432c98ec4b173c69906c73cb95951f4ff Mon Sep 17 00:00:00 2001 From: _ <_@_> Date: Fri, 29 Apr 2022 01:07:00 +0000 Subject: [PATCH] :heavy_plus_sign: add `index_directories` --- crates/ptth_server/src/lib.rs | 6 ++++++ crates/ptth_server_gui/src/main.rs | 1 + 2 files changed, 7 insertions(+) diff --git a/crates/ptth_server/src/lib.rs b/crates/ptth_server/src/lib.rs index e2d0fce..5ca3fd1 100644 --- a/crates/ptth_server/src/lib.rs +++ b/crates/ptth_server/src/lib.rs @@ -224,6 +224,8 @@ pub struct ConfigFile { pub client_keys: HashSet , 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 , pub file_server_root: Option , pub file_server_roots: Option >, + pub index_directories: Option , } fn gen_and_save_key (path: &Path) -> anyhow::Result <()> { diff --git a/crates/ptth_server_gui/src/main.rs b/crates/ptth_server_gui/src/main.rs index 0d87035..41c1b3b 100644 --- a/crates/ptth_server_gui/src/main.rs +++ b/crates/ptth_server_gui/src/main.rs @@ -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 ();