khonsulabs / bonsaidb

A developer-friendly document database that grows with you, written in Rust
https://bonsaidb.io/
Apache License 2.0
998 stars 37 forks source link

Fixed default server listener #301

Closed phantie closed 1 year ago

phantie commented 1 year ago

A breaking change was introduced in the commit a22d45966b0e89c34586ae76b5552c36746b016c, likely by mistake, because it's not mentioned in the CHANGELOG. Should be Ipv6Addr::UNSPECIFIED which stands for [0; 8], instead of Ipv6Addr::LOCALHOST. Strange that remote server by default would only listen on localhost.

Also, port 5645 instead of 5465. Easy to make a mistake here.

ecton commented 1 year ago

Thank you for catching this. I believe the switch to localhost was intentional, but not the fact I didn't document the change. The traditional wisdom for databases is to not expose more than you expect. Pretty much every database out there is now configured by default to listen on localhost rather than unspecified, to prevent people from exposing databases to the internet that shouldn't be.

After thinking about it, however, I've decided that listening on unspecified is better for BonsaiDb. This is for a few reasons:

All of this is to say I'm merging this PR. I just wanted to document why the default for BonsaiDb isn't localhost when it is generally considered a good security practice for database servers.

phantie commented 1 year ago

I do agree with you, and I'm glad it was of some use.