From 360ae8eee43a9397ef0b09f8d8dd28c962b41389 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Tue, 3 Dec 2019 18:45:13 +0100 Subject: [PATCH] :hammer: Improve Bitwarden WebSocket notifications --- bitwarden/config.json | 4 ++-- bitwarden/rootfs/etc/services.d/bitwarden/run | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/bitwarden/config.json b/bitwarden/config.json index 5551b8c..0cf7196 100755 --- a/bitwarden/config.json +++ b/bitwarden/config.json @@ -16,11 +16,11 @@ "hassio_role": "default", "ports": { "7277/tcp": 7277, - "7278/tcp": 7278, + "3012/tcp": 3012 }, "ports_description": { "7277/tcp": "Bitwarden Vault", - "7278/tcp": "Bitwarden WebSockets" + "3012/tcp": "Bitwarden WebSocket notifications" }, "map": [ "ssl" diff --git a/bitwarden/rootfs/etc/services.d/bitwarden/run b/bitwarden/rootfs/etc/services.d/bitwarden/run index e6f7ddc..c5273ab 100644 --- a/bitwarden/rootfs/etc/services.d/bitwarden/run +++ b/bitwarden/rootfs/etc/services.d/bitwarden/run @@ -7,6 +7,7 @@ declare admin_token declare certfile declare keyfile declare log_level +declare port declare request_size_limit declare secret_key @@ -14,8 +15,6 @@ declare secret_key export DATA_FOLDER=/data export ROCKET_PORT=7277 export ROCKET_WORKERS=2 -export WEBSOCKET_ENABLED=true -export WEBSOCKET_PORT=7278 # Set a random secret, to remove confusing warning from logs. secret_key=$(openssl rand -base64 32) @@ -82,6 +81,11 @@ if bashio::config.true 'ssl'; then export ROCKET_TLS="{certs=\"/ssl/${certfile}\",key=\"/ssl/${keyfile}\"}" fi +port=$(bashio::addon.port 3012) +if bashio::var.has_value "${port}"; then + export WEBSOCKET_ENABLED=true +fi + # Run the Bitwarden server bashio::log.info 'Starting the Bitwarden RS server...' cd /opt || bashio::exit.nok