Skip to content

Commit

Permalink
🔨 Improve Bitwarden WebSocket notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
frenck committed Dec 3, 2019
1 parent baaef0b commit 360ae8e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions bitwarden/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 6 additions & 2 deletions bitwarden/rootfs/etc/services.d/bitwarden/run
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ declare admin_token
declare certfile
declare keyfile
declare log_level
declare port
declare request_size_limit
declare secret_key

# Set defaults
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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 360ae8e

Please sign in to comment.