pub struct Registry {Show 22 fields
pub data_dir: String,
pub session_age_seconds: u64,
pub cache_size: u64,
pub cache_max_size: u64,
pub max_crate_size: u64,
pub max_db_connections: u32,
pub auth_required: bool,
pub required_crate_fields: Vec<String>,
pub new_crates_restricted: bool,
pub cookie_signing_key: Option<String>,
pub allow_ownerless_crates: bool,
pub token_cache_enabled: bool,
pub token_cache_ttl_seconds: u64,
pub token_cache_max_capacity: u64,
pub token_db_retry_count: u32,
pub token_db_retry_delay_ms: u64,
pub download_timeout_seconds: u64,
pub download_max_concurrent: usize,
pub download_counter_flush_seconds: u64,
pub auth_max_failed_attempts: u32,
pub auth_failed_attempts_window_seconds: u64,
pub sponsor_links_enabled: bool,
}Fields§
§data_dir: StringData directory for crates, index, and database
session_age_seconds: u64Session lifetime in seconds, counted from the login (0 = sessions never expire)
cache_size: u64Max number of crates in the in-memory crate cache (0 = disabled)
cache_max_size: u64Max total size of the in-memory crate cache in MB (0 = no size limit,
only cache_size applies)
max_crate_size: u64Max crate size in MB
max_db_connections: u32Max database connections (0 = unlimited)
auth_required: boolRequire authentication for all operations
required_crate_fields: Vec<String>Required crate fields (comma-separated)
new_crates_restricted: boolRestrict new crate uploads to admins
Cookie signing key (for multi-instance setups). At least 64 bytes of
random data; generate it with e.g. openssl rand -hex 64. Unset, a
random key is generated on every start
allow_ownerless_crates: boolAllow crates without owners
token_cache_enabled: boolEnable token cache
token_cache_ttl_seconds: u64Token cache TTL in seconds
token_cache_max_capacity: u64Token cache max capacity
token_db_retry_count: u32Token DB retry count
token_db_retry_delay_ms: u64Token DB retry delay in ms
download_timeout_seconds: u64Download request timeout in seconds (0 = disabled)
download_max_concurrent: usizeMax concurrent download requests (0 = unlimited)
download_counter_flush_seconds: u64Download counter flush interval in seconds (0 = flush every download)
auth_max_failed_attempts: u32Password attempts allowed per username within the window before further attempts are rejected with HTTP 429 (0 = disabled). Applies to web UI login and cargo basic auth; a successful login resets the count
auth_failed_attempts_window_seconds: u64Window in seconds for counting password attempts per username
sponsor_links_enabled: boolShow links to sponsor Kellnr in the web UI and the startup log
Implementations§
Source§impl Registry
impl Registry
pub fn session_age(&self) -> SessionAge
pub fn token_cache_ttl(&self) -> Duration
pub fn auth_failed_attempts_window(&self) -> Duration
Sourcepub fn max_crate_bytes(&self) -> usize
pub fn max_crate_bytes(&self) -> usize
max_crate_size in bytes.
Sourcepub fn cache_max_bytes(&self) -> Option<u64>
pub fn cache_max_bytes(&self) -> Option<u64>
cache_max_size in bytes, None if the size of the crate cache is
not limited.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Registry
impl<'de> Deserialize<'de> for Registry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Registry
impl StructuralPartialEq for Registry
Auto Trait Implementations§
impl Forget for Registry
impl Freeze for Registry
impl Move for Registry
impl RefUnwindSafe for Registry
impl Send for Registry
impl Sync for Registry
impl Unpin for Registry
impl UnsafeUnpin for Registry
impl UnwindSafe for Registry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more