config.blossom_directory

This commit is contained in:
Mike Dilger 2024-11-16 20:33:54 +13:00
parent 853fefbdf6
commit 8b90d83dd5
No known key found for this signature in database
GPG Key ID: 47581A78D4329BA4
3 changed files with 30 additions and 0 deletions

View File

@ -299,3 +299,16 @@ throttling_bytes_per_second = 1024576
# Default is 16777216 bytes.
#
throttling_burst = 16777216
# Blossom server directory
#
# Set to a filesystem directory where you want chorus to store files.
#
# Blossom allows clients to upload files making them available for the public to download.
# Our implementation makes all files publicly readable, but only chorus users can upload
# or delete. See https://github.com/hzrd149/blossom
#
# Default is not set
#
# blossom_directory =

View File

@ -257,3 +257,15 @@ second. If that bucket doesn't have enough, the burst won't be allowed and the c
will be closed.
Default is 16777216 bytes.
### blossom_directory
Blossom server directory
Set to a filesystem directory where you want chorus to store files.
Blossom allows clients to upload files making them available for the public to download.
Our implementation makes all files publicly readable, but only chorus users can upload
or delete. See https://github.com/hzrd149/blossom
Default is None

View File

@ -40,6 +40,7 @@ pub struct FriendlyConfig {
pub max_connections_per_ip: usize,
pub throttling_bytes_per_second: usize,
pub throttling_burst: usize,
pub blossom_directory: Option<String>,
}
impl Default for FriendlyConfig {
@ -77,6 +78,7 @@ impl Default for FriendlyConfig {
max_connections_per_ip: 5,
throttling_bytes_per_second: 1024 * 1024,
throttling_burst: 1024 * 1024 * 16,
blossom_directory: None,
}
}
}
@ -116,6 +118,7 @@ impl FriendlyConfig {
max_connections_per_ip,
throttling_bytes_per_second,
throttling_burst,
blossom_directory,
} = self;
let mut public_key: Option<Pubkey> = None;
@ -177,6 +180,7 @@ impl FriendlyConfig {
max_connections_per_ip,
throttling_bytes_per_second,
throttling_burst,
blossom_directory,
})
}
}
@ -217,6 +221,7 @@ pub struct Config {
pub max_connections_per_ip: usize,
pub throttling_bytes_per_second: usize,
pub throttling_burst: usize,
pub blossom_directory: Option<String>,
}
impl Default for Config {