Skip to content

Commit e5bc0e4

Browse files
Deploy solution to azure
1 parent 9af6e51 commit e5bc0e4

File tree

11 files changed

+327
-214
lines changed

11 files changed

+327
-214
lines changed

conf/casemanagement.nginx

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
server {
2+
3+
listen 80;
4+
5+
gzip on;
6+
gzip_types text/plain text/css application/xml application/json application/javascript;
7+
8+
root /var/www/html;
9+
10+
# Add index.php to the list if you are using PHP
11+
index index.html index.htm index.nginx-debian.html;
12+
13+
server_name simpleidserver.northeurope.cloudapp.azure.com;
14+
15+
location / {
16+
proxy_pass http://localhost:51724;
17+
proxy_set_header Upgrade $http_upgrade;
18+
proxy_set_header Connection keep-alive;
19+
proxy_set_header Host $host;
20+
proxy_pass_header Set-Cookie;
21+
proxy_pass_request_headers on;
22+
proxy_cache_bypass $http_upgrade;
23+
proxy_cookie_domain localhost $host;
24+
proxy_set_header X-Scheme https;
25+
proxy_set_header X-Real-IP $remote_addr;
26+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
27+
proxy_set_header X-Forwarded-Proto $scheme;
28+
proxy_set_header X-URL-SCHEME https;
29+
client_max_body_size 1M;
30+
client_body_buffer_size 4096k;
31+
proxy_connect_timeout 90;
32+
proxy_send_timeout 90;
33+
proxy_read_timeout 90;
34+
proxy_buffer_size 128k;
35+
proxy_buffers 32 256k;
36+
}
37+
38+
location /casemanagementapi {
39+
proxy_pass http://localhost:54942;
40+
proxy_set_header Upgrade $http_upgrade;
41+
proxy_set_header Connection keep-alive;
42+
proxy_set_header Host $host;
43+
proxy_pass_header Set-Cookie;
44+
proxy_pass_request_headers on;
45+
proxy_cache_bypass $http_upgrade;
46+
proxy_cookie_domain localhost $host;
47+
proxy_set_header X-Scheme https;
48+
proxy_set_header X-Real-IP $remote_addr;
49+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
50+
proxy_set_header X-Forwarded-Proto $scheme;
51+
proxy_set_header X-URL-SCHEME https;
52+
client_max_body_size 1M;
53+
client_body_buffer_size 4096k;
54+
proxy_connect_timeout 90;
55+
proxy_send_timeout 90;
56+
proxy_read_timeout 90;
57+
proxy_buffer_size 128k;
58+
proxy_buffers 32 256k;
59+
}
60+
}

conf/casemanagement.service

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[Unit]
2+
Description=Case management
3+
After=network.target
4+
5+
[Service]
6+
ExecStart=/usr/bin/dotnet /src/CaseManagement/src/CaseManagement.CMMN.Host/bin/Debug/netcoreapp2.2/CaseManagement.CMMN.Host.dll --pathBase=/casemanagementapi --server.urls="http://*:54942"
7+
KillMode=process
8+
TimeoutStopSec=5s
9+
Restart=always
10+
WorkingDirectory=/src/CaseManagement/src/CaseManagement.CMMN.Host/bin/Debug/netcoreapp2.2
11+
12+
[Install]
13+
WantedBy=multi-user.target

conf/casemanagementwebsite.service

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[Unit]
2+
Description=Case management website
3+
After=network.target
4+
5+
[Service]
6+
ExecStart=/usr/bin/dotnet /src/CaseManagement/src/CaseManagement.Website/bin/Debug/netcoreapp2.2/CaseManagement.Website.dll --server.urls="http://*:51724"
7+
KillMode=process
8+
TimeoutStopSec=5s
9+
Restart=always
10+
WorkingDirectory=/src/CaseManagement/src/CaseManagement.Website
11+
12+
[Install]
13+
WantedBy=multi-user.target

default.ps1

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,6 @@ task pack -depends compile {
4646
}
4747

4848
task test {
49-
Push-Location -Path $base_dir\tests\CaseManagement.Workflow.Tests
50-
51-
try {
52-
exec { & dotnet test -c $config --no-build --no-restore }
53-
} finally {
54-
Pop-Location
55-
}
56-
5749
Push-Location -Path $base_dir\tests\CaseManagement.CMMN.Tests
5850

5951
try {

src/CaseManagement.CMMN.Benchmark/BenchmarkDotNet.Artifacts/results/CaseManagement.CMMN.Benchmark.CaseInstanceControllerBenchmark-measurements.csv

Lines changed: 34 additions & 186 deletions
Large diffs are not rendered by default.
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
``` ini
22

3-
BenchmarkDotNet=v0.12.0, OS=Windows 10.0.18362, VM=VMware
4-
Intel Core i5-6440HQ CPU 2.60GHz (Skylake), 1 CPU, 4 logical and 4 physical cores
3+
BenchmarkDotNet=v0.12.0, OS=Windows 10.0.18362
4+
Intel Core i7-8750H CPU 2.20GHz (Coffee Lake), 1 CPU, 12 logical and 6 physical cores
55
.NET Core SDK=3.0.100
6-
[Host] : .NET Core 2.2.8 (CoreCLR 4.6.28207.03, CoreFX 4.6.28208.02), X64 RyuJIT DEBUG [AttachedDebugger]
6+
[Host] : .NET Core 2.2.5 (CoreCLR 4.6.27617.05, CoreFX 4.6.27618.01), X64 RyuJIT DEBUG
77

88
Job=InProcess Toolchain=InProcessEmitToolchain
99

1010
```
11-
| Method | Mean | Error | StdDev | Median | Gen 0 | Gen 1 | Gen 2 | Allocated |
12-
|---------------------- |---------:|---------:|---------:|---------:|----------:|------:|------:|----------:|
13-
| CreateCaseWithOneTask | 123.9 ms | 8.83 ms | 25.05 ms | 116.1 ms | - | - | - | 8.61 KB |
14-
| LaunchCaseWithOneTask | 392.8 ms | 28.68 ms | 81.35 ms | 385.4 ms | 1000.0000 | - | - | 8.61 KB |
11+
| Method | Mean | Error | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
12+
|---------------------- |----------:|----------:|----------:|----------:|---------:|------:|----------:|
13+
| CreateCaseWithOneTask | 167.70 ms | 49.022 ms | 58.357 ms | 1333.3333 | - | - | 7.2 KB |
14+
| LaunchCaseWithOneTask | 64.57 ms | 0.483 ms | 0.404 ms | 1750.0000 | 250.0000 | - | 7.2 KB |

src/CaseManagement.CMMN.Host/Startup.cs

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
using Microsoft.AspNetCore.Authentication.Cookies;
77
using Microsoft.AspNetCore.Builder;
88
using Microsoft.AspNetCore.Hosting;
9+
using Microsoft.AspNetCore.HttpOverrides;
10+
using Microsoft.Extensions.Configuration;
911
using Microsoft.Extensions.DependencyInjection;
1012
using Microsoft.Extensions.Logging;
1113
using System;
@@ -18,7 +20,14 @@ namespace CaseManagement.CMMN.Host
1820
{
1921
public class Startup
2022
{
21-
public Startup(IHostingEnvironment env) { }
23+
private readonly IHostingEnvironment _env;
24+
private readonly IConfiguration _configuration;
25+
26+
public Startup(IHostingEnvironment env, IConfiguration configuration)
27+
{
28+
_env = env;
29+
_configuration = configuration;
30+
}
2231

2332
public void ConfigureServices(IServiceCollection services)
2433
{
@@ -31,7 +40,7 @@ public void ConfigureServices(IServiceCollection services)
3140
services.AddCors(options => options.AddPolicy("AllowAll", p => p.AllowAnyOrigin()
3241
.AllowAnyMethod()
3342
.AllowAnyHeader()));
34-
var files = Directory.EnumerateFiles(Path.Combine(Directory.GetCurrentDirectory(), "Cmmns"), "*.cmmn").ToList();
43+
var files = Directory.EnumerateFiles(Path.Combine(_env.ContentRootPath, "Cmmns"), "*.cmmn").ToList();
3544
services.AddHostedService<BusHostedService>();
3645
services.AddCMMNApi();
3746
services.AddCMMNEngine()
@@ -109,10 +118,20 @@ public void ConfigureServices(IServiceCollection services)
109118
NbCreatedActivation = 1
110119
}
111120
});
121+
services.Configure<ForwardedHeadersOptions>(options =>
122+
{
123+
options.ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
124+
});
112125
}
113126

114127
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
115128
{
129+
if (_configuration.GetChildren().Any(i => i.Key == "pathBase"))
130+
{
131+
app.UsePathBase(_configuration["pathBase"]);
132+
}
133+
134+
app.UseForwardedHeaders();
116135
app.UseAuthentication();
117136
app.UseCors("AllowAll");
118137
app.UseMvc();

src/CaseManagement.ConsoleApp/Program.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using CaseManagement.CMMN;
22
using Microsoft.Extensions.DependencyInjection;
3-
using Microsoft.Extensions.Logging;
43
using System;
54

65
namespace CaseManagement.ConsoleApp

src/CaseManagement.Website/Startup.cs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using Microsoft.AspNetCore.Builder;
22
using Microsoft.AspNetCore.Hosting;
33
using Microsoft.AspNetCore.Http;
4+
using Microsoft.AspNetCore.HttpOverrides;
45
using Microsoft.AspNetCore.Mvc;
56
using Microsoft.Extensions.Configuration;
67
using Microsoft.Extensions.DependencyInjection;
@@ -11,15 +12,7 @@ namespace CaseManagement.Website
1112
{
1213
public class Startup
1314
{
14-
public Startup(IHostingEnvironment env)
15-
{
16-
var builder = new ConfigurationBuilder()
17-
.SetBasePath(env.ContentRootPath)
18-
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
19-
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
20-
.AddEnvironmentVariables();
21-
Configuration = builder.Build();
22-
}
15+
public Startup() { }
2316

2417
public IConfigurationRoot Configuration { get; }
2518

@@ -40,16 +33,22 @@ public void ConfigureServices(IServiceCollection services)
4033

4134
// Add framework services.
4235
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
36+
services.Configure<ForwardedHeadersOptions>(options =>
37+
{
38+
options.ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
39+
});
4340
}
4441

4542
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
4643
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
4744
{
45+
app.UseForwardedHeaders();
4846
var angularRoutes = new[] {
4947
"/home",
5048
"/about",
5149
"/casedefinitions",
52-
"/caseinstances"
50+
"/caseinstances",
51+
"/performances"
5352
};
5453

5554
app.Use(async (context, next) =>

0 commit comments

Comments
 (0)