Below steps allow you to setup Websocket support for your Bitwarden_rs installation running on Synology Diskstation. You can do all steps using the GUI so there is no SSH Access needed.
- Working HTTPS Reverse proxy Setup (Control Panel -> Application Portal -> Reverse Proxy)
- Set Enviourment Variable
WEBSOCKET_ENABLED=true
in your Bitwarden container and expose the container port3012
to a local port, in my case5556
.
- Download enable_ws.sh
- Upload the script "enable_ws.sh" onto your Diskstation. I would recommand putting it in your Bitwarden directory. In my case
/volume1/docker/bitwarden
Control Panel -> Task Scheduler -> Create -> Scheduled Task -> User-defined Script
Make sure to amend the command according to your setup.
/volume1/docker/bitwarden/enable_ws.sh
= Full path to previously uploaded scriptvault.example.com
= Hostname of your Bitwarden_rs as configured in the Reverse Proxy5555
= Exposed ROCKET_PORT by Docker (The same as in your Reverse Proxy setup)5556
= Exposed WEBSOCKET_PORT by Docker
Run Command (My example):
bash /volume1/docker/bitwarden/enable_ws.sh vault.example.com 5555 5556
General Settings
Task -> Enable BW WS
User -> root
Enabled -> Tick
Schedule
Run on the following days -> Daily
Frequency -> Every hour
Task Settings:
(Optional) Enable Notifications
Run Command: <Paste Command Crafted Above>
Save and run the new task by selecting Run
. Login into your Webvault and confirm in your web browsers developer console that the connection to wss://
succeded.
Hi there and thanks for all the research!
Just to be sure and before anything else; If the internal container ROCKET_PORT is 1111, the local mapped port is 2222, and the WAN port is 3333, so the reversed proxy is doing HTTPS://WANIP:3333->HTTP://LANIP:2222, i should be using the command : bash /volume1/docker/vaultwarden/enable_ws.sh mynas.mydomain.com 3333 3012?
(all three WAN/LAN/Docker port numbers for the WEBSOCKET_PORT are the same: 3012 in my config)
If so, then perhaps someone may know why i'm getting this error in my vaultwarden.log:
2021-10-22 00:30:38.655][vaultwarden::api::notifications][ERROR]
###########################################################
'/notifications/hub' should be proxied to the websocket server or notifications won't work.
Go to the Wiki for more info, or disable WebSockets setting WEBSOCKET_ENABLED=false.
###########################################################################################
And although it 'seems' to work, as the developer console of firefox gives: "Information: WebSocket connected to wss://mynas.mydomain,com:3333/notifications", changing an item in the Firefox extension or in the iOS app, syncs immediately to the webvault, but not the reverse. Neither does it livesync from extension to iOS or vice versa. only after manual sync...
I checked for /etc/nginx/websocket.locations.vaultwarden and if /etc/nginx/websocket.locations.vaultwarden gets added to /etc/nginx/sites-enabled/server.ReverseProxy.conf and its all there...
Thanks in advance for any feedback!