Live data from Hacker News

Bitwarden compatible server written in Rust

github.com

11–20 of 116 posts

Re: Bitwarden compatible server written in Rust

#11
post #7

I’ve been really diving into Rust over this holiday break and reading through code bases like this is really helpful. Little things like a shared db connection are not intuitive on the first pass when everything is under such a strict borrow/move/release paradigm. I’m going to study this a little closer but it still isn’t super clear to me. In other languages I would probably implement a singleton of some sort. I kno…

I know this is off-topic but isn't Rust meant to be more of a systems-level language? It seems to me that Go would be a better choice for server-side API (assuming .NET 5 and 6 are too bloated and slow for your tastes).

Or is Rust finding a niche in userpace apps even though it was designed for systems level use? I am not saying apps shouldn't be written in Rust, I just don't understand the appeal. What am I missing?

Re: Bitwarden compatible server written in Rust

#13
I don't have any experience with running the bitwarden server, but the primary selling point for this is that it is less resource intensive than the official server backend. The official backend is written in C#, and is currently using .NET 5. I haven't ever felt like .NET apps were particularly bloated, but I guess it's possible to write bloated code in any language. Does anybody have any insights as to what is done poorly in the official version? I also wonder if the performance improvements in .NET 6 would make a difference.

Re: Bitwarden compatible server written in Rust

#14
post #4

As cool as a native code back-end for Bitwarden would be I would be more interested in seeing vendor native mobile apps (Swift/Xcode, Kotlin/Android Studio) and putting the Xamarin code out to pasture. Would also like to see an improvement in the desktop Electron app as well or at least get it to feature parity with the web vault. All of that said Bitwarden is a fantastic product and I recommend that over every other…

Why move away from Xamarin? It works. Reduces development needs. Xamarin iOS uses Ahead-of-Time compile which is pretty close to native at that point. Phones are fast enough now to handle a little extra UI layer code like I'm sure Swift and Kotlin have. Most end-users don't even know what Xamarin is.

Re: Bitwarden compatible server written in Rust

#15

I don't have any experience with running the bitwarden server, but the primary selling point for this is that it is less resource intensive than the official server backend. The official backend is written in C#, and is currently using .NET 5. I haven't ever felt like .NET apps were particularly bloated, but I guess it's possible to write bloated code in any language. Does anybody have any insights as to what is done…

I do still run the bitwarden official server. While I would not considered bloated by 2021 standards, it still eats up more that 2GB of RAM for my single-user setup... It prompted me to upgrade the VPS I run it to a more expensive version with more RAM.

So yeah, resource usage is real, especially if you plan to run this on a Pi or on small cloud intances.

Re: Bitwarden compatible server written in Rust

#16
post #6

I have been using Vaultwarden for all my home needs for some time and I love it. I host it on a raspberry pi in a docker container and have had no issues whatsoever.

What would happen if your Pi was damaged/stolen, or the SD card crashed?

Re: Bitwarden compatible server written in Rust

#17
post #7

I’ve been really diving into Rust over this holiday break and reading through code bases like this is really helpful. Little things like a shared db connection are not intuitive on the first pass when everything is under such a strict borrow/move/release paradigm. I’m going to study this a little closer but it still isn’t super clear to me. In other languages I would probably implement a singleton of some sort. I kno…

I‘m on Mobile right now, but in that case you’d wrap your db in a Arc> (or Rc if you don’t need concurrency.). Then, anytime you need to access the DB, you’d try to lock the RwLock’s Writer or reader.

Re: Bitwarden compatible server written in Rust

#18

I don't have any experience with running the bitwarden server, but the primary selling point for this is that it is less resource intensive than the official server backend. The official backend is written in C#, and is currently using .NET 5. I haven't ever felt like .NET apps were particularly bloated, but I guess it's possible to write bloated code in any language. Does anybody have any insights as to what is done…

Apart from the pain around dealing with .NET itself, Bitwarden's official server only supports MSSQL which is a nightmare in pretty much every conceivable way (licensing, tooling, packaging, and so on). Vaultwarden seems to support plain old Postgres and SQLite.

Re: Bitwarden compatible server written in Rust

#19

I don't have any experience with running the bitwarden server, but the primary selling point for this is that it is less resource intensive than the official server backend. The official backend is written in C#, and is currently using .NET 5. I haven't ever felt like .NET apps were particularly bloated, but I guess it's possible to write bloated code in any language. Does anybody have any insights as to what is done…

They start 12 containers and recommend 2 core cpu with 4GB RAM. At least 2 GB RAM. [1]

[1] https://bitwarden.com/help/article/install-on-premise-linux/

Re: Bitwarden compatible server written in Rust

#20
post #6

I have been using Vaultwarden for all my home needs for some time and I love it. I host it on a raspberry pi in a docker container and have had no issues whatsoever.

What would happen if your Pi was damaged/stolen, or the SD card crashed?

The way I understand it, the server component is "zero knowledge", meaning you decrypt on clients with your password and the server just serves an encrypted blob. Am I right?
Post reply on HN