vw_small

Hardened fork of Vaultwarden (https://github.com/dani-garcia/vaultwarden) with fewer features.
git clone https://git.philomathiclife.com/repos/vw_small
Log | Files | Refs | README

commit 4df686f49e50eebc0978f06cf33538bb270fb3c4
parent d7eeaaf24952bc893ef6209d428c8d9b775b618b
Author: Miroslav Prasil <miroslav@prasil.info>
Date:   Mon, 18 Feb 2019 10:48:48 +0000

Add an option to not enable WAL (should help in #399)

Diffstat:
Msrc/config.rs | 3+++
Msrc/main.rs | 12+++++++-----
2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/config.rs b/src/config.rs @@ -253,6 +253,9 @@ make_config! { extended_logging: bool, false, def, true; /// Log file path log_file: String, false, option; + + /// Enable DB WAL |> Turning this off might lead to worse performance, but might help if using bitwarden_rs on some exotic filesystems, that do not support WAL + enable_db_wal: bool, false, def, true; }, /// Yubikey settings diff --git a/src/main.rs b/src/main.rs @@ -168,11 +168,13 @@ fn check_db() { } // Turn on WAL in SQLite - use diesel::RunQueryDsl; - let connection = db::get_connection().expect("Can't conect to DB"); - diesel::sql_query("PRAGMA journal_mode=wal") - .execute(&connection) - .expect("Failed to turn on WAL"); + if CONFIG.enable_db_wal() { + use diesel::RunQueryDsl; + let connection = db::get_connection().expect("Can't conect to DB"); + diesel::sql_query("PRAGMA journal_mode=wal") + .execute(&connection) + .expect("Failed to turn on WAL"); + } } fn check_rsa_keys() {