misc changes

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-04-24 02:19:50 -04:00 committed by June
parent c915f3dec5
commit dc35d06c0a
4 changed files with 31 additions and 10 deletions

View file

@ -9,6 +9,10 @@ pub(crate) fn check(config: &Config) -> Result<(), Error> {
config.warn_deprecated();
config.warn_unknown_key();
if config.sentry && config.sentry_endpoint.is_none() {
return Err(Error::bad_config("Sentry cannot be enabled without an endpoint set"));
}
if cfg!(feature = "hardened_malloc") && cfg!(feature = "jemalloc") {
warn!(
"hardened_malloc and jemalloc were built together, this causes neither to be used. Conduwuit will still \
@ -87,8 +91,8 @@ pub(crate) fn check(config: &Config) -> Result<(), Error> {
return Err(Error::bad_config("Registration token was specified but is empty (\"\")"));
}
if config.max_request_size < 16384 {
return Err(Error::bad_config("Max request size is less than 16KB. Please increase it."));
if config.max_request_size < 5120000 {
return Err(Error::bad_config("Max request size is less than 5MB. Please increase it."));
}
// check if user specified valid IP CIDR ranges on startup

View file

@ -320,6 +320,8 @@ pub(crate) struct Config {
#[serde(default)]
pub(crate) sentry: bool,
#[serde(default = "default_sentry_endpoint")]
pub(crate) sentry_endpoint: Option<Url>,
#[serde(default)]
pub(crate) sentry_send_server_name: bool,
#[serde(default = "default_sentry_traces_sample_rate")]
@ -998,6 +1000,12 @@ fn default_url_preview_max_spider_size() -> usize {
fn default_new_user_displayname_suffix() -> String { "🏳️‍⚧️".to_owned() }
fn default_sentry_endpoint() -> Option<Url> {
Url::parse("https://fe2eb4536aa04949e28eff3128d64757@o4506996327251968.ingest.us.sentry.io/4506996334657536")
.unwrap()
.into()
}
fn default_sentry_traces_sample_rate() -> f32 { 0.15 }
fn default_startup_netburst_keep() -> i64 { 50 }