Fixed mail template storage access, added docker image default resources
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Net.Mail;
|
|||||||
using Logging.Net;
|
using Logging.Net;
|
||||||
using Moonlight.App.Database.Entities;
|
using Moonlight.App.Database.Entities;
|
||||||
using Moonlight.App.Exceptions;
|
using Moonlight.App.Exceptions;
|
||||||
|
using Moonlight.App.Helpers;
|
||||||
|
|
||||||
namespace Moonlight.App.Services;
|
namespace Moonlight.App.Services;
|
||||||
|
|
||||||
@@ -31,13 +32,13 @@ public class MailService
|
|||||||
Action<Dictionary<string, string>> values
|
Action<Dictionary<string, string>> values
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (!File.Exists($"resources/mail/{name}.html"))
|
if (!File.Exists(PathBuilder.File("storage", "resources", "mail", $"{name}.html")))
|
||||||
{
|
{
|
||||||
Logger.Warn($"Mail template '{name}' not found. Make sure to place one in the resources folder");
|
Logger.Warn($"Mail template '{name}' not found. Make sure to place one in the resources folder");
|
||||||
throw new DisplayException("Mail template not found");
|
throw new DisplayException("Mail template not found");
|
||||||
}
|
}
|
||||||
|
|
||||||
var rawHtml = await File.ReadAllTextAsync($"resources/mail/{name}.html");
|
var rawHtml = await File.ReadAllTextAsync(PathBuilder.File("storage", "resources", "mail", $"{name}.html"));
|
||||||
|
|
||||||
var val = new Dictionary<string, string>();
|
var val = new Dictionary<string, string>();
|
||||||
values.Invoke(val);
|
values.Invoke(val);
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ RUN dotnet publish "Moonlight.csproj" -c Release -o /app/publish
|
|||||||
FROM base AS final
|
FROM base AS final
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=publish /app/publish .
|
COPY --from=publish /app/publish .
|
||||||
RUN mkdir /app/storage
|
RUN mkdir -p /app/storage
|
||||||
RUN rm -r /app/storage/*
|
RUN rm -r /app/storage/*
|
||||||
|
COPY "Moonlight/defaultstorage" "/app/defaultstorage"
|
||||||
ENTRYPOINT ["dotnet", "Moonlight.dll"]
|
ENTRYPOINT ["dotnet", "Moonlight.dll"]
|
||||||
Reference in New Issue
Block a user