mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-04-26 01:35:54 +03:00
[GH-ISSUE #740] Websocket with Traefik and docker compose #499
Labels
No labels
SSO
Third party
better for forum
bug
bug
documentation
duplicate
enhancement
future Vault
future Vault
future Vault
good first issue
help wanted
low priority
notes
pull-request
question
troubleshooting
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vaultwarden#499
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ZenoBell on GitHub (Nov 21, 2019).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/740
Hello guys,
i cant achieve to make the websocket to work. If i try to open https://domain.com/notifications/hub i'm getting the error "Internal Server Error" .If i change the label from ws to wss same error.
i don't know if it helps but i can see these errors too in the browser
``
``
Also from what i read Cloudflare SSL fully supports WebSockets traffic passing through their network so it shouldn't be an issue.
In the raw data i can see this
and in the logs
Any idea ? Thanx !
@NLLucifer commented on GitHub (Jan 24, 2020):
Same problem here. Still can't find a sollution
@eric-pierce commented on GitHub (Feb 5, 2020):
@sesshomaru86 what appears to have fixed it for me was to disable traefik.backend=bitwarden_rs, but I don't see that listed as a label in your docker compose file. Here's the thread where I found my answer: https://github.com/dani-garcia/bitwarden_rs/issues/453#issuecomment-482522679
cc @NLLucifer
@NLLucifer commented on GitHub (Feb 6, 2020):
Worked for me, Thanks @eric-pierce
@ZenoBell commented on GitHub (Feb 6, 2020):
yep in the wiki there is an example also based on traefik v1
labels:
- traefik.enable=true
- traefik.docker.network=traefik
- traefik.web.frontend.rule=Host:bitwarden.domain.tld
- traefik.web.port=80
- traefik.hub.frontend.rule=Host:bitwarden.domain.tld;Path:/notifications/hub
- traefik.hub.port=3012
- traefik.hub.protocol=ws
so that's why from the beginning i didnt include the label traefik.backend.
if is it possible @eric-pierce @NLLucifer could you guys both post your docker compose configuration so maybe i will get to figure out why mine doesnt work ? Thanx !
@eric-pierce commented on GitHub (Feb 7, 2020):
@sesshomaru86 happy to share, I'm still using docker 1.7 but will eventually upgrade to 2.x
bitwarden:
image: bitwardenrs/server:latest
restart: always
volumes:
- ./bw-data:/data
- /var/run/docker.sock:/var/run/docker.sock
environment:
- WEBSOCKET_ENABLED=true # Required to use websockets
- SIGNUPS_ALLOWED=false # set to false to disable signups
- SMTP_EXPLICIT_TLS=true
- SMTP_HOST=${SMTP_HOST}
- SMTP_FROM=${SMTP_FROM}
- SMTP_PORT=${SMTP_PORT}
- SMTP_SSL=true
- SMTP_USERNAME=${SMTP_USERNAME}
- SMTP_PASSWORD=${SMTP_PASSWORD}
- DOMAIN=bitwarden.${DOMAINNAME}
- TZ=${TZ}
ports:
- 8099:80
- 3012:3012
labels:
- "traefik.enable=true"
- "traefik.web.frontend.rule=Host:bitwarden.${DOMAINNAME}"
- "traefik.web.port=80"
- "traefik.hub.frontend.rule=Host:bitwarden.${DOMAINNAME};Path:/notifications/hub"
- "traefik.hub.port=3012"
- "traefik.hub.protocol=ws"
- "traefik.docker.network=traefik"
- "traefik.frontend.headers.SSLRedirect=true"
- "traefik.frontend.headers.STSSeconds=315360000"
- "traefik.frontend.headers.browserXSSFilter=true"
- "traefik.frontend.headers.contentTypeNosniff=true"
- "traefik.frontend.headers.forceSTSHeader=true"
- "traefik.frontend.headers.SSLHost=${DOMAINNAME}"
- "traefik.frontend.headers.STSIncludeSubdomains=true"
- "traefik.frontend.headers.STSPreload=true"
- "traefik.frontend.headers.frameDeny=true"
@ZenoBell commented on GitHub (Feb 9, 2020):
Thanx @eric-pierce ! i just uncommented the lines to match yours and magically this time worked. The only new line that i added was traefik.frontend.headers.frameDeny=true" . Also i updated to the latest bw image. Don't know exactly what did the trick but it worked !.. 1000x thanx once again!
@fmoledina commented on GitHub (Apr 12, 2020):
@eric-pierce , I'm just setting this up on my end and using your compose snippet as a guide. Any reason why you need
/var/run/docker.sock:/var/run/docker.sockin your volumes list for bitwarden_rs? I've copied the rest of your lines, and my instance works without thatdocker.sockline.@eric-pierce commented on GitHub (Apr 12, 2020):
It isn’t required, I tend to include it for docker containers to allow control of the docker daemon from outside the container, more info here https://medium.com/better-programming/about-var-run-docker-sock-3bfd276e12fd
@fmoledina commented on GitHub (Apr 13, 2020):
Right. I understand the use of the socket for monitoring and manipulating Docker on the host. I guess I only use it for a handful of containers, including Traefik, Portainer, and Watchtower. I'll leave it off of my bitwarden_rs instance as I don't think it uses it. Thanks for the prompt response!