Struct lemmy_utils::settings::structs::Settings [−][src]
pub struct Settings {Show 15 fields
pub database: DatabaseConfig,
pub rate_limit: Option<RateLimitConfig>,
pub federation: FederationConfig,
pub captcha: CaptchaConfig,
pub email: Option<EmailConfig>,
pub setup: Option<SetupConfig>,
pub hostname: String,
pub bind: IpAddr,
pub port: u16,
pub tls_enabled: bool,
pub pictrs_url: Option<String>,
pub additional_slurs: Option<String>,
pub actor_name_max_length: usize,
pub webfinger_community_regex: Option<Regex>,
pub webfinger_username_regex: Option<Regex>,
}
Fields
database: DatabaseConfig
rate_limit: Option<RateLimitConfig>
federation: FederationConfig
captcha: CaptchaConfig
email: Option<EmailConfig>
setup: Option<SetupConfig>
hostname: String
bind: IpAddr
port: u16
tls_enabled: bool
pictrs_url: Option<String>
additional_slurs: Option<String>
actor_name_max_length: usize
webfinger_community_regex: Option<Regex>
webfinger_username_regex: Option<Regex>
Implementations
Reads config from configuration file.
Note: The env var LEMMY_DATABASE_URL
is parsed in
lemmy_db_queries/src/lib.rs::get_database_url_from_env()
Warning: Only call this once.
Returns either “http” or “https”, depending on tls_enabled setting
Returns something like http://localhost
or https://lemmy.ml
,
with the correct protocol and hostname.
When running the federation test setup in api_tests/
or docker/federation
, the hostname
variable will be like lemmy-alpha:8541
. This method removes the port and returns
lemmy-alpha
instead. It has no effect in production.
Trait Implementations
Return Settings { database: Default::default(), rate_limit: Some(RateLimitConfig :: default()), federation: FederationConfig :: default(), captcha: CaptchaConfig :: default(), email: None, setup: None, hostname: ("unset").into(), bind: IpAddr :: V4(Ipv4Addr :: new(0, 0, 0, 0)), port: 8536, tls_enabled: true, pictrs_url: None, additional_slurs: None, actor_name_max_length: 20, webfinger_community_regex: None, webfinger_username_regex: None }
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for Settings
impl UnwindSafe for Settings
Blanket Implementations
Mutably borrows from an owned value. Read more
Convert self
to an expression for Diesel’s query builder. Read more
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression where
&'a Self: AsExpression<T>,
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression where
&'a Self: AsExpression<T>,
Convert &self
to an expression for Diesel’s query builder. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more