VictorNine / bitwarden-go

A Bitwarden-compatible server written in Golang

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot register account through Bitwarden-web

shackra opened this issue · comments

I have a docker container for Bitwarden-go, the binary running inside is based on my pull request /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?

Looking through your repo, it appears that your mirror is out of date, perhaps updating it could fix the problem? The last commit of your mirror seems to be 02995b9, decently old at this time.

EDIT: I reread and realized you were running a different binary. Ill look into the problem and try to recreate it on my end.

On the mean time I will too update my repo with your recent changes and re-apply my additions and see what happens

The code is now part of this repo if you would like to try again

Nope, the weird error is still there even with the latest code for bitwarden-go compiled:

screenshot-2018-1-30 register - bitwarden web vault

The most frustrating part is the ausence of output from bitwarden-go, I can see you have log.Println inside the HandleRegister among many but nothing prints to console besides 2018/01/30 23:36:31 Starting server on :8000

On the other hand, maybe the Bitwarden Vault running inside the container is NOT hitting the backend. Going to check tomorrow.

Running everything locally (without docker) the behavior remains the same.

Bitwarden Vault is configure in this fashion:

{
  "appSettings": {
      "apiUri": "http://localhost:8000",
      "identityUri": "http://localhost:8000",
      "iconsUri": "https://icons.bitwarden.com",
      "stripeKey": "pk_test_KPoCfZXu7mznb9uSCPZ2JpTD",
      "braintreeKey": "sandbox_r72q8jq6_9pnxkwm75f87sdc2"
  }
}

and package.json is changed in its env variable:

...
   "env": "Development",
...

Not sure what is going on.

Looks like thats the problem. My setting.json file looks like this:

{
"appSettings": {
"apiUri": "/api",
"identityUri": "/identity",
"iconsUri": "https://icons.bitwarden.com",
"stripeKey": "pk_test_KPoCfZXu7mznb9uSCPZ2JpTD",
"braintreeKey": "sandbox_r72q8jq6_9pnxkwm75f87sdc2",
"whitelistDomains": [
"localhost",
"localhost:8080"
]
}
}

So far, I can register at the web-vault. But I get this error: Missing auth header; I am using your neweset version and the newest version of the web-vault. It is 1.22

@shackra
Thanks, I referenced your dockerfiles to build my own alpine-based containers.
I got this to work using reverse proxy with the vaultURL parameter.

The command I used is as follows. The Vault container IP is in docker's default 172.17../16 subnet.
bitwarden-go -init -location /data -vaultURL <vault container IP>:4001

In the Vault container, I copied settings.Production.json to settings.json and changed to env tag in package.json. Access is via port 8000 on the bitwarden-go container.

@thoundernousx Just tried with the latest version. Could you post your settings.json?

Thanks, I tried it yesterday. Now everything works like a charm.

Weird, suddenly I was unable to access Bitwarden-web from the outside running inside a docker container.

I just will use @leonghui alpine versions of both containers and that is.