Compare commits
1 Commits
master
...
f3c405ad10
Author | SHA1 | Date | |
---|---|---|---|
f3c405ad10 |
831
Cargo.lock
generated
831
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
38
Cargo.toml
38
Cargo.toml
@ -4,32 +4,32 @@ version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
log = "0.4.27"
|
||||
env_logger = "0.11.8"
|
||||
clap = { version = "4.5.41", features = ["derive", "env"] }
|
||||
log = "0.4.25"
|
||||
env_logger = "0.11.6"
|
||||
clap = { version = "4.5.26", features = ["derive", "env"] }
|
||||
lazy_static = "1.5.0"
|
||||
anyhow = "1.0.98"
|
||||
serde = { version = "1.0.219", features = ["derive"] }
|
||||
serde_json = "1.0.140"
|
||||
anyhow = "1.0.95"
|
||||
serde = { version = "1.0.217", features = ["derive"] }
|
||||
serde_json = "1.0.137"
|
||||
rust-s3 = { version = "0.36.0-beta.2", features = ["tokio"] }
|
||||
actix-web = "4.11.0"
|
||||
actix-web = "4"
|
||||
actix-session = { version = "0.10.1", features = ["redis-session"] }
|
||||
light-openid = "1.0.4"
|
||||
thiserror = "2.0.12"
|
||||
rand = "0.9.1"
|
||||
rust-embed = "8.7.2"
|
||||
light-openid = "1.0.2"
|
||||
thiserror = "2.0.11"
|
||||
rand = "0.9.0"
|
||||
rust-embed = "8.5.0"
|
||||
mime_guess = "2.0.5"
|
||||
askama = "0.14.0"
|
||||
askama = "0.12.1"
|
||||
urlencoding = "2.1.3"
|
||||
uuid = { version = "1.17.0", features = ["v4", "serde"] }
|
||||
uuid = { version = "1.12.1", features = ["v4", "serde"] }
|
||||
ipnet = { version = "2.11.0", features = ["serde"] }
|
||||
chrono = "0.4.41"
|
||||
chrono = "0.4.39"
|
||||
futures-util = { version = "0.3.31", features = ["sink"] }
|
||||
jwt-simple = { version = "0.12.12", default-features = false, features = ["pure-rust"] }
|
||||
jwt-simple = { version = "0.12.11", default-features = false, features = ["pure-rust"] }
|
||||
actix-remote-ip = "0.1.0"
|
||||
bytes = "1.10.1"
|
||||
sha2 = "0.11.0-rc.0"
|
||||
bytes = "1.9.0"
|
||||
sha2 = "0.11.0-pre.4"
|
||||
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.0", features = ["client-api-c", "client-ext-client-api", "client-hyper-native-tls", "rand"] }
|
||||
actix-ws = "0.3.0"
|
||||
tokio = { version = "1.46.1", features = ["rt", "time", "macros", "rt-multi-thread"] }
|
||||
tokio = { version = "1.43.0", features = ["rt", "time", "macros", "rt-multi-thread"] }
|
@ -30,7 +30,7 @@ services:
|
||||
- 8448:8448/tcp
|
||||
|
||||
db:
|
||||
image: docker.io/postgres:17-alpine
|
||||
image: docker.io/postgres:12-alpine
|
||||
user: "1000"
|
||||
environment:
|
||||
- POSTGRES_USER=synapse
|
||||
|
@ -1,3 +1,9 @@
|
||||
{
|
||||
"extends": ["local>renovate/presets"]
|
||||
}
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"packageRules": [
|
||||
{
|
||||
"matchUpdateTypes": ["major", "minor", "patch"],
|
||||
"automerge": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ use clap::Parser;
|
||||
use s3::creds::Credentials;
|
||||
use s3::{Bucket, Region};
|
||||
|
||||
/// Matrix gateway backend API
|
||||
/// GeneIT backend API
|
||||
#[derive(Parser, Debug, Clone)]
|
||||
#[clap(author, version, about, long_about = None)]
|
||||
pub struct AppConfig {
|
||||
|
@ -42,5 +42,5 @@ pub enum BroadcastMessage {
|
||||
/// Stop a client with a given client ID
|
||||
StopSyncClient(SyncClientID),
|
||||
/// Propagate a new sync event
|
||||
SyncEvent(UserID, Box<SyncEvent>),
|
||||
SyncEvent(UserID, SyncEvent),
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ pub async fn ws(
|
||||
if let Err(e) = tx.send(BroadcastMessage::StartSyncTaskForUser(
|
||||
auth.user.user_id.clone(),
|
||||
)) {
|
||||
log::error!("Failed to send StartSyncTaskForUser: {e}");
|
||||
log::error!("Failed to send StartSyncTaskForUser: {}", e);
|
||||
}
|
||||
|
||||
let rx = tx.subscribe();
|
||||
@ -94,9 +94,9 @@ pub async fn ws_handler(
|
||||
}
|
||||
|
||||
// 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 {
|
||||
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
|
||||
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
|
||||
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());
|
||||
|
||||
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()),
|
||||
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)?;
|
||||
|
||||
Ok(HttpResponse::Found()
|
||||
|
@ -28,7 +28,7 @@ pub async fn sync_client_manager(tx: broadcast::Sender<BroadcastMessage>) -> ! {
|
||||
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());
|
||||
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) => {
|
||||
// Check if a task is running for this user
|
||||
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();
|
||||
} else {
|
||||
log::info!("Not stopping sync task for user {user_id:?}: not running");
|
||||
@ -122,12 +122,12 @@ async fn sync_task(
|
||||
match msg_stream {
|
||||
Ok(Some(msg)) => {
|
||||
log::debug!("Received new message from Matrix: {msg:#?}");
|
||||
if let Err(e) = tx.send(BroadcastMessage::SyncEvent(user_id.clone(), Box::new(SyncEvent {
|
||||
if let Err(e) = tx.send(BroadcastMessage::SyncEvent(user_id.clone(), SyncEvent {
|
||||
rooms: msg.rooms,presence: msg.presence,
|
||||
account_data: msg.account_data,
|
||||
to_device: msg.to_device,
|
||||
device_lists: msg.device_lists,
|
||||
}))) {
|
||||
})) {
|
||||
log::error!("Failed to propagate event! {e}");
|
||||
}
|
||||
}
|
||||
|
@ -147,7 +147,7 @@ impl UserConfig {
|
||||
log::warn!("The bucket does not seem to exists, trying to create it!")
|
||||
}
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user