* Fast patching via IL rewriting of Bitwarden images
Brings back the pre-047c4dd approach of patching pre-built Bitwarden
images instead of cloning and building from source. The fast patch mode
(now default) pulls ghcr.io/bitwarden/{api,identity} and rewrites
Core.dll in-place using Mono.Cecil, bypassing the full source build.
Updated to work with current Bitwarden:
- Uses SingleFileExtractor.Core to extract Core.dll from the
PublishSingleFile bundle before patching; replaces the native
launcher with a shell script wrapper (exec dotnet /app/Api.dll)
so entrypoint.sh continues to work unchanged
- LicensingService search is now namespace-agnostic (handles the
Bit.Core.Services → Bit.Core.Billing.Services rename)
- Thumbprint matching uses Contains() instead of Equals() to handle
the hidden Unicode LRM character prepended to the production
thumbprint string literal in the compiled IL
The original source-build path is preserved and accessible via
BITBETTER_BUILD_FROM_SOURCE=1.
Signed-off-by: Lorenzo Moscati <lorenzo@moscati.page>
* Address review: fix correctness and robustness
- dotnet publish -c Release with explicit -o to match Dockerfile expectation
- Add --platform "$TARGETPLATFORM" to fast-patch docker builds for parity with source-build mode
- mkdir -p for idempotent .keys directory creation
- Align namespace to BitwardenSelfLicensor (repo convention)
- Branch bundle extraction on .dll extension instead of bare catch; exit 1 with clear message on failure
- Replace First() with FirstOrDefault() + targeted error on missing licensing resource
- FixRuntimeConfig derives framework name/version from includedFrameworks; switch to LatestPatch rollForward
Signed-off-by: Lorenzo Moscati <lorenzo@moscati.page>
* Add BITBETTER_BUILD_FROM_SOURCE notes to README.md
Signed-off-by: Lorenzo Moscati <lorenzo@moscati.page>
---------
Signed-off-by: Lorenzo Moscati <lorenzo@moscati.page>
Co-authored-by: h44z <christoph.h@sprinternet.at>
Move `Manually generating Certificate & Key` section from `Building BitBetter` to `Setting up BitBetter` and mark it as `Optional` instead of `Note`.
Co-authored-by: h44z <christoph.h@sprinternet.at>
* Exclude cert.cert from git
* Use latest release of bitwarden as base image (#67, #66)
* Add a script which simplifies Bitwarden updates
* fix typo
* Add UseApi
* Updated version, created update section
* Workaround for docker-compose --ignore-pull-failures bugs (4377 and 7127)
* use version from docker script
* check if bitbetter images are outdated
* Make Sso available in org license
Add `UseSso` var and enable
* Update README.md
Co-authored-by: Christoph Haas <christoph.h@sprinternet.at>
Co-authored-by: Lework <kuailemy123@163.com>
Co-authored-by: Captainhook <ec14018@qmul.ac.uk>
* Make policies available in generated org licenses.
* Change license version to current value used in BitWarden. Add info about compatibility in README file.
* Update README.md
Added note that testing has been done up to Bitwarden 1.32.0.
Replaced editing of `docker-compose.yml` with the update-resistant usage
of `docker-compose.override.yml`
* Updated Readme
Better description of dependencies, updated readme.
* Fixed default key directory
Script was not looking in the right place for the auto-generated key directory. This patch fixes issue #35.
* Cleans up Key Directory Patch
Key directory path fix was echoing the directory when run.
* Use absolute path rather than relative path in scripts
* Remove src/bitBetter/.keys/cert.cert
* Build licenseGen in Docker
This way we don't have to install dotnet sdk on the host
* Build bitBetter in Docker
This way we don't have to install dotnet sdk on the host
* Change DIR in run.sh to point to the project root
* Replace echo in Dockerfiles by set -x and set -e
* Use same Dockerfile for api and identity images
* Update README.md
* Update CircleCI config
The Docker Executor can't mount volume.
https://support.circleci.com/hc/en-us/articles/360007324514https://circleci.com/docs/2.0/executor-types/#using-machine
* Make scripts work with sh
* Remove the container used to build bitBetter
* Added a Key Generating script
To make the keygen process a bit easier I've added a `generate-keys.sh` script that can be found in the `.keys` directory. It will generate the key & cert and bundle them into the required pkcs#12 file.
I've updated the readme to include instructions on the script.
* Generate bitbetter/identiry container with modified Core.dll
Added the generation of a second modified container, bitbetter/identity, which contains the modified dll. Fixes#12.
This works on my testing environment but has not gone through extensive testing. I'd recommend a review and cleanup of this commit before it is merged into the develop or master branches.
* Updated Docs
I've taken the steps written out by @online-stuff and consolidated/organized them into the README. This closes#13.
In a future update it might be worth adding a docs/ directory and breaking the readme into several docs that link to one another.
* Updated build.sh
Build now checks for and creates missing .keys directories.
* Added subj to allow for non-interactive use.
* Generate keys on build.
* Circle-ci needs to gen keys to test build
* Generate keys if they don't exist.
Don't overwrite if keys already exist.
* Generate keys online in the .keys directory
* Updated README.md
* Added initial interactive options
* Functional implementation of licensegen interactive mode.
* Bumped Newtonson.Json version
Never versions of the dotnet-sdk have issues with older Newtonsoft versions. 12.0.1 seems to satisfy the widest variety of sdk versions.
* Removing old readme
* Removed Duplicate Section
* Fixed typo
This fixes and closes issue #24.
* Added a Key Generating script
To make the keygen process a bit easier I've added a `generate-keys.sh` script that can be found in the `.keys` directory. It will generate the key & cert and bundle them into the required pkcs#12 file automatically when running the build script if none already exist.
* Generate bitbetter/identiry container with modified Core.dll
Added the generation of a second modified container, bitbetter/identity, which contains the modified dll. Fixes#12.
This works on my testing environment but has not gone through extensive testing. I'd recommend a review and cleanup of this commit before it is merged into the develop or master branches.
* Updated Docs
I've taken the steps written out by @online-stuff and consolidated/organized them into the README. This closes#13.
In a future update it might be worth adding a docs/ directory and breaking the readme into several docs that link to one another.
* Fixed Broken section Links