This commit is contained in:
xenofem 2025-09-25 01:06:43 -04:00
parent 2d580d2b78
commit cecb0e3db3
5 changed files with 953 additions and 778 deletions

View file

@ -15,6 +15,7 @@ use actix_web::{
use actix_web_actors::ws;
use argon2::{Argon2, PasswordVerifier};
use askama_actix::{Template, TemplateToResponse};
use base64::prelude::*;
use bytesize::ByteSize;
use log::{error, warn};
use password_hash::PasswordHashString;
@ -395,13 +396,16 @@ async fn main() -> std::io::Result<()> {
let admin_password_hash: PasswordHashString = env_or_panic("TRANSBEAM_ADMIN_PASSWORD_HASH");
let cookie_secret_base64: String = env_or_panic("TRANSBEAM_COOKIE_SECRET");
let cookie_key =
cookie::Key::from(&base64::decode(&cookie_secret_base64).unwrap_or_else(|_| {
panic!(
"Value {} for TRANSBEAM_COOKIE_SECRET is not valid base64",
cookie_secret_base64
)
}));
let cookie_key = cookie::Key::from(
&BASE64_STANDARD
.decode(&cookie_secret_base64)
.unwrap_or_else(|_| {
panic!(
"Value {} for TRANSBEAM_COOKIE_SECRET is not valid base64",
cookie_secret_base64
)
}),
);
let state_file: PathBuf = match std::env::var("TRANSBEAM_STATE_FILE") {
Ok(v) => v