feat: completed the rust side of the new wolves api

This commit is contained in:
silver 2023-10-26 22:56:49 +01:00
parent 5267c588c4
commit 984ebc4fb0
2 changed files with 59 additions and 47 deletions

View file

@ -188,6 +188,8 @@ pub struct Config {
pub ssh_root: String,
pub auth_discord: String,
pub users_restricted: Vec<String>,
pub wolves_url: String,
pub wolves_key: String,
}
pub fn get_config() -> Config {
@ -208,6 +210,8 @@ pub fn get_config() -> Config {
ssh_root: "skynet_old".to_string(),
auth_discord: "".to_string(),
users_restricted: vec![],
wolves_url: "".to_string(),
wolves_key: "".to_string(),
};
if let Ok(x) = env::var("LDAP_HOST") {
@ -246,6 +250,12 @@ pub fn get_config() -> Config {
if let Ok(x) = env::var("LDAP_DISCORD_AUTH") {
config.auth_discord = x.trim().to_string();
}
if let Ok(x) = env::var("WOLVES_URL") {
config.wolves_url = x.trim().to_string();
}
if let Ok(x) = env::var("WOLVES_KEY") {
config.wolves_key = x.trim().to_string();
}
if let Ok(x) = env::var("USERS_RESTRICTED") {
// usernames that are restricted