Browse Source

only use dotenv in debug builds, not in release builds

dotenv will look for .env files in the current and all parent
directories. this is potentionaly dangerous.
pull/378/head
Дамјан Георгиевски 7 years ago
parent
commit
c33bf143ef
  1. 4
      src/config.rs

4
src/config.rs

@ -125,7 +125,9 @@ impl Config {
fn load() -> Self {
use crate::util::{get_env, get_env_or};
dotenv::dotenv().ok();
#[cfg(debug_assertions)] {
dotenv::dotenv().ok();
}
let df = get_env_or("DATA_FOLDER", "data".to_string());
let key = get_env_or("RSA_KEY_FILENAME", format!("{}/{}", &df, "rsa_key"));

Loading…
Cancel
Save