mirror of
				https://github.com/jakeswenson/BitBetter.git
				synced 2025-10-31 12:53:25 +00:00 
			
		
		
		
	Upstream patches
This commit is contained in:
		
							parent
							
								
									3d4c10d6f6
								
							
						
					
					
						commit
						a97f6f3e49
					
				|  | @ -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 | ||||||
|  |  | ||||||
							
								
								
									
										3
									
								
								build.sh
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								build.sh
									
									
									
									
									
								
							|  | @ -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 | ||||||
|  |  | ||||||
|  | @ -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" | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -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; } | ||||||
|  |  | ||||||
|  | @ -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:" | ||||||
|  |  | ||||||
|  | @ -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...]" | ||||||
|  |  | ||||||
|  | @ -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); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -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" ] | ||||||
|  | @ -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]))); | ||||||
| 
 | 
 | ||||||
|  | @ -441,6 +440,9 @@ internal class Program | ||||||
| 		Set("UseRiskInsights", true); | 		Set("UseRiskInsights", true); | ||||||
| 		Set("UseOrganizationDomains", true); | 		Set("UseOrganizationDomains", true); | ||||||
| 		Set("UseAdminSponsoredFamilies", true); | 		Set("UseAdminSponsoredFamilies", true); | ||||||
|  | 		Set("UseRiskInsights", true); | ||||||
|  |         Set("UseOrganizationDomains", true); | ||||||
|  |         Set("UseAdminSponsoredFamilies", true); | ||||||
|         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]))); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user