mirror of
https://github.com/Astatin3/unshell.git
synced 2026-06-09 06:47:59 -06:00
Restructure some of the folder structure in unshell-server
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user