From ef1e35d51d28d4d63afbfd3cfa6f06713d0d5ce8 Mon Sep 17 00:00:00 2001 From: Rob Wood Date: Wed, 9 Sep 2020 15:52:27 +0100 Subject: [PATCH] Additional build platforms Move info to Github wiki and reference from README. --- README.md | 89 +++++---------------------------------------- azure-pipelines.yml | 46 +++++++++++++++++++---- 2 files changed, 49 insertions(+), 86 deletions(-) diff --git a/README.md b/README.md index 77ed84af3..f3a7437fe 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,21 @@ # logo -smtp4dev - the fake SMTP email server for development and testing. +**smtp4dev - the fake SMTP email server for development and testing.** A dummy SMTP server for Windows, Linux, Mac OS-X (and maybe elsewhere where .NET Core is available). Lets you test your application without spamming your real customers and without needing to set up a complicated real email server with a special configuration. Messages received in smtp4dev can be viewed and inspected. -This repository hosts the development of v3 which has a web UI so that it can be shared amongst members of a team, and be available cross platform. -This version is in development, but now approaching a stable state. +*If you're looking for the older v2 Windows GUI version. [Grab it here](https://github.com/rnwood/smtp4dev/releases/tag/v2.0.10).* -**If you're looking for the older v2 Windows GUI version. [Grab it here](https://github.com/rnwood/smtp4dev/releases/tag/v2.0.10).** +> Become a Patreon Donate *If you find smtp4dev useful, please consider supporting further development by making a donation* +> . -*If you find smtp4dev useful, please consider supporting further development by making a donation:* -Become a Patreon -Donate +## Getting Started +[Installation Instructions](https://github.com/rnwood/smtp4dev/wiki/Installation) + +[Configuration](https://github.com/rnwood/smtp4dev/wiki/Configuration) + +[Configuring your programs to send mails to smtp4dev](https://github.com/rnwood/smtp4dev/wiki/Configuring-Clients) -[![Build Status](https://dev.azure.com/smtp4dev/smtp4dev/_apis/build/status/rnwood.smtp4dev?branchName=master)](https://dev.azure.com/smtp4dev/smtp4dev/_build/latest?definitionId=2&branchName=master) -[![Github Releases](https://img.shields.io/github/downloads/rnwood/smtp4dev/latest/total.svg)](https://github.com/rnwood/smtp4dev/releases) (+270k when prev hosted on Codeplex) ## Screenshots @@ -22,73 +23,3 @@ This version is in development, but now approaching a stable state. ![Screenshot 2](screenshot2.png) -## How to run smtp4dev by downloading from github releases - -*The MacOS release is totally untested. Please contribute instructions on how to use and feedback on any issues* - -- Download [a release](https://github.com/rnwood/smtp4dev/releases) and unzip. - -- On Linux `chmod +x` the `Rnwood.Smtp4dev` file to make it executable - -- Edit ``appsettings.json`` and set the port number you want the SMTP server to listen on. - -- Run `Rnwood.Smtp4dev` (`.exe` on Windows). (If you downloaded the ``noruntime`` version, you need the .NET Core 3.1 runtime on your machine and you should execute ``dotnet Rnwood.Smtpdev.dll`` to run it.) - -- Open your browser at `http://localhost:5000` (to run the web server on a different port or make it listen on interfaces other than loopback, add the command line arg `--server.urls "http://0.0.0.0:5001/"` when starting the executable. - -- Now configure your apps which send mail, to use the SMTP server on the machine where SMTP4dev is running (``localhost`` if they are on the same machine), and using the port you selected (``25`` by default). - -## How to run smtp4dev as a dotnet global tool - -If you're using the .NET Core SDK 3.1 or greater, you can install smtp4dev as a global tool using the following command: -``` -dotnet tool install -g Rnwood.Smtp4dev --version "3.1.0-*" -``` -Then you can start smtp4dev by running -``` -smtp4dev -``` - - -## How to run smtp4dev in Docker -Docker images for both Windows and Linux are available. To run with the web interface on port 3000 and SMTP on port 2525: - -``` -docker run -p 3000:80 -p 2525:25 rnwood/smtp4dev:v3 -``` -This is a cross platform tag which will work on either Windows or Linux. To see the full list of available tags [see the Docker hub page for smtp4dev](https://hub.docker.com/r/rnwood/smtp4dev/tags/). - -The folder ``/smtp4dev`` will be used for the database and auto-generated TLS certificate. You can mount a directory outside of the container here for peristent storage. - -## How to run smtp4dev as a service (Windows only) - -A service in Windows can be installed using New-Service in PowerShell, or sc in both command line or PowerShell. If you use sc in PowerShell, it must be run as sc.exe. sc is an alias for Set-Content. - -## How to run smtp4dev in Windows IIS - -Download a smtp4dev release and unzip. You must pick the win-x64 version. - -Create a site in IIS and set the path to where you unzipped smtp4dev. You can also host in a virtual directory under another site, but don't forget to convert the directory to an application. - -Grant permission to the IIS app pool to read and modify the files. The principal name is `IIS APPPOOL\` where `` is the name of the app pool, which is the name of the site you created unless you changed something. - -Edit the application pool and set '.NET CLR version' to 'No managed code' - -You can then access the site via the ports/hostname set in bindings that are set in IIS. If you see an error check the `Application` event log for details and you'll see any errors output from IIS. - -### Install service in PowerShell - -``` -New-Service -Name Smtp4dev -BinaryPathName "{PathToExe} --service" -``` - -### Install service in Cmd or PowerShell - -``` -sc.exe create Smtp4dev binPath= "{PathToExe} --service" -``` - - -### Configuration - -smtp4dev configuration can be performed via `appsetting.json` file, environment variables and command line arguments. Run smtp4dev with `--help` for information or see the `appsettings.json` file. diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 48fafdd47..307e6a14d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -93,17 +93,29 @@ stages: - powershell: move-item $(Build.ArtifactStagingDirectory)/linux-x64/Rnwood.Smtp4dev.zip $(Build.ArtifactStagingDirectory)/linux-x64/Rnwood.Smtp4dev-linux-x64-$(tag).zip displayName: Rename artifact - publish: $(Build.ArtifactStagingDirectory)/linux-x64 - artifact: linux-x64 + artifact: linux-x64 + - task: DotNetCoreCLI@2 - displayName: Build .NET Core - osx-x64 + displayName: Build .NET Core - linux-musl-x64 inputs: command: publish projects: Rnwood.Smtp4dev/Rnwood.Smtp4dev.csproj - arguments: '-c Release -r osx-x64 -p:version=$(tag) -o "$(Build.ArtifactStagingDirectory)/osx-x64"' - - powershell: move-item $(Build.ArtifactStagingDirectory)/osx-x64/Rnwood.Smtp4dev.zip $(Build.ArtifactStagingDirectory)/osx-x64/Rnwood.Smtp4dev-osx-x64-$(tag).zip + arguments: '-c Release -r linux-musl-x64 -p:version=$(tag) -o "$(Build.ArtifactStagingDirectory)/linux-musl-x64"' + - powershell: move-item $(Build.ArtifactStagingDirectory)/linux-musl-x64/Rnwood.Smtp4dev.zip $(Build.ArtifactStagingDirectory)/linux-musl-x64/Rnwood.Smtp4dev-linux-musl-x64-$(tag).zip displayName: Rename artifact - - publish: $(Build.ArtifactStagingDirectory)/osx-x64 - artifact: osx-x64 + - publish: $(Build.ArtifactStagingDirectory)/linux-musl-x64 + artifact: linux-musl-x64 + + # - task: DotNetCoreCLI@2 + # displayName: Build .NET Core - osx-x64 + # inputs: + # command: publish + # projects: Rnwood.Smtp4dev/Rnwood.Smtp4dev.csproj + # arguments: '-c Release -r osx-x64 -p:version=$(tag) -o "$(Build.ArtifactStagingDirectory)/osx-x64"' + # - powershell: move-item $(Build.ArtifactStagingDirectory)/osx-x64/Rnwood.Smtp4dev.zip $(Build.ArtifactStagingDirectory)/osx-x64/Rnwood.Smtp4dev-osx-x64-$(tag).zip + # displayName: Rename artifact + # - publish: $(Build.ArtifactStagingDirectory)/osx-x64 + # artifact: osx-x64 - task: DotNetCoreCLI@2 displayName: Build .NET Core - win-arm inputs: @@ -120,10 +132,30 @@ stages: command: publish projects: Rnwood.Smtp4dev/Rnwood.Smtp4dev.csproj arguments: '-c Release -r linux-arm -p:version=$(tag) -o "$(Build.ArtifactStagingDirectory)/linux-arm"' - - powershell: move-item $(Build.ArtifactStagingDirectory)/linux-arm/Rnwood.Smtp4dev.zip $(Build.ArtifactStagingDirectory)/linux-arm/Rnwood.Smtp4dev-noruntime-$(tag).zip + - powershell: move-item $(Build.ArtifactStagingDirectory)/linux-arm/Rnwood.Smtp4dev.zip $(Build.ArtifactStagingDirectory)/linux-arm/Rnwood.Smtp4dev-arm-$(tag).zip displayName: Rename artifact - publish: $(Build.ArtifactStagingDirectory)/linux-arm artifact: linux-arm + - task: DotNetCoreCLI@2 + displayName: Build .NET Core - win-arm64 + inputs: + command: publish + projects: Rnwood.Smtp4dev/Rnwood.Smtp4dev.csproj + arguments: '-c Release -r win-arm64 -p:version=$(tag) -o "$(Build.ArtifactStagingDirectory)/win-arm64"' + - powershell: move-item $(Build.ArtifactStagingDirectory)/win-arm64/Rnwood.Smtp4dev.zip $(Build.ArtifactStagingDirectory)/win-arm64/Rnwood.Smtp4dev-win-arm64-$(tag).zip + displayName: Rename artifact + - publish: $(Build.ArtifactStagingDirectory)/win-arm64 + artifact: win-arm64 + - task: DotNetCoreCLI@2 + displayName: Build .NET Core - linux-arm64 + inputs: + command: publish + projects: Rnwood.Smtp4dev/Rnwood.Smtp4dev.csproj + arguments: '-c Release -r linux-arm64 -p:version=$(tag) -o "$(Build.ArtifactStagingDirectory)/linux-arm64"' + - powershell: move-item $(Build.ArtifactStagingDirectory)/linux-arm64/Rnwood.Smtp4dev.zip $(Build.ArtifactStagingDirectory)/linux-arm64/Rnwood.Smtp4dev-arm64-$(tag).zip + displayName: Rename artifact + - publish: $(Build.ArtifactStagingDirectory)/linux-arm64 + artifact: linux-arm64 - job: DockerBuildLinux displayName: DockerBuild - Linux