/// Directory that the file server module will expose to clients
/// over the relay. If None, the current working dir is used.
/// over the relay, under `/files`. If None, the current working dir is used.
pubfile_server_root: PathBuf,
/// The file server module will expose these directories to clients under
/// `/dirs`. If symlinks can't be used (like on Windows), this allows PTTH
/// to serve multiple directories easily.
pubfile_server_roots: BTreeMap<String,PathBuf>,
/// For debugging.
pubthrottle_upload: bool,
@ -226,6 +231,7 @@ impl ConfigFile {
api_key,
relay_url,
file_server_root: PathBuf::from("."),
file_server_roots: Default::default(),
throttle_upload: false,
client_keys: Default::default(),
allow_any_client: true,
@ -268,6 +274,7 @@ impl Builder {
api_key: ptth_core::gen_key(),
relay_url,
file_server_root: PathBuf::from("."),
file_server_roots: Default::default(),
throttle_upload: false,
client_keys: Default::default(),
allow_any_client: true,
@ -529,6 +536,12 @@ pub mod executable {
api_key: config_file.api_key,
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"))?,