mirror of
https://github.com/bitwarden/server.git
synced 2025-07-07 02:52:50 -05:00
Merge branch 'main' into add-docker-arm64-builds
This commit is contained in:
@ -31,10 +31,6 @@ public class Configuration
|
||||
"Learn more: https://docs.docker.com/compose/compose-file/#ports")]
|
||||
public string HttpsPort { get; set; } = "443";
|
||||
|
||||
[Description("Docker compose file version. Leave empty for default.\n" +
|
||||
"Learn more: https://docs.docker.com/compose/compose-file/compose-versioning/")]
|
||||
public string ComposeVersion { get; set; }
|
||||
|
||||
[Description("Configure Nginx for Captcha.")]
|
||||
public bool Captcha { get; set; } = false;
|
||||
|
||||
|
@ -150,6 +150,7 @@ public class Context
|
||||
var configText = File.ReadAllText(ConfigPath);
|
||||
var deserializer = new DeserializerBuilder()
|
||||
.WithNamingConvention(UnderscoredNamingConvention.Instance)
|
||||
.IgnoreUnmatchedProperties()
|
||||
.Build();
|
||||
Config = deserializer.Deserialize<Configuration>(configText);
|
||||
|
||||
|
@ -42,10 +42,6 @@ public class DockerComposeBuilder
|
||||
{
|
||||
public TemplateModel(Context context)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(context.Config.ComposeVersion))
|
||||
{
|
||||
ComposeVersion = context.Config.ComposeVersion;
|
||||
}
|
||||
MssqlDataDockerVolume = context.Config.DatabaseDockerVolume;
|
||||
EnableKeyConnector = context.Config.EnableKeyConnector;
|
||||
EnableScim = context.Config.EnableScim;
|
||||
@ -65,7 +61,6 @@ public class DockerComposeBuilder
|
||||
}
|
||||
}
|
||||
|
||||
public string ComposeVersion { get; set; } = "3";
|
||||
public bool MssqlDataDockerVolume { get; set; }
|
||||
public bool EnableKeyConnector { get; set; }
|
||||
public bool EnableScim { get; set; }
|
||||
|
@ -1,7 +1,7 @@
|
||||
###############################################
|
||||
# Build stage #
|
||||
###############################################
|
||||
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:6.0 AS build
|
||||
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||
|
||||
# Docker buildx supplies the value for this arg
|
||||
ARG TARGETPLATFORM
|
||||
@ -44,16 +44,16 @@ WORKDIR /app
|
||||
###############################################
|
||||
# App stage #
|
||||
###############################################
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:6.0
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:8.0
|
||||
|
||||
ARG TARGETPLATFORM
|
||||
LABEL com.bitwarden.product="bitwarden" com.bitwarden.project="setup"
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
openssl \
|
||||
gosu \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
openssl \
|
||||
gosu \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Copy app from the build stage
|
||||
WORKDIR /app
|
||||
|
@ -17,6 +17,7 @@ public class Program
|
||||
{
|
||||
Args = args
|
||||
};
|
||||
|
||||
ParseParameters();
|
||||
|
||||
if (_context.Parameters.ContainsKey("q"))
|
||||
@ -155,7 +156,7 @@ public class Program
|
||||
|
||||
if (_context.Parameters.ContainsKey("db"))
|
||||
{
|
||||
MigrateDatabase();
|
||||
PrepareAndMigrateDatabase();
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -185,17 +186,19 @@ public class Program
|
||||
Console.WriteLine("\n");
|
||||
}
|
||||
|
||||
private static void MigrateDatabase(int attempt = 1)
|
||||
private static void PrepareAndMigrateDatabase()
|
||||
{
|
||||
var vaultConnectionString = Helpers.GetValueFromEnvFile("global",
|
||||
"globalSettings__sqlServer__connectionString");
|
||||
var migrator = new DbMigrator(vaultConnectionString, null);
|
||||
var migrator = new DbMigrator(vaultConnectionString);
|
||||
|
||||
var log = false;
|
||||
var enableLogging = false;
|
||||
|
||||
migrator.MigrateMsSqlDatabaseWithRetries(log);
|
||||
// execute all general migration scripts (will detect those not yet applied)
|
||||
migrator.MigrateMsSqlDatabaseWithRetries(enableLogging);
|
||||
|
||||
migrator.MigrateMsSqlDatabaseWithRetries(log, true, MigratorConstants.TransitionMigrationsFolderName);
|
||||
// execute explicit transition migration scripts, per EDD
|
||||
migrator.MigrateMsSqlDatabaseWithRetries(enableLogging, true, MigratorConstants.TransitionMigrationsFolderName);
|
||||
}
|
||||
|
||||
private static bool ValidateInstallation()
|
||||
|
@ -10,8 +10,8 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Handlebars.Net" Version="2.1.2" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
|
||||
<PackageReference Include="Handlebars.Net" Version="2.1.6" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
|
||||
<PackageReference Include="YamlDotNet" Version="11.2.1" />
|
||||
</ItemGroup>
|
||||
|
||||
|
@ -13,8 +13,6 @@
|
||||
# ./bwdata/config.yml file for your installation. #
|
||||
#########################################################################
|
||||
|
||||
version: '{{{ComposeVersion}}}'
|
||||
|
||||
services:
|
||||
mssql:
|
||||
image: bitwarden/mssql:{{{CoreVersion}}}
|
||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user