summaryrefslogtreecommitdiff
path: root/src/config.rs
diff options
context:
space:
mode:
authorGeekCornerGH <[email protected]>2023-06-11 13:28:18 +0200
committerGeekCornerGH <[email protected]>2023-06-11 13:28:18 +0200
commit2d66292350d352c3ea41db08d4c2de33898e9806 (patch)
treed41f087f7a173c24f6d6f0da5eb378e69bd0d4c4 /src/config.rs
parentadf67a8ee887d21e104adfa8b6521d7971f5a1f1 (diff)
downloadvaultwarden-2d66292350d352c3ea41db08d4c2de33898e9806.tar.gz
vaultwarden-2d66292350d352c3ea41db08d4c2de33898e9806.zip
feat: Push Notifications
Co-authored-by: samb-devel <[email protected]> Co-authored-by: Zoruk <[email protected]>
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs
index 2a42b5f5..7351b941 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -377,6 +377,16 @@ make_config! {
/// Websocket port
websocket_port: u16, false, def, 3012;
},
+ push {
+ /// Enable push notifications
+ push_enabled: bool, false, def, false;
+ /// Push relay base uri
+ push_relay_uri: String, false, def, "https://push.bitwarden.com".to_string();
+ /// Installation id |> The installation id from https://bitwarden.com/host
+ push_installation_id: Pass, false, def, String::new();
+ /// Installation key |> The installation key from https://bitwarden.com/host
+ push_installation_key: Pass, false, def, String::new();
+ },
jobs {
/// Job scheduler poll interval |> How often the job scheduler thread checks for jobs to run.
/// Set to 0 to globally disable scheduled jobs.
@@ -724,6 +734,17 @@ fn validate_config(cfg: &ConfigItems) -> Result<(), Error> {
}
}
+ if cfg.push_enabled && (cfg.push_installation_id == String::new() || cfg.push_installation_key == String::new()) {
+ err!(
+ "Misconfigured Push Notification service\n\
+ ########################################################################################\n\
+ # It looks like you enabled Push Notification feature, but didn't configure it #\n\
+ # properly. Make sure the installation id and key from https://bitwarden.com/host are #\n\
+ # added to your configuration. #\n\
+ ########################################################################################\n"
+ )
+ }
+
if cfg._enable_duo
&& (cfg.duo_host.is_some() || cfg.duo_ikey.is_some() || cfg.duo_skey.is_some())
&& !(cfg.duo_host.is_some() && cfg.duo_ikey.is_some() && cfg.duo_skey.is_some())