From 14d7d29845801c9c0ba7748db2afbe20bd93ab71 Mon Sep 17 00:00:00 2001 From: Jackson K Date: Sat, 29 Nov 2025 16:14:38 +1300 Subject: [PATCH 1/5] Rename Containers from bitwarden/self-host:beta to bitwarden/lite:beta --- build.ps1 | 256 +++++++++++------------ build.sh | 8 +- src/bitBetter/Dockerfile-bitwarden-patch | 6 +- 3 files changed, 135 insertions(+), 135 deletions(-) diff --git a/build.ps1 b/build.ps1 index 5b2bb3a..64b9de7 100644 --- a/build.ps1 +++ b/build.ps1 @@ -1,128 +1,128 @@ -$ErrorActionPreference = 'Stop' -$PSNativeCommandUseErrorActionPreference = $true - -# detect buildx, ErrorActionPreference will ensure the script stops execution if not found -docker buildx version - -# define temporary directory -$tempdirectory = "$pwd\temp" -# define services to patch -$components = "Api","Identity" - -# delete old directories / files if applicable -if (Test-Path "$tempdirectory" -PathType Container) { - Remove-Item "$tempdirectory" -Recurse -Force -} - -if (Test-Path -Path "$pwd\src\licenseGen\Core.dll" -PathType Leaf) { - Remove-Item "$pwd\src\licenseGen\Core.dll" -Force -} - -if (Test-Path -Path "$pwd\src\licenseGen\cert.pfx" -PathType Leaf) { - Remove-Item "$pwd\src\licenseGen\cert.pfx" -Force -} - -if (Test-Path -Path "$pwd\src\bitBetter\cert.cer" -PathType Leaf) { - Remove-Item "$pwd\src\bitBetter\cert.cer" -Force -} - -if (Test-Path "$pwd\.keys\cert.cert" -PathType Leaf) { - Rename-Item -Path "$pwd\.keys\cert.cert" -NewName "$pwd\.keys\cert.cer" -} - -# generate keys if none are available -if (!(Test-Path "$pwd\.keys" -PathType Container)) { - .\generateKeys.ps1 -} - -# copy the key to bitBetter -Copy-Item "$pwd\.keys\cert.cer" -Destination "$pwd\src\bitBetter" - -# build bitBetter and clean the source directory after -docker build --no-cache -t bitbetter/bitbetter "$pwd\src\bitBetter" -Remove-Item "$pwd\src\bitBetter\cert.cer" -Force - -# gather all running instances, cannot run a wildcard filter on Ancestor= :(, does find all where name = *bitwarden* -$oldinstances = docker container ps --all -f Name=bitwarden --format '{{.ID}}' - -# stop and remove all running instances -foreach ($instance in $oldinstances) { - docker stop $instance - docker rm $instance -} - -# update bitwarden itself -if ($args[0] -eq 'update') { - docker pull ghcr.io/bitwarden/self-host:beta -} else { - $confirmation = Read-Host "Update (or get) bitwarden source container (y/n)" - if ($confirmation -eq 'y') { - docker pull ghcr.io/bitwarden/self-host:beta - } -} - -# stop and remove previous existing patch(ed) container -$oldinstances = docker container ps --all -f Ancestor=bitwarden-patched --format '{{.ID}}' -foreach ($instance in $oldinstances) { - docker stop $instance - docker rm $instance -} -$oldinstances = docker image ls bitwarden-patched --format '{{.ID}}' -foreach ($instance in $oldinstances) { - docker image rm $instance -} - -# remove old extract containers -$oldinstances = docker container ps --all -f Name=bitwarden-extract --format '{{.ID}}' -foreach ($instance in $oldinstances) { - docker stop $instance - docker rm $instance -} - -# start a new bitwarden instance so we can patch it -$patchinstance = docker run -d --name bitwarden-extract ghcr.io/bitwarden/self-host:beta - -# create our temporary directory -New-item -ItemType Directory -Path $tempdirectory - -# extract the files that need to be patched from the services that need to be patched into our temporary directory -foreach ($component in $components) { - New-item -itemtype Directory -path "$tempdirectory\$component" - docker cp $patchinstance`:/app/$component/Core.dll "$tempdirectory\$component\Core.dll" -} - -# stop and remove our temporary container -docker stop bitwarden-extract -docker rm bitwarden-extract - -# run bitBetter, this applies our patches to the required files -docker run -v "$tempdirectory`:/app/mount" --rm bitbetter/bitbetter - -# create a new image with the patched files -docker build . --tag bitwarden-patched --file "$pwd\src\bitBetter\Dockerfile-bitwarden-patch" - -# start all user requested instances -if (Test-Path -Path "$pwd\.servers\serverlist.txt" -PathType Leaf) { - foreach($line in Get-Content "$pwd\.servers\serverlist.txt") { - if (!($line.StartsWith("#"))) { - Invoke-Expression "& $line" - } - } -} - -# remove our bitBetter image -docker image rm bitbetter/bitbetter - -# copy our patched library to the licenseGen source directory -Copy-Item "$tempdirectory\Identity\Core.dll" -Destination "$pwd\src\licenseGen" -Copy-Item "$pwd\.keys\cert.pfx" -Destination "$pwd\src\licenseGen" - -# build the licenseGen -docker build -t bitbetter/licensegen "$pwd\src\licenseGen" - -# clean the licenseGen source directory -Remove-Item "$pwd\src\licenseGen\Core.dll" -Force -Remove-Item "$pwd\src\licenseGen\cert.pfx" -Force - -# remove our temporary directory -Remove-Item "$tempdirectory" -Recurse -Force \ No newline at end of file +$ErrorActionPreference = 'Stop' +$PSNativeCommandUseErrorActionPreference = $true + +# detect buildx, ErrorActionPreference will ensure the script stops execution if not found +docker buildx version + +# define temporary directory +$tempdirectory = "$pwd\temp" +# define services to patch +$components = "Api","Identity" + +# delete old directories / files if applicable +if (Test-Path "$tempdirectory" -PathType Container) { + Remove-Item "$tempdirectory" -Recurse -Force +} + +if (Test-Path -Path "$pwd\src\licenseGen\Core.dll" -PathType Leaf) { + Remove-Item "$pwd\src\licenseGen\Core.dll" -Force +} + +if (Test-Path -Path "$pwd\src\licenseGen\cert.pfx" -PathType Leaf) { + Remove-Item "$pwd\src\licenseGen\cert.pfx" -Force +} + +if (Test-Path -Path "$pwd\src\bitBetter\cert.cer" -PathType Leaf) { + Remove-Item "$pwd\src\bitBetter\cert.cer" -Force +} + +if (Test-Path "$pwd\.keys\cert.cert" -PathType Leaf) { + Rename-Item -Path "$pwd\.keys\cert.cert" -NewName "$pwd\.keys\cert.cer" +} + +# generate keys if none are available +if (!(Test-Path "$pwd\.keys" -PathType Container)) { + .\generateKeys.ps1 +} + +# copy the key to bitBetter +Copy-Item "$pwd\.keys\cert.cer" -Destination "$pwd\src\bitBetter" + +# build bitBetter and clean the source directory after +docker build --no-cache -t bitbetter/bitbetter "$pwd\src\bitBetter" +Remove-Item "$pwd\src\bitBetter\cert.cer" -Force + +# gather all running instances, cannot run a wildcard filter on Ancestor= :(, does find all where name = *bitwarden* +$oldinstances = docker container ps --all -f Name=bitwarden --format '{{.ID}}' + +# stop and remove all running instances +foreach ($instance in $oldinstances) { + docker stop $instance + docker rm $instance +} + +# update bitwarden itself +if ($args[0] -eq 'update') { + docker pull ghcr.io/bitwarden/lite:beta +} else { + $confirmation = Read-Host "Update (or get) bitwarden source container (y/n)" + if ($confirmation -eq 'y') { + docker pull ghcr.io/bitwarden/lite:beta + } +} + +# stop and remove previous existing patch(ed) container +$oldinstances = docker container ps --all -f Ancestor=bitwarden-patched --format '{{.ID}}' +foreach ($instance in $oldinstances) { + docker stop $instance + docker rm $instance +} +$oldinstances = docker image ls bitwarden-patched --format '{{.ID}}' +foreach ($instance in $oldinstances) { + docker image rm $instance +} + +# remove old extract containers +$oldinstances = docker container ps --all -f Name=bitwarden-extract --format '{{.ID}}' +foreach ($instance in $oldinstances) { + docker stop $instance + docker rm $instance +} + +# start a new bitwarden instance so we can patch it +$patchinstance = docker run -d --name bitwarden-extract ghcr.io/bitwarden/lite:beta + +# create our temporary directory +New-item -ItemType Directory -Path $tempdirectory + +# extract the files that need to be patched from the services that need to be patched into our temporary directory +foreach ($component in $components) { + New-item -itemtype Directory -path "$tempdirectory\$component" + docker cp $patchinstance`:/app/$component/Core.dll "$tempdirectory\$component\Core.dll" +} + +# stop and remove our temporary container +docker stop bitwarden-extract +docker rm bitwarden-extract + +# run bitBetter, this applies our patches to the required files +docker run -v "$tempdirectory`:/app/mount" --rm bitbetter/bitbetter + +# create a new image with the patched files +docker build . --tag bitwarden-patched --file "$pwd\src\bitBetter\Dockerfile-bitwarden-patch" + +# start all user requested instances +if (Test-Path -Path "$pwd\.servers\serverlist.txt" -PathType Leaf) { + foreach($line in Get-Content "$pwd\.servers\serverlist.txt") { + if (!($line.StartsWith("#"))) { + Invoke-Expression "& $line" + } + } +} + +# remove our bitBetter image +docker image rm bitbetter/bitbetter + +# copy our patched library to the licenseGen source directory +Copy-Item "$tempdirectory\Identity\Core.dll" -Destination "$pwd\src\licenseGen" +Copy-Item "$pwd\.keys\cert.pfx" -Destination "$pwd\src\licenseGen" + +# build the licenseGen +docker build -t bitbetter/licensegen "$pwd\src\licenseGen" + +# clean the licenseGen source directory +Remove-Item "$pwd\src\licenseGen\Core.dll" -Force +Remove-Item "$pwd\src\licenseGen\cert.pfx" -Force + +# remove our temporary directory +Remove-Item "$tempdirectory" -Recurse -Force diff --git a/build.sh b/build.sh index 0b7938d..1ffa7ee 100755 --- a/build.sh +++ b/build.sh @@ -54,11 +54,11 @@ done # update bitwarden itself if [ "$1" = "update" ]; then - docker pull ghcr.io/bitwarden/self-host:beta + docker pull ghcr.io/bitwarden/lite:beta else read -p "Update (or get) bitwarden source container (y/n): " if [[ $REPLY =~ ^[Yy]$ ]]; then - docker pull ghcr.io/bitwarden/self-host:beta + docker pull ghcr.io/bitwarden/lite:beta fi fi @@ -81,7 +81,7 @@ for INSTANCE in ${OLDINSTANCES[@]}; do done # start a new bitwarden instance so we can patch it -PATCHINSTANCE=$(docker run -d --name bitwarden-extract ghcr.io/bitwarden/self-host:beta) +PATCHINSTANCE=$(docker run -d --name bitwarden-extract ghcr.io/bitwarden/lite:beta) # create our temporary directory mkdir $TEMPDIRECTORY @@ -128,4 +128,4 @@ rm -f "$PWD/src/licenseGen/Core.dll" rm -f "$PWD/src/licenseGen/cert.pfx" # remove our temporary directory -rm -rf "$TEMPDIRECTORY" \ No newline at end of file +rm -rf "$TEMPDIRECTORY" diff --git a/src/bitBetter/Dockerfile-bitwarden-patch b/src/bitBetter/Dockerfile-bitwarden-patch index c14b2b3..bfb44fa 100644 --- a/src/bitBetter/Dockerfile-bitwarden-patch +++ b/src/bitBetter/Dockerfile-bitwarden-patch @@ -1,3 +1,3 @@ -FROM ghcr.io/bitwarden/self-host:beta - -COPY ./temp/ /app/ \ No newline at end of file +FROM ghcr.io/bitwarden/lite:beta + +COPY ./temp/ /app/ From a6a5a3a7dfe50a412b5fd533ef5934fe7126eaa9 Mon Sep 17 00:00:00 2001 From: Jackson K Date: Sat, 29 Nov 2025 16:19:53 +1300 Subject: [PATCH 2/5] Edit README to reflect rename --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f147d80..31da987 100644 --- a/README.md +++ b/README.md @@ -63,14 +63,14 @@ The scripts supports running and patching multi instances. Edit the .servers/serverlist.txt file and fill in the missing values, they can be replaced with existing installation values. This file may be empty, but there will be no containers will be spun up automatically. -Now it is time to **run the main build script** to generate a modified version of the `ghcr.io/bitwarden/self-host` docker image and the license generator. +Now it is time to **run the main build script** to generate a modified version of the `ghcr.io/bitwarden/lite` docker image and the license generator. From the BitBetter directory, simply run: ``` ./build.[sh|ps1] ``` -This will create a new self-signed certificate in the `.keys` directory if one does not already exist and then create a modified version of the official `ghcr.io/bitwarden/self-host` image called `bitwarden-patched`. +This will create a new self-signed certificate in the `.keys` directory if one does not already exist and then create a modified version of the official `ghcr.io/bitwarden/lite` image called `bitwarden-patched`. Afterwards it will automatically generate the license generator and start all previously specified containers which are **now ready to accept self-issued licenses.** @@ -100,7 +100,7 @@ If you ran the build script, you can **simply run the license gen in interactive ## Migrating from mssql to a real database -Prepare a new database and bwdata directory, download and prepare the new settings.env (https://raw.githubusercontent.com/bitwarden/self-host/refs/heads/main/docker-unified/settings.env) +Prepare a new database and bwdata directory, download and prepare the new settings.env (https://raw.githubusercontent.com/bitwarden/self-host/refs/heads/main/bitwarden-lite/settings.env) Make sure you can get the data from either the backup file or by connecting directly to the mssql database (navicat has a trial). @@ -160,4 +160,4 @@ Require a recreation of the docker container, build.sh will suffice too. 1This tool builds on top of the `bitbetter/api` container image so make sure you've built that above using the root `./build.sh` script. -2 If you wish to change this you'll need to change the value that `licenseGen/Program.cs` uses for its `GenerateUserLicense` and `GenerateOrgLicense` calls. Remember, this is really unnecessary as this certificate does not represent any type of security-related certificate. \ No newline at end of file +2 If you wish to change this you'll need to change the value that `licenseGen/Program.cs` uses for its `GenerateUserLicense` and `GenerateOrgLicense` calls. Remember, this is really unnecessary as this certificate does not represent any type of security-related certificate. From 3ac8aed47f1c41a2478f40680ad9a057f4997f58 Mon Sep 17 00:00:00 2001 From: Jackson K Date: Sat, 6 Dec 2025 07:05:38 +1300 Subject: [PATCH 3/5] Change build.ps1 and Dockerfile-bitwarden-patched to CRLF --- .DS_Store | Bin 0 -> 8196 bytes build.ps1 | 256 +++++++++++------------ licenseGen.ps1 | 34 +-- src/bitBetter/Dockerfile-bitwarden-patch | 6 +- 4 files changed, 148 insertions(+), 148 deletions(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..15a00caa34dafdfc34db977996b6349fc74b6c6f GIT binary patch literal 8196 zcmeHM&u<(x6n;(uooPrjX_FEvkVf50rA8rbLlHu#+ij|{R47q4DoKAWGqcWS=)_*l z%w|cWNPBK24jegfv5f1|}aYgAP1 zQ{Nt#p)zyDV49BYKDi@S4fZu^IxtNKW=3Y_hQie7$n%vuu&PE|S_P~E!wS&d-GzC& zvqM_Ezso30WQeU4P&Lf+f2o8Ph5J0Tk&)Mv1Aaf3{7w%1(6%QqIM_b{e;qH#ak$uNUl%rZ<^I zsZ5d;nZ=APGXAEQ^}V zbGc2P)Eh2jCFRtU8oSX6qFA&m*Z$CQR;nul<{3T-j?v3hug< z>TT2Hz(u$YUqA!4pa_(P)uZ4^cJDO_2M+Yilvg8!DX4jox- z7)9>H5!|6s8EqX!rVFcZ6QAi4e2F*@+t4bhM5-1Uqc}UkR7oCDW=C3hRBEP;yMZtnxs9s&i j5nugbh_-Lqss{TSu?5rr{vn|7&SKAh^$2Y71}gA3#sH5l literal 0 HcmV?d00001 diff --git a/build.ps1 b/build.ps1 index 64b9de7..a43d971 100644 --- a/build.ps1 +++ b/build.ps1 @@ -1,128 +1,128 @@ -$ErrorActionPreference = 'Stop' -$PSNativeCommandUseErrorActionPreference = $true - -# detect buildx, ErrorActionPreference will ensure the script stops execution if not found -docker buildx version - -# define temporary directory -$tempdirectory = "$pwd\temp" -# define services to patch -$components = "Api","Identity" - -# delete old directories / files if applicable -if (Test-Path "$tempdirectory" -PathType Container) { - Remove-Item "$tempdirectory" -Recurse -Force -} - -if (Test-Path -Path "$pwd\src\licenseGen\Core.dll" -PathType Leaf) { - Remove-Item "$pwd\src\licenseGen\Core.dll" -Force -} - -if (Test-Path -Path "$pwd\src\licenseGen\cert.pfx" -PathType Leaf) { - Remove-Item "$pwd\src\licenseGen\cert.pfx" -Force -} - -if (Test-Path -Path "$pwd\src\bitBetter\cert.cer" -PathType Leaf) { - Remove-Item "$pwd\src\bitBetter\cert.cer" -Force -} - -if (Test-Path "$pwd\.keys\cert.cert" -PathType Leaf) { - Rename-Item -Path "$pwd\.keys\cert.cert" -NewName "$pwd\.keys\cert.cer" -} - -# generate keys if none are available -if (!(Test-Path "$pwd\.keys" -PathType Container)) { - .\generateKeys.ps1 -} - -# copy the key to bitBetter -Copy-Item "$pwd\.keys\cert.cer" -Destination "$pwd\src\bitBetter" - -# build bitBetter and clean the source directory after -docker build --no-cache -t bitbetter/bitbetter "$pwd\src\bitBetter" -Remove-Item "$pwd\src\bitBetter\cert.cer" -Force - -# gather all running instances, cannot run a wildcard filter on Ancestor= :(, does find all where name = *bitwarden* -$oldinstances = docker container ps --all -f Name=bitwarden --format '{{.ID}}' - -# stop and remove all running instances -foreach ($instance in $oldinstances) { - docker stop $instance - docker rm $instance -} - -# update bitwarden itself -if ($args[0] -eq 'update') { - docker pull ghcr.io/bitwarden/lite:beta -} else { - $confirmation = Read-Host "Update (or get) bitwarden source container (y/n)" - if ($confirmation -eq 'y') { - docker pull ghcr.io/bitwarden/lite:beta - } -} - -# stop and remove previous existing patch(ed) container -$oldinstances = docker container ps --all -f Ancestor=bitwarden-patched --format '{{.ID}}' -foreach ($instance in $oldinstances) { - docker stop $instance - docker rm $instance -} -$oldinstances = docker image ls bitwarden-patched --format '{{.ID}}' -foreach ($instance in $oldinstances) { - docker image rm $instance -} - -# remove old extract containers -$oldinstances = docker container ps --all -f Name=bitwarden-extract --format '{{.ID}}' -foreach ($instance in $oldinstances) { - docker stop $instance - docker rm $instance -} - -# start a new bitwarden instance so we can patch it -$patchinstance = docker run -d --name bitwarden-extract ghcr.io/bitwarden/lite:beta - -# create our temporary directory -New-item -ItemType Directory -Path $tempdirectory - -# extract the files that need to be patched from the services that need to be patched into our temporary directory -foreach ($component in $components) { - New-item -itemtype Directory -path "$tempdirectory\$component" - docker cp $patchinstance`:/app/$component/Core.dll "$tempdirectory\$component\Core.dll" -} - -# stop and remove our temporary container -docker stop bitwarden-extract -docker rm bitwarden-extract - -# run bitBetter, this applies our patches to the required files -docker run -v "$tempdirectory`:/app/mount" --rm bitbetter/bitbetter - -# create a new image with the patched files -docker build . --tag bitwarden-patched --file "$pwd\src\bitBetter\Dockerfile-bitwarden-patch" - -# start all user requested instances -if (Test-Path -Path "$pwd\.servers\serverlist.txt" -PathType Leaf) { - foreach($line in Get-Content "$pwd\.servers\serverlist.txt") { - if (!($line.StartsWith("#"))) { - Invoke-Expression "& $line" - } - } -} - -# remove our bitBetter image -docker image rm bitbetter/bitbetter - -# copy our patched library to the licenseGen source directory -Copy-Item "$tempdirectory\Identity\Core.dll" -Destination "$pwd\src\licenseGen" -Copy-Item "$pwd\.keys\cert.pfx" -Destination "$pwd\src\licenseGen" - -# build the licenseGen -docker build -t bitbetter/licensegen "$pwd\src\licenseGen" - -# clean the licenseGen source directory -Remove-Item "$pwd\src\licenseGen\Core.dll" -Force -Remove-Item "$pwd\src\licenseGen\cert.pfx" -Force - -# remove our temporary directory -Remove-Item "$tempdirectory" -Recurse -Force +$ErrorActionPreference = 'Stop' +$PSNativeCommandUseErrorActionPreference = $true + +# detect buildx, ErrorActionPreference will ensure the script stops execution if not found +docker buildx version + +# define temporary directory +$tempdirectory = "$pwd\temp" +# define services to patch +$components = "Api","Identity" + +# delete old directories / files if applicable +if (Test-Path "$tempdirectory" -PathType Container) { + Remove-Item "$tempdirectory" -Recurse -Force +} + +if (Test-Path -Path "$pwd\src\licenseGen\Core.dll" -PathType Leaf) { + Remove-Item "$pwd\src\licenseGen\Core.dll" -Force +} + +if (Test-Path -Path "$pwd\src\licenseGen\cert.pfx" -PathType Leaf) { + Remove-Item "$pwd\src\licenseGen\cert.pfx" -Force +} + +if (Test-Path -Path "$pwd\src\bitBetter\cert.cer" -PathType Leaf) { + Remove-Item "$pwd\src\bitBetter\cert.cer" -Force +} + +if (Test-Path "$pwd\.keys\cert.cert" -PathType Leaf) { + Rename-Item -Path "$pwd\.keys\cert.cert" -NewName "$pwd\.keys\cert.cer" +} + +# generate keys if none are available +if (!(Test-Path "$pwd\.keys" -PathType Container)) { + .\generateKeys.ps1 +} + +# copy the key to bitBetter +Copy-Item "$pwd\.keys\cert.cer" -Destination "$pwd\src\bitBetter" + +# build bitBetter and clean the source directory after +docker build --no-cache -t bitbetter/bitbetter "$pwd\src\bitBetter" +Remove-Item "$pwd\src\bitBetter\cert.cer" -Force + +# gather all running instances, cannot run a wildcard filter on Ancestor= :(, does find all where name = *bitwarden* +$oldinstances = docker container ps --all -f Name=bitwarden --format '{{.ID}}' + +# stop and remove all running instances +foreach ($instance in $oldinstances) { + docker stop $instance + docker rm $instance +} + +# update bitwarden itself +if ($args[0] -eq 'update') { + docker pull ghcr.io/bitwarden/lite:beta +} else { + $confirmation = Read-Host "Update (or get) bitwarden source container (y/n)" + if ($confirmation -eq 'y') { + docker pull ghcr.io/bitwarden/lite:beta + } +} + +# stop and remove previous existing patch(ed) container +$oldinstances = docker container ps --all -f Ancestor=bitwarden-patched --format '{{.ID}}' +foreach ($instance in $oldinstances) { + docker stop $instance + docker rm $instance +} +$oldinstances = docker image ls bitwarden-patched --format '{{.ID}}' +foreach ($instance in $oldinstances) { + docker image rm $instance +} + +# remove old extract containers +$oldinstances = docker container ps --all -f Name=bitwarden-extract --format '{{.ID}}' +foreach ($instance in $oldinstances) { + docker stop $instance + docker rm $instance +} + +# start a new bitwarden instance so we can patch it +$patchinstance = docker run -d --name bitwarden-extract ghcr.io/bitwarden/lite:beta + +# create our temporary directory +New-item -ItemType Directory -Path $tempdirectory + +# extract the files that need to be patched from the services that need to be patched into our temporary directory +foreach ($component in $components) { + New-item -itemtype Directory -path "$tempdirectory\$component" + docker cp $patchinstance`:/app/$component/Core.dll "$tempdirectory\$component\Core.dll" +} + +# stop and remove our temporary container +docker stop bitwarden-extract +docker rm bitwarden-extract + +# run bitBetter, this applies our patches to the required files +docker run -v "$tempdirectory`:/app/mount" --rm bitbetter/bitbetter + +# create a new image with the patched files +docker build . --tag bitwarden-patched --file "$pwd\src\bitBetter\Dockerfile-bitwarden-patch" + +# start all user requested instances +if (Test-Path -Path "$pwd\.servers\serverlist.txt" -PathType Leaf) { + foreach($line in Get-Content "$pwd\.servers\serverlist.txt") { + if (!($line.StartsWith("#"))) { + Invoke-Expression "& $line" + } + } +} + +# remove our bitBetter image +docker image rm bitbetter/bitbetter + +# copy our patched library to the licenseGen source directory +Copy-Item "$tempdirectory\Identity\Core.dll" -Destination "$pwd\src\licenseGen" +Copy-Item "$pwd\.keys\cert.pfx" -Destination "$pwd\src\licenseGen" + +# build the licenseGen +docker build -t bitbetter/licensegen "$pwd\src\licenseGen" + +# clean the licenseGen source directory +Remove-Item "$pwd\src\licenseGen\Core.dll" -Force +Remove-Item "$pwd\src\licenseGen\cert.pfx" -Force + +# remove our temporary directory +Remove-Item "$tempdirectory" -Recurse -Force diff --git a/licenseGen.ps1 b/licenseGen.ps1 index 7b69b43..c9477b2 100644 --- a/licenseGen.ps1 +++ b/licenseGen.ps1 @@ -1,17 +1,17 @@ -$ErrorActionPreference = 'Stop' -$PSNativeCommandUseErrorActionPreference = $true - -if ($($args.Count) -lt 1) { - echo "USAGE: [License Gen args...]" - echo "ACTIONS:" - echo " interactive" - echo " user" - echo " org" - Exit 1 -} - -if ($args[0] -eq "interactive") { - docker run -it --rm bitbetter/licensegen interactive -} else { - docker run bitbetter/licensegen $args -} +$ErrorActionPreference = 'Stop' +$PSNativeCommandUseErrorActionPreference = $true + +if ($($args.Count) -lt 1) { + echo "USAGE: [License Gen args...]" + echo "ACTIONS:" + echo " interactive" + echo " user" + echo " org" + Exit 1 +} + +if ($args[0] -eq "interactive") { + docker run -it --rm bitbetter/licensegen interactive +} else { + docker run bitbetter/licensegen $args +} diff --git a/src/bitBetter/Dockerfile-bitwarden-patch b/src/bitBetter/Dockerfile-bitwarden-patch index bfb44fa..deb72bb 100644 --- a/src/bitBetter/Dockerfile-bitwarden-patch +++ b/src/bitBetter/Dockerfile-bitwarden-patch @@ -1,3 +1,3 @@ -FROM ghcr.io/bitwarden/lite:beta - -COPY ./temp/ /app/ +FROM ghcr.io/bitwarden/lite:beta + +COPY ./temp/ /app/ From 9d5ed5eddd749eb119a30913c854d9c8e45bad26 Mon Sep 17 00:00:00 2001 From: Jackson K Date: Sat, 6 Dec 2025 07:07:45 +1300 Subject: [PATCH 4/5] Remove .DS_Store file, and add to .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 56566e8..647e9ad 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ src/bitBetter/.vs/* *.pfx *.cer *.vsidx +.DS_Store From fff2b4294d50f47a68358d95216d9e45ec735c84 Mon Sep 17 00:00:00 2001 From: Jackson K Date: Sat, 6 Dec 2025 07:09:12 +1300 Subject: [PATCH 5/5] Actually remove .DS_Store --- .DS_Store | Bin 8196 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 15a00caa34dafdfc34db977996b6349fc74b6c6f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8196 zcmeHM&u<(x6n;(uooPrjX_FEvkVf50rA8rbLlHu#+ij|{R47q4DoKAWGqcWS=)_*l z%w|cWNPBK24jegfv5f1|}aYgAP1 zQ{Nt#p)zyDV49BYKDi@S4fZu^IxtNKW=3Y_hQie7$n%vuu&PE|S_P~E!wS&d-GzC& zvqM_Ezso30WQeU4P&Lf+f2o8Ph5J0Tk&)Mv1Aaf3{7w%1(6%QqIM_b{e;qH#ak$uNUl%rZ<^I zsZ5d;nZ=APGXAEQ^}V zbGc2P)Eh2jCFRtU8oSX6qFA&m*Z$CQR;nul<{3T-j?v3hug< z>TT2Hz(u$YUqA!4pa_(P)uZ4^cJDO_2M+Yilvg8!DX4jox- z7)9>H5!|6s8EqX!rVFcZ6QAi4e2F*@+t4bhM5-1Uqc}UkR7oCDW=C3hRBEP;yMZtnxs9s&i j5nugbh_-Lqss{TSu?5rr{vn|7&SKAh^$2Y71}gA3#sH5l