mqtt connections

almost working, need encryption
This commit is contained in:
JMARyA 2025-04-28 23:33:11 +02:00
parent 20ab0153d1
commit 125d50530d
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
15 changed files with 1259 additions and 42 deletions

View file

@ -1,4 +1,5 @@
use crate::api;
use crate::api::JoinResponse;
use crate::server_core::model::Machine;
use axum::Json;
use axum::http::StatusCode;
@ -44,5 +45,14 @@ pub async fn join_device(
save!(machine);
(StatusCode::OK, Json(json!({"ok": new_token})))
let i = crate::IDENTITY.get().unwrap();
(
StatusCode::OK,
Json(json!(JoinResponse {
token: new_token,
identity: i.public(),
mqtt: crate::CONFIG.get().unwrap().mqtt.clone()
})),
)
}