geforkt von mirrored/vaultwarden
Remove warning when compiling only with mysql and add compatibility mode with the old docker script names
Dieser Commit ist enthalten in:
Ursprung
6890c25ea1
Commit
1e5306b820
2 geänderte Dateien mit 12 neuen und 4 gelöschten Zeilen
|
@ -2,6 +2,9 @@
|
||||||
|
|
||||||
if [ -r /etc/vaultwarden.sh ]; then
|
if [ -r /etc/vaultwarden.sh ]; then
|
||||||
. /etc/vaultwarden.sh
|
. /etc/vaultwarden.sh
|
||||||
|
elif [ -r /etc/bitwarden_rs.sh ]; then
|
||||||
|
echo "### You are using the old /etc/bitwarden_rs.sh script, please migrate to /etc/vaultwarden.sh ###"
|
||||||
|
. /etc/bitwarden_rs.sh
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -d /etc/vaultwarden.d ]; then
|
if [ -d /etc/vaultwarden.d ]; then
|
||||||
|
@ -10,6 +13,13 @@ if [ -d /etc/vaultwarden.d ]; then
|
||||||
. $f
|
. $f
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
elif [ -d /etc/bitwarden_rs.d ]; then
|
||||||
|
echo "### You are using the old /etc/bitwarden_rs.d script directory, please migrate to /etc/vaultwarden.d ###"
|
||||||
|
for f in /etc/bitwarden_rs.d/*.sh; do
|
||||||
|
if [ -r $f ]; then
|
||||||
|
. $f
|
||||||
|
fi
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec /vaultwarden "${@}"
|
exec /vaultwarden "${@}"
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
use chrono::prelude::*;
|
|
||||||
use diesel::r2d2::{ConnectionManager, Pool, PooledConnection};
|
use diesel::r2d2::{ConnectionManager, Pool, PooledConnection};
|
||||||
use rocket::{
|
use rocket::{
|
||||||
http::Status,
|
http::Status,
|
||||||
|
@ -228,13 +227,12 @@ pub fn backup_database(conn: &DbConn) -> Result<(), Error> {
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
let db_url = CONFIG.database_url();
|
let db_url = CONFIG.database_url();
|
||||||
let db_path = Path::new(&db_url).parent().unwrap().to_string_lossy();
|
let db_path = Path::new(&db_url).parent().unwrap().to_string_lossy();
|
||||||
let file_date = Utc::now().format("%Y%m%d_%H%M%S").to_string();
|
let file_date = chrono::Utc::now().format("%Y%m%d_%H%M%S").to_string();
|
||||||
diesel::sql_query(format!("VACUUM INTO '{}/db_{}.sqlite3'", db_path, file_date)).execute(conn)?;
|
diesel::sql_query(format!("VACUUM INTO '{}/db_{}.sqlite3'", db_path, file_date)).execute(conn)?;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Get the SQL Server version
|
/// Get the SQL Server version
|
||||||
pub fn get_sql_server_version(conn: &DbConn) -> String {
|
pub fn get_sql_server_version(conn: &DbConn) -> String {
|
||||||
|
|
Laden …
In neuem Issue referenzieren