icicimov / kubernetes-bitwarden_rs

Kubernetes manifests for the bitwarden_rs project https://github.com/dani-garcia/bitwarden_rs.git
Apache License 2.0
49 stars 39 forks source link

need websocket support #18

Open lvnilesh opened 1 year ago

lvnilesh commented 1 year ago

Need to update ingress so websocket is supported for sync

icicimov commented 1 year ago

Hi @lvnilesh can you please add more detail about what is not working for you?

lvnilesh commented 1 year ago

I haven't dug further, but my browser says

[2022-11-17T04:46:37.761Z] Information: (WebSockets transport) There was an error with the transport.
lvnilesh commented 1 year ago

Also, I see Dani mentions https://github.com/dani-garcia/vaultwarden/wiki/Enabling-WebSocket-notifications to make sure to pass the connection and upgrade headers but I can't see any references in the ingress.yaml

Route the /notifications/hub endpoint to the WebSocket server, by default at port 3012, making sure to pass the Connection and Upgrade headers. (Note the port can be changed with WEBSOCKET_PORT variable)

I must be missing something.

icicimov commented 1 year ago

Pushed an ingress update check if that works for you.

lvnilesh commented 1 year ago

Thanks. I applied and refreshed browser. I need to test more on a fresh clean machine.

What tools do you suggest to use to examine this specific header transport?

Browser still says:

WebSocketTransport.ts:74 WebSocket connection to 'wss://vault.example.com/notifications/hub?access_token=token' failed: 
(anonymous) @ WebSocketTransport.ts:74
t @ zone.js:1351
connect @ WebSocketTransport.ts:51
Utils.ts:199 [2022-11-17T19:05:19.160Z] Information: (WebSockets transport) There was an error with the transport.
Utils.ts:193 [2022-11-17T19:05:19.160Z] Error: Failed to start the connection: Error: WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled.
icicimov commented 1 year ago

You can always check the logs and look for hints there. Apart from that maybe try curl something like

$ curl -sSI \
       --no-buffer \
       --header "Connection: Upgrade" \
       --header "Upgrade: websocket" \
       --header "Host: socketsbay.com:443" \
       --header "Origin: https://socketsbay.com:443" \
       --header "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" \
       --header "Sec-WebSocket-Version: 13" \
       https://socketsbay.com:443/
HTTP/1.1 200 OK
Date: Thu, 17 Nov 2022 22:55:53 GMT
Server: Apache/2.4.41 (Ubuntu)
Set-Cookie: ci_session=lg9eg499i74vcnvui31cdjt606fv69kg; expires=Fri, 18-Nov-2022 00:55:53 GMT; Max-Age=7200; path=/; HttpOnly
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Content-Type: text/html; charset=UTF-8

targeting wss enabled site.