Live data from Hacker News

Bitwarden compatible server written in Rust

github.com

31–40 of 116 posts

Re: Bitwarden compatible server written in Rust

#31
post #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?

It's definitely true that being good for writing services wasn't really a big design goal of rust and it's far from the lowest friction language to do it in. However it is still a mainstream high performance language with a rich type system and amazing compile time error checking and that makes it attractive to use for many other things if you are already used to it.

Re: Bitwarden compatible server written in Rust

#32
post #25
post #11

Earlier quoted context omitted.

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?

I'm not very opinionated on Rust's comparison to other languages, but to me it does seem like rewriting things in rust (which now even has its own acronym RIIR) has become trendy. Trendy enough that the very fact that rust tools happen to be written in that language is used as a main selling point.

This is true for basically every budding community. "Rustaceans" writing tools for writing rust, in rust, seems like a gimmick, but every language goes through this period. JavaScript is probably the single biggest offender I can think of, but other examples include rewriting Vim plugins in Lua even though neovim supports vimscript, rewriting literally anything in Go, rewriting python libraries in Julia, etc.

Re: Bitwarden compatible server written in Rust

#33
I love this, it's how I run my password manager (Using docker-compose and traefik for the ui). Bitwarden works very well in iOS and Android and on Windows10 and in Firefox. Syncs are always instant, I used to use KeePassXC with NextCloud but inevitably I'd have syncing issues (admittedly, not very often). Not anymore.

I still have to dig into the Organization feature to share passwords with my partner.

Re: Bitwarden compatible server written in Rust

#34
post #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?

I remember a time when people called Go a systems language, is that time over now?

Re: Bitwarden compatible server written in Rust

#36
post #10

Earlier quoted context omitted.

The bitwarden mobile apps are using Xamarin? That's actually pretty impressive...I've never had any of the weird issues with the bitwarden app that I've had with other Xamarin apps in the past. The desktop app looks and feels like an electron app, so I'm far less impressed by it. At the very least it would be nice to have it in Qt or something like that.

> The desktop app looks and feels like an electron app, so I'm far less impressed by it. That is because it IS an Electron app. > At the very least it would be nice to have it in Qt or something like that. Sure, I hope so too. Unfortunately there are very few serious alternative password managers that are not using Electron for the desktop app these days. Seems like 1Password is on the way out too.

keepassxc is Qt based and a serious alternative. I've been using it for >3 years and have only good things to say about it.

Re: Bitwarden compatible server written in Rust

#37
post #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?

Once I got used to writing in Rust, I found it really hard to mess up. I sort of like it for applications, although some idioms can be a bit verbose and hard to parse visually and mentally.

First, thanks to default immutability of variables and the borrow checker, I trust that I'm far less likely to accidentally mutate something and cause an action-at-a-distance bug.

Second, I absolutely love idiomatic Rust error handling of returning a Result (especially combined with the question-mark operator). It forces me to deal with error conditions. Unlike C# or Python or Java or C++, I don't have to worry that any code could throw an exception at any time. (Rust code can panic, but panics generally represent unrecoverable errors — see http://joeduffyblog.com/2016/02/07/the-error-model/#bugs-are... ) And unlike Go or C, I don't have to remember to check the error every single time.

I still have to write functionality tests for Rust code, but once I've done that I feel like the code is mostly locked down. It's harder to get to that sense of security in other languages.

Re: Bitwarden compatible server written in Rust

#38

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.

I switched after my instance stock because of a failed migration - this was my fault cause I aborted the upgrade - and I couldn't get it to upgrade anymore. Iam very happy with vaultwarden ever since

Re: Bitwarden compatible server written in Rust

#39
post #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?

Why are the Rust proponents so triggered by what seems to be an honest question about the popularity of Rust? I don't know the first thing about Elixir or Erlang but I realize there are some powerful properties of BEAM and if there seemed to be a trend to rewrite apps into BEAM apps I would want to know what am I missing out on that, if clued-in, I would join the rush as well. I think that's what OP is saying here (perhaps clumsily) but why vote the question down so aggressively? Makes you look like a thin-skinned lot who don't like to explain yourselves which would be a reason to avoid the "Rustacean" community.

Re: Bitwarden compatible server written in Rust

#40
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?

I switched my server and forgot a device. It worked without the server and I only noticed it because I missed some new passwords.

But there is also an old saying in IT: no backup no mercy

Post reply on HN