Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bitwarden_rs Support for Subpaths,how to config (caddy) ? #767

Closed
bigbighill opened this issue Dec 13, 2019 · 4 comments
Closed

Bitwarden_rs Support for Subpaths,how to config (caddy) ? #767

bigbighill opened this issue Dec 13, 2019 · 4 comments

Comments

@bigbighill
Copy link

bigbighill commented Dec 13, 2019

docker-compose.yml

version: '3'
services:
bitwarden:
image: bitwardenrs/server:latest
container_name: bitwarden
restart: always
volumes:
- ./data:/data
- /etc/localtime:/etc/localtime
- /var/log:/var/log
ports:
- "127.0.0.1:9990:80"
- "127.0.0.1:9991:3012"
environment:
SIGNUPS_ALLOWED: "true"
DOMAIN: "https://www.xxxx.com/subpath"
DATABASE_URL: "/data/bitwarden.db"
ROCKET_WORKERS: "10"
WEB_VAULT_ENABLED: "true"
ADMIN_TOKEN: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

caddy:
image: abiosoft/caddy
container_name: caddy
restart: always
volumes:
- ./Caddyfile:/etc/Caddyfile:ro
- ./Caddycerts:/root/.caddy
- ./www:/var/www
- /etc/localtime:/etc/localtime
ports:
- "127.0.0.1:2015:2015"
- 443:443
- 80:80
environment:
ACME_AGREE: "true" # agree to Let's Encrypt Subscriber Agreement
ARGS: "version='1.0.4'"

Caddyfile
https://www.xxxx.com {
tls asdf@gmail.com
root /var/www
index index.html
gzip
header / {
# Enable HTTP Strict Transport Security (HSTS)
Strict-Transport-Security "max-age=31536000;"
# Enable cross-site filter (XSS) and tell browser to block detected attacks
X-XSS-Protection "1; mode=block"
# Disallow the site to be rendered within a frame (clickjacking protection)
X-Frame-Options "DENY"
# Prevent search engines from indexing (optional)
X-Robots-Tag "none"
}
proxy /subpath/notifications/hub/negotiate bitwarden:80 {
transparent
}
proxy /subpath notifications/hub bitwarden:3012 {
websocket
}
proxy /subpath bitwarden:80 {
transparent
}
}

https://www.xxxx.com/subpath 404 error

bitwarden/server#277 now support subpaths ,how to config?

thanks

@bigbighill
Copy link
Author

@dani-garcia

@fbartels
Copy link
Contributor

The linked issue says:

bitwarden/server#277 (comment)

Yes, running Bitwarden under a domain subfolder is not a supported scenario.

The linked issues also has a reference back to this project: #528

@BlackDex
Copy link
Collaborator

@bigbighill This is not supported by this project or by the upstream bitwarden.com project.
There are some workarounds which could work but that means you need to compile the web-vault your self. See #241 . But there is no guarantee given for that to keep working.

@dani-garcia
Copy link
Owner

I think this is answered already, subpaths are not supported though they can be made to work with the patches mentioned above, that requires recompiling the web vault and the server yourself.

I would personally save myself the trouble and run it in a separate subdomain or under a different port.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants