Compare commits
1 Commits
renovate/s
...
f3c405ad10
Author | SHA1 | Date | |
---|---|---|---|
f3c405ad10 |
922
Cargo.lock
generated
922
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
44
Cargo.toml
44
Cargo.toml
@@ -4,32 +4,32 @@ version = "0.1.0"
|
|||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
log = "0.4.28"
|
log = "0.4.25"
|
||||||
env_logger = "0.11.8"
|
env_logger = "0.11.6"
|
||||||
clap = { version = "4.5.47", features = ["derive", "env"] }
|
clap = { version = "4.5.26", features = ["derive", "env"] }
|
||||||
lazy_static = "1.5.0"
|
lazy_static = "1.5.0"
|
||||||
anyhow = "1.0.99"
|
anyhow = "1.0.95"
|
||||||
serde = { version = "1.0.225", features = ["derive"] }
|
serde = { version = "1.0.217", features = ["derive"] }
|
||||||
serde_json = "1.0.145"
|
serde_json = "1.0.137"
|
||||||
rust-s3 = { version = "0.37.0", features = ["tokio"] }
|
rust-s3 = { version = "0.36.0-beta.2", features = ["tokio"] }
|
||||||
actix-web = "4.11.0"
|
actix-web = "4"
|
||||||
actix-session = { version = "0.11.0", features = ["redis-session"] }
|
actix-session = { version = "0.10.1", features = ["redis-session"] }
|
||||||
light-openid = "1.0.4"
|
light-openid = "1.0.2"
|
||||||
thiserror = "2.0.16"
|
thiserror = "2.0.11"
|
||||||
rand = "0.9.2"
|
rand = "0.9.0"
|
||||||
rust-embed = "8.7.2"
|
rust-embed = "8.5.0"
|
||||||
mime_guess = "2.0.5"
|
mime_guess = "2.0.5"
|
||||||
askama = "0.14.0"
|
askama = "0.12.1"
|
||||||
urlencoding = "2.1.3"
|
urlencoding = "2.1.3"
|
||||||
uuid = { version = "1.18.0", features = ["v4", "serde"] }
|
uuid = { version = "1.12.1", features = ["v4", "serde"] }
|
||||||
ipnet = { version = "2.11.0", features = ["serde"] }
|
ipnet = { version = "2.11.0", features = ["serde"] }
|
||||||
chrono = "0.4.42"
|
chrono = "0.4.39"
|
||||||
futures-util = { version = "0.3.31", features = ["sink"] }
|
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"
|
actix-remote-ip = "0.1.0"
|
||||||
bytes = "1.10.1"
|
bytes = "1.9.0"
|
||||||
sha2 = "0.11.0-rc.2"
|
sha2 = "0.11.0-pre.4"
|
||||||
base16ct = { version = "0.3.0", features = ["alloc"] }
|
base16ct = "0.2.0"
|
||||||
ruma = { version = "0.13.0", 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"
|
actix-ws = "0.3.0"
|
||||||
tokio = { version = "1.47.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
|
- 8448:8448/tcp
|
||||||
|
|
||||||
db:
|
db:
|
||||||
image: docker.io/postgres:17-alpine
|
image: docker.io/postgres:12-alpine
|
||||||
user: "1000"
|
user: "1000"
|
||||||
environment:
|
environment:
|
||||||
- POSTGRES_USER=synapse
|
- 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::creds::Credentials;
|
||||||
use s3::{Bucket, Region};
|
use s3::{Bucket, Region};
|
||||||
|
|
||||||
/// Matrix gateway backend API
|
/// GeneIT backend API
|
||||||
#[derive(Parser, Debug, Clone)]
|
#[derive(Parser, Debug, Clone)]
|
||||||
#[clap(author, version, about, long_about = None)]
|
#[clap(author, version, about, long_about = None)]
|
||||||
pub struct AppConfig {
|
pub struct AppConfig {
|
||||||
|
@@ -42,5 +42,5 @@ pub enum BroadcastMessage {
|
|||||||
/// Stop a client with a given client ID
|
/// Stop a client with a given client ID
|
||||||
StopSyncClient(SyncClientID),
|
StopSyncClient(SyncClientID),
|
||||||
/// Propagate a new sync event
|
/// 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(
|
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();
|
||||||
@@ -94,9 +94,9 @@ 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");
|
||||||
@@ -122,12 +122,12 @@ async fn sync_task(
|
|||||||
match msg_stream {
|
match msg_stream {
|
||||||
Ok(Some(msg)) => {
|
Ok(Some(msg)) => {
|
||||||
log::debug!("Received new message from Matrix: {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,
|
rooms: msg.rooms,presence: msg.presence,
|
||||||
account_data: msg.account_data,
|
account_data: msg.account_data,
|
||||||
to_device: msg.to_device,
|
to_device: msg.to_device,
|
||||||
device_lists: msg.device_lists,
|
device_lists: msg.device_lists,
|
||||||
}))) {
|
})) {
|
||||||
log::error!("Failed to propagate event! {e}");
|
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!")
|
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