mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 23:02:31 +00:00
Workaround for #10
This commit is contained in:
21
Cargo.lock
generated
21
Cargo.lock
generated
@@ -519,8 +519,6 @@ dependencies = [
|
|||||||
"http 1.2.0",
|
"http 1.2.0",
|
||||||
"http-body",
|
"http-body",
|
||||||
"http-body-util",
|
"http-body-util",
|
||||||
"hyper",
|
|
||||||
"hyper-util",
|
|
||||||
"itoa",
|
"itoa",
|
||||||
"matchit",
|
"matchit",
|
||||||
"memchr",
|
"memchr",
|
||||||
@@ -529,15 +527,10 @@ dependencies = [
|
|||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
"rustversion",
|
"rustversion",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
|
||||||
"serde_path_to_error",
|
|
||||||
"serde_urlencoded",
|
|
||||||
"sync_wrapper",
|
"sync_wrapper",
|
||||||
"tokio",
|
|
||||||
"tower 0.5.2",
|
"tower 0.5.2",
|
||||||
"tower-layer",
|
"tower-layer",
|
||||||
"tower-service",
|
"tower-service",
|
||||||
"tracing",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -558,7 +551,6 @@ dependencies = [
|
|||||||
"sync_wrapper",
|
"sync_wrapper",
|
||||||
"tower-layer",
|
"tower-layer",
|
||||||
"tower-service",
|
"tower-service",
|
||||||
"tracing",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -2597,7 +2589,6 @@ dependencies = [
|
|||||||
"anyhow",
|
"anyhow",
|
||||||
"argon2",
|
"argon2",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"axum",
|
|
||||||
"clap",
|
"clap",
|
||||||
"opentelemetry",
|
"opentelemetry",
|
||||||
"opentelemetry-otlp",
|
"opentelemetry-otlp",
|
||||||
@@ -2839,16 +2830,6 @@ dependencies = [
|
|||||||
"serde",
|
"serde",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "serde_path_to_error"
|
|
||||||
version = "0.1.16"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6"
|
|
||||||
dependencies = [
|
|
||||||
"itoa",
|
|
||||||
"serde",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_spanned"
|
name = "serde_spanned"
|
||||||
version = "0.6.8"
|
version = "0.6.8"
|
||||||
@@ -3550,10 +3531,8 @@ dependencies = [
|
|||||||
"futures-util",
|
"futures-util",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
"sync_wrapper",
|
"sync_wrapper",
|
||||||
"tokio",
|
|
||||||
"tower-layer",
|
"tower-layer",
|
||||||
"tower-service",
|
"tower-service",
|
||||||
"tracing",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|||||||
@@ -97,7 +97,6 @@ quote = "1.0"
|
|||||||
proc-macro2 = "1.0"
|
proc-macro2 = "1.0"
|
||||||
heck = "0.5"
|
heck = "0.5"
|
||||||
darling = "0.20"
|
darling = "0.20"
|
||||||
axum = { version = "0.7", features = ["http2"] }
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
rustical_store = { workspace = true }
|
rustical_store = { workspace = true }
|
||||||
@@ -133,4 +132,3 @@ rpassword.workspace = true
|
|||||||
argon2.workspace = true
|
argon2.workspace = true
|
||||||
pbkdf2.workspace = true
|
pbkdf2.workspace = true
|
||||||
password-hash.workspace = true
|
password-hash.workspace = true
|
||||||
axum.workspace = true
|
|
||||||
|
|||||||
@@ -27,10 +27,6 @@ impl ResponseError for UnauthorizedError {
|
|||||||
header::WWW_AUTHENTICATE,
|
header::WWW_AUTHENTICATE,
|
||||||
r#"Basic realm="RustiCal", charset="UTF-8""#,
|
r#"Basic realm="RustiCal", charset="UTF-8""#,
|
||||||
))
|
))
|
||||||
// The force_close is a workaround for a bug where something freezes when the
|
|
||||||
// connection is reused after a 401.
|
|
||||||
// possibly related to https://github.com/actix/actix-web/issues/1805
|
|
||||||
.force_close()
|
|
||||||
.finish()
|
.finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,5 +48,5 @@ pub fn make_app<AS: AddressbookStore + ?Sized, CS: CalendarStore + ?Sized>(
|
|||||||
frontend_config,
|
frontend_config,
|
||||||
)
|
)
|
||||||
}))
|
}))
|
||||||
.service(web::redirect("/", "/frontend").see_other())
|
// .service(web::redirect("/", "/frontend").see_other())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
use crate::config::Config;
|
use crate::config::Config;
|
||||||
|
use actix_web::http::KeepAlive;
|
||||||
use actix_web::HttpServer;
|
use actix_web::HttpServer;
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use app::make_app;
|
use app::make_app;
|
||||||
@@ -75,6 +76,10 @@ async fn main() -> Result<()> {
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
.bind((config.http.host, config.http.port))?
|
.bind((config.http.host, config.http.port))?
|
||||||
|
// Workaround for a weird bug where
|
||||||
|
// new requests might timeout since they cannot properly reuse the connection
|
||||||
|
// https://github.com/lennart-k/rustical/issues/10
|
||||||
|
.keep_alive(KeepAlive::Disabled)
|
||||||
.run()
|
.run()
|
||||||
.await?;
|
.await?;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user