Updated DAV config properties + Added 'nats' feature to CI job
This commit is contained in:
@@ -36,53 +36,43 @@ impl GroupwareConfig {
|
||||
pub fn parse(config: &mut Config) -> Self {
|
||||
GroupwareConfig {
|
||||
max_request_size: config
|
||||
.property("dav.limits.size.request")
|
||||
.property("dav.request.max-size")
|
||||
.unwrap_or(25 * 1024 * 1024),
|
||||
dead_property_size: config
|
||||
.property_or_default::<Option<usize>>("dav.limits.size.dead-property", "1024")
|
||||
.property_or_default::<Option<usize>>("dav.property.max-size.dead", "1024")
|
||||
.unwrap_or(Some(1024)),
|
||||
live_property_size: config
|
||||
.property("dav.limits.size.live-property")
|
||||
.unwrap_or(250),
|
||||
max_lock_timeout: config
|
||||
.property("dav.limits.timeout.max-lock")
|
||||
.unwrap_or(3600),
|
||||
max_locks_per_user: config
|
||||
.property("dav.limits.max-locks-per-user")
|
||||
.unwrap_or(10),
|
||||
max_results: config.property("dav.limits.max-results").unwrap_or(2000),
|
||||
max_vcard_size: config
|
||||
.property("dav.limits.size.vcard")
|
||||
.unwrap_or(512 * 1024),
|
||||
max_ical_size: config
|
||||
.property("dav.limits.size.ical")
|
||||
.unwrap_or(512 * 1024),
|
||||
live_property_size: config.property("dav.property.max-size.live").unwrap_or(250),
|
||||
max_lock_timeout: config.property("dav.lock.max-timeout").unwrap_or(3600),
|
||||
max_locks_per_user: config.property("dav.locks.max-per-user").unwrap_or(10),
|
||||
max_results: config.property("dav.response.max-results").unwrap_or(2000),
|
||||
max_vcard_size: config.property("contacts.max-size").unwrap_or(512 * 1024),
|
||||
max_ical_size: config.property("calendar.max-size").unwrap_or(512 * 1024),
|
||||
default_calendar_name: config
|
||||
.property_or_default::<Option<String>>("dav.default.calendar.name", "default")
|
||||
.property_or_default::<Option<String>>("calendar.default.href-name", "default")
|
||||
.unwrap_or_default(),
|
||||
default_addressbook_name: config
|
||||
.property_or_default::<Option<String>>("dav.default.addressbook.name", "default")
|
||||
.property_or_default::<Option<String>>("contacts.default.href-name", "default")
|
||||
.unwrap_or_default(),
|
||||
default_calendar_display_name: config
|
||||
.property_or_default::<Option<String>>(
|
||||
"dav.default.calendar.display-name",
|
||||
"Default Calendar",
|
||||
"calendar.default.display-name",
|
||||
"Stalwart Calendar",
|
||||
)
|
||||
.unwrap_or_default(),
|
||||
default_addressbook_display_name: config
|
||||
.property_or_default::<Option<String>>(
|
||||
"dav.default.addressbook.display-name",
|
||||
"Default Address Book",
|
||||
"contacts.default.display-name",
|
||||
"Stalwart Address Book",
|
||||
)
|
||||
.unwrap_or_default(),
|
||||
max_ical_instances: config
|
||||
.property("dav.limits.ical.max-instances")
|
||||
.property("calendar.max-recurrence-expansions")
|
||||
.unwrap_or(1000),
|
||||
max_ical_attendees_per_instance: config
|
||||
.property("dav.limits.ical.max-attendees-per-instance")
|
||||
.property("calendar.max-attendees-per-instance")
|
||||
.unwrap_or(1000),
|
||||
max_file_size: config
|
||||
.property("dav.limits.size.file")
|
||||
.property("file-storage.max-size")
|
||||
.unwrap_or(25 * 1024 * 1024),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -549,7 +549,6 @@ impl DavRequestHandler for Server {
|
||||
};
|
||||
|
||||
//let c = println!("------------------------------------------");
|
||||
|
||||
//let std_body = std::str::from_utf8(&body).unwrap_or("[binary]").to_string();
|
||||
|
||||
// Parse headers
|
||||
@@ -559,7 +558,7 @@ impl DavRequestHandler for Server {
|
||||
}
|
||||
|
||||
let start_time = Instant::now();
|
||||
let result = match self
|
||||
match self
|
||||
.dispatch_dav_request(&request, &headers, access_token, resource, method, body)
|
||||
.await
|
||||
{
|
||||
@@ -674,7 +673,7 @@ impl DavRequestHandler for Server {
|
||||
|
||||
HttpResponse::new(code)
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/*let c = println!(
|
||||
"{:?} {} -> {:?}\nHeaders: {:?}\nBody: {}\nResponse headers: {:?}\nResponse: {}",
|
||||
@@ -689,9 +688,9 @@ impl DavRequestHandler for Server {
|
||||
http_proto::HttpResponseBody::Empty => "[empty]".to_string(),
|
||||
_ => "[binary]".to_string(),
|
||||
}
|
||||
);*/
|
||||
);
|
||||
|
||||
result
|
||||
result*/
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
8
crates/groupware/src/cache/mod.rs
vendored
8
crates/groupware/src/cache/mod.rs
vendored
@@ -288,8 +288,12 @@ impl GroupwareCache for Server {
|
||||
name: name.clone(),
|
||||
preferences: vec![CalendarPreferences {
|
||||
account_id,
|
||||
name: name.clone(),
|
||||
description: self.core.groupware.default_calendar_display_name.clone(),
|
||||
name: self
|
||||
.core
|
||||
.groupware
|
||||
.default_calendar_display_name
|
||||
.clone()
|
||||
.unwrap_or_else(|| name.clone()),
|
||||
..Default::default()
|
||||
}],
|
||||
..Default::default()
|
||||
|
||||
Reference in New Issue
Block a user