Restructure some of the folder structure in unshell-server

This commit is contained in:
Michael Mikovsky
2025-12-20 18:19:08 -07:00
parent c8cfa685ec
commit 338eb93bfc
18 changed files with 98 additions and 198 deletions
+18 -4
View File
@@ -1,15 +1,14 @@
// #![macro_use]
mod api;
mod auth;
mod config;
pub mod logger;
mod modules;
mod server;
pub use api::app::start_api;
pub use server::Server;
use static_init::dynamic;
#[static_init::dynamic]
pub static DATABASE_TREES: Vec<&'static str> = vec!["users"];
@@ -24,3 +23,18 @@ pub static SERVER_CONFIG: unshell_lib::config::PayloadConfig = unshell_lib::conf
components: Vec::new(),
runtime_config: Vec::new(),
};
// Constants for server config
pub use api::start_api;
use chrono::Duration;
use jsonwebtoken::{DecodingKey, EncodingKey};
static EXPIRE_DURATION: Duration = Duration::hours(12);
#[dynamic]
static JWT_SECRET: String = std::env::var("JWT_SECRET").expect("JWT_SECRET must be set");
#[dynamic]
static JWT_ENCODING_KEY: EncodingKey = EncodingKey::from_secret(JWT_SECRET.as_bytes());
#[dynamic]
static JWT_DECODING_KEY: DecodingKey = DecodingKey::from_secret(JWT_SECRET.as_bytes());