mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-04-25 17:25:57 +03:00
[GH-ISSUE #634] making bitwarden_rs production ready #429
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#429
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 @hboetes on GitHub (Sep 25, 2019).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/634
Hi there,
I just compiled and installed bitwarden_rs and it is a very nice implementation indeed. But could you make it ready for production, as in using a "make install" which installs all binaries, data files and config files and having a configuration file in /etc/bitwarden_rs
This will make deploying and using bitwarden_rs so much easier.
Thanks!
@mqus commented on GitHub (Sep 25, 2019):
What you describe is mostly a packaging issue (e.g. should the binary be located in
/binor in/usr/bin? should the files for the web interface be located in/usr/share/bitwarden_rsor some other directory? should the config be a file in/etcor in a subdirectory? What are the options one should enable in a systemd service, if systemd is available at all (e.g. the BSDs)?Most of the answers to this depend on the Linux/BSD/Windows(?) flavor and can't easily be adressed in an upstream makefile. Therefore we have created some packages(see here) already and you are invited to do the same for your distribution/OS. Due to the static linking, packaging bitwarden_rs is relatively easy.
Another option many users prefer is the dockerfile (also described in the Wiki) but as I understand your issue, this is maybe not your goal.
@hboetes commented on GitHub (Sep 25, 2019):
Ah yes, the arch linux file is nice to read: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=bitwarden_rs
Thanks for the heads up.
Let's see if I can create a debian/ubuntu .deb package based on that.
@hboetes commented on GitHub (Sep 25, 2019):
Trying to build with the stable rustc doesn't work alas.
@hboetes commented on GitHub (Sep 25, 2019):
Also having to use environment variable to pass on the configuration is rather clumsy:
Case in point, now I am running with this service file:
And after using systemctl start bitwarden_rs I get this log output:
When I'm using exactly the same contents in my
envfile, which does work when I source it manually.It would really be nice if
bitwarden_rswould read the config file instead of using environment variables.@mqus commented on GitHub (Sep 25, 2019):
Why do you need
PassEnvironment? systemd sets the environment based on the file it read inEnvironmentFilewhich should be set to your .env file@hboetes commented on GitHub (Sep 25, 2019):
Because I keep getting:
And there is nothing suspicious about the ROCKET_TLS env var from the .env file.
@hboetes commented on GitHub (Sep 25, 2019):
I get that error message even when I remove ROCKET_TLS completely from the .env file???
@mqus commented on GitHub (Sep 25, 2019):
This is just a shot into the blue but systemd starts the service as the user
bitwarden_rs, so the tls keys have to be readable for that user, are they (and all directories in the path)?@mqus commented on GitHub (Sep 25, 2019):
Ah no, the
data/rsa_key.derfile is not the tls key but is neccessary for bitwarden_rs to function at all and should be located under[bitwarden_rs data dir or working directory]/data/rsa_key.der. Bitwarden_rs will usually create this key when starting for the first time (i think) and for this the directories must be at least readable or creatable for the userbitwarden_rs.In the case of archlinux, the directory /var/lib/bitwarden_rs is created on install and
chmod/chown'd to bitwarden_rs. bitwarden_rs then has the rights to create the data directory and its own files.EDIT: see here: https://aur.archlinux.org/cgit/aur.git/tree/bitwarden_rs.install?h=bitwarden_rs#n1
@hboetes commented on GitHub (Sep 25, 2019):
Figured it out: I forgot to set DATA_FOLDER :-)
I haven't got a Debian port yet, but I did create a c4O port, which makes it easy to build from git and still get everything in the right place.
@mprasil commented on GitHub (Sep 26, 2019):
Do I understand correctly that you managed to resolve all the issue and this can now be closed?
@hboetes commented on GitHub (Sep 26, 2019):
I solved my own issues, but there is still no documentation on how to prepare
bitwarden_rsfor packaging. I think I'll write something this evening.Ideally quite a few things would be implemented in code, making the life of packagers easier. Something like a
make installtarget.@hboetes commented on GitHub (Sep 26, 2019):
So this is a TLDR howto:
bitwarden_rs.envto your liking as described in that file.apt/yum/whatever install nginx pkg-config libssl1.0-dev$PWD/fakedirsudo tar xzf bitwarden_rs-*.tgz -C /installinstructions.txt
bitwarden_rs.env.txt
buildinstructions.txt
nginx_config.txt
bitwarden_rs.service.txt
@mprasil commented on GitHub (Sep 30, 2019):
Thanks for that, I'm sure some people will find that helpful. I'm going to close the issue now.
@hboetes commented on GitHub (Sep 30, 2019):
Is the 'make install target' on some TODO list now? :-)