Compare commits
1 Commits
master
...
036118d737
Author | SHA1 | Date | |
---|---|---|---|
036118d737 |
36
Cargo.lock
generated
36
Cargo.lock
generated
@ -719,9 +719,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap"
|
name = "clap"
|
||||||
version = "4.5.41"
|
version = "4.5.40"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "be92d32e80243a54711e5d7ce823c35c41c9d929dc4ab58e1276f625841aadf9"
|
checksum = "40b6887a1d8685cebccf115538db5c0efe625ccac9696ad45c409d96566e910f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap_builder",
|
"clap_builder",
|
||||||
"clap_derive",
|
"clap_derive",
|
||||||
@ -729,9 +729,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap_builder"
|
name = "clap_builder"
|
||||||
version = "4.5.41"
|
version = "4.5.40"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "707eab41e9622f9139419d573eca0900137718000c517d47da73045f54331c3d"
|
checksum = "e0c66c08ce9f0c698cbce5c0279d0bb6ac936d8674174fe48f736533b964f59e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anstream",
|
"anstream",
|
||||||
"anstyle",
|
"anstyle",
|
||||||
@ -741,9 +741,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap_derive"
|
name = "clap_derive"
|
||||||
version = "4.5.41"
|
version = "4.5.40"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ef4f52386a59ca4c860f7393bcf8abd8dfd91ecccc0f774635ff68e92eeef491"
|
checksum = "d2c7947ae4cc3d851207c1adb5b5e260ff0cca11446b1d6d1423788e442257ce"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"heck",
|
"heck",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
@ -2750,9 +2750,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma"
|
name = "ruma"
|
||||||
version = "0.12.5"
|
version = "0.12.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c1d47e42b7dea75a468dea63a230f51331c58d690ca018ea1c6ac782ea98880c"
|
checksum = "d910a9b75cbf0e88f74295997c1a41c3ab7a117879a029c72db815192c167a0d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"assign",
|
"assign",
|
||||||
"js_int",
|
"js_int",
|
||||||
@ -2788,9 +2788,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-client-api"
|
name = "ruma-client-api"
|
||||||
version = "0.20.4"
|
version = "0.20.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3a9e9c613cfda4923b851c5d8bc442305905bee4f0c2b924564b00e71636c8d4"
|
checksum = "09cc4ff88a70a3d1e7a2c5b51cca7499cb889b42687608ab664b9a216c49314d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"as_variant",
|
"as_variant",
|
||||||
"assign",
|
"assign",
|
||||||
@ -2812,9 +2812,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-common"
|
name = "ruma-common"
|
||||||
version = "0.15.4"
|
version = "0.15.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "387e1898e868d32ff7b205e7db327361d5dcf635c00a8ae5865068607595a9cf"
|
checksum = "6b75da013b362664c3e161662902e5da3f77e990525681b59c6035bac27e87b4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"as_variant",
|
"as_variant",
|
||||||
"base64 0.22.1",
|
"base64 0.22.1",
|
||||||
@ -2844,9 +2844,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-events"
|
name = "ruma-events"
|
||||||
version = "0.30.4"
|
version = "0.30.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3cdc7abec9bc2a9ca0b4831cc26ce97a6a8c39a0bde44a19281a719e861b4293"
|
checksum = "41ab3d1b54c32a65194ecc44bc7f7575df50ef4255b139547d7dcc1753dc883d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"as_variant",
|
"as_variant",
|
||||||
"indexmap",
|
"indexmap",
|
||||||
@ -2878,9 +2878,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-macros"
|
name = "ruma-macros"
|
||||||
version = "0.15.2"
|
version = "0.15.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5ff13fbd6045a7278533390826de316d6116d8582ed828352661337b0c422e1c"
|
checksum = "c1182e83ee5cd10121974f163337b16af68a93eedfc7cdbdbd52307ac7e1d743"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"proc-macro-crate",
|
"proc-macro-crate",
|
||||||
@ -3487,9 +3487,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tokio"
|
name = "tokio"
|
||||||
version = "1.46.1"
|
version = "1.46.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0cc3a2344dafbe23a245241fe8b09735b521110d30fcefbbd5feb1797ca35d17"
|
checksum = "1140bb80481756a8cbe10541f37433b459c5aa1e727b4c020fbfebdc25bf3ec4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"backtrace",
|
"backtrace",
|
||||||
"bytes",
|
"bytes",
|
||||||
|
@ -6,7 +6,7 @@ edition = "2021"
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
log = "0.4.27"
|
log = "0.4.27"
|
||||||
env_logger = "0.11.8"
|
env_logger = "0.11.8"
|
||||||
clap = { version = "4.5.41", features = ["derive", "env"] }
|
clap = { version = "4.5.40", features = ["derive", "env"] }
|
||||||
lazy_static = "1.5.0"
|
lazy_static = "1.5.0"
|
||||||
anyhow = "1.0.98"
|
anyhow = "1.0.98"
|
||||||
serde = { version = "1.0.219", features = ["derive"] }
|
serde = { version = "1.0.219", features = ["derive"] }
|
||||||
@ -30,6 +30,6 @@ actix-remote-ip = "0.1.0"
|
|||||||
bytes = "1.10.1"
|
bytes = "1.10.1"
|
||||||
sha2 = "0.11.0-rc.0"
|
sha2 = "0.11.0-rc.0"
|
||||||
base16ct = "0.2.0"
|
base16ct = "0.2.0"
|
||||||
ruma = { version = "0.12.5", features = ["client-api-c", "client-ext-client-api", "client-hyper-native-tls", "rand"] }
|
ruma = { version = "0.12.3", features = ["client-api-c", "client-ext-client-api", "client-hyper-native-tls", "rand"] }
|
||||||
actix-ws = "0.3.0"
|
actix-ws = "0.3.0"
|
||||||
tokio = { version = "1.46.1", features = ["rt", "time", "macros", "rt-multi-thread"] }
|
tokio = { version = "1.46.0", features = ["rt", "time", "macros", "rt-multi-thread"] }
|
@ -34,7 +34,7 @@ pub async fn ws(
|
|||||||
if let Err(e) = tx.send(BroadcastMessage::StartSyncTaskForUser(
|
if let Err(e) = tx.send(BroadcastMessage::StartSyncTaskForUser(
|
||||||
auth.user.user_id.clone(),
|
auth.user.user_id.clone(),
|
||||||
)) {
|
)) {
|
||||||
log::error!("Failed to send StartSyncTaskForUser: {e}");
|
log::error!("Failed to send StartSyncTaskForUser: {}", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
let rx = tx.subscribe();
|
let rx = tx.subscribe();
|
||||||
@ -96,7 +96,7 @@ pub async fn ws_handler(
|
|||||||
// Send the message to the websocket
|
// Send the message to the websocket
|
||||||
if let Ok(msg) = serde_json::to_string(&WsMessage::Sync(*event)) {
|
if let Ok(msg) = serde_json::to_string(&WsMessage::Sync(*event)) {
|
||||||
if let Err(e) = session.text(msg).await {
|
if let Err(e) = session.text(msg).await {
|
||||||
log::error!("Failed to send SyncEvent: {e}");
|
log::error!("Failed to send SyncEvent: {}", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -105,12 +105,12 @@ pub async fn home(
|
|||||||
|
|
||||||
// Close sync task
|
// Close sync task
|
||||||
if let Err(e) = tx.send(BroadcastMessage::StopSyncTaskForUser(user.id.clone())) {
|
if let Err(e) = tx.send(BroadcastMessage::StopSyncTaskForUser(user.id.clone())) {
|
||||||
log::error!("Failed to send StopSyncClientForUser: {e}");
|
log::error!("Failed to send StopSyncClientForUser: {}", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Invalidate all Ws connections
|
// Invalidate all Ws connections
|
||||||
if let Err(e) = tx.send(BroadcastMessage::CloseAllUserSessions(user.id.clone())) {
|
if let Err(e) = tx.send(BroadcastMessage::CloseAllUserSessions(user.id.clone())) {
|
||||||
log::error!("Failed to send CloseAllUserSessions: {e}");
|
log::error!("Failed to send CloseAllUserSessions: {}", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -145,7 +145,7 @@ pub async fn home(
|
|||||||
success_message = Some("The client was successfully deleted!".to_string());
|
success_message = Some("The client was successfully deleted!".to_string());
|
||||||
|
|
||||||
if let Err(e) = tx.send(BroadcastMessage::CloseClientSession(delete_client_id)) {
|
if let Err(e) = tx.send(BroadcastMessage::CloseClientSession(delete_client_id)) {
|
||||||
log::error!("Failed to send CloseClientSession: {e}");
|
log::error!("Failed to send CloseClientSession: {}", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -215,7 +215,7 @@ pub async fn oidc_cb(session: Session, query: web::Query<AuthCallbackQuery>) ->
|
|||||||
name: user.name.unwrap_or("no_name".to_string()),
|
name: user.name.unwrap_or("no_name".to_string()),
|
||||||
email: user.email.unwrap_or("no@mail.com".to_string()),
|
email: user.email.unwrap_or("no@mail.com".to_string()),
|
||||||
};
|
};
|
||||||
log::info!("Successful authentication as {user:?}");
|
log::info!("Successful authentication as {:?}", user);
|
||||||
session.insert(USER_SESSION_KEY, user)?;
|
session.insert(USER_SESSION_KEY, user)?;
|
||||||
|
|
||||||
Ok(HttpResponse::Found()
|
Ok(HttpResponse::Found()
|
||||||
|
@ -28,7 +28,7 @@ pub async fn sync_client_manager(tx: broadcast::Sender<BroadcastMessage>) -> ! {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
log::info!("Start sync task for user {user_id:?}");
|
log::info!("Start sync task for user {:?}", user_id);
|
||||||
let task_id = SyncClientID(uuid::Uuid::new_v4());
|
let task_id = SyncClientID(uuid::Uuid::new_v4());
|
||||||
running_tasks.insert(user_id.clone(), task_id.clone());
|
running_tasks.insert(user_id.clone(), task_id.clone());
|
||||||
|
|
||||||
@ -41,7 +41,7 @@ pub async fn sync_client_manager(tx: broadcast::Sender<BroadcastMessage>) -> ! {
|
|||||||
BroadcastMessage::StopSyncTaskForUser(user_id) => {
|
BroadcastMessage::StopSyncTaskForUser(user_id) => {
|
||||||
// Check if a task is running for this user
|
// Check if a task is running for this user
|
||||||
if let Some(task_id) = running_tasks.remove(&user_id) {
|
if let Some(task_id) = running_tasks.remove(&user_id) {
|
||||||
log::info!("Stop sync task for user {user_id:?}");
|
log::info!("Stop sync task for user {:?}", user_id);
|
||||||
tx.send(BroadcastMessage::StopSyncClient(task_id)).unwrap();
|
tx.send(BroadcastMessage::StopSyncClient(task_id)).unwrap();
|
||||||
} else {
|
} else {
|
||||||
log::info!("Not stopping sync task for user {user_id:?}: not running");
|
log::info!("Not stopping sync task for user {user_id:?}: not running");
|
||||||
|
@ -147,7 +147,7 @@ impl UserConfig {
|
|||||||
log::warn!("The bucket does not seem to exists, trying to create it!")
|
log::warn!("The bucket does not seem to exists, trying to create it!")
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
log::error!("Got unexpected error when querying bucket info: {e}");
|
log::error!("Got unexpected error when querying bucket info: {}", e);
|
||||||
return Err(e.into());
|
return Err(e.into());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user