Disable upload: do not expose in default builds, move under a feature flag.

This commit is contained in:
Igor Katson 2024-10-03 09:01:38 +01:00
parent b99a1e2b73
commit 990c5f866b
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
11 changed files with 45 additions and 16 deletions

View file

@ -144,6 +144,7 @@ pub struct RqbitDesktopConfigUpnp {
pub struct RqbitDesktopConfig {
pub default_download_location: PathBuf,
#[cfg(feature = "disable-upload")]
#[serde(default)]
pub disable_upload: bool,
@ -171,6 +172,7 @@ impl Default for RqbitDesktopConfig {
persistence: Default::default(),
peer_opts: Default::default(),
http_api: Default::default(),
#[cfg(feature = "disable-upload")]
disable_upload: false,
}
}

View file

@ -105,6 +105,7 @@ async fn api_from_config(
},
enable_upnp_port_forwarding: !config.upnp.disable_tcp_port_forward,
fastresume: config.persistence.fastresume,
#[cfg(feature = "disable-upload")]
disable_upload: config.disable_upload,
..Default::default()
},