From 4385db09e7b6f5b2915e66236daa7e93493989b7 Mon Sep 17 00:00:00 2001 From: Stephen Russett Date: Wed, 30 Jun 2021 18:11:16 -0400 Subject: [PATCH] cleanup and docker support :ship: --- README.md | 5 ++++ docker/.gitignore | 3 +++ docker/README.md | 27 +++++++++++++++++++ docker/default.yml | 17 ++++++++++++ docker/docker-compose.yml | 20 ++++++++++++++ .../Deployment/DeploymentsTable.razor | 2 +- .../Components/Job/HistoricJobsTable.razor | 16 ++++++----- .../Components/Job/RuntimeJobsTable.razor | 2 +- .../DeleteProcessDefinitionDialog.razor | 2 +- .../ProcessDefinitionsTable.razor | 6 ++--- src/MainApp/MainApp.csproj | 1 + src/MainApp/Program.cs | 20 +++++++++----- src/MainApp/Shared/NavMenu.razor | 16 +++++------ .../wwwroot/appsettings.Development.json | 5 ++++ src/MainApp/wwwroot/appsettings.json | 5 ++++ src/MainApp/wwwroot/index.html | 5 +++- 16 files changed, 123 insertions(+), 29 deletions(-) create mode 100644 docker/.gitignore create mode 100644 docker/README.md create mode 100644 docker/default.yml create mode 100644 docker/docker-compose.yml diff --git a/README.md b/README.md index 0bdb02c..6efea01 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ Default app is a "Kitchen Sick" app that covers runtime and history apis. Contributions and collaboration is always welcomed. + ## Features: 1. Extendable @@ -17,6 +18,10 @@ Contributions and collaboration is always welcomed. 7. Swap APIs for your custom endpoints 8. What more do you need? +# Quick Start for Demos and Development Testing + +See [Docker](./docker) folder + ## Screenshots ### Process Definitions diff --git a/docker/.gitignore b/docker/.gitignore new file mode 100644 index 0000000..b31188d --- /dev/null +++ b/docker/.gitignore @@ -0,0 +1,3 @@ +cammand/ +*.jar +*.p12 \ No newline at end of file diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 0000000..3fd2ff8 --- /dev/null +++ b/docker/README.md @@ -0,0 +1,27 @@ +# Cammad Docker Setup (Alternative UI for Camunda / Replacement for Camunda Webapps) + +**This is a development version for demo purposes!** + +You must access the UI from the root url. +If you copy a url with path or query parameters the page will fail to load. + +## Setup: + +1. Download the Cammand.zip from the Releases and uzip into the `docker/cammand` folder. +1. Add your `keystore.p12` or pcks file for https into the root of the docker folder. +1. Update the `default.yml` for the ssl settings: + ```yml + server.ssl.key-store: classpath:keystore.p12 + server.ssl.key-store-password: 1234567890 + server.ssl.key-store-type: PKCS12 + server.ssl.key-alias: tomcat + ``` +1. run from the docker folder: `docker-compose up` +1. `https://locahost:8080` (note **s** in the https) + +If you want to access the original Camunda WebApps: + +1. `localhost:8080/camunda/app/welcome` +1. `localhost:8080/camunda/app/cockpit` +1. `localhost:8080/camunda/app/tasklist` +1. `localhost:8080/camunda/app/admin` \ No newline at end of file diff --git a/docker/default.yml b/docker/default.yml new file mode 100644 index 0000000..66cd710 --- /dev/null +++ b/docker/default.yml @@ -0,0 +1,17 @@ +#spring: +# datasource: +# url: jdbc:h2:./build/DB/dbdevDb1;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=TRUE # jdbc:h2:~/devDb1;MODE=PostgreSQL;AUTO_SERVER=TRUE +# username: sa +# password: '' + +server: + ssl: + key-store: classpath:keystore.p12 + key-store-password: 1234567890 + key-store-type: PKCS12 + key-alias: tomcat + +camunda: + bpm: + webapp: + index-redirect-enabled: false \ No newline at end of file diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml new file mode 100644 index 0000000..8c3d75c --- /dev/null +++ b/docker/docker-compose.yml @@ -0,0 +1,20 @@ +version: '3.7' + +services: + camunda: + image: camunda/camunda-bpm-platform:run-latest + container_name: camunda-with-cammand + ports: + - "8080:8080" + expose: + - 8080 + volumes: + - ./cammand:/camunda/configuration/userlib/META-INF/resources/ + - ./default.yml:/camunda/configuration/default.yml + - ./keystore.p12:/camunda/configuration/keystore/keystore.p12 + networks: + - camunda-net + +networks: + camunda-net: + driver: bridge \ No newline at end of file diff --git a/src/MainApp/Components/Deployment/DeploymentsTable.razor b/src/MainApp/Components/Deployment/DeploymentsTable.razor index 13a9084..0096ec0 100644 --- a/src/MainApp/Components/Deployment/DeploymentsTable.razor +++ b/src/MainApp/Components/Deployment/DeploymentsTable.razor @@ -30,7 +30,7 @@ @if (_selectedDeployment?.Id == parentContext.Id) { - + diff --git a/src/MainApp/Components/Job/HistoricJobsTable.razor b/src/MainApp/Components/Job/HistoricJobsTable.razor index 23d8056..4ee353e 100644 --- a/src/MainApp/Components/Job/HistoricJobsTable.razor +++ b/src/MainApp/Components/Job/HistoricJobsTable.razor @@ -10,23 +10,25 @@ OnRowClick="@OnRowClicked" Elevation="0"> - Id + Log Id Log Type + Job Id + Job Type Hostname Timestamp Activity Id - Job Id Job Priority Job Due Date - @context.Id + @context.Id @LogTypeElement(context) + @context.JobId + @context.JobDefinitionType @context.Hostname @context.Timestamp @context.ActivityId - @context.JobId @context.JobPriority @context.JobDueDate @@ -35,7 +37,7 @@ @if (_selectedJobLog?.Id == parentContext.Id) { - + @@ -125,8 +127,8 @@ return @; } Console.Error.WriteLine("Unknown Historic Job Log DTO Log type: " + log.ToJson()); - - return @; + + return @; } void OnRowClicked(TableRowClickEventArgs clickedRow) diff --git a/src/MainApp/Components/Job/RuntimeJobsTable.razor b/src/MainApp/Components/Job/RuntimeJobsTable.razor index f0c92b4..628f1bf 100644 --- a/src/MainApp/Components/Job/RuntimeJobsTable.razor +++ b/src/MainApp/Components/Job/RuntimeJobsTable.razor @@ -42,7 +42,7 @@ @if (_selectedJob?.Id == parentContext.Id) { - + diff --git a/src/MainApp/Components/ProcessDefinition/DeleteProcessDefinitionDialog.razor b/src/MainApp/Components/ProcessDefinition/DeleteProcessDefinitionDialog.razor index 40e14af..2628e24 100644 --- a/src/MainApp/Components/ProcessDefinition/DeleteProcessDefinitionDialog.razor +++ b/src/MainApp/Components/ProcessDefinition/DeleteProcessDefinitionDialog.razor @@ -32,7 +32,7 @@ Definition: @ProcessDefinitionId - + @if (_cascade) diff --git a/src/MainApp/Components/ProcessDefinition/ProcessDefinitionsTable.razor b/src/MainApp/Components/ProcessDefinition/ProcessDefinitionsTable.razor index 3d74ad2..5ae0043 100644 --- a/src/MainApp/Components/ProcessDefinition/ProcessDefinitionsTable.razor +++ b/src/MainApp/Components/ProcessDefinition/ProcessDefinitionsTable.razor @@ -33,7 +33,7 @@ @if (_selectedSubDefinition?.Id == parentContext.Id) { - + @@ -86,8 +86,8 @@ - - + + diff --git a/src/MainApp/MainApp.csproj b/src/MainApp/MainApp.csproj index 702d465..65303ae 100644 --- a/src/MainApp/MainApp.csproj +++ b/src/MainApp/MainApp.csproj @@ -9,6 +9,7 @@ + diff --git a/src/MainApp/Program.cs b/src/MainApp/Program.cs index bbeaa81..7bce176 100644 --- a/src/MainApp/Program.cs +++ b/src/MainApp/Program.cs @@ -6,6 +6,8 @@ using Microsoft.Extensions.DependencyInjection; using MudBlazor; using MudBlazor.Services; +using Microsoft.Extensions.Logging; + namespace MainApp { @@ -16,20 +18,24 @@ public static async Task Main(string[] args) var builder = WebAssemblyHostBuilder.CreateDefault(args); builder.RootComponents.Add("#app"); - builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); - - builder.Services.AddHttpClient("CamundaAPI", client => { - client.BaseAddress = new Uri("https://localhost:8080/engine-rest"); - }); + builder.Services.AddScoped( + sp => new HttpClient {BaseAddress = new Uri(builder.HostEnvironment.BaseAddress)}); + + builder.Services.AddHttpClient("CamundaAPI", + client => { client.BaseAddress = new Uri("https://localhost:8080/engine-rest"); }); builder.Services.AddSingleton(); - builder.Services.AddOidcAuthentication(options => { + builder.Services.AddOidcAuthentication(options => + { // Configure your authentication provider options here. // For more information, see https://aka.ms/blazor-standalone-auth builder.Configuration.Bind("Local", options.ProviderOptions); }); + builder.Logging.AddConfiguration( + builder.Configuration.GetSection("Logging")); + builder.Services .AddMudServices(config => { @@ -48,4 +54,4 @@ public static async Task Main(string[] args) await builder.Build().RunAsync(); } } -} +} \ No newline at end of file diff --git a/src/MainApp/Shared/NavMenu.razor b/src/MainApp/Shared/NavMenu.razor index f950164..d2e41ca 100644 --- a/src/MainApp/Shared/NavMenu.razor +++ b/src/MainApp/Shared/NavMenu.razor @@ -5,17 +5,17 @@ Dashboard - Process Definitions - Deployments - Create Deployment - Form Builder - Start New Process Instance - Jobs - Settings + Process Definitions + Deployments + Create Deployment + Form Builder + Start New Process Instance + Jobs + Settings - My Tasks + My Tasks diff --git a/src/MainApp/wwwroot/appsettings.Development.json b/src/MainApp/wwwroot/appsettings.Development.json index fd4a6f0..80b0009 100644 --- a/src/MainApp/wwwroot/appsettings.Development.json +++ b/src/MainApp/wwwroot/appsettings.Development.json @@ -2,5 +2,10 @@ "Local": { "Authority": "https:login.microsoftonline.com/", "ClientId": "33333333-3333-3333-33333333333333333" + }, + "Logging": { + "LogLevel": { + "Default": "Information" + } } } diff --git a/src/MainApp/wwwroot/appsettings.json b/src/MainApp/wwwroot/appsettings.json index fdae94a..f25986f 100644 --- a/src/MainApp/wwwroot/appsettings.json +++ b/src/MainApp/wwwroot/appsettings.json @@ -2,5 +2,10 @@ "Local": { "Authority": "https://login.microsoftonline.com/", "ClientId": "33333333-3333-3333-33333333333333333" + }, + "Logging": { + "LogLevel": { + "Default": "Warning" + } } } diff --git a/src/MainApp/wwwroot/index.html b/src/MainApp/wwwroot/index.html index 123eb12..c77cdb1 100644 --- a/src/MainApp/wwwroot/index.html +++ b/src/MainApp/wwwroot/index.html @@ -1,11 +1,14 @@ + MainApp - + + +