From 4b4733f3b4c9d8b8ba341f6d689b30d515d32127 Mon Sep 17 00:00:00 2001 From: BlackDex Date: Tue, 24 May 2022 18:23:18 +0200 Subject: [PATCH] Prevent some ROCKET env variables to cause issues Some ROCKET_ env variables can cause issues if they are set. With the older Rocket v0.4.x this was not an issue. But with Rocket v0.5.x some have changed and we control them in a different way. This PR removes/unset these variables to prevent errors during startup. resolves #2482 --- src/config.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/config.rs b/src/config.rs index cd90caa1..877899f8 100644 --- a/src/config.rs +++ b/src/config.rs @@ -82,6 +82,13 @@ macro_rules! make_config { } }; + // Delete some old Rocket env variables which could cause issues and have no use for Vaultwarden. + std::env::remove_var("ROCKET_CLI_COLORS"); // This is disabled by default and could cause issues when set + std::env::remove_var("ROCKET_ENV"); // Vaultwarden configures sane defaults for this already + std::env::remove_var("ROCKET_PROFILE"); // Vaultwarden configures sane defaults for this already + std::env::remove_var("ROCKET_LOG"); // The log level is determined by Vaultwarden via LOG_LEVEL + std::env::remove_var("ROCKET_LOG_LEVEL"); // The log level is determined by Vaultwarden via LOG_LEVEL + let mut builder = ConfigBuilder::default(); $($( builder.$name = make_config! { @getenv &stringify!($name).to_uppercase(), $ty };