added deployment via docker compose

This commit is contained in:
2025-10-09 14:34:24 +01:00
parent 78f9e757dc
commit 24b3cbe4ce
13 changed files with 100 additions and 15 deletions
+1 -1
View File
@@ -99,7 +99,7 @@ pub async fn mfa_page(session: Session) -> Template {
}
#[get("/api/totp.jpg")]
pub async fn gen_totp(s: Session) -> Option<QrCodeImage> {
pub async fn get_totp(s: Session) -> Option<QrCodeImage> {
let totp = TOTP::new(
Algorithm::SHA1,
6,
+19 -6
View File
@@ -2,7 +2,7 @@
#[macro_use]
extern crate rocket;
use rocket::fs::FileServer;
use rocket::fs::{FileServer, NamedFile};
use rocket::http::Method;
use rocket::serde::json::Json;
use rocket::{Build, Rocket};
@@ -66,16 +66,29 @@ fn rocket() -> Rocket<Build> {
.mount(
"/",
routes![
users,
username_for_id,
favicon,
messages::chat_page,
auth::signup_page,
auth::login_page,
auth::mfa_page,
],
)
.mount(
"/api",
routes![
messages::get_messages,
messages::post_message,
messages::event_stream,
users,
username_for_id,
auth::signup,
auth::signup_page,
auth::login_page,
auth::login
auth::login,
auth::get_totp,
],
)
}
#[get("/favicon.ico")]
async fn favicon() -> NamedFile {
NamedFile::open("static/favicon.ico").await.unwrap()
}