SIGN IN SIGN UP
dani-garcia / vaultwarden UNCLAIMED

Unofficial Bitwarden compatible server written in Rust, formerly known as bitwarden_rs

0 0 22 Rust

Reject unrecognised DATABASE_URL instead of silent SQLite fallback (#7061)

* Panic on unrecognised DATABASE_URL instead of silent SQLite fallback

Previously, any DATABASE_URL that did not match the mysql: or postgresql:
prefix was silently treated as a SQLite file path. This caused data loss
in containerised environments when the URL was misconfigured (typos,
quoting issues), as vaultwarden would create an ephemeral SQLite database
that was wiped on restart.

Now, an explicit sqlite:// prefix is supported and used as the default.
Bare paths without a recognised scheme are still accepted for backwards
compatibility, but only if the database file already exists. If not, the
process panics with a clear error message.

Relates to #2835, #1910, #860.

* Use err!() instead of panic!() for unrecognised DATABASE_URL

Follow the established codebase convention where configuration
validation errors use err!() to propagate gracefully, rather than
panic!(). The error propagates through from_config() and is caught
by create_db_pool() which logs and calls exit(1).

* Use 'scheme' instead of 'prefix' in DATABASE_URL messages

Per review feedback, 'scheme' is the more accurate term for the
sqlite:// portion of the URL.
M
mfw78 committed
54895ad4bed4c12e07cce0dedfb0498830d6f991
Parent: a057c7d
Committed by GitHub <noreply@github.com> on 5/16/2026, 7:18:53 PM