Bitwarden-go - A Bitwarden-compatible server written in Golang

(Note: This is still a work in progress. This project is not associated with the Bitwarden project nor 8bit Solutions LLC. Please use gitter or the issue tracker for this repo if you need support. If you need to use the official Bitwarden channels make it clear that you are using a 3rd party backend server)

bitwarden-go

Build Status Gitter chat

A server compatible with the Bitwarden apps and plugins. The server has a small footprint and could be run locally on your computer, a Raspberry Pi or a small VPS. The data is stored in a local SQLite database.

** If you're using an old database you need to add kdf and kdfIterations to your accounts table **

For more information on the protocol you can read the documentation provided by jcs

Usage

Fetching the code

Make sure you have the go package installed. Note: package name may vary based on distribution

You can then run go get github.com/VictorNine/bitwarden-go/cmd/bitwarden-go to fetch the latest code.

Build/Install

Run in your favorite terminal:

cd $GOPATH/src/github.com/VictorNine/bitwarden-go/cmd/bitwarden-go

followed by

go build

or

go install

The former will create a executable named bitwarden-go in the current directory, and go install will build and install the executable bitwarden-go as a system-wide application (located in $GOPATH/bin). Note: From here on, this guide assumes you ran go install

Initalizing the Database

Note: This step only has to be performed once

Run the following to initalize the database:

bitwarden-go -init

This will create a database called db in the directory of the application. Use -location to set a different directory for the database.

Running

To run bitwarden-go, run the following in the terminal:

bitwarden-go

Usage with Flags

To see all current flags and options with the application, run

bitwarden-go -h
Comments
  • Cannot register account through Bitwarden-web

    Cannot register account through Bitwarden-web

    I have a docker container for Bitwarden-go, the binary running inside is based on my pull request VictorNine/bitwarden-go/pull/8 that is started this way.

    I also have a docker container for Bitwarden Vault which is told to point to http://localhost:8000 as there is were Bitwarden-go listens requests.

    Bitwarden-go can response to requests perfectly fine:

    jorge@morpho ~ % wget 0.0.0.0:8000/api/accounts/register          
    --2018-01-05 04:13:34--  http://0.0.0.0:8000/api/accounts/register
    Connecting to 0.0.0.0:8000... connected.
    HTTP request sent, awaiting response... 400 Bad Request
    2018-01-05 04:13:34 ERROR 400: Bad Request.
    

    However, Bitwarden Vault tells me that "Errors have occurred. · An unexpected error has occurred." and I cannot register my account (or login, I put the credentials I cannot register and try to login but bitwarden vault displays the exact error message).

    I don't have any output from the bitwarden-go binary indicating an error.

    What am I doing wrong?

  • Allow setting a directory for the database and create tables only if they don't exists

    Allow setting a directory for the database and create tables only if they don't exists

    I add this change for the reason that I would like to set the location of the database somewhere else than ./, this is useful for binaries running inside a Docker container, we can save the database inside a Docker volume.

    I also changed the SQL statement for creating the tables to create them only if they do not exist. This allow running the option -init more than once without triggering errors or breaking something in the database.

  • Allow more headers in the CORS options to make WebVault (1.22.0) work

    Allow more headers in the CORS options to make WebVault (1.22.0) work

    I was not able to connect to the bitwarden-go server with the WebVault and found that "Device-Type" and "Content-Type" headers had to be allowed in the CORS options to make it work.

  • Which features do you cover ?

    Which features do you cover ?

    Hello,

    To be curious, which feature do you cover with your api version ? Do you cover :

    • the web vault
    • The import tool
    • the collection/team
    • folders relationship

    I've tried to understand your code, but i'm not familiar with Go.

    One more question :

    • Do you check each parameters sent to avoid SQL injection ?
    • How do you manager user session ? Cookie ?
  • Importing - Fails or Imports nothing

    Importing - Fails or Imports nothing

    If i try and import my fairly large KeePass XML file, bitwarden-go crashes:

    $ /home/bitwarden/go/bin/bitwarden-go -disableRegistration -location /home/bitwarden/go/bin/ 2019/04/07 15:10:43 Starting server on :8000 2019/04/07 15:11:15 dave@xxxx is trying to import data 2019/04/07 15:11:15 json: cannot unmarshal array into Go struct field newCipher.fields of type string

    If I try and import a smaller set (a folder containing one or two entries), this is reported as successful by bitwarden-web but no entries appear. bitwarden-go reports:

    $ /home/bitwarden/go/bin/bitwarden-go -disableRegistration -location /home/bitwarden/go/bin/ 2019/04/07 15:11:35 Starting server on :8000 2019/04/07 15:11:39 dave@xxxx is trying to import data

    In the chrome inspector, I can see a successful POST to api/ciphers/import and then a GET to api/accounts/revision-date (which fails - 404)

    Adding a single item through bitwarden-web, or one of the mobile apps works fine.

  • Items appear missing with bitwarden-web v1.23.0

    Items appear missing with bitwarden-web v1.23.0

    With the latest vault release (v1.23.0), account login, 2FA, and folders work but existing items are missing.

    Registering a new user on a fresh DB works.

    Trying to add a new item triggers an error message on vault: image

    Server stdout reports: 2018/03/13 16:13:27 [email protected] is trying to add data

    Other bitwarden clients are working fine (e.g. Android app, Firefox extension).

    Not sure if this is related to the upcoming API changes?

  • API Breaking Changes Coming

    API Breaking Changes Coming

    Just thought you should know that there are some breaking changes coming to cipher API models.

    1. Cipher.Login.Uri on the request and response models is being deprecated in favor of Cipher.Login.Uris, an array of { "Uri": string, "Match": enum }
    2. The cipher response model is being updated to better match the request model. Namely:
      • Data prop is being deprecated.
      • Adding: Name, Notes, and Fields to the root object.
      • Adding: Login, Card, Identity, and SecureNote to the root object (their prop values were part of the dynamic Data property in the past).

    Our API will handle these changes in a backwards compatible way for a few iterations since outdated client apps will still be expecting the old models for some time.

    These changes are already in the Core API project and refactoring is being done in all client apps over the next few days.

  • Added functions to enable the use of a yaml file for server configuration.

    Added functions to enable the use of a yaml file for server configuration.

    This moves the configuration for server settings to be read from a more user-friendly "config.yaml" in the root directory of the repo.

    Also, moving main.go from cmd/ to cmd/bitwarden-go/ will make go build and go install use a default name of "bitwarden-go", instead of "cmd".

  • Built, installed, ran `bitwarden-go -init`... Now what?

    Built, installed, ran `bitwarden-go -init`... Now what?

    I believe I have successfully built and installed bitwarden-go. Running bitwarden-go -init doesn't terminate, which wasn't what I expected according to README.md, but that's fine.

    Trying to connect to server, via port 8000, right from the server or from another host, gets me a 404 error.

    Killing bitwarden-go -init with ctrl-c and restarting it without the -init gets the same result.

    I may just have misinterpreted what the server provides. Am I completely wrong in expecting some sort of web interface to be hosted by bitwarden-go? Or should I be pointing another client at it?

  • Install fail

    Install fail

    root@pi_fhem:~/go# go get github.com/VictorNine/bitwarden-go package github.com/VictorNine/bitwarden-go: no buildable Go source files in /root/go/src/github.com/VictorNine/bitwarden-go

  • Revision date lookup

    Revision date lookup

    Anyone else with the following issue? The server crashes when /api/accounts/revision-date is called by clients:

    2018-06-01 03:14:28 | stdout | 2018/06/01 03:14:28 Starting server on :8000
    2018-06-01 03:14:25 | stdout | 2018/06/01 03:14:25 Get http://172.18.0.2:4001/api/accounts/revision-date: dial tcp 172.18.0.2:4001: connect: connection refused
    2018-06-01 03:09:27 | stdout | 2018/06/01 03:09:27 Starting server on :8000
    2018-06-01 03:09:24 | stdout | 2018/06/01 03:09:24 Get http://172.18.0.2:4001/api/accounts/revision-date: dial tcp 172.18.0.2:4001: connect: connection refused
    2018-06-01 03:04:26 | stdout | 2018/06/01 03:04:26 Starting server on :8000
    2018-06-01 03:04:23 | stdout | 2018/06/01 03:04:23 Get http://172.18.0.2:4001/api/accounts/revision-date: dial tcp 172.18.0.2:4001: connect: connection refused
    2018-06-01 02:59:27 | stdout | 2018/06/01 02:59:27 Starting server on :8000
    2018-06-01 02:59:23 | stdout | 2018/06/01 02:59:23 Get http://172.18.0.2:4001/api/accounts/revision-date: dial tcp 172.18.0.2:4001: connect: connection refused
    2018-06-01 02:54:26 | stdout | 2018/06/01 02:54:26 Starting server on :8000
    2018-06-01 02:54:23 | stdout | 2018/06/01 02:54:23 Get http://172.18.0.2:4001/api/accounts/revision-date: dial tcp 172.18.0.2:4001: connect: connection refused
    2018-06-01 02:49:25 | stdout | 2018/06/01 02:49:25 Starting server on :8000
    2018-06-01 02:49:22 | stdout | 2018/06/01 02:49:22 Get http://172.18.0.2:4001/api/accounts/revision-date: dial tcp 172.18.0.2:4001: connect: connection refused
    2018-06-01 02:44:25 | stdout | 2018/06/01 02:44:25 Starting server on :8000
    
  • Official Desktop App

    Official Desktop App

    Windows 10 just used the exact same server, login and password for browser extension and it works fine. Desktop app tells me there is there something I am missing. I also checked if anyone had the same issue is closed tickets. Is there a version I need to download specifically? Trying to get fingerprint reader in browser extension to work. Do I need to docker-compose up -d my container and update? please assist.

    P.S love the app its awesome thank you for all your hard work. I donated today.

  • What's the path to access the web vault?

    What's the path to access the web vault?

    I've got bitwarden-go installed in an lxc container and have it listening on 0.0.0.0:8000 but when I point my browser to 192.168.0.37:8000 it just says '404 page not found'

  • Implement support for folder deletion

    Implement support for folder deletion

    This should close #27 . I have tested with bitwarden-web, the chrome plugin, windows desktop app and Android app - all seem to function correctly following this PR.

  • Somehow make it clear to people that they shouldn't contact official Bitwarden support

    Somehow make it clear to people that they shouldn't contact official Bitwarden support

    We frequently get people using these third party servers that contact official support channels for help with problems they are having with it. Lots of times we go back and forth trying to figure out what the problem they are having is only to find out later they are using a third-party server (which they originally fail to mention) and we can't help. This is a drain on resources for the official Bitwarden product. I am not sure what the solution is, but could you brainstorm ideas on how to better communicate to users that they shouldn't do this? I suppose a simple start would be to put a notice in the README or something but I am not sure that is going to solve the problem completely.

    Thanks.

  • Cannot run standalone binary

    Cannot run standalone binary

    I downloaded the binary from the releases page, and ran it with -init and got:

    $ bitwarden-go-linux-arm -init
    2019/01/08 22:55:27 SQL error with 
    ...
    Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work. This is a stub
    
kubectl plugin for generating nginx-ingress compatible basic-auth secrets on kubernetes clusters

kubectl-htpasswd kubectl plugin for easily generating hashed basic auth secrets. Supported hash algorithms bcrypt Examples Create the secret on the cl

Jul 17, 2022
Integrated ssh-agent for windows. (pageant compatible. openSSH ssh-agent etc ..)
Integrated ssh-agent for windows. (pageant compatible. openSSH ssh-agent etc ..)

OmniSSHAgent About The chaotic windows ssh-agent has been integrated into one program. Chaos Map of SSH-Agent on Windows There are several different c

Dec 19, 2022
EdgeDB-Golang-Docker-Sample - The sample of connection between EdgeDB Server and Go Echo API Server

EdgeDB Golang Docker Sample 『Go + Docker Composeを使ってEdgeDBを動かしてみた』のサンプルコードです。 使い

Nov 2, 2022
Kubernetes OS Server - Kubernetes Extension API server exposing OS configuration like sysctl via Kubernetes API

KOSS is a Extension API Server which exposes OS properties and functionality using Kubernetes API, so it can be accessed using e.g. kubectl. At the moment this is highly experimental and only managing sysctl is supported. To make things actually usable, you must run KOSS binary as root on the machine you will be managing.

May 19, 2021
Gemini server running on the dailybuild server

#dailybuild notice This is the titan2 repo for the dailybuild server. It the static binary is built in a GitHub runner and sent over to the dailybuild

Nov 26, 2021
Go-http-server-docker - Simple sample server using docker and go

go-http-server-docker Simple sample webserver using docker and go.

Jan 8, 2022
Webhook-server - Webhook Server for KubeDB resources

webhook-server Webhook Server for KubeDB resources Installation To install KubeD

Feb 22, 2022
Fast, Docker-ready image processing server written in Go and libvips, with Thumbor URL syntax

Imagor Imagor is a fast, Docker-ready image processing server written in Go. Imagor uses one of the most efficient image processing library libvips (w

Dec 30, 2022
Amazeful web backend server for golang

Amazeful-Backend The all new Amazeful-Backend written in GoLang using Chi. To re

Jan 10, 2022
exporter for Aliyun CloudMonitor. Written in Golang.

Aliyun CloudMonitor Exporter exporter for Aliyun CloudMonitor. Written in Golang. inspired by aliyun-exporter Develop cd aliyun-exporter make tidy Bui

Dec 12, 2022
Rest API for todoapp written in Golang, using clean architecture, CI/CD
Rest API for todoapp written in Golang, using clean architecture, CI/CD

todoapp-backend Rest API for todoapp written in Golang, using Clean Architecture and CI/CD (includes unit tests and integration tests). Using: Web fra

Oct 23, 2022
A Prometheus exporter, written in Golang, for Magento 2

Magento 2 Prometheus Exporter A Prometheus exporter, written in Golang, for Magento 2. Philosophy It might be abnormal to start with the "philosophy"

May 3, 2022
A cross platform CLI for Flyte. Written in Golang. Offers an intuitive interface to Flyte https://flytectl.readthedocs.io/en/latest/
A cross platform CLI for Flyte. Written in Golang. Offers an intuitive interface to Flyte https://flytectl.readthedocs.io/en/latest/

FlyteCTL Flyte's official command-line interface Documentation · Contribution Guide FlyteCTL was designed as a portable and lightweight command-line i

Nov 7, 2022
library for working with github api, written in Golang

gitdata library for working with github api, written in Golang Example: get user data package main import ( "fmt" "log" "github.com/a1excoder/git

May 19, 2022
A sed interpreter written in Golang

A sed interpreter written in Golang. Most behaviors of this program is implemented follow GNU-sed, except all those operations related to external fil

Dec 15, 2021
dashd-go is an alternative full node dash implementation written in Go (golang)

dashd-go is an alternative full node dash implementation written in Go (golang)

Jan 26, 2022
Rainbow pfetch-like program written in golang.

rfetch Rainbow pfetch-like program written in golang. It has an kind of lolcat function called random, maybe someday I will rewrite lolcat to golang,

Jan 30, 2022
Goatmo - Dht22 prometheus exporter written in golang

description Prometheus exporter for the DHT22 written in go. usage In order to a

Aug 8, 2022
Cross-platform beanstalkd queue server admin console.
Cross-platform beanstalkd queue server admin console.

Overview aurora is a web-based Beanstalkd queue server console written in Go and works on macOS, Linux, and Windows machines. The main idea behind usi

Dec 30, 2022