diff --git a/icon.png b/icon.png index 47e1cad..43fb5b7 100644 Binary files a/icon.png and b/icon.png differ diff --git a/icon_elsa.png b/icon_elsa.png new file mode 100644 index 0000000..47e1cad Binary files /dev/null and b/icon_elsa.png differ diff --git a/src/apps/Elsa.ServerAndStudio.Web/Elsa.ServerAndStudio.Web.csproj b/src/apps/Elsa.ServerAndStudio.Web/Elsa.ServerAndStudio.Web.csproj index 23b7189..cd2bfc0 100644 --- a/src/apps/Elsa.ServerAndStudio.Web/Elsa.ServerAndStudio.Web.csproj +++ b/src/apps/Elsa.ServerAndStudio.Web/Elsa.ServerAndStudio.Web.csproj @@ -5,6 +5,11 @@ Linux false + @@ -18,38 +23,39 @@ - + - - + + - - - - - - - - - - + + + + + + + + + + - - - - - + + + + + - - + + - - + + + \ No newline at end of file diff --git a/src/apps/Elsa.ServerAndStudio.Web/Pages/_Host.cshtml b/src/apps/Elsa.ServerAndStudio.Web/Pages/_Host.cshtml index d1fbc2a..7af34d8 100644 --- a/src/apps/Elsa.ServerAndStudio.Web/Pages/_Host.cshtml +++ b/src/apps/Elsa.ServerAndStudio.Web/Pages/_Host.cshtml @@ -5,14 +5,83 @@ var baseUrl = Configuration["Hosting:BaseUrl"] ?? Configuration["Http:BaseUrl"]!; // HttpBaseUrl is for backward compatibility. var apiUrl = $"{baseUrl.TrimEnd('/')}/{(Configuration["Hosting:ApiPrefix"] ?? "elsa/api").TrimStart('/')}"; } + - Elsa Studio 3.5 + Workflow Management + @* *@ @@ -29,7 +98,7 @@ - + @* *@ @@ -56,6 +125,39 @@ } }; + \ No newline at end of file diff --git a/src/apps/Elsa.ServerAndStudio.Web/Program.cs b/src/apps/Elsa.ServerAndStudio.Web/Program.cs index 2987cf1..e202fdc 100644 --- a/src/apps/Elsa.ServerAndStudio.Web/Program.cs +++ b/src/apps/Elsa.ServerAndStudio.Web/Program.cs @@ -15,6 +15,8 @@ using WebhooksCore.Options; using Elsa.Connections.Middleware; using Elsa.IO.Http.Features; using Proto.Persistence.Sqlite; +using Elsa.EntityFrameworkCore.Modules.Identity; +using Proto.Persistence.SqlServer; const bool useMassTransit = true; const bool useProtoActor = true; @@ -51,6 +53,7 @@ services .UseIdentity(identity => { identity.TokenOptions = options => identityTokenSection.Bind(options); + identity.UseEntityFrameworkCore(ef => ef.UseSqlServer(sqlServerConnectionString)); identity.UseConfigurationBasedUserProvider(options => identitySection.Bind(options)); identity.UseConfigurationBasedApplicationProvider(options => identitySection.Bind(options)); identity.UseConfigurationBasedRoleProvider(options => identitySection.Bind(options)); @@ -148,9 +151,13 @@ services if (useProtoActor) { + //elsa.UseProtoActor(proto => proto.PersistenceProvider = _ => + //{ + // return new SqliteProvider(new SqliteConnectionStringBuilder(sqliteConnectionString)); + //}); elsa.UseProtoActor(proto => proto.PersistenceProvider = _ => { - return new SqliteProvider(new SqliteConnectionStringBuilder(sqliteConnectionString)); + return new SqlServerProvider(sqlServerConnectionString, true); }); } @@ -183,9 +190,9 @@ services }); } - elsa.UseConnections( - configure=> configure.AddConnectionsFrom()); - elsa.UseConnectionPersistence(ef=> ef.UseEntityFrameworkCore(f=>f.UseSqlite())); + elsa.UseConnections(configure=> configure.AddConnectionsFrom()); + //elsa.UseConnectionPersistence(ef=> ef.UseEntityFrameworkCore(f=>f.UseSqlite())); + elsa.UseConnectionPersistence(ef => ef.UseEntityFrameworkCore(f => f.UseSqlServer(sqlServerConnectionString))); elsa.UseConnectionsApi(); }); @@ -204,12 +211,13 @@ var app = builder.Build(); // Configure the HTTP request pipeline. if (!app.Environment.IsDevelopment()) { + //app.UsePathBase("/Wf"); app.UseExceptionHandler("/Error"); // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } -app.UseHttpsRedirection(); +//app.UseHttpsRedirection(); app.UseBlazorFrameworkFiles(); app.MapHealthChecks("/health"); app.UseRouting(); @@ -220,4 +228,14 @@ app.UseAuthorization(); app.UseWorkflowsApi(); app.UseWorkflows(); app.MapFallbackToPage("/_Host"); + +//var saltPlain = "Besmellah@rRahman@rrah1m"; +//var passPlain = "Az123456"; +//var saltBytes = Encoding.UTF8.GetBytes(saltPlain); +//var _secretHasher = app.Services.CreateScope().ServiceProvider.GetService(); +//var result = _secretHasher.HashSecret(passPlain, saltBytes); + +//var hashedSalt = result.EncodeSalt(); +//var hashedPass = result.EncodeSecret(); + await app.RunAsync(); \ No newline at end of file diff --git a/src/apps/Elsa.ServerAndStudio.Web/appsettings.json b/src/apps/Elsa.ServerAndStudio.Web/appsettings.json index 09a3f96..6878f72 100644 --- a/src/apps/Elsa.ServerAndStudio.Web/appsettings.json +++ b/src/apps/Elsa.ServerAndStudio.Web/appsettings.json @@ -9,14 +9,16 @@ }, "AllowedHosts": "*", "ConnectionStrings": { - "Sqlite": "Data Source=elsa.sqlite.db;Cache=Shared;", - "RabbitMq": "rabbitmq://guest:guest@localhost:5672", - "MySql": "Server=localhost;Database=elsa;Uid=user;Pwd=password;", - "SqlServer": "Server=.;Database=WorkflowDb;User Id=sa;Password=123456;TrustServerCertificate=True;", - "PostgreSql": "Server=localhost;Username=elsa;Database=elsa;Port=5432;Password=elsa;SSLMode=Prefer;MaxPoolSize=2000;Timeout=60" + "Sqlite": "", //"Data Source=elsa.sqlite.db;Cache=Shared;", + "RabbitMq": "", //"rabbitmq://guest:guest@localhost:5672", + "MySql": "", //"Server=localhost;Database=elsa;Uid=user;Pwd=password;", + "SqlServer": "Server=.;Database=WorkflowDb_3-5-0;User Id=sa;Password=123456;TrustServerCertificate=True;", + "PostgreSql": "" //"Server=localhost;Username=elsa;Database=elsa;Port=5432;Password=elsa;SSLMode=Prefer;MaxPoolSize=2000;Timeout=60" }, - "DatabaseProvider": "Sqlite", + "DatabaseProvider": "SqlServer", //"Sqlite", "Hosting": { + //"BaseUrl": "https://sandbox.parsian-bank.ir/Wf", + //"BaseUrl": "http://192.168.251.160:8080", "BaseUrl": "https://localhost:8080", "ApiPrefix": "/elsa/api" }, @@ -39,8 +41,10 @@ { "Id": "a2323f46-42db-4e15-af8b-94238717d817", "Name": "admin", - "HashedPassword": "TfKzh9RLix6FPcCNeHLkGrysFu3bYxqzGqduNdi8v1U=", - "HashedPasswordSalt": "JEy9kBlhHCNsencitRHlGxmErmSgY+FVyMJulCH27Ds=", + //"HashedPassword": "TfKzh9RLix6FPcCNeHLkGrysFu3bYxqzGqduNdi8v1U=", + //"HashedPasswordSalt": "JEy9kBlhHCNsencitRHlGxmErmSgY+FVyMJulCH27Ds=", + "HashedPassword": "p90gXKnVpt5Q2VZ4KkeOaM5GZN3bqjczoznWbnFMrvo=", + "HashedPasswordSalt": "QmVzbWVsbGFoQHJSYWhtYW5AcnJhaDFt", "Roles": [ "admin" ] @@ -87,9 +91,9 @@ "Sinks": [] }, "CorsPolicy": { - "Origins": ["*"], - "Methods": ["*"], - "Headers": ["*"] + "Origins": [ "*" ], + "Methods": [ "*" ], + "Headers": [ "*" ] }, "Runtime": { "WorkflowInboxCleanup": {