mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-06-12 13:17:43 +02:00
Improve domain detection, should fix attachment problems. Otherwise, set the DOMAIN
env variable to the correct domain
This commit is contained in:
@ -165,6 +165,7 @@ pub struct Config {
|
||||
signups_allowed: bool,
|
||||
password_iterations: i32,
|
||||
domain: String,
|
||||
domain_set: bool,
|
||||
}
|
||||
|
||||
impl Config {
|
||||
@ -174,6 +175,8 @@ impl Config {
|
||||
let df = env::var("DATA_FOLDER").unwrap_or("data".into());
|
||||
let key = env::var("RSA_KEY_FILENAME").unwrap_or(format!("{}/{}", &df, "rsa_key"));
|
||||
|
||||
let domain = env::var("DOMAIN");
|
||||
|
||||
Config {
|
||||
database_url: env::var("DATABASE_URL").unwrap_or(format!("{}/{}", &df, "db.sqlite3")),
|
||||
icon_cache_folder: env::var("ICON_CACHE_FOLDER").unwrap_or(format!("{}/{}", &df, "icon_cache")),
|
||||
@ -189,7 +192,8 @@ impl Config {
|
||||
local_icon_extractor: util::parse_option_string(env::var("LOCAL_ICON_EXTRACTOR").ok()).unwrap_or(false),
|
||||
signups_allowed: util::parse_option_string(env::var("SIGNUPS_ALLOWED").ok()).unwrap_or(true),
|
||||
password_iterations: util::parse_option_string(env::var("PASSWORD_ITERATIONS").ok()).unwrap_or(100_000),
|
||||
domain: env::var("DOMAIN").unwrap_or("https://localhost".into()),
|
||||
domain_set: domain.is_ok(),
|
||||
domain: domain.unwrap_or("http://localhost".into()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user