Skip to content

alexyao2015/BitBetter

 
 

Repository files navigation

GitHub Actions Build Docker Pulls

BitBetter

BitBetter is is a tool to modify Bitwarden's core dll to allow you to generate your own individual and organisation licenses. You must have an existing installation of Bitwarden for BitBetter to modify.

Please see the FAQ below for details on why this software was created.

Beware! BitBetter does janky stuff to rewrite the bitwarden core dll and allow the installation of a self signed certificate. Use at your own risk!

Credit to https://github.com/h44z/BitBetter and https://github.com/jakeswenson/BitBetter

Refactor Notice

There was a major refactor done that improved the rebustness of the patching to remove the need to recompile bitwarden images.

Several BREAKING changes were made:

  • Previously generated certificates are no longer compatible and will need to be regenerated
  • Previously generated licenses will need to be regenerated and installed
  • Previously, the public images did not have a suffix and now will have the -public suffix
  • patch-bitwarden-custom.sh and patch-bitwarden.sh (renamed to patch-bitwarden-public.sh) scripts were updated and need to be locally redownloaded
  • This project will work for bitwarden versions 2025.7.0 and onward

Install methods

There are two installation methods. One utilizes public licensing certificates and keys to ease the installation and remove the need for you to manually keep track of certificates. The custom method keeps certificates private but requires you to generate and store them. Sinc the certificates are only used for licensing, there is no security concerns.

It is recommended to use the public method for ease of setup.

Install with standard bitwarden setup

The following methods detail installation of bitbetter with the standard install method

Using Public Images

First patch the Bitwarden script to use BitBetter Images:

sudo curl -o patch-bitwarden-public.sh https://raw.githubusercontent.com/alexyao2015/BitBetter/public/patch-bitwarden-public.sh && sudo chmod 755 patch-bitwarden-public.sh && sudo ./patch-bitwarden-public.sh

Generate a License:

sudo docker run -it --rm -v $(pwd)/license:/bitbetter/output ghcr.io/alexyao2015/bitbetter:licensegen-public-latest

Updating:

sudo ./patch-bitwarden-public.sh

Using Custom Images

Patch the Bitwarden script to use BitBetter Images (Automatically generates certificates):

sudo curl -o patch-bitwarden-custom.sh https://raw.githubusercontent.com/alexyao2015/BitBetter/public/patch-bitwarden-custom.sh && sudo chmod 755 patch-bitwarden-custom.sh && sudo ./patch-bitwarden-custom.sh

Generate Custom License:

sudo docker run -it --rm -v $PWD/bwdata/bitbetter/bitbetter.key:/bitbetter/certs/bitbetter.key -v $(pwd)/license:/bitbetter/output ghcr.io/alexyao2015/bitbetter:licensegen-custom-latest

Updating:

sudo ./patch-bitwarden-custom.sh

Updating Bitwarden and BitBetter

WARNING: This section may or may not be accurate

To update Bitwarden, ran patch-bitwarden-public.sh or patch-bitwarden-custom.sh script, depending or your installation. It will rebuild the BitBetter images and automatically update Bitwarden afterwards. Docker pull errors can be ignored for api and identity images.

You can either run these scripts without providing any parameters, in interactive mode (e.g. ./patch-bitwarden-public.sh) or by setting the parameters as follows, to run the script in non-interactive mode:

./patch-bitwarden-public.sh <bitwarden-path> <update-override>
./patch-bitwarden-custom.sh <bitwarden-path> <update-override> <regenerate-certificates>

<bitwarden-path>: The path to the directory containing your bwdata directory

<update-override>: If you want the docker-compose.override.yml file to be updated (either y or n)

<regenerate-certificates>: It you want to regenerate the custom certificates in bitwarden-path/bwdata/bitbetter (either y or n)

Install using Bitwarden unified

Follow the official unified installation instructions, but replace ghcr.io/bitwarden/lite with

ghcr.io/alexyao2015/bitbetter:lite-<self_host_method>-<bitwarden_version>

where <bitwarden_version> is latest or the bitwarden version you want (e.g. 2025.7.0)

Using public images

Replace self_host_method with public.

Generate a License:

sudo docker run -it --rm -v $(pwd)/license:/bitbetter/output ghcr.io/alexyao2015/bitbetter:licensegen-public-<bitwarden_version>

Using custom images

  • Replace self_host_method with custom

  • Generate certificates using

docker run --rm -v <path_to_store_certs>:/certs ghcr.io/alexyao2015/bitbetter:certificate-gen-<bitwarden_version>
  • Mount <path_to_store_certs>/bitbetter/bitbetter.cer to /bitbetter/certs/bitbetter.cer in the container.

    • For docker compose, add this to your volumes section
<path_to_store_certs>/bitbetter/bitbetter.cer:/bitbetter/certs/bitbetter.cer
  • For docker run, use the following
-v <path_to_store_certs>/bitbetter/bitbetter.cer:/bitbetter/certs/bitbetter.cer

Generate a License:

sudo docker run -it --rm -v <path_to_store_certs>/bitbetter/bitbetter.key:/bitbetter/certs/bitbetter.key -v $(pwd)/license:/bitbetter/output ghcr.io/alexyao2015/bitbetter:licensegen-custom-<bitwarden_version>

About

Modify bitwarden to provide my own licensing for self hosting

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

No contributors

Languages

  • Rust 29.4%
  • Python 28.4%
  • Shell 24.7%
  • HCL 11.4%
  • Dockerfile 6.1%