#[non_exhaustive]pub struct BackendConfig {
pub secure_cookie: bool,
pub timezone: String,
pub paths: BTreeMap<String, String>,
pub path: String,
pub trusted_proxies: Vec<String>,
}Expand description
Deployment-level backend settings. Per-install brand and per-operator preferences live in the settings and preferences stores, not here.
Non-exhaustive: build one with Default and set fields, so a field added
in a later release is additive.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.Set the Secure attribute on the admin session cookie. Enable behind HTTPS
in production; leave off for plain-HTTP local development.
timezone: StringThe default display timezone for the admin (an IANA name like
Asia/Kolkata). Storage is always UTC; this only affects how dates render.
An operator’s own preference overrides it (later); it falls back to UTC.
paths: BTreeMap<String, String>Admin path overrides, keyed by module id ("rainmill.location") or by a
module id and one contribution’s declared path
("rainmill.location/nodes"), the more specific winning. Values are
absolute under the admin mount, so they survive a relocated panel. Lets a
deployment move a plugin’s screens without forking it.
path: StringThe URL path the admin panel is mounted under, without a trailing slash
(default /admin). Change it to move or obscure the panel (/manage,
/backend). A leading slash is added if missing and a trailing slash is
stripped; an empty value falls back to /admin.
trusted_proxies: Vec<String>Networks whose X-Forwarded-For header may be believed, as CIDR ranges
("10.0.0.0/8"). The header is caller-controlled, so it is read only when
the connecting peer falls inside one of these; the client is then the
rightmost address in the chain that is not itself a trusted proxy.
Empty (the default) trusts nothing and records the peer address, which is right for a directly bound server. Set it to the load balancer’s network when there is one: leaving it empty behind a proxy records the proxy on every row, and filling it in for a network that is not a proxy lets anyone on it forge the address in the audit log.
Trait Implementations§
Source§impl Clone for BackendConfig
impl Clone for BackendConfig
Source§impl Debug for BackendConfig
impl Debug for BackendConfig
Source§impl Default for BackendConfig
impl Default for BackendConfig
Source§impl<'de> Deserialize<'de> for BackendConfigwhere
BackendConfig: Default,
impl<'de> Deserialize<'de> for BackendConfigwhere
BackendConfig: Default,
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>,
Auto Trait Implementations§
impl Freeze for BackendConfig
impl RefUnwindSafe for BackendConfig
impl Send for BackendConfig
impl Sync for BackendConfig
impl Unpin for BackendConfig
impl UnsafeUnpin for BackendConfig
impl UnwindSafe for BackendConfig
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<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