Spiegel von
https://github.com/dani-garcia/vaultwarden.git
synchronisiert 2024-11-29 06:20:29 +01:00
only check sqlite parent if there could be one
Dieser Commit ist enthalten in:
Ursprung
8837660ba7
Commit
d5e54cb576
1 geänderte Dateien mit 3 neuen und 3 gelöschten Zeilen
|
@ -639,11 +639,11 @@ make_config! {
|
||||||
fn validate_config(cfg: &ConfigItems) -> Result<(), Error> {
|
fn validate_config(cfg: &ConfigItems) -> Result<(), Error> {
|
||||||
// Validate connection URL is valid and DB feature is enabled
|
// Validate connection URL is valid and DB feature is enabled
|
||||||
let url = &cfg.database_url;
|
let url = &cfg.database_url;
|
||||||
if DbConnType::from_url(url)? == DbConnType::sqlite {
|
if DbConnType::from_url(url)? == DbConnType::sqlite && url.contains('/') {
|
||||||
let path = std::path::Path::new(&url);
|
let path = std::path::Path::new(&url);
|
||||||
if let Some(parent) = path.parent() {
|
if let Some(parent) = path.parent() {
|
||||||
if !parent.exists() {
|
if !parent.is_dir() {
|
||||||
err!(format!("SQLite database directory `{}` does not exist", parent.display()));
|
err!(format!("SQLite database directory `{}` does not exist or is not a directory", parent.display()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Laden …
In neuem Issue referenzieren