Prevent starting up if the JWT secret is not given

Similarly, don't create the admin if the password is not given
This commit is contained in:
Valentin Tolmer
2024-12-23 23:03:27 +01:00
committed by nitnelave
parent 1f26262e13
commit f417427635
9 changed files with 114 additions and 45 deletions

View File

@@ -3,6 +3,8 @@ use std::env::var;
pub const DB_KEY: &str = "LLDAP_DATABASE_URL";
pub const PRIVATE_KEY_SEED: &str = "LLDAP_KEY_SEED";
pub const JWT_SECRET: &str = "LLDAP_JWT_SECRET";
pub const LDAP_USER_PASSWORD: &str = "LLDAP_LDAP_USER_PASS";
pub fn database_url() -> String {
let url = var(DB_KEY).ok();