mirror of
https://github.com/lennart-k/rustical.git
synced 2026-01-30 12:58:28 +00:00
PUT calendar_object: Allow omission of timezones as in RFC7809
This commit is contained in:
@@ -9,7 +9,7 @@ use axum_extra::TypedHeader;
|
||||
use headers::{HeaderMapExt, UserAgent};
|
||||
use http::header::CONNECTION;
|
||||
use http::{HeaderValue, StatusCode};
|
||||
use rustical_caldav::caldav_router;
|
||||
use rustical_caldav::{CalDavConfig, caldav_router};
|
||||
use rustical_carddav::carddav_router;
|
||||
use rustical_frontend::nextcloud_login::nextcloud_login_router;
|
||||
use rustical_frontend::{FrontendConfig, frontend_router};
|
||||
@@ -45,6 +45,7 @@ pub fn make_app<
|
||||
auth_provider: Arc<impl AuthenticationProvider>,
|
||||
frontend_config: FrontendConfig,
|
||||
oidc_config: Option<OidcConfig>,
|
||||
caldav_config: CalDavConfig,
|
||||
nextcloud_login_config: &NextcloudLoginConfig,
|
||||
dav_push_enabled: bool,
|
||||
session_cookie_samesite_strict: bool,
|
||||
@@ -54,6 +55,8 @@ pub fn make_app<
|
||||
let combined_cal_store =
|
||||
Arc::new(CombinedCalendarStore::new(cal_store).with_store(birthday_store));
|
||||
|
||||
let caldav_config = Arc::new(caldav_config);
|
||||
|
||||
let mut router = Router::new()
|
||||
// endpoint to be used by healthcheck to see if rustical is online
|
||||
.route("/ping", axum::routing::get(async || "Pong!"))
|
||||
@@ -63,6 +66,7 @@ pub fn make_app<
|
||||
combined_cal_store.clone(),
|
||||
subscription_store.clone(),
|
||||
false,
|
||||
caldav_config.clone(),
|
||||
))
|
||||
.merge(caldav_router(
|
||||
"/caldav-compat",
|
||||
@@ -70,6 +74,7 @@ pub fn make_app<
|
||||
combined_cal_store.clone(),
|
||||
subscription_store.clone(),
|
||||
true,
|
||||
caldav_config,
|
||||
))
|
||||
.route(
|
||||
"/.well-known/caldav",
|
||||
|
||||
@@ -3,6 +3,7 @@ use crate::config::{
|
||||
SqliteDataStoreConfig, TracingConfig,
|
||||
};
|
||||
use clap::Parser;
|
||||
use rustical_caldav::CalDavConfig;
|
||||
use rustical_frontend::FrontendConfig;
|
||||
|
||||
pub mod health;
|
||||
@@ -15,6 +16,7 @@ pub struct GenConfigArgs {}
|
||||
pub fn cmd_gen_config(_args: GenConfigArgs) -> anyhow::Result<()> {
|
||||
let config = Config {
|
||||
http: HttpConfig::default(),
|
||||
caldav: CalDavConfig::default(),
|
||||
data_store: DataStoreConfig::Sqlite(SqliteDataStoreConfig {
|
||||
db_url: "/var/lib/rustical/db.sqlite3".to_owned(),
|
||||
run_repairs: true,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
use rustical_caldav::CalDavConfig;
|
||||
use rustical_frontend::FrontendConfig;
|
||||
use rustical_oidc::OidcConfig;
|
||||
use serde::{Deserialize, Serialize};
|
||||
@@ -97,4 +98,6 @@ pub struct Config {
|
||||
pub dav_push: DavPushConfig,
|
||||
#[serde(default)]
|
||||
pub nextcloud_login: NextcloudLoginConfig,
|
||||
#[serde(default)]
|
||||
pub caldav: CalDavConfig,
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ use crate::{app::make_app, config::NextcloudLoginConfig};
|
||||
use axum::extract::Request;
|
||||
use axum::{body::Body, response::Response};
|
||||
use rstest::rstest;
|
||||
use rustical_caldav::CalDavConfig;
|
||||
use rustical_frontend::FrontendConfig;
|
||||
use rustical_store_sqlite::tests::{TestStoreContext, test_store_context};
|
||||
use std::sync::Arc;
|
||||
@@ -26,6 +27,7 @@ pub fn get_app(context: TestStoreContext) -> axum::Router {
|
||||
allow_password_login: true,
|
||||
},
|
||||
None,
|
||||
CalDavConfig::default(),
|
||||
&NextcloudLoginConfig { enabled: false },
|
||||
false,
|
||||
true,
|
||||
|
||||
@@ -153,6 +153,7 @@ async fn main() -> Result<()> {
|
||||
principal_store.clone(),
|
||||
config.frontend.clone(),
|
||||
config.oidc.clone(),
|
||||
config.caldav,
|
||||
&config.nextcloud_login,
|
||||
config.dav_push.enabled,
|
||||
config.http.session_cookie_samesite_strict,
|
||||
|
||||
Reference in New Issue
Block a user