Cleanup
This commit is contained in:
parent
005d9d0a68
commit
3384f6e68f
|
|
@ -1,9 +1,11 @@
|
|||
using System;
|
||||
using Elsa.Activities.UserTask.Extensions;
|
||||
using Elsa.Caching.Rebus.Extensions;
|
||||
using Elsa.Persistence.EntityFramework.Core.Extensions;
|
||||
using Elsa.Persistence.EntityFramework.SqlServer;
|
||||
using Elsa.Rebus.RabbitMq;
|
||||
using Elsa.Samples.Server.Host.Activities;
|
||||
using Hangfire;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
|
@ -52,7 +54,7 @@ namespace Elsa.Samples.Server.Host
|
|||
// store.UseClustering();
|
||||
// }))
|
||||
//.AddHangfireTemporalActivities(hangfire => hangfire.UseInMemoryStorage(), (_, hangfireServer) => hangfireServer.SchedulePollingInterval = TimeSpan.FromSeconds(5))
|
||||
//.AddHangfireTemporalActivities(hangfire => hangfire.UseSqlServerStorage(sqlServerConnectionString), (_, hangfireServer) => hangfireServer.SchedulePollingInterval = TimeSpan.FromSeconds(5))
|
||||
.AddHangfireTemporalActivities(hangfire => hangfire.UseSqlServerStorage(sqlServerConnectionString), (_, hangfireServer) => hangfireServer.SchedulePollingInterval = TimeSpan.FromSeconds(5))
|
||||
.AddJavaScriptActivities()
|
||||
.AddUserTaskActivities()
|
||||
.AddActivitiesFrom<Startup>()
|
||||
|
|
|
|||
|
|
@ -1,26 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
<Import Project="..\..\..\configureawait.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<IsPackable>false</IsPackable>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Hangfire.InMemory" Version="0.3.4" />
|
||||
<PackageReference Include="Hangfire.SqlServer" Version="1.7.22" />
|
||||
<PackageReference Include="Quartz.Serialization.Json" Version="3.3.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\activities\Elsa.Activities.Email\Elsa.Activities.Email.csproj" />
|
||||
<ProjectReference Include="..\..\activities\Elsa.Activities.Temporal.Hangfire\Elsa.Activities.Temporal.Hangfire.csproj" />
|
||||
<ProjectReference Include="..\..\core\Elsa\Elsa.csproj" />
|
||||
<ProjectReference Include="..\..\persistence\Elsa.Persistence.EntityFramework\Elsa.Persistence.EntityFramework.Sqlite\Elsa.Persistence.EntityFramework.Sqlite.csproj" />
|
||||
<ProjectReference Include="..\..\samples\persistence\Elsa.Samples.Persistence.EntityFramework\Elsa.Samples.Persistence.EntityFramework.csproj" />
|
||||
<ProjectReference Include="..\Elsa.Server.Api\Elsa.Server.Api.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
|
||||
<ConfigureAwait ContinueOnCapturedContext="false" />
|
||||
</Weavers>
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
namespace Elsa.Samples.Server.Host.Models
|
||||
{
|
||||
public record SampleInputModel(string Name);
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
using Elsa.Server.Host;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
|
||||
namespace Elsa.Samples.Server.Host
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
CreateHostBuilder(args).Build().Run();
|
||||
}
|
||||
|
||||
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
||||
Microsoft.Extensions.Hosting.Host.CreateDefaultBuilder(args)
|
||||
.ConfigureWebHostDefaults(webBuilder => webBuilder
|
||||
.UseStaticWebAssets()
|
||||
.UseStartup<Startup>())
|
||||
// .UseOrleans(siloBuilder => siloBuilder
|
||||
// .UseLocalhostClustering()
|
||||
// .Configure<ClusterOptions>(options =>
|
||||
// {
|
||||
// options.ClusterId = "localhost";
|
||||
// options.ServiceId = "elsa-workflows";
|
||||
// })
|
||||
// .ConfigureApplicationParts(parts => parts.AddApplicationPart(typeof(IWorkflowDefinitionGrain).Assembly).WithReferences())
|
||||
// .Configure<EndpointOptions>(options => options.AdvertisedIPAddress = IPAddress.Loopback))
|
||||
;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
{
|
||||
"profiles": {
|
||||
"Elsa.Server.Host": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": false,
|
||||
"applicationUrl": "https://localhost:11000",
|
||||
"launchUrl": "https://localhost:11000/swagger",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,84 +0,0 @@
|
|||
using System;
|
||||
using Elsa.Persistence.EntityFramework.Core.Extensions;
|
||||
using Elsa.Persistence.EntityFramework.Sqlite;
|
||||
using Elsa.Persistence.EntityFramework.SqlServer;
|
||||
using Hangfire;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
|
||||
namespace Elsa.Server.Host
|
||||
{
|
||||
public class Startup
|
||||
{
|
||||
public Startup(IWebHostEnvironment environment, IConfiguration configuration)
|
||||
{
|
||||
Environment = environment;
|
||||
Configuration = configuration;
|
||||
}
|
||||
|
||||
private IWebHostEnvironment Environment { get; }
|
||||
private IConfiguration Configuration { get; }
|
||||
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
var elsaSection = Configuration.GetSection("Elsa");
|
||||
var sqlServerConnectionString = Configuration.GetConnectionString("SqlServer");
|
||||
|
||||
services.AddControllers();
|
||||
|
||||
services
|
||||
//.AddRedis(Configuration.GetConnectionString("Redis"))
|
||||
.AddElsa(elsa => elsa
|
||||
//.WithContainerName(Configuration["ContainerName"] ?? System.Environment.MachineName)
|
||||
.UseEntityFrameworkPersistence(ef => ef.UseSqlServer(sqlServerConnectionString))
|
||||
//.UseRabbitMq(Configuration.GetConnectionString("RabbitMq"))
|
||||
//.UseRebusCacheSignal()
|
||||
//.UseRedisCacheSignal()
|
||||
// .ConfigureDistributedLockProvider(options => options.UseProviderFactory(sp => name =>
|
||||
// {
|
||||
// var connection = sp.GetRequiredService<IConnectionMultiplexer>();
|
||||
// return new RedisDistributedLock(name, connection.GetDatabase());
|
||||
// }))
|
||||
.AddConsoleActivities()
|
||||
.AddHttpActivities(elsaSection.GetSection("Http").Bind)
|
||||
.AddEmailActivities(elsaSection.GetSection("Smtp").Bind)
|
||||
//.AddQuartzTemporalActivities()
|
||||
.AddHangfireTemporalActivities(hangfire => hangfire.UseSqlServerStorage(sqlServerConnectionString), (_, hangfireServer) => hangfireServer.SchedulePollingInterval = TimeSpan.FromSeconds(5))
|
||||
.AddJavaScriptActivities()
|
||||
.AddActivitiesFrom<Startup>()
|
||||
.AddWorkflowsFrom<Startup>()
|
||||
);
|
||||
|
||||
// Elsa API endpoints.
|
||||
services
|
||||
.AddElsaApiEndpoints()
|
||||
.AddElsaSwagger();
|
||||
|
||||
// Allow arbitrary client browser apps to access the API for demo purposes only.
|
||||
// In a production environment, make sure to allow only origins you trust.
|
||||
services.AddCors(cors => cors.AddDefaultPolicy(policy => policy.AllowAnyHeader().AllowAnyMethod().AllowAnyOrigin().WithExposedHeaders("Content-Disposition")));
|
||||
}
|
||||
|
||||
public void Configure(IApplicationBuilder app)
|
||||
{
|
||||
if (Environment.IsDevelopment())
|
||||
{
|
||||
app.UseDeveloperExceptionPage();
|
||||
app.UseSwagger();
|
||||
app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "Elsa"));
|
||||
}
|
||||
|
||||
app
|
||||
.UseCors()
|
||||
.UseHttpActivities()
|
||||
.UseRouting()
|
||||
.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapControllers();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Debug",
|
||||
"Orleans": "Warning",
|
||||
"System": "Information",
|
||||
"Microsoft": "Warning"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Warning",
|
||||
"Microsoft": "Warning",
|
||||
"Orleans": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"ConnectionStrings": {
|
||||
"RabbitMq": "amqp://localhost:5672",
|
||||
"Redis": "localhost:6379,abortConnect=false",
|
||||
"SqlServer": ""
|
||||
},
|
||||
"Elsa": {
|
||||
"Http": {
|
||||
"BaseUrl": "https://localhost:11000",
|
||||
"BasePath": "/workflows"
|
||||
},
|
||||
"Smtp": {
|
||||
"Host": "localhost",
|
||||
"Port": "2525",
|
||||
"DefaultSender": "noreply@acme.com"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
version: '3.7'
|
||||
|
||||
services:
|
||||
|
||||
mongodb:
|
||||
image: mongo
|
||||
ports:
|
||||
- "27017:27017"
|
||||
volumes:
|
||||
- /var/lib/mongodb:/var/lib/mongodb
|
||||
|
||||
azureblobstorage:
|
||||
image: mcr.microsoft.com/azure-blob-storage
|
||||
|
||||
redis:
|
||||
image: redis
|
||||
ports:
|
||||
- "6379:6379"
|
||||
|
||||
rabbitmq:
|
||||
image: "rabbitmq:3-management"
|
||||
ports:
|
||||
- "15672:15672"
|
||||
- "5672:5672"
|
||||
|
||||
smtp4dev:
|
||||
image: rnwood/smtp4dev:linux-amd64-3.1.0-ci0856
|
||||
ports:
|
||||
- "3000:80"
|
||||
- "2525:25"
|
||||
Loading…
Reference in a new issue