pub struct Config {Show 14 fields
pub mode: Mode,
pub base_url: Url,
pub bind: SocketAddr,
pub secret_key: String,
pub smtp_url: Option<String>,
pub mail_from: String,
pub github: Option<GithubConfig>,
pub bot_ip: Option<String>,
pub turnstile: Option<TurnstileConfig>,
pub client_ip_header: String,
pub admin_emails: Vec<String>,
pub rankorg_url: Url,
pub billing: Option<DodoConfig>,
pub mcp: McpAnonConfig,
}Fields§
§mode: Mode§base_url: UrlThe public address of the app; used for magic links, OAuth callbacks and the Origin
check on every POST.
bind: SocketAddr§secret_key: StringKeys the channel-target encryption (codoseo_notify::ChannelKey).
smtp_url: Option<String>§mail_from: StringThe sender of every email (MAIL_FROM).
github: Option<GithubConfig>§bot_ip: Option<String>The fixed address cloud crawls come from, listed on the bot page (CODOSEO_BOT_IP).
turnstile: Option<TurnstileConfig>Turnstile on the audit form: TURNSTILE_SITE_KEY and TURNSTILE_SECRET. Cloud only.
client_ip_header: StringThe request header carrying the visitor’s address behind the cloud’s proxy
(CLIENT_IP_HEADER, default CF-Connecting-IP). Read in cloud mode only.
admin_emails: Vec<String>Who may open /admin in the cloud: canonical emails from ADMIN_EMAILS.
rankorg_url: UrlWhere RankOrg links go (RANKORG_URL).
billing: Option<DodoConfig>Billing through Dodo Payments; None in self-hosted mode or when keys are missing.
mcp: McpAnonConfigThe no-key MCP tier (cloud only; self-hosted refuses it).
Implementations§
Source§impl Config
impl Config
pub fn from_env() -> Result<Config, ConfigError>
Sourcepub fn from_lookup(
lookup: impl Fn(&str) -> Option<String>,
) -> Result<Config, ConfigError>
pub fn from_lookup( lookup: impl Fn(&str) -> Option<String>, ) -> Result<Config, ConfigError>
Reads configuration through lookup, so tests can pass a map instead of the process
environment.
Cookies get Secure whenever the app is served over https.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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