diff --git a/.env b/.env index 6af09d1..ac1c311 100644 --- a/.env +++ b/.env @@ -2,3 +2,4 @@ DATABASE_PASSWORD=CHANGE_ME #DATABASE_KEYFILE= BW_PATH=/usr/local/bin/bw DATABASE_PATH=/exports/bitwarden-export.kdbx +BITWARDEN_URL=https://bitwarden.com diff --git a/README.md b/README.md index ad14a38..a92d93a 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ It uses official [bitwarden-cli](https://bitwarden.com/help/article/cli/) client - Clone this repository - Edit `.env` file - ⚠️ make sure to set your own `DATABASE_PASSWORD` - used as password for KeePass database + - If you are using a custom Bitwarden instance, set the URL in `BITWARDEN_URL` - Run ``` docker-compose run bitwarden-to-keepass @@ -30,4 +31,4 @@ source .venv/bin/activate - Run ``` python3 bitwarden-to-keepass.py --bw-session BW_SESSION --database-path DATABASE_PATH --database-password DATABASE_PASSWORD [--database-keyfile DATABASE_KEYFILE] [--bw-path BW_PATH] -``` \ No newline at end of file +``` diff --git a/docker-compose.yaml b/docker-compose.yaml index 11d6161..b392793 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -3,7 +3,7 @@ services: bitwarden-to-keepass: build: . command: > - bash -c 'export BW_SESSION=`$BW_PATH login --raw || $BW_PATH unlock --raw` + bash -c '$BW_PATH config server $BITWARDEN_URL && export BW_SESSION=`$BW_PATH login --raw || $BW_PATH unlock --raw` && $BW_PATH sync && python3 bitwarden-to-keepass.py && $BW_PATH lock'