diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 000000000..117a47532
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,5 @@
+.git
+.idea
+node_modules
+*/samples*
+*/doc*
\ No newline at end of file
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 000000000..971e981ed
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,25 @@
+FROM mcr.microsoft.com/dotnet/core/sdk:3.0 AS build-env
+WORKDIR /app
+
+COPY . ./
+
+WORKDIR /app/src/dashboard/Elsa.Dashboard/Theme/argon-dashboard
+
+RUN apt-get update -yq \
+ && apt-get install build-essential -y \
+ && apt-get install curl gnupg -yq \
+ && curl -sL https://deb.nodesource.com/setup_10.x | bash \
+ && apt-get install nodejs -yq
+
+RUN npm install
+RUN npm install --global gulp-cli
+RUN npm rebuild node-sass --force
+RUN gulp build
+
+WORKDIR /app
+RUN dotnet publish Elsa.sln -c Release -o out
+
+FROM mcr.microsoft.com/dotnet/core/aspnet:3.0
+WORKDIR /app
+COPY --from=build-env /app/out .
+ENTRYPOINT ["dotnet", "Elsa.Dashboard.Web.dll"]
\ No newline at end of file
diff --git a/Elsa.sln b/Elsa.sln
index d72ce7df6..51ae2652c 100644
--- a/Elsa.sln
+++ b/Elsa.sln
@@ -13,6 +13,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "solution", "solution", "{71
.gitignore = .gitignore
Nuget.Config = Nuget.Config
README.md = README.md
+ .dockerignore = .dockerignore
+ docker-compose.yaml = docker-compose.yaml
+ Dockerfile = Dockerfile
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Abstractions", "src\core\Elsa.Abstractions\Elsa.Abstractions.csproj", "{3130C574-557C-4DA2-933E-AED7A9EBE48A}"
@@ -67,6 +70,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Activities.Workflows",
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa", "src\core\Elsa\Elsa.csproj", "{ED2A4FE5-821B-46F7-B72F-E66DE0D66C93}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Dashboard.Web", "src\dashboard\Elsa.Dashboard.Web\Elsa.Dashboard.Web.csproj", "{7179277B-E692-43CA-8243-3FE4FC2DD1EA}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -157,6 +162,10 @@ Global
{ED2A4FE5-821B-46F7-B72F-E66DE0D66C93}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ED2A4FE5-821B-46F7-B72F-E66DE0D66C93}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ED2A4FE5-821B-46F7-B72F-E66DE0D66C93}.Release|Any CPU.Build.0 = Release|Any CPU
+ {7179277B-E692-43CA-8243-3FE4FC2DD1EA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {7179277B-E692-43CA-8243-3FE4FC2DD1EA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {7179277B-E692-43CA-8243-3FE4FC2DD1EA}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {7179277B-E692-43CA-8243-3FE4FC2DD1EA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -189,6 +198,7 @@ Global
{3FC85C9D-CC20-4F54-9936-029F19FBFBE1} = {B43B546E-23F3-46E8-ACB7-D04F05CDA180}
{1BB8EC9E-AEBD-438B-9FA7-B7FA78999D7D} = {B43B546E-23F3-46E8-ACB7-D04F05CDA180}
{ED2A4FE5-821B-46F7-B72F-E66DE0D66C93} = {35F44BE9-13D0-417C-A01A-F0787BEE6DC3}
+ {7179277B-E692-43CA-8243-3FE4FC2DD1EA} = {8B87D79A-F0DE-4F88-81D3-8C8C69108ADB}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8B0975FD-7050-48B0-88C5-48C33378E158}
diff --git a/Samples.sln b/Samples.sln
index d2b162251..d2059deb4 100644
--- a/Samples.sln
+++ b/Samples.sln
@@ -13,6 +13,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "solution", "solution", "{71
.gitignore = .gitignore
Nuget.Config = Nuget.Config
README.md = README.md
+ docker-compose.yaml = docker-compose.yaml
+ Dockerfile = Dockerfile
+ .dockerignore = .dockerignore
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Abstractions", "src\core\Elsa.Abstractions\Elsa.Abstractions.csproj", "{3130C574-557C-4DA2-933E-AED7A9EBE48A}"
@@ -111,6 +114,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Activities.Reflection"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample20", "src\samples\Sample20\Sample20.csproj", "{9B238B75-5A68-48B1-973A-59F0EFAB0A8B}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Dashboard.Web", "src\dashboard\Elsa.Dashboard.Web\Elsa.Dashboard.Web.csproj", "{AE0363D2-3630-4CDD-86A1-7D6A717361BD}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -285,6 +290,10 @@ Global
{9B238B75-5A68-48B1-973A-59F0EFAB0A8B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9B238B75-5A68-48B1-973A-59F0EFAB0A8B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9B238B75-5A68-48B1-973A-59F0EFAB0A8B}.Release|Any CPU.Build.0 = Release|Any CPU
+ {AE0363D2-3630-4CDD-86A1-7D6A717361BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {AE0363D2-3630-4CDD-86A1-7D6A717361BD}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {AE0363D2-3630-4CDD-86A1-7D6A717361BD}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {AE0363D2-3630-4CDD-86A1-7D6A717361BD}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -339,6 +348,7 @@ Global
{2AEA0028-96D6-4823-A88F-24294E4BA4E8} = {5E5E1E84-DDBC-40D6-B891-0D563A15A44A}
{258F624E-98D7-4498-AE2E-F612D8ECA763} = {B43B546E-23F3-46E8-ACB7-D04F05CDA180}
{9B238B75-5A68-48B1-973A-59F0EFAB0A8B} = {5E5E1E84-DDBC-40D6-B891-0D563A15A44A}
+ {AE0363D2-3630-4CDD-86A1-7D6A717361BD} = {0DF567E8-2A21-4A1C-90E8-025F1EC615F3}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8B0975FD-7050-48B0-88C5-48C33378E158}
diff --git a/docker-compose.yaml b/docker-compose.yaml
new file mode 100644
index 000000000..0f986837b
--- /dev/null
+++ b/docker-compose.yaml
@@ -0,0 +1,24 @@
+version: '3.7'
+
+services:
+ elsa-dashboard:
+ build: .
+ environment:
+ - Elsa:Smtp:Host=smtp4dev
+ - ConnectionStrings:MongoDb=mongodb://mongodb
+ ports:
+ - "22174:80"
+ depends_on:
+ - mongodb
+ - smtp4dev
+
+ mongodb:
+ image: mongo
+ ports:
+ - "27017:27017"
+
+ smtp4dev:
+ image: opvolger/rnwoodsmtp4dev
+ ports:
+ - "3000:80"
+ - "2525:25"
\ No newline at end of file
diff --git a/src/activities/Elsa.Activities.Dropbox/Elsa.Activities.Dropbox.csproj b/src/activities/Elsa.Activities.Dropbox/Elsa.Activities.Dropbox.csproj
index 8ac8489d0..8cfbcfc8a 100644
--- a/src/activities/Elsa.Activities.Dropbox/Elsa.Activities.Dropbox.csproj
+++ b/src/activities/Elsa.Activities.Dropbox/Elsa.Activities.Dropbox.csproj
@@ -23,7 +23,7 @@
-
+
diff --git a/src/activities/Elsa.Activities.Http/Elsa.Activities.Http.csproj b/src/activities/Elsa.Activities.Http/Elsa.Activities.Http.csproj
index 95718bee4..b59a6c03e 100644
--- a/src/activities/Elsa.Activities.Http/Elsa.Activities.Http.csproj
+++ b/src/activities/Elsa.Activities.Http/Elsa.Activities.Http.csproj
@@ -31,7 +31,7 @@
-
+
\ No newline at end of file
diff --git a/src/activities/Elsa.Activities.Timers/Elsa.Activities.Timers.csproj b/src/activities/Elsa.Activities.Timers/Elsa.Activities.Timers.csproj
index 77a47744a..cd79f809c 100644
--- a/src/activities/Elsa.Activities.Timers/Elsa.Activities.Timers.csproj
+++ b/src/activities/Elsa.Activities.Timers/Elsa.Activities.Timers.csproj
@@ -25,7 +25,7 @@
-
+
diff --git a/src/core/Elsa.Abstractions/Elsa.Abstractions.csproj b/src/core/Elsa.Abstractions/Elsa.Abstractions.csproj
index c890e362a..4fbd82cf4 100644
--- a/src/core/Elsa.Abstractions/Elsa.Abstractions.csproj
+++ b/src/core/Elsa.Abstractions/Elsa.Abstractions.csproj
@@ -18,10 +18,10 @@
-
-
-
-
+
+
+
+
diff --git a/src/core/Elsa.Core/Elsa.Core.csproj b/src/core/Elsa.Core/Elsa.Core.csproj
index ee01e6d7b..217da7ffa 100644
--- a/src/core/Elsa.Core/Elsa.Core.csproj
+++ b/src/core/Elsa.Core/Elsa.Core.csproj
@@ -25,14 +25,14 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
diff --git a/src/dashboard/Elsa.Dashboard.Web/Elsa.Dashboard.Web.csproj b/src/dashboard/Elsa.Dashboard.Web/Elsa.Dashboard.Web.csproj
new file mode 100644
index 000000000..a08ba521f
--- /dev/null
+++ b/src/dashboard/Elsa.Dashboard.Web/Elsa.Dashboard.Web.csproj
@@ -0,0 +1,13 @@
+
+
+
+ netcoreapp3.0
+
+
+
+
+
+
+
+
+
diff --git a/src/dashboard/Elsa.Dashboard.Web/Program.cs b/src/dashboard/Elsa.Dashboard.Web/Program.cs
new file mode 100644
index 000000000..47f95481a
--- /dev/null
+++ b/src/dashboard/Elsa.Dashboard.Web/Program.cs
@@ -0,0 +1,17 @@
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.Extensions.Hosting;
+
+namespace Elsa.Dashboard.Web
+{
+ public static class Program
+ {
+ public static void Main(string[] args)
+ {
+ CreateHostBuilder(args).Build().Run();
+ }
+
+ public static IHostBuilder CreateHostBuilder(string[] args) =>
+ Host.CreateDefaultBuilder(args)
+ .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup(); });
+ }
+}
\ No newline at end of file
diff --git a/src/dashboard/Elsa.Dashboard.Web/Properties/launchSettings.json b/src/dashboard/Elsa.Dashboard.Web/Properties/launchSettings.json
new file mode 100644
index 000000000..c6787fa55
--- /dev/null
+++ b/src/dashboard/Elsa.Dashboard.Web/Properties/launchSettings.json
@@ -0,0 +1,27 @@
+{
+ "iisSettings": {
+ "windowsAuthentication": false,
+ "anonymousAuthentication": true,
+ "iisExpress": {
+ "applicationUrl": "http://localhost:22174",
+ "sslPort": 44332
+ }
+ },
+ "profiles": {
+ "IIS Express": {
+ "commandName": "IISExpress",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ },
+ "Elsa.Dashboard.Web": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "applicationUrl": "http://localhost:22174",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ }
+ }
+}
diff --git a/src/dashboard/Elsa.Dashboard.Web/README.md b/src/dashboard/Elsa.Dashboard.Web/README.md
new file mode 100644
index 000000000..c9281c509
--- /dev/null
+++ b/src/dashboard/Elsa.Dashboard.Web/README.md
@@ -0,0 +1,6 @@
+# Elsa Dashboard
+
+This is a sample implementation of an ASP.NET Core application hosting both the Elsa Dashboard as well as Elsa services that trigger workflows.
+
+## Running the Project
+To run this project, make sure you have a MongoDB and SMTP host running. If not, then the easiest way is to run `docker compose up`.
diff --git a/src/dashboard/Elsa.Dashboard.Web/Startup.cs b/src/dashboard/Elsa.Dashboard.Web/Startup.cs
new file mode 100644
index 000000000..de8fb85d9
--- /dev/null
+++ b/src/dashboard/Elsa.Dashboard.Web/Startup.cs
@@ -0,0 +1,57 @@
+using Elsa.Activities.Email.Extensions;
+using Elsa.Activities.Http.Extensions;
+using Elsa.Activities.Timers.Extensions;
+using Elsa.Dashboard.Extensions;
+using Elsa.Persistence.MongoDb.Extensions;
+using Microsoft.AspNetCore.Builder;
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Hosting;
+
+namespace Elsa.Dashboard.Web
+{
+ public class Startup
+ {
+ public Startup(IConfiguration configuration)
+ {
+ Configuration = configuration;
+ }
+
+ public IConfiguration Configuration { get; }
+
+ public void ConfigureServices(IServiceCollection services)
+ {
+ var elsaSection = Configuration.GetSection("Elsa");
+
+ services
+ // Add workflow services.
+ .AddElsa(x => x.AddMongoDbStores(Configuration, "Elsa", "MongoDb"))
+
+ // Add activities we'd like to use.
+ // Configuring the activities as is done here is only required if we want to be able to actually run workflows form this application.
+ // Otherwise it's only necessary to register activities for the workflow designer to discover.
+ .AddHttpActivities(options => options.Bind(elsaSection.GetSection("Http")))
+ .AddEmailActivities(options => options.Bind(elsaSection.GetSection("Smtp")))
+ .AddTimerActivities(options => options.Bind(elsaSection.GetSection("BackgroundRunner")))
+
+ // Add Dashboard services.
+ .AddElsaDashboard();
+ }
+
+ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
+ {
+ if (env.IsDevelopment())
+ app.UseDeveloperExceptionPage();
+
+ app
+ // This is only necessary if we want to be able to run workflows containing HTTP activities from this application.
+ .UseHttpActivities()
+
+ .UseStaticFiles()
+ .UseRouting()
+ .UseEndpoints(endpoints => endpoints.MapControllers())
+ .UseWelcomePage();
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/dashboard/Elsa.Dashboard.Web/appsettings.Development.json b/src/dashboard/Elsa.Dashboard.Web/appsettings.Development.json
new file mode 100644
index 000000000..e203e9407
--- /dev/null
+++ b/src/dashboard/Elsa.Dashboard.Web/appsettings.Development.json
@@ -0,0 +1,9 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Debug",
+ "System": "Information",
+ "Microsoft": "Information"
+ }
+ }
+}
diff --git a/src/dashboard/Elsa.Dashboard.Web/appsettings.json b/src/dashboard/Elsa.Dashboard.Web/appsettings.json
new file mode 100644
index 000000000..c1d95dec9
--- /dev/null
+++ b/src/dashboard/Elsa.Dashboard.Web/appsettings.json
@@ -0,0 +1,25 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft": "Warning",
+ "Microsoft.Hosting.Lifetime": "Information"
+ }
+ },
+ "AllowedHosts": "*",
+ "ConnectionStrings": {
+ "MongoDb": "mongodb://localhost"
+ },
+ "Elsa": {
+ "Http": {
+ "BaseUrl": "http://localhost:22174"
+ },
+ "Smtp": {
+ "Host": "localhost",
+ "Port": "2525"
+ },
+ "Timers": {
+ "SweepInterval": "PT10S"
+ }
+ }
+}
diff --git a/src/dashboard/Elsa.Dashboard/Extensions/ActivityDefinitionListExtensions.cs b/src/dashboard/Elsa.Dashboard/Extensions/ActivityDefinitionListExtensions.cs
index 80153c0e7..55c135292 100644
--- a/src/dashboard/Elsa.Dashboard/Extensions/ActivityDefinitionListExtensions.cs
+++ b/src/dashboard/Elsa.Dashboard/Extensions/ActivityDefinitionListExtensions.cs
@@ -38,7 +38,7 @@ namespace Elsa.Dashboard.Extensions
options.ActivityDefinitions
// Add all activities from all referenced assemblies.
.Discover(
- selector => selector.FromApplicationDependencies()
+ selector => selector.FromApplicationDependencies(x => !x.FullName.StartsWith("Microsoft.AspNetCore")) // TODO: Prevents type load exception. Needs more investigation.
.AddClasses(x => x.AssignableTo()));
return options;
diff --git a/src/dashboard/Elsa.WorkflowDesigner/Elsa.WorkflowDesigner.csproj b/src/dashboard/Elsa.WorkflowDesigner/Elsa.WorkflowDesigner.csproj
index 16b193cca..4cd460734 100644
--- a/src/dashboard/Elsa.WorkflowDesigner/Elsa.WorkflowDesigner.csproj
+++ b/src/dashboard/Elsa.WorkflowDesigner/Elsa.WorkflowDesigner.csproj
@@ -1,8 +1,10 @@
- netstandard2.0
+ netcoreapp3.0
+ 3.0
8.0
+ true
enable
1.0.0
Elsa Contributors
@@ -17,9 +19,12 @@
elsa, workflows
+
+
+
+
-
diff --git a/src/persistence/Elsa.Persistence.DocumentDb/Elsa.Persistence.DocumentDb.csproj b/src/persistence/Elsa.Persistence.DocumentDb/Elsa.Persistence.DocumentDb.csproj
index ae14c6b69..9216149fa 100644
--- a/src/persistence/Elsa.Persistence.DocumentDb/Elsa.Persistence.DocumentDb.csproj
+++ b/src/persistence/Elsa.Persistence.DocumentDb/Elsa.Persistence.DocumentDb.csproj
@@ -17,7 +17,7 @@
-
+
diff --git a/src/persistence/Elsa.Persistence.EntityFrameworkCore/Elsa.Persistence.EntityFrameworkCore.csproj b/src/persistence/Elsa.Persistence.EntityFrameworkCore/Elsa.Persistence.EntityFrameworkCore.csproj
index a8b17a6c3..20e6fe57a 100644
--- a/src/persistence/Elsa.Persistence.EntityFrameworkCore/Elsa.Persistence.EntityFrameworkCore.csproj
+++ b/src/persistence/Elsa.Persistence.EntityFrameworkCore/Elsa.Persistence.EntityFrameworkCore.csproj
@@ -19,10 +19,10 @@
-
-
-
-
+
+
+
+
diff --git a/src/persistence/Elsa.Persistence.MongoDb/Elsa.Persistence.MongoDb.csproj b/src/persistence/Elsa.Persistence.MongoDb/Elsa.Persistence.MongoDb.csproj
index 20083a750..223920d43 100644
--- a/src/persistence/Elsa.Persistence.MongoDb/Elsa.Persistence.MongoDb.csproj
+++ b/src/persistence/Elsa.Persistence.MongoDb/Elsa.Persistence.MongoDb.csproj
@@ -22,7 +22,7 @@
-
+
diff --git a/src/persistence/Elsa.Persistence.YesSql/Elsa.Persistence.YesSql.csproj b/src/persistence/Elsa.Persistence.YesSql/Elsa.Persistence.YesSql.csproj
index c2f36ac68..191eb18d0 100644
--- a/src/persistence/Elsa.Persistence.YesSql/Elsa.Persistence.YesSql.csproj
+++ b/src/persistence/Elsa.Persistence.YesSql/Elsa.Persistence.YesSql.csproj
@@ -22,7 +22,7 @@
-
+
diff --git a/src/samples/Sample05/Sample05.csproj b/src/samples/Sample05/Sample05.csproj
index c07e4470c..461ad6bab 100644
--- a/src/samples/Sample05/Sample05.csproj
+++ b/src/samples/Sample05/Sample05.csproj
@@ -10,7 +10,7 @@
-
+
diff --git a/src/samples/Sample14/Sample14.csproj b/src/samples/Sample14/Sample14.csproj
index e1841cbc5..b78610a0c 100644
--- a/src/samples/Sample14/Sample14.csproj
+++ b/src/samples/Sample14/Sample14.csproj
@@ -12,8 +12,8 @@
-
-
+
+
diff --git a/src/samples/Sample18/Sample18.csproj b/src/samples/Sample18/Sample18.csproj
index edb32d535..9f2ae0a24 100644
--- a/src/samples/Sample18/Sample18.csproj
+++ b/src/samples/Sample18/Sample18.csproj
@@ -6,7 +6,7 @@
-
+
diff --git a/src/utils/Elsa.AutoMapper.Extensions/Elsa.AutoMapper.Extensions.csproj b/src/utils/Elsa.AutoMapper.Extensions/Elsa.AutoMapper.Extensions.csproj
index 8abbbc856..442aab7c8 100644
--- a/src/utils/Elsa.AutoMapper.Extensions/Elsa.AutoMapper.Extensions.csproj
+++ b/src/utils/Elsa.AutoMapper.Extensions/Elsa.AutoMapper.Extensions.csproj
@@ -18,7 +18,7 @@
-
+