Fixes for newer containers (#280)

* Find the new file

Next extract Core.dll, patch, reinsert

* Prepare Linux script too

* Extract and patch Core.dll again

* Make build script dynamic

* Cleanup after ourselves

* Build, then delete file

* Attempt to deconstruct the new file

* Add missing quotes

* Add missing file

* Rectify dll location

* Fix dumb extra character matching

* Dynamically find LicensingService and improve error reporting

* Upgrade package

* Implement new code

* Filter out new lines

* Force the runtime config

* Use correct external .NET library

* Update to .NET 10 in build.sh

Copy .NET 10 runtime from aspnet10.0-alpine3.23 to the bitwarden-lite container

* Update to .NET 10 in build.ps1

Copy .NET 10 runtime from aspnet:10.0-alpine3.23 to bitwarden-lite container

* Update generateKeys.sh to OpenSSL 3.x-compatible

Update to OpenSSL 3.x-compatible cipher generation

* Update generateKeys.ps1 to OpenSSL 3.x-compatible

Update to OpenSSL 3.x-compatible cipher

* Update bitBetter Dockerfile to .NET 10

* Update bitBetter.csproj to .NET 10

* Switch to X509CertificateLoader, switch to patching multiple thumbprint certificates

Update Program.cs in bitBetter to switch from deprecated X509Certificate to X509CertificateLoader
Patch multiple thumbprint certificate instances

* Update licenseGen Dockerfile to .NET 10

* Update licenseGen.csproj to .NET 10

* Remove extra line

* Get rid of extra line

* Update deprecated X509Certificate2 in LicenseGen

* Cleanup

* Fix tabbing

---------

Co-authored-by: Michiel Hazelhof <m.hazelhof@fyn.nl>
Co-authored-by: huntb4646 <94577767+huntb4646@users.noreply.github.com>
This commit is contained in:
Michiel Hazelhof
2026-06-05 20:09:27 +02:00
committed by GitHub
parent d305a3f202
commit 287b6a4d34
11 changed files with 287 additions and 64 deletions

View File

@@ -93,7 +93,8 @@ mkdir $TEMPDIRECTORY
# extract the files that need to be patched from the services that need to be patched into our temporary directory
for COMPONENT in ${COMPONENTS[@]}; do
mkdir "$TEMPDIRECTORY/$COMPONENT"
docker cp $PATCHINSTANCE:/app/$COMPONENT/Core.dll "$TEMPDIRECTORY/$COMPONENT/Core.dll"
docker cp $PATCHINSTANCE:/app/$COMPONENT/$COMPONENT "$TEMPDIRECTORY/$COMPONENT/$COMPONENT"
docker cp $PATCHINSTANCE:/etc/supervisor.d/${COMPONENT,,}.ini "$TEMPDIRECTORY/${COMPONENT,,}.ini"
done
# stop and remove our temporary container
@@ -104,14 +105,27 @@ docker rm bitwarden-extract
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"
if [ -f "$PWD/Dockerfile-bitwarden-patch" ]; then
rm -f "$PWD/Dockerfile-bitwarden-patch"
fi
echo "FROM mcr.microsoft.com/dotnet/aspnet:10.0-alpine3.23" >> "$PWD/Dockerfile-bitwarden-patch"
echo "FROM ghcr.io/bitwarden/lite:latest" >> "$PWD/Dockerfile-bitwarden-patch"
echo "COPY --from=0 /usr/share/dotnet /usr/share/dotnet" >> "$PWD/Dockerfile-bitwarden-patch"
for COMPONENT in ${COMPONENTS[@]}; do
echo "" >> "$PWD/Dockerfile-bitwarden-patch"
echo "RUN rm -f /app/$COMPONENT/$COMPONENT" >> "$PWD/Dockerfile-bitwarden-patch"
echo "COPY ./temp/${COMPONENT,,}.ini /etc/supervisor.d/${COMPONENT,,}.ini" >> "$PWD/Dockerfile-bitwarden-patch"
echo "COPY ./temp/$COMPONENT/ /app/$COMPONENT/" >> "$PWD/Dockerfile-bitwarden-patch"
done
docker build . --tag bitwarden-patched --file "$PWD/Dockerfile-bitwarden-patch"
rm -f "$PWD/Dockerfile-bitwarden-patch"
# start all user requested instances
if [ -f "$PWD/.servers/serverlist.txt" ]; then
# convert line endings to unix
sed -i 's/\r$//' "$PWD/.servers/serverlist.txt"
cat "$PWD/.servers/serverlist.txt" | while read -r LINE; do
if [[ $LINE != "#"* ]]; then
if [[ $LINE != "#"* && -n $LINE ]]; then
bash -c "$LINE"
fi
done