From d2ab098ca553b383fe2f441a5e258a7b26f25ef6 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 3 Nov 2020 14:29:07 -0500 Subject: [PATCH] configure send for self-host --- util/Attachments/entrypoint.sh | 2 +- util/Server/Program.cs | 7 ++++++- util/Setup/EnvironmentFileBuilder.cs | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/util/Attachments/entrypoint.sh b/util/Attachments/entrypoint.sh index 3b5047293..ed39c1fbd 100644 --- a/util/Attachments/entrypoint.sh +++ b/util/Attachments/entrypoint.sh @@ -34,4 +34,4 @@ mkdir -p /etc/bitwarden/core/attachments chown -R $USERNAME:$GROUPNAME /etc/bitwarden exec gosu $USERNAME:$GROUPNAME dotnet /bitwarden_server/Server.dll \ - /contentRoot=/etc/bitwarden/core/attachments /webRoot=. /serveUnknown=true + /webRoot=/etc/bitwarden/core/attachments /serveUnknown=true diff --git a/util/Server/Program.cs b/util/Server/Program.cs index 2dc558861..9a87162c0 100644 --- a/util/Server/Program.cs +++ b/util/Server/Program.cs @@ -1,4 +1,5 @@ -using Microsoft.AspNetCore.Hosting; +using System.IO; +using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; @@ -27,6 +28,10 @@ namespace Bit.Server { builder.UseContentRoot(contentRoot); } + else + { + builder.UseContentRoot(Directory.GetCurrentDirectory()); + } var webRoot = config.GetValue("webRoot"); if (string.IsNullOrWhiteSpace(webRoot)) diff --git a/util/Setup/EnvironmentFileBuilder.cs b/util/Setup/EnvironmentFileBuilder.cs index 233d7c641..6a09fe426 100644 --- a/util/Setup/EnvironmentFileBuilder.cs +++ b/util/Setup/EnvironmentFileBuilder.cs @@ -99,6 +99,8 @@ namespace Bit.Setup ["globalSettings__identityServer__certificatePassword"] = _context.Install?.IdentityCertPassword, ["globalSettings__attachment__baseDirectory"] = $"{_context.OutputDir}/core/attachments", ["globalSettings__attachment__baseUrl"] = $"{_context.Config.Url}/attachments", + ["globalSettings__send__baseDirectory"] = $"{_context.OutputDir}/core/attachments/send", + ["globalSettings__send__baseUrl"] = $"{_context.Config.Url}/attachments/send", ["globalSettings__dataProtection__directory"] = $"{_context.OutputDir}/core/aspnet-dataprotection", ["globalSettings__logDirectory"] = $"{_context.OutputDir}/logs", ["globalSettings__logRollBySizeLimit"] = string.Empty,