Upstream patches

This commit is contained in:
Michiel Hazelhof 2025-07-15 10:52:18 +02:00
parent 3d4c10d6f6
commit a97f6f3e49
No known key found for this signature in database
GPG Key ID: EECB9B96355B5EBF
9 changed files with 21 additions and 7 deletions

View File

@ -1,3 +1,6 @@
$ErrorActionPreference = 'Stop'
$PSNativeCommandUseErrorActionPreference = $true
# define temporary directory # define temporary directory
$tempdirectory = "$pwd\temp" $tempdirectory = "$pwd\temp"
# define services to patch # define services to patch
@ -30,7 +33,7 @@ Copy-Item "$pwd\.keys\cert.cert" -Destination "$pwd\src\bitBetter"
Copy-Item "$pwd\.keys\cert.pfx" -Destination "$pwd\src\licenseGen" Copy-Item "$pwd\.keys\cert.pfx" -Destination "$pwd\src\licenseGen"
# build bitBetter and clean the source directory after # build bitBetter and clean the source directory after
docker build -t bitbetter/bitbetter "$pwd\src\bitBetter" docker build --no-cache -t bitbetter/bitbetter "$pwd\src\bitBetter"
Remove-Item "$pwd\src\bitBetter\cert.cert" -Force Remove-Item "$pwd\src\bitBetter\cert.cert" -Force
# gather all running instances # gather all running instances

View File

@ -1,4 +1,5 @@
#!/bin/bash #!/bin/bash
set -e
# define temporary directory # define temporary directory
TEMPDIRECTORY="$PWD/temp" TEMPDIRECTORY="$PWD/temp"
@ -33,7 +34,7 @@ cp -f "$PWD/.keys/cert.cert" "$PWD/src/bitBetter"
cp -f "$PWD/.keys/cert.pfx" "$PWD/src/licenseGen" cp -f "$PWD/.keys/cert.pfx" "$PWD/src/licenseGen"
# build bitBetter and clean the source directory after # build bitBetter and clean the source directory after
docker build -t bitbetter/bitbetter "$PWD/src/bitBetter" docker build --no-cache -t bitbetter/bitbetter "$PWD/src/bitBetter"
rm -f "$PWD/src/bitBetter/cert.cert" rm -f "$PWD/src/bitBetter/cert.cert"
# gather all running instances # gather all running instances

View File

@ -1,3 +1,6 @@
$ErrorActionPreference = 'Stop'
$PSNativeCommandUseErrorActionPreference = $true
# get the basic openssl binary path # get the basic openssl binary path
$opensslbinary = "$Env:Programfiles\OpenSSL-Win64\bin\openssl.exe" $opensslbinary = "$Env:Programfiles\OpenSSL-Win64\bin\openssl.exe"

View File

@ -1,4 +1,5 @@
#!/bin/bash #!/bin/bash
set -e
# Check for openssl # Check for openssl
command -v openssl >/dev/null 2>&1 || { echo >&2 "openssl required but not found. Aborting."; exit 1; } command -v openssl >/dev/null 2>&1 || { echo >&2 "openssl required but not found. Aborting."; exit 1; }

View File

@ -1,3 +1,6 @@
$ErrorActionPreference = 'Stop'
$PSNativeCommandUseErrorActionPreference = $true
if ($($args.Count) -lt 1) { if ($($args.Count) -lt 1) {
echo "USAGE: <License Gen action> [License Gen args...]" echo "USAGE: <License Gen action> [License Gen args...]"
echo "ACTIONS:" echo "ACTIONS:"

View File

@ -1,4 +1,5 @@
#!/bin/bash #!/bin/bash
set -e
if [ $# -lt 1 ]; then if [ $# -lt 1 ]; then
echo "USAGE: <License Gen action> [License Gen args...]" echo "USAGE: <License Gen action> [License Gen args...]"

View File

@ -29,7 +29,7 @@ internal class Program
Console.WriteLine(embeddedResourceToRemove.Name); Console.WriteLine(embeddedResourceToRemove.Name);
EmbeddedResource embeddedResourceToAdd = new("Bit.Core.licensing.cer", cert) {Attributes = embeddedResourceToRemove.Attributes }; EmbeddedResource embeddedResourceToAdd = new("Bit.Core.licensing.cer", cert) { Attributes = embeddedResourceToRemove.Attributes };
moduleDefMd.Resources.Add(embeddedResourceToAdd); moduleDefMd.Resources.Add(embeddedResourceToAdd);
moduleDefMd.Resources.Remove(embeddedResourceToRemove); moduleDefMd.Resources.Remove(embeddedResourceToRemove);

View File

@ -12,4 +12,4 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0
WORKDIR /app WORKDIR /app
COPY --from=build /app . COPY --from=build /app .
ENTRYPOINT [ "dotnet", "/app/licenseGen.dll", "--core", "/app/Core.dll", "--cert", "/app/cert.pfx" ] ENTRYPOINT [ "dotnet", "/app/licenseGen.dll", "--core", "/app/Core.dll", "--executable", "/app/Api", "--cert", "/app/cert.pfx" ]

View File

@ -377,7 +377,6 @@ internal class Program
Set("Expires", DateTime.UtcNow.AddYears(100)); Set("Expires", DateTime.UtcNow.AddYears(100));
Set("Trial", false); Set("Trial", false);
Set("LicenseType", Enum.Parse(licenseTypeEnum, "User")); Set("LicenseType", Enum.Parse(licenseTypeEnum, "User"));
Set("Hash", Convert.ToBase64String((Byte[])type.GetMethod("ComputeHash").Invoke(license, []))); Set("Hash", Convert.ToBase64String((Byte[])type.GetMethod("ComputeHash").Invoke(license, [])));
Set("Signature", Convert.ToBase64String((Byte[])type.GetMethod("Sign").Invoke(license, [cert]))); Set("Signature", Convert.ToBase64String((Byte[])type.GetMethod("Sign").Invoke(license, [cert])));
@ -437,8 +436,11 @@ internal class Program
Set("Trial", false); Set("Trial", false);
Set("LicenseType", Enum.Parse(licenseTypeEnum, "Organization")); Set("LicenseType", Enum.Parse(licenseTypeEnum, "Organization"));
Set("LimitCollectionCreationDeletion", true); //This will be used in the new version of BitWarden but can be applied now Set("LimitCollectionCreationDeletion", true); //This will be used in the new version of BitWarden but can be applied now
Set("AllowAdminAccessToAllCollectionItems", true); Set("AllowAdminAccessToAllCollectionItems", true);
Set("UseRiskInsights", true); Set("UseRiskInsights", true);
Set("UseOrganizationDomains", true);
Set("UseAdminSponsoredFamilies", true);
Set("UseRiskInsights", true);
Set("UseOrganizationDomains", true); Set("UseOrganizationDomains", true);
Set("UseAdminSponsoredFamilies", true); Set("UseAdminSponsoredFamilies", true);
Set("Hash", Convert.ToBase64String((Byte[])type.GetMethod("ComputeHash").Invoke(license, []))); Set("Hash", Convert.ToBase64String((Byte[])type.GetMethod("ComputeHash").Invoke(license, [])));