mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-06-12 05:07:40 +02:00
Removed included web vault.
Now that docker automatically downloads the web-vault, keeping it in the repo doesn't make sense. Added error message in case someone tries to run the application directly without the web-vault instaled..
This commit is contained in:
15
src/main.rs
15
src/main.rs
@ -51,13 +51,12 @@ fn init_rocket() -> Rocket {
|
||||
embed_migrations!();
|
||||
|
||||
fn main() {
|
||||
println!("{:#?}", *CONFIG);
|
||||
|
||||
// Make sure the database is up to date (create if it doesn't exist, or run the migrations)
|
||||
let connection = db::get_connection().expect("Can't conect to DB");
|
||||
embedded_migrations::run_with_output(&connection, &mut io::stdout()).expect("Can't run migrations");
|
||||
|
||||
check_rsa_keys();
|
||||
check_web_vault();
|
||||
|
||||
init_rocket().launch();
|
||||
}
|
||||
@ -108,6 +107,18 @@ fn check_rsa_keys() {
|
||||
}
|
||||
}
|
||||
|
||||
fn check_web_vault() {
|
||||
use std::path::Path;
|
||||
use std::process::exit;
|
||||
|
||||
let index_path = Path::new(&CONFIG.web_vault_folder).join("index.html");
|
||||
|
||||
if !index_path.exists() {
|
||||
println!("Web vault is not found. Please follow the steps in the README to install it");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
lazy_static! {
|
||||
// Load the config from .env or from environment variables
|
||||
static ref CONFIG: Config = Config::load();
|
||||
|
Reference in New Issue
Block a user