-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
150 changed files
with
7,721 additions
and
5,161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
**/.dockerignore | ||
**/.env | ||
**/.git | ||
**/.gitignore | ||
**/.project | ||
**/.settings | ||
**/.toolstarget | ||
**/.vs | ||
**/.vscode | ||
**/.idea | ||
**/*.*proj.user | ||
**/*.dbmdl | ||
**/*.jfm | ||
**/azds.yaml | ||
**/bin | ||
**/charts | ||
**/docker-compose* | ||
**/Dockerfile* | ||
**/node_modules | ||
**/npm-debug.log | ||
**/obj | ||
**/secrets.dev.yaml | ||
**/values.dev.yaml | ||
LICENSE | ||
README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base | ||
USER $APP_UID | ||
WORKDIR /app | ||
|
||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build | ||
ARG BUILD_CONFIGURATION=Release | ||
ARG BUILD_VERSION=1.0.0.0 | ||
WORKDIR /work | ||
COPY ["src/Papercut.Service/Papercut.Service.csproj", "/work/Papercut.Service/"] | ||
COPY ["src/Papercut.Common/Papercut.Common.csproj", "/work/Papercut.Common/"] | ||
COPY ["src/Papercut.Core/Papercut.Core.csproj", "/work/Papercut.Core/"] | ||
COPY ["src/Papercut.Infrastructure.IPComm/Papercut.Infrastructure.IPComm.csproj", "/work/Papercut.Infrastructure.IPComm/"] | ||
COPY ["src/Papercut.Infrastructure.Smtp/Papercut.Infrastructure.Smtp.csproj", "/work/Papercut.Infrastructure.Smtp/"] | ||
COPY ["src/Papercut.Message/Papercut.Message.csproj", "/work/Papercut.Message/"] | ||
COPY ["src/Papercut.Rules/Papercut.Rules.csproj", "/work/Papercut.Rules/"] | ||
RUN dotnet restore "/work/Papercut.Service/Papercut.Service.csproj" | ||
COPY . . | ||
|
||
#RUN sed "s/\(Assembly\(Informational\|File\)Version(\d34[0-9]\+\.[0-9]\+\.[0-9]\+\.\)[0-9]\+/\1$BUILD_VERSION/" src/GlobalAssemblyInfo.cs | ||
|
||
WORKDIR "/work/src/Papercut.Service" | ||
|
||
RUN dotnet build "Papercut.Service.csproj" -c $BUILD_CONFIGURATION -o /app/build | ||
|
||
FROM build AS publish | ||
ARG BUILD_CONFIGURATION=Release | ||
RUN dotnet publish "Papercut.Service.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false | ||
|
||
FROM base AS final | ||
|
||
ARG BUILD_VERSION | ||
ARG BUILD_DATE | ||
ARG VCS_REF | ||
|
||
LABEL org.opencontainers.image.title="Papercut SMTP Service" \ | ||
org.opencontainers.image.description="Papercut SMTP Service is a 2-in-1 quick email viewer AND built-in SMTP server" \ | ||
org.opencontainers.image.version=${BUILD_VERSION} \ | ||
org.opencontainers.image.url="https://www.papercut-smtp.com/" \ | ||
org.opencontainers.image.source="https://github.com/ChangemakerStudios/Papercut-SMTP" \ | ||
org.opencontainers.image.created=${BUILD_DATE} \ | ||
org.opencontainers.image.revision=${VCS_REF} \ | ||
org.opencontainers.image.licenses="Apache License, Version 2.0" | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=publish /app/publish . | ||
|
||
ENV ASPNETCORE_HTTP_PORTS=80 | ||
|
||
# HTTP | ||
EXPOSE 80 | ||
|
||
# SMTP | ||
EXPOSE 25 | ||
|
||
# optional -- should only be used locally: IPComm | ||
# EXPOSE 37403 | ||
|
||
CMD ["dotnet", "Papercut.Service.dll"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
param ( | ||
[string]$BuildVersion | ||
) | ||
|
||
if (-not $BuildVersion) { | ||
Write-Host "You must specify a build version. E.g.: 7.0.1" | ||
exit 1 | ||
} | ||
|
||
$BuildDate = (Get-Date).ToString("yyyy-MM-ddTHH:mm:ssZ") | ||
$VcsRef = (git rev-parse --short HEAD) | ||
|
||
docker build -t "changemakerstudiosus/papercut-smtp:$BuildVersion" . ` | ||
--build-arg BUILD_VERSION=$BuildVersion ` | ||
--build-arg BUILD_DATE=$BuildDate ` | ||
--build-arg VCS_REF=$VcsRef ` | ||
--no-cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
BuildVersion=$1 | ||
if [ -z "$BuildVersion" ]; then | ||
echo "You must specify a build version. E.g.: 7.0.1" | ||
exit 1 | ||
fi | ||
|
||
BuildDate=$(date -u +"%Y-%m-%dT%H:%M:%SZ") | ||
VcsRef=$(git rev-parse --short HEAD) | ||
|
||
docker build -t changemakerstudiosus/papercut-smtp:"$BuildVersion" . \ | ||
--build-arg BUILD_VERSION="$BuildVersion" \ | ||
--build-arg BUILD_DATE="$BuildDate" \ | ||
--build-arg VCS_REF="$VcsRef" \ | ||
--no-cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
dotnet tool install --global Cake.Tool --version 3.2.0 | ||
dotnet tool install --global vpk --version 0.0.359 | ||
dotnet tool install --global vpk --version 0.0.626 | ||
dotnet-cake --configuration=Release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/Papercut.Core/Infrastructure/Logging/LoggerExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Papercut | ||
// | ||
// Copyright © 2008 - 2012 Ken Robertson | ||
// Copyright © 2013 - 2024 Jaben Cargman | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
|
||
namespace Papercut.Core.Infrastructure.Logging; | ||
|
||
public static class LoggerExtensions | ||
{ | ||
public static bool ErrorWithContext(this ILogger logger, Exception? exception, string message, params object?[] propertyValues) | ||
{ | ||
if (logger == null) throw new ArgumentNullException(nameof(logger)); | ||
|
||
logger.Error(exception, message, propertyValues); | ||
|
||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.