mirror of
https://github.com/jakeswenson/BitBetter.git
synced 2025-12-17 19:56:18 +00:00
Update and fix unified branch (#257)
* Upstream patches * Fix license generator according to upstream changes (#245) (#249) * Test generating user and organization licenses during build check (#252) * Fix ps1 script and update language * Update class path * Cleanup code * Cleanup code * Cleanup code * Refactor and fixes * Copy all files * Copy files only when needed * Make call consistent * Simplify call * Clarify language * Reuse code * Cleanup * Cleanup * Remove NewtonSoft.Json * Upgrade dnlib * Cleanup * Fix path issue * Fix comparator * Cleanup circleci * Fix type * Fix circleci * Properly detect previous version * Add missing parameter * Better detect running patched containers * Improve naming * Fix line endings * Fix typo * Add comment * Fix tabs * Cleanup org license * Use proper file extension * Add missing file * Migrate cert.cert if exists * Check for the correct file * Fix character check * Add comment * Add more documentation * Add proper line endings * Add potentially correct line * Add auto restart * Update comment * Improve consistency between bash and powerhell * Update documentation * Detect buildx * Fix spelling mistake * Fix check order and improve verbosity
This commit is contained in:
@@ -2,7 +2,7 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||
WORKDIR /bitBetter
|
||||
|
||||
COPY . /bitBetter
|
||||
COPY cert.cert /app/
|
||||
COPY cert.cer /app/
|
||||
|
||||
RUN dotnet restore
|
||||
RUN dotnet publish -c Release -o /app --no-restore
|
||||
@@ -11,4 +11,4 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0
|
||||
WORKDIR /app
|
||||
COPY --from=build /app .
|
||||
|
||||
ENTRYPOINT [ "/app/bitBetter" ]
|
||||
ENTRYPOINT ["dotnet", "/app/bitBetter.dll"]
|
||||
@@ -1,4 +1,3 @@
|
||||
FROM ghcr.io/bitwarden/self-host:beta
|
||||
|
||||
COPY ./temp/Api/Core.dll /app/Api/Core.dll
|
||||
COPY ./temp/Identity/Core.dll /app/Identity/Core.dll
|
||||
COPY ./temp/ /app/
|
||||
@@ -14,7 +14,7 @@ internal class Program
|
||||
{
|
||||
private static Int32 Main()
|
||||
{
|
||||
const String certFile = "/app/cert.cert";
|
||||
const String certFile = "/app/cert.cer";
|
||||
String[] files = Directory.GetFiles("/app/mount", "Core.dll", SearchOption.AllDirectories);
|
||||
|
||||
foreach (String file in files)
|
||||
@@ -23,12 +23,7 @@ internal class Program
|
||||
ModuleDefMD moduleDefMd = ModuleDefMD.Load(file);
|
||||
Byte[] cert = File.ReadAllBytes(certFile);
|
||||
|
||||
EmbeddedResource embeddedResourceToRemove = moduleDefMd.Resources
|
||||
.OfType<EmbeddedResource>()
|
||||
.First(r => r.Name.Equals("Bit.Core.licensing.cer"));
|
||||
|
||||
Console.WriteLine(embeddedResourceToRemove.Name);
|
||||
|
||||
EmbeddedResource embeddedResourceToRemove = moduleDefMd.Resources.OfType<EmbeddedResource>().First(r => r.Name.Equals("Bit.Core.licensing.cer"));
|
||||
EmbeddedResource embeddedResourceToAdd = new("Bit.Core.licensing.cer", cert) { Attributes = embeddedResourceToRemove.Attributes };
|
||||
moduleDefMd.Resources.Add(embeddedResourceToAdd);
|
||||
moduleDefMd.Resources.Remove(embeddedResourceToRemove);
|
||||
@@ -45,10 +40,7 @@ internal class Program
|
||||
TypeDef type = services.First(t => t.Name == "LicensingService");
|
||||
MethodDef constructor = type.FindConstructors().First();
|
||||
|
||||
Instruction instructionToPatch =
|
||||
constructor.Body.Instructions
|
||||
.FirstOrDefault(i => i.OpCode == OpCodes.Ldstr
|
||||
&& String.Equals((String)i.Operand, existingCert.Thumbprint, StringComparison.InvariantCultureIgnoreCase));
|
||||
Instruction instructionToPatch = constructor.Body.Instructions.FirstOrDefault(i => i.OpCode == OpCodes.Ldstr && String.Equals((String)i.Operand, existingCert.Thumbprint, StringComparison.InvariantCultureIgnoreCase));
|
||||
|
||||
if (instructionToPatch != null)
|
||||
{
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="dnlib" Version="4.4.0" />
|
||||
<PackageReference Include="dnlib" Version="4.5.0" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user