MySQL feature issues #3443

Closed
opened 2026-04-06 04:49:08 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @tycho on 6/2/2019

I've got two issues with the MySQL feature.

First, bitwarden_rs apparently logs the DATABASE_URL for on startup, which is a Bad Idea(tm) because with the MySQL variant it includes the password (!!), e.g:

bitwarden_rs[13455]: /--------------------------------------------------------------------\
bitwarden_rs[13455]: |                       Starting Bitwarden_RS                        |
bitwarden_rs[13455]: |                       Version 1.9.1-9add8e19                       |
bitwarden_rs[13455]: |--------------------------------------------------------------------|
bitwarden_rs[13455]: | This is an *unofficial* Bitwarden implementation, DO NOT use the   |
bitwarden_rs[13455]: | official channels to report bugs/features, regardless of client.   |
bitwarden_rs[13455]: | Report URL: https://github.com/dani-garcia/bitwarden_rs/issues/new |
bitwarden_rs[13455]: \--------------------------------------------------------------------/
bitwarden_rs[13455]: mysql://bitwarden_rs:SUPERSECRETPASSWORDHERE@localhost/bitwarden_rs
bitwarden_rs[13455]: mysql://bitwarden_rs:SUPERSECRETPASSWORDHERE@localhost/bitwarden_rs
bitwarden_rs[13455]: [2019-06-01 22:46:36][launch][INFO] Configured for production.
bitwarden_rs[13455]: [2019-06-01 22:46:36][launch_][INFO] address: 0.0.0.0
bitwarden_rs[13455]: [2019-06-01 22:46:36][launch_][INFO] port: 8000
bitwarden_rs[13455]: [2019-06-01 22:46:36][launch_][INFO] log: critical
bitwarden_rs[13455]: [2019-06-01 22:46:36][launch_][INFO] workers: 64
bitwarden_rs[13455]: [2019-06-01 22:46:36][launch_][INFO] secret key: private-cookies disabled
bitwarden_rs[13455]: [2019-06-01 22:46:36][launch_][INFO] limits: forms = 32KiB
bitwarden_rs[13455]: [2019-06-01 22:46:36][launch_][INFO] keep-alive: 5s
bitwarden_rs[13455]: [2019-06-01 22:46:36][launch_][INFO] tls: disabled
bitwarden_rs[13455]: [2019-06-01 22:46:36][rocket::fairing::fairings][INFO] Fairings:
bitwarden_rs[13455]: [2019-06-01 22:46:36][_][INFO] 1 response: Application Headers
bitwarden_rs[13455]: [2019-06-01 22:46:36][launch][INFO] Rocket has launched from http://0.0.0.0:8000

Please do this before you do a release with the MySQL feature:

diff --git a/src/db/mod.rs b/src/db/mod.rs
index 2751aea..5c9f6ee 100644
--- a/src/db/mod.rs
+++ b/src/db/mod.rs
@@ -45,7 +45,6 @@ pub fn init_pool() -> Pool {

 pub fn get_connection() -> Result<Connection, ConnectionError> {
     let url = CONFIG.database_url();
-    println!("{}", url.to_string());
     Connection::establish(&url)
 }

diff --git a/src/main.rs b/src/main.rs
index 4ff6c62..c820d60 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -149,7 +149,6 @@ fn check_db() {
                 .expect("Failed to turn on WAL");
         }
     }
-    println!("{}", url.to_string());
     db::get_connection().expect("Can't connect to DB");
 }

Alternatively, if there's some other way to specify the password than in the connection string, that'd be nice. But I couldn't find such an option.


And second issue, I couldn't find any documentation in bitwarden_rs.env for setting up the DATABASE_URL for the MySQL build variant. I found this, which got me what I needed. It'd probably be a good idea to add an example to the bitwarden_rs.env template file.

*Originally created by @tycho on 6/2/2019* I've got two issues with the MySQL feature. First, bitwarden_rs apparently logs the `DATABASE_URL` for on startup, which is a Bad Idea(tm) because with the MySQL variant it includes the password (!!), e.g: ``` bitwarden_rs[13455]: /--------------------------------------------------------------------\ bitwarden_rs[13455]: | Starting Bitwarden_RS | bitwarden_rs[13455]: | Version 1.9.1-9add8e19 | bitwarden_rs[13455]: |--------------------------------------------------------------------| bitwarden_rs[13455]: | This is an *unofficial* Bitwarden implementation, DO NOT use the | bitwarden_rs[13455]: | official channels to report bugs/features, regardless of client. | bitwarden_rs[13455]: | Report URL: https://github.com/dani-garcia/bitwarden_rs/issues/new | bitwarden_rs[13455]: \--------------------------------------------------------------------/ bitwarden_rs[13455]: mysql://bitwarden_rs:SUPERSECRETPASSWORDHERE@localhost/bitwarden_rs bitwarden_rs[13455]: mysql://bitwarden_rs:SUPERSECRETPASSWORDHERE@localhost/bitwarden_rs bitwarden_rs[13455]: [2019-06-01 22:46:36][launch][INFO] Configured for production. bitwarden_rs[13455]: [2019-06-01 22:46:36][launch_][INFO] address: 0.0.0.0 bitwarden_rs[13455]: [2019-06-01 22:46:36][launch_][INFO] port: 8000 bitwarden_rs[13455]: [2019-06-01 22:46:36][launch_][INFO] log: critical bitwarden_rs[13455]: [2019-06-01 22:46:36][launch_][INFO] workers: 64 bitwarden_rs[13455]: [2019-06-01 22:46:36][launch_][INFO] secret key: private-cookies disabled bitwarden_rs[13455]: [2019-06-01 22:46:36][launch_][INFO] limits: forms = 32KiB bitwarden_rs[13455]: [2019-06-01 22:46:36][launch_][INFO] keep-alive: 5s bitwarden_rs[13455]: [2019-06-01 22:46:36][launch_][INFO] tls: disabled bitwarden_rs[13455]: [2019-06-01 22:46:36][rocket::fairing::fairings][INFO] Fairings: bitwarden_rs[13455]: [2019-06-01 22:46:36][_][INFO] 1 response: Application Headers bitwarden_rs[13455]: [2019-06-01 22:46:36][launch][INFO] Rocket has launched from http://0.0.0.0:8000 ``` Please do this before you do a release with the MySQL feature: ```diff diff --git a/src/db/mod.rs b/src/db/mod.rs index 2751aea..5c9f6ee 100644 --- a/src/db/mod.rs +++ b/src/db/mod.rs @@ -45,7 +45,6 @@ pub fn init_pool() -> Pool { pub fn get_connection() -> Result<Connection, ConnectionError> { let url = CONFIG.database_url(); - println!("{}", url.to_string()); Connection::establish(&url) } diff --git a/src/main.rs b/src/main.rs index 4ff6c62..c820d60 100644 --- a/src/main.rs +++ b/src/main.rs @@ -149,7 +149,6 @@ fn check_db() { .expect("Failed to turn on WAL"); } } - println!("{}", url.to_string()); db::get_connection().expect("Can't connect to DB"); } ``` Alternatively, if there's some other way to specify the password than in the connection string, that'd be nice. But I couldn't find such an option. --- And second issue, I couldn't find any documentation in `bitwarden_rs.env` for setting up the `DATABASE_URL` for the MySQL build variant. I found [this](https://docs.diesel.rs/diesel/mysql/index.html), which got me what I needed. It'd probably be a good idea to add an example to the `bitwarden_rs.env` template file.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/vaultwarden#3443