TLS 1.3, channel persistence, membership signaling

- TLS 1.3 on TCP (rustls + tokio-rustls, optional self-signed cert)
- Server-side channel CRUD with SQLite persistence
- Gateway → voice-node membership bridge via broadcast channel
This commit is contained in:
Loki 2026-07-09 12:48:18 +02:00
parent 523680e05d
commit 5534cd01f7
Signed by: boba
GPG key ID: 253067914055423B
37 changed files with 771 additions and 160 deletions

View file

@ -1,5 +1,5 @@
use anyhow::Result;
use tokio::net::TcpStream;
use tokio::io::{AsyncRead, AsyncWrite};
use crate::{
domain::session,
@ -8,7 +8,7 @@ use crate::{
};
pub async fn handle_friend_decline(
stream: &mut TcpStream,
stream: &mut (impl AsyncRead + AsyncWrite + Unpin),
seq: &mut u32,
session_id: &str,
payload: &[u8],

View file

@ -1,5 +1,5 @@
use anyhow::Result;
use tokio::net::TcpStream;
use tokio::io::{AsyncRead, AsyncWrite};
use crate::{
domain::session,
@ -8,7 +8,7 @@ use crate::{
};
pub async fn handle_friend_list(
stream: &mut TcpStream,
stream: &mut (impl AsyncRead + AsyncWrite + Unpin),
seq: &mut u32,
session_id: &str,
crypto: &SessionCrypto,

View file

@ -1,5 +1,5 @@
use anyhow::Result;
use tokio::net::TcpStream;
use tokio::io::{AsyncRead, AsyncWrite};
use crate::{
domain::session,
@ -11,7 +11,7 @@ use crate::{
};
pub async fn handle_friend_remove(
stream: &mut TcpStream,
stream: &mut (impl AsyncRead + AsyncWrite + Unpin),
seq: &mut u32,
session_id: &str,
payload: &[u8],
@ -40,7 +40,7 @@ pub async fn handle_friend_remove(
}
pub async fn handle_block_user(
stream: &mut TcpStream,
stream: &mut (impl AsyncRead + AsyncWrite + Unpin),
seq: &mut u32,
session_id: &str,
payload: &[u8],
@ -69,7 +69,7 @@ pub async fn handle_block_user(
}
pub async fn handle_unblock_user(
stream: &mut TcpStream,
stream: &mut (impl AsyncRead + AsyncWrite + Unpin),
seq: &mut u32,
session_id: &str,
payload: &[u8],
@ -98,7 +98,7 @@ pub async fn handle_unblock_user(
}
pub async fn handle_block_list(
stream: &mut TcpStream,
stream: &mut (impl AsyncRead + AsyncWrite + Unpin),
seq: &mut u32,
session_id: &str,
crypto: &SessionCrypto,

View file

@ -4,7 +4,7 @@ mod manage;
mod requests;
use anyhow::Result;
use tokio::net::TcpStream;
use tokio::io::{AsyncRead, AsyncWrite};
use crate::{
net::io,
@ -12,7 +12,7 @@ use crate::{
};
async fn send_err(
stream: &mut TcpStream,
stream: &mut (impl AsyncRead + AsyncWrite + Unpin),
seq: &mut u32,
code: crate::proto::ErrorCode,
msg: &str,

View file

@ -1,5 +1,5 @@
use anyhow::Result;
use tokio::net::TcpStream;
use tokio::io::{AsyncRead, AsyncWrite};
use crate::{
domain::session,
@ -16,7 +16,7 @@ use crate::{
use super::send_err;
pub async fn handle_friend_request(
stream: &mut TcpStream,
stream: &mut (impl AsyncRead + AsyncWrite + Unpin),
seq: &mut u32,
session_id: &str,
payload: &[u8],
@ -100,7 +100,7 @@ pub async fn handle_friend_request(
}
pub async fn handle_friend_accept(
stream: &mut TcpStream,
stream: &mut (impl AsyncRead + AsyncWrite + Unpin),
seq: &mut u32,
session_id: &str,
payload: &[u8],