-
diff --git a/Oqtane.Client/UI/Pane.razor b/Oqtane.Client/UI/Pane.razor
index d9f4f299..f193aab0 100644
--- a/Oqtane.Client/UI/Pane.razor
+++ b/Oqtane.Client/UI/Pane.razor
@@ -58,7 +58,11 @@ else
}
if (Name.ToLower() == pane.ToLower())
{
- Module module = PageState.Modules.FirstOrDefault(item => item.ModuleId == PageState.ModuleId);
+ Module module = PageState.Modules.FirstOrDefault(item => item.PageId == PageState.Page.PageId && item.ModuleId == PageState.ModuleId);
+ if (module == null)
+ {
+ module = PageState.Modules.FirstOrDefault(item => item.ModuleId == PageState.ModuleId);
+ }
if (module != null)
{
var moduleType = Type.GetType(module.ModuleType);
@@ -107,8 +111,12 @@ else
{
if (PageState.ModuleId != -1)
{
- Module module = PageState.Modules.FirstOrDefault(item => item.ModuleId == PageState.ModuleId);
- if (module != null && module.Pane.ToLower() == Name.ToLower())
+ Module module = PageState.Modules.FirstOrDefault(item => item.PageId == PageState.Page.PageId && item.ModuleId == PageState.ModuleId);
+ if (module == null)
+ {
+ module = PageState.Modules.FirstOrDefault(item => item.ModuleId == PageState.ModuleId);
+ }
+ if (module != null && module.Pane.ToLower() == Name.ToLower())
{
// check if user is authorized to view module
if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.View, module.PermissionList))
@@ -119,7 +127,7 @@ else
}
else
{
- foreach (Module module in PageState.Modules.Where(item => item.PageId == PageState.Page.PageId && item.Pane.ToLower() == Name.ToLower()).OrderBy(x => x.Order).ToArray())
+ foreach (Module module in PageState.Modules.Where(item => item.PageId == PageState.Page.PageId && item.Pane.ToLower() == Name.ToLower()))
{
// check if user is authorized to view module
if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.View, module.PermissionList))
diff --git a/Oqtane.Database.MySQL/Oqtane.Database.MySQL.csproj b/Oqtane.Database.MySQL/Oqtane.Database.MySQL.csproj
index 034285d0..772cecd9 100644
--- a/Oqtane.Database.MySQL/Oqtane.Database.MySQL.csproj
+++ b/Oqtane.Database.MySQL/Oqtane.Database.MySQL.csproj
@@ -2,7 +2,7 @@
net6.0
- 3.4.2
+ 3.4.3
Oqtane
Shaun Walker
.NET Foundation
@@ -10,7 +10,7 @@
.NET Foundation
https://www.oqtane.org
https://github.com/oqtane/oqtane.framework/blob/dev/LICENSE
- https://github.com/oqtane/oqtane.framework/releases/tag/v3.4.2
+ https://github.com/oqtane/oqtane.framework/releases/tag/v3.4.3
https://github.com/oqtane/oqtane.framework
Git
true
diff --git a/Oqtane.Database.MySQL/Oqtane.Database.MySQL.nuspec b/Oqtane.Database.MySQL/Oqtane.Database.MySQL.nuspec
index 76f1c3a2..e30388a5 100644
--- a/Oqtane.Database.MySQL/Oqtane.Database.MySQL.nuspec
+++ b/Oqtane.Database.MySQL/Oqtane.Database.MySQL.nuspec
@@ -2,7 +2,7 @@
Oqtane.Database.MySQL
- 3.4.2
+ 3.4.3
Shaun Walker
.NET Foundation
Oqtane MySQL Provider
@@ -12,7 +12,7 @@
false
MIT
https://github.com/oqtane/oqtane.framework
- https://github.com/oqtane/oqtane.framework/releases/tag/v3.4.2
+ https://github.com/oqtane/oqtane.framework/releases/tag/v3.4.3
icon.png
oqtane
diff --git a/Oqtane.Database.PostgreSQL/Oqtane.Database.PostgreSQL.csproj b/Oqtane.Database.PostgreSQL/Oqtane.Database.PostgreSQL.csproj
index 0b352b7c..6d6b8f19 100644
--- a/Oqtane.Database.PostgreSQL/Oqtane.Database.PostgreSQL.csproj
+++ b/Oqtane.Database.PostgreSQL/Oqtane.Database.PostgreSQL.csproj
@@ -2,7 +2,7 @@
net6.0
- 3.4.2
+ 3.4.3
Oqtane
Shaun Walker
.NET Foundation
@@ -10,7 +10,7 @@
.NET Foundation
https://www.oqtane.org
https://github.com/oqtane/oqtane.framework/blob/dev/LICENSE
- https://github.com/oqtane/oqtane.framework/releases/tag/v3.4.2
+ https://github.com/oqtane/oqtane.framework/releases/tag/v3.4.3
https://github.com/oqtane/oqtane.framework
Git
true
diff --git a/Oqtane.Database.PostgreSQL/Oqtane.Database.PostgreSQL.nuspec b/Oqtane.Database.PostgreSQL/Oqtane.Database.PostgreSQL.nuspec
index 45e4ccd3..23691ae5 100644
--- a/Oqtane.Database.PostgreSQL/Oqtane.Database.PostgreSQL.nuspec
+++ b/Oqtane.Database.PostgreSQL/Oqtane.Database.PostgreSQL.nuspec
@@ -2,7 +2,7 @@
Oqtane.Database.PostgreSQL
- 3.4.2
+ 3.4.3
Shaun Walker
.NET Foundation
Oqtane PostgreSQL Provider
@@ -12,7 +12,7 @@
false
MIT
https://github.com/oqtane/oqtane.framework
- https://github.com/oqtane/oqtane.framework/releases/tag/v3.4.2
+ https://github.com/oqtane/oqtane.framework/releases/tag/v3.4.3
icon.png
oqtane
diff --git a/Oqtane.Database.SqlServer/Oqtane.Database.SqlServer.csproj b/Oqtane.Database.SqlServer/Oqtane.Database.SqlServer.csproj
index b7887756..ecd413cd 100644
--- a/Oqtane.Database.SqlServer/Oqtane.Database.SqlServer.csproj
+++ b/Oqtane.Database.SqlServer/Oqtane.Database.SqlServer.csproj
@@ -2,7 +2,7 @@
net6.0
- 3.4.2
+ 3.4.3
Oqtane
Shaun Walker
.NET Foundation
@@ -10,7 +10,7 @@
.NET Foundation
https://www.oqtane.org
https://github.com/oqtane/oqtane.framework/blob/dev/LICENSE
- https://github.com/oqtane/oqtane.framework/releases/tag/v3.4.2
+ https://github.com/oqtane/oqtane.framework/releases/tag/v3.4.3
https://github.com/oqtane/oqtane.framework
Git
true
diff --git a/Oqtane.Database.SqlServer/Oqtane.Database.SqlServer.nuspec b/Oqtane.Database.SqlServer/Oqtane.Database.SqlServer.nuspec
index 92891873..e61b079e 100644
--- a/Oqtane.Database.SqlServer/Oqtane.Database.SqlServer.nuspec
+++ b/Oqtane.Database.SqlServer/Oqtane.Database.SqlServer.nuspec
@@ -2,7 +2,7 @@
Oqtane.Database.SqlServer
- 3.4.2
+ 3.4.3
Shaun Walker
.NET Foundation
Oqtane SQL Server Provider
@@ -12,7 +12,7 @@
false
MIT
https://github.com/oqtane/oqtane.framework
- https://github.com/oqtane/oqtane.framework/releases/tag/v3.4.2
+ https://github.com/oqtane/oqtane.framework/releases/tag/v3.4.3
icon.png
oqtane
diff --git a/Oqtane.Database.Sqlite/Oqtane.Database.Sqlite.csproj b/Oqtane.Database.Sqlite/Oqtane.Database.Sqlite.csproj
index 83182f3d..f3f2594e 100644
--- a/Oqtane.Database.Sqlite/Oqtane.Database.Sqlite.csproj
+++ b/Oqtane.Database.Sqlite/Oqtane.Database.Sqlite.csproj
@@ -2,7 +2,7 @@
net6.0
- 3.4.2
+ 3.4.3
Oqtane
Shaun Walker
.NET Foundation
@@ -10,7 +10,7 @@
.NET Foundation
https://www.oqtane.org
https://github.com/oqtane/oqtane.framework/blob/dev/LICENSE
- https://github.com/oqtane/oqtane.framework/releases/tag/v3.4.2
+ https://github.com/oqtane/oqtane.framework/releases/tag/v3.4.3
https://github.com/oqtane/oqtane.framework
Git
true
diff --git a/Oqtane.Database.Sqlite/Oqtane.Database.Sqlite.nuspec b/Oqtane.Database.Sqlite/Oqtane.Database.Sqlite.nuspec
index 10fd65b2..d748a047 100644
--- a/Oqtane.Database.Sqlite/Oqtane.Database.Sqlite.nuspec
+++ b/Oqtane.Database.Sqlite/Oqtane.Database.Sqlite.nuspec
@@ -2,7 +2,7 @@
Oqtane.Database.Sqlite
- 3.4.2
+ 3.4.3
Shaun Walker
.NET Foundation
Oqtane SQLite Provider
@@ -12,7 +12,7 @@
false
MIT
https://github.com/oqtane/oqtane.framework
- https://github.com/oqtane/oqtane.framework/releases/tag/v3.4.2
+ https://github.com/oqtane/oqtane.framework/releases/tag/v3.4.3
icon.png
oqtane
diff --git a/Oqtane.Maui/Oqtane.Maui.csproj b/Oqtane.Maui/Oqtane.Maui.csproj
index 4cb0adff..f47ea09a 100644
--- a/Oqtane.Maui/Oqtane.Maui.csproj
+++ b/Oqtane.Maui/Oqtane.Maui.csproj
@@ -6,7 +6,7 @@
Exe
- 3.4.2
+ 3.4.3
Oqtane
Shaun Walker
.NET Foundation
@@ -14,7 +14,7 @@
.NET Foundation
https://www.oqtane.org
https://github.com/oqtane/oqtane.framework/blob/dev/LICENSE
- https://github.com/oqtane/oqtane.framework/releases/tag/v3.4.2
+ https://github.com/oqtane/oqtane.framework/releases/tag/v3.4.3
https://github.com/oqtane/oqtane.framework
Git
Oqtane.Maui
@@ -31,7 +31,7 @@
0E29FC31-1B83-48ED-B6E0-9F3C67B775D4
- 3.4.2
+ 3.4.3
1
14.2
@@ -71,8 +71,8 @@
-
-
+
+
diff --git a/Oqtane.Package/Oqtane.Client.nuspec b/Oqtane.Package/Oqtane.Client.nuspec
index 2a8e5869..99de9771 100644
--- a/Oqtane.Package/Oqtane.Client.nuspec
+++ b/Oqtane.Package/Oqtane.Client.nuspec
@@ -2,7 +2,7 @@
Oqtane.Client
- 3.4.2
+ 3.4.3
Shaun Walker
.NET Foundation
Oqtane Framework
@@ -12,7 +12,7 @@
false
MIT
https://github.com/oqtane/oqtane.framework
- https://github.com/oqtane/oqtane.framework/releases/tag/v3.4.2
+ https://github.com/oqtane/oqtane.framework/releases/tag/v3.4.3
icon.png
oqtane
diff --git a/Oqtane.Package/Oqtane.Framework.nuspec b/Oqtane.Package/Oqtane.Framework.nuspec
index 60a80141..b2bbe94b 100644
--- a/Oqtane.Package/Oqtane.Framework.nuspec
+++ b/Oqtane.Package/Oqtane.Framework.nuspec
@@ -2,7 +2,7 @@
Oqtane.Framework
- 3.4.2
+ 3.4.3
Shaun Walker
.NET Foundation
Oqtane Framework
@@ -11,8 +11,8 @@
.NET Foundation
false
MIT
- https://github.com/oqtane/oqtane.framework/releases/download/v3.4.2/Oqtane.Framework.3.4.2.Upgrade.zip
- https://github.com/oqtane/oqtane.framework/releases/tag/v3.4.2
+ https://github.com/oqtane/oqtane.framework/releases/download/v3.4.3/Oqtane.Framework.3.4.3.Upgrade.zip
+ https://github.com/oqtane/oqtane.framework/releases/tag/v3.4.3
icon.png
oqtane framework
diff --git a/Oqtane.Package/Oqtane.Server.nuspec b/Oqtane.Package/Oqtane.Server.nuspec
index 21445f05..e4e993ad 100644
--- a/Oqtane.Package/Oqtane.Server.nuspec
+++ b/Oqtane.Package/Oqtane.Server.nuspec
@@ -2,7 +2,7 @@
Oqtane.Server
- 3.4.2
+ 3.4.3
Shaun Walker
.NET Foundation
Oqtane Framework
@@ -12,7 +12,7 @@
false
MIT
https://github.com/oqtane/oqtane.framework
- https://github.com/oqtane/oqtane.framework/releases/tag/v3.4.2
+ https://github.com/oqtane/oqtane.framework/releases/tag/v3.4.3
icon.png
oqtane
diff --git a/Oqtane.Package/Oqtane.Shared.nuspec b/Oqtane.Package/Oqtane.Shared.nuspec
index ad5d3f9f..965fdcaa 100644
--- a/Oqtane.Package/Oqtane.Shared.nuspec
+++ b/Oqtane.Package/Oqtane.Shared.nuspec
@@ -2,7 +2,7 @@
Oqtane.Shared
- 3.4.2
+ 3.4.3
Shaun Walker
.NET Foundation
Oqtane Framework
@@ -12,7 +12,7 @@
false
MIT
https://github.com/oqtane/oqtane.framework
- https://github.com/oqtane/oqtane.framework/releases/tag/v3.4.2
+ https://github.com/oqtane/oqtane.framework/releases/tag/v3.4.3
icon.png
oqtane
diff --git a/Oqtane.Package/Oqtane.Updater.nuspec b/Oqtane.Package/Oqtane.Updater.nuspec
index 98a4ab4a..12d8391b 100644
--- a/Oqtane.Package/Oqtane.Updater.nuspec
+++ b/Oqtane.Package/Oqtane.Updater.nuspec
@@ -2,7 +2,7 @@
Oqtane.Updater
- 3.4.2
+ 3.4.3
Shaun Walker
.NET Foundation
Oqtane Framework
@@ -12,7 +12,7 @@
false
MIT
https://github.com/oqtane/oqtane.framework
- https://github.com/oqtane/oqtane.framework/releases/tag/v3.4.2
+ https://github.com/oqtane/oqtane.framework/releases/tag/v3.4.3
icon.png
oqtane
diff --git a/Oqtane.Package/install.ps1 b/Oqtane.Package/install.ps1
index 2823927f..ed7f214e 100644
--- a/Oqtane.Package/install.ps1
+++ b/Oqtane.Package/install.ps1
@@ -1 +1 @@
-Compress-Archive -Path "..\Oqtane.Server\bin\Release\net6.0\publish\*" -DestinationPath "Oqtane.Framework.3.4.2.Install.zip" -Force
\ No newline at end of file
+Compress-Archive -Path "..\Oqtane.Server\bin\Release\net6.0\publish\*" -DestinationPath "Oqtane.Framework.3.4.3.Install.zip" -Force
\ No newline at end of file
diff --git a/Oqtane.Package/upgrade.ps1 b/Oqtane.Package/upgrade.ps1
index 910259d8..d05ecaee 100644
--- a/Oqtane.Package/upgrade.ps1
+++ b/Oqtane.Package/upgrade.ps1
@@ -1 +1 @@
-Compress-Archive -Path "..\Oqtane.Server\bin\Release\net6.0\publish\*" -DestinationPath "Oqtane.Framework.3.4.2.Upgrade.zip" -Force
\ No newline at end of file
+Compress-Archive -Path "..\Oqtane.Server\bin\Release\net6.0\publish\*" -DestinationPath "Oqtane.Framework.3.4.3.Upgrade.zip" -Force
\ No newline at end of file
diff --git a/Oqtane.Server/Controllers/InstallationController.cs b/Oqtane.Server/Controllers/InstallationController.cs
index 25976fc9..9de2e512 100644
--- a/Oqtane.Server/Controllers/InstallationController.cs
+++ b/Oqtane.Server/Controllers/InstallationController.cs
@@ -120,6 +120,13 @@ namespace Oqtane.Controllers
var binFolder = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
var assemblyList = new List();
+ // testmode setting is used for validating that the API is downloading the appropriate assemblies to the client
+ bool hashfilename = true;
+ if (_configManager.GetSetting($"{SettingKeys.TestModeKey}", "false") == "true")
+ {
+ hashfilename = false;
+ }
+
// get list of assemblies which should be downloaded to client
var assemblies = AppDomain.CurrentDomain.GetOqtaneClientAssemblies();
var list = assemblies.Select(a => a.GetName().Name).ToList();
@@ -127,7 +134,7 @@ namespace Oqtane.Controllers
// populate assemblies
for (int i = 0; i < list.Count; i++)
{
- assemblyList.Add(new ClientAssembly(Path.Combine(binFolder, list[i] + ".dll")));
+ assemblyList.Add(new ClientAssembly(Path.Combine(binFolder, list[i] + ".dll"), hashfilename));
}
// insert satellite assemblies at beginning of list
@@ -143,7 +150,7 @@ namespace Oqtane.Controllers
{
foreach (var resourceFile in Directory.EnumerateFiles(assembliesFolderPath))
{
- assemblyList.Insert(0, new ClientAssembly(resourceFile));
+ assemblyList.Insert(0, new ClientAssembly(resourceFile, hashfilename));
}
}
else
@@ -160,12 +167,12 @@ namespace Oqtane.Controllers
var instance = Activator.CreateInstance(type) as IModule;
foreach (string name in instance.ModuleDefinition.Dependencies.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Reverse())
{
- var filepath = Path.Combine(binFolder, name + ".dll");
+ var filepath = Path.Combine(binFolder, name.ToLower().EndsWith(".dll") ? name : name + ".dll");
if (System.IO.File.Exists(filepath))
{
if (!assemblyList.Exists(item => item.FilePath == filepath))
{
- assemblyList.Insert(0, new ClientAssembly(filepath));
+ assemblyList.Insert(0, new ClientAssembly(filepath, hashfilename));
}
}
else
@@ -179,12 +186,12 @@ namespace Oqtane.Controllers
var instance = Activator.CreateInstance(type) as ITheme;
foreach (string name in instance.Theme.Dependencies.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Reverse())
{
- var filepath = Path.Combine(binFolder, name + ".dll");
+ var filepath = Path.Combine(binFolder, name.ToLower().EndsWith(".dll") ? name : name + ".dll");
if (System.IO.File.Exists(filepath))
{
if (!assemblyList.Exists(item => item.FilePath == filepath))
{
- assemblyList.Insert(0, new ClientAssembly(filepath));
+ assemblyList.Insert(0, new ClientAssembly(filepath, hashfilename));
}
}
else
@@ -285,11 +292,18 @@ namespace Oqtane.Controllers
public struct ClientAssembly
{
- public ClientAssembly(string filepath)
+ public ClientAssembly(string filepath, bool hashfilename)
{
FilePath = filepath;
DateTime lastwritetime = System.IO.File.GetLastWriteTime(filepath);
- HashedName = GetDeterministicHashCode(filepath).ToString("X8") + "." + lastwritetime.ToString("yyyyMMddHHmmss") + Path.GetExtension(filepath);
+ if (hashfilename)
+ {
+ HashedName = GetDeterministicHashCode(filepath).ToString("X8") + "." + lastwritetime.ToString("yyyyMMddHHmmss") + Path.GetExtension(filepath);
+ }
+ else
+ {
+ HashedName = Path.GetFileNameWithoutExtension(filepath) + "." + lastwritetime.ToString("yyyyMMddHHmmss") + Path.GetExtension(filepath);
+ }
}
public string FilePath { get; private set; }
diff --git a/Oqtane.Server/Controllers/ModuleController.cs b/Oqtane.Server/Controllers/ModuleController.cs
index f6578624..7176057f 100644
--- a/Oqtane.Server/Controllers/ModuleController.cs
+++ b/Oqtane.Server/Controllers/ModuleController.cs
@@ -9,6 +9,7 @@ using Oqtane.Infrastructure;
using Oqtane.Repository;
using Oqtane.Security;
using System.Net;
+using System.Security.Policy;
namespace Oqtane.Controllers
{
@@ -83,6 +84,7 @@ namespace Oqtane.Controllers
modules.Add(module);
}
+ modules = modules.OrderBy(item => item.PageId).ThenBy(item => item.Pane).ThenBy(item => item.Order).ToList();
}
}
else
diff --git a/Oqtane.Server/Controllers/ModuleDefinitionController.cs b/Oqtane.Server/Controllers/ModuleDefinitionController.cs
index db8612e9..a0e6a6a2 100644
--- a/Oqtane.Server/Controllers/ModuleDefinitionController.cs
+++ b/Oqtane.Server/Controllers/ModuleDefinitionController.cs
@@ -268,14 +268,6 @@ namespace Oqtane.Controllers
}
}
- [HttpGet("install")]
- [Authorize(Roles = RoleNames.Host)]
- public void InstallModules()
- {
- _logger.Log(LogLevel.Information, this, LogFunction.Create, "Modules Installed");
- _installationManager.InstallPackages();
- }
-
// GET: api//templates
[HttpGet("templates")]
[Authorize(Roles = RoleNames.Host)]
diff --git a/Oqtane.Server/Controllers/SiteController.cs b/Oqtane.Server/Controllers/SiteController.cs
index 2ce891b7..895744a1 100644
--- a/Oqtane.Server/Controllers/SiteController.cs
+++ b/Oqtane.Server/Controllers/SiteController.cs
@@ -137,6 +137,7 @@ namespace Oqtane.Controllers
site.Modules.Add(module);
}
}
+ site.Modules = site.Modules.OrderBy(item => item.PageId).ThenBy(item => item.Pane).ThenBy(item => item.Order).ToList();
// languages
site.Languages = _languages.GetLanguages(site.SiteId).ToList();
diff --git a/Oqtane.Server/Controllers/ThemeController.cs b/Oqtane.Server/Controllers/ThemeController.cs
index 690db812..7ddad124 100644
--- a/Oqtane.Server/Controllers/ThemeController.cs
+++ b/Oqtane.Server/Controllers/ThemeController.cs
@@ -41,14 +41,6 @@ namespace Oqtane.Controllers
return _themes.GetThemes();
}
- [HttpGet("install")]
- [Authorize(Roles = RoleNames.Host)]
- public void InstallThemes()
- {
- _logger.Log(LogLevel.Information, this, LogFunction.Create, "Themes Installed");
- _installationManager.InstallPackages();
- }
-
// DELETE api//xxx
[HttpDelete("{themename}")]
[Authorize(Roles = RoleNames.Host)]
diff --git a/Oqtane.Server/Infrastructure/InstallationManager.cs b/Oqtane.Server/Infrastructure/InstallationManager.cs
index 2221675f..fa856456 100644
--- a/Oqtane.Server/Infrastructure/InstallationManager.cs
+++ b/Oqtane.Server/Infrastructure/InstallationManager.cs
@@ -12,6 +12,8 @@ using System.Threading.Tasks;
using System.Xml;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
+using Microsoft.Extensions.Logging;
+using Oqtane.Controllers;
using Oqtane.Shared;
// ReSharper disable AssignNullToNotNullAttribute
@@ -21,21 +23,27 @@ namespace Oqtane.Infrastructure
{
private readonly IHostApplicationLifetime _hostApplicationLifetime;
private readonly IWebHostEnvironment _environment;
+ private readonly ILogger _filelogger;
- public InstallationManager(IHostApplicationLifetime hostApplicationLifetime, IWebHostEnvironment environment)
+ public InstallationManager(IHostApplicationLifetime hostApplicationLifetime, IWebHostEnvironment environment, ILogger filelogger)
{
_hostApplicationLifetime = hostApplicationLifetime;
_environment = environment;
+ _filelogger = filelogger;
}
public void InstallPackages()
{
- InstallPackages(_environment.WebRootPath, _environment.ContentRootPath);
+ var errors = InstallPackages(_environment.WebRootPath, _environment.ContentRootPath);
+ if (!string.IsNullOrEmpty(errors))
+ {
+ _filelogger.LogError(errors);
+ }
}
- public static bool InstallPackages(string webRootPath, string contentRootPath)
+ public static string InstallPackages(string webRootPath, string contentRootPath)
{
- bool install = true;
+ string errors = "";
string binPath = Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location);
string sourceFolder = Path.Combine(contentRootPath, "Packages");
@@ -172,16 +180,14 @@ namespace Oqtane.Infrastructure
}
catch (Exception ex)
{
- // problem installing package - logging is not possible as this is a static method
- Debug.WriteLine($"Oqtane Error: Installing Package {packagename} - {ex}");
- install = false;
+ errors += $"Error Installing Package {packagename} - {ex.Message}. ";
}
// remove package
File.Delete(packagename);
}
- return install;
+ return errors;
}
private static string ExtractFile(ZipArchiveEntry entry, string folder, int ignoreLeadingSegments)
@@ -300,7 +306,7 @@ namespace Oqtane.Infrastructure
if (packageversion != "" && Version.Parse(Constants.Version).CompareTo(Version.Parse(packageversion)) <= 0 && packageurl != "")
{
// install Oqtane.Framework and Oqtane.Updater nuget packages
- InstallPackages();
+ InstallPackages(_environment.WebRootPath, _environment.ContentRootPath);
// download upgrade zip package
Uri uri = new Uri(packageurl);
string upgradepackage = Path.Combine(folder, uri.Segments[uri.Segments.Length - 1]);
diff --git a/Oqtane.Server/Oqtane.Server.csproj b/Oqtane.Server/Oqtane.Server.csproj
index 158c27fa..2073c8a6 100644
--- a/Oqtane.Server/Oqtane.Server.csproj
+++ b/Oqtane.Server/Oqtane.Server.csproj
@@ -3,7 +3,7 @@
net6.0
Debug;Release
- 3.4.2
+ 3.4.3
Oqtane
Shaun Walker
.NET Foundation
@@ -11,7 +11,7 @@
.NET Foundation
https://www.oqtane.org
https://github.com/oqtane/oqtane.framework/blob/dev/LICENSE
- https://github.com/oqtane/oqtane.framework/releases/tag/v3.4.2
+ https://github.com/oqtane/oqtane.framework/releases/tag/v3.4.3
https://github.com/oqtane/oqtane.framework
Git
Oqtane
diff --git a/Oqtane.Server/Pages/Sitemap.cshtml.cs b/Oqtane.Server/Pages/Sitemap.cshtml.cs
index 109d1e5d..95cc1dfc 100644
--- a/Oqtane.Server/Pages/Sitemap.cshtml.cs
+++ b/Oqtane.Server/Pages/Sitemap.cshtml.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.IO;
using System.Linq;
using System.Text;
using System.Xml;
@@ -24,16 +25,18 @@ namespace Oqtane.Pages
private readonly IPageRepository _pages;
private readonly IPageModuleRepository _pageModules;
private readonly IModuleDefinitionRepository _moduleDefinitions;
+ private readonly ISettingRepository _settings;
private readonly IUserPermissions _userPermissions;
private readonly ILogManager _logger;
private readonly Alias _alias;
- public SitemapModel(IServiceProvider serviceProvider, IPageRepository pages, IPageModuleRepository pageModules, IModuleDefinitionRepository moduleDefinitions, IUserPermissions userPermissions, IUrlMappingRepository urlMappings, ISyncManager syncManager, ILogManager logger, ITenantManager tenantManager)
+ public SitemapModel(IServiceProvider serviceProvider, IPageRepository pages, IPageModuleRepository pageModules, IModuleDefinitionRepository moduleDefinitions, ISettingRepository settings, IUserPermissions userPermissions, IUrlMappingRepository urlMappings, ISyncManager syncManager, ILogManager logger, ITenantManager tenantManager)
{
_serviceProvider = serviceProvider;
_pages = pages;
_pageModules = pageModules;
_moduleDefinitions = moduleDefinitions;
+ _settings = settings;
_userPermissions = userPermissions;
_logger = logger;
_alias = tenantManager.GetAlias();
@@ -50,7 +53,7 @@ namespace Oqtane.Pages
{
if (_userPermissions.IsAuthorized(null, PermissionNames.View, page.PermissionList) && page.IsNavigation)
{
- sitemap.Add(new Sitemap { Url = _alias.Protocol + _alias.Name + Utilities.NavigateUrl(_alias.Path, page.Path, ""), ModifiedOn = page.ModifiedOn });
+ sitemap.Add(new Sitemap { Url = _alias.Protocol + _alias.Name + Utilities.NavigateUrl(_alias.Path, page.Path, ""), ModifiedOn = DateTime.UtcNow });
foreach (var pageModule in pageModules.Where(item => item.PageId == page.PageId))
{
@@ -68,7 +71,7 @@ namespace Oqtane.Pages
var urls = ((ISitemap)moduleobject).GetUrls(_alias.Path, page.Path, pageModule.Module);
foreach (var url in urls)
{
- sitemap.Add(new Sitemap { Url = _alias.Protocol + _alias.Name + url.Url, ModifiedOn = url.ModifiedOn });
+ sitemap.Add(new Sitemap { Url = _alias.Protocol + _alias.Name + url.Url, ModifiedOn = DateTime.UtcNow });
}
}
catch (Exception ex)
@@ -83,19 +86,21 @@ namespace Oqtane.Pages
}
// write XML
- XmlWriterSettings settings = new XmlWriterSettings();
- settings.Indent = true;
- settings.IndentChars = (" ");
- settings.CloseOutput = true;
- settings.OmitXmlDeclaration = true;
- settings.WriteEndDocumentOnClose = true;
+ var builder = new StringBuilder();
+ var stringWriter = new StringWriterWithEncoding(builder, Encoding.UTF8);
- StringBuilder builder = new StringBuilder();
- using (XmlWriter writer = XmlWriter.Create(builder, settings))
+ var settings = new XmlWriterSettings
{
- writer.WriteStartDocument();
- writer.WriteStartElement("urlset", "http://www.sitemaps.org/schemas/sitemap/0.9");
+ Indent = true,
+ IndentChars = " ",
+ NewLineChars = Environment.NewLine,
+ CloseOutput = true,
+ WriteEndDocumentOnClose = true
+ };
+ using (var writer = XmlWriter.Create(stringWriter, settings))
+ {
+ writer.WriteStartElement("urlset", "http://www.sitemaps.org/schemas/sitemap/0.9");
foreach (var url in sitemap)
{
writer.WriteStartElement("url");
@@ -103,10 +108,29 @@ namespace Oqtane.Pages
writer.WriteElementString("lastmod", url.ModifiedOn.ToString("yyyy-MM-dd"));
writer.WriteEndElement();
}
+ writer.WriteEndElement();
writer.Close();
}
- return Content(builder.ToString());
+ return Content(builder.ToString(), "application/xml");
+ }
+ }
+
+ public class StringWriterWithEncoding : StringWriter
+ {
+ private readonly Encoding _encoding;
+
+ public StringWriterWithEncoding(StringBuilder builder, Encoding encoding) : base(builder)
+ {
+ this._encoding = encoding;
+ }
+
+ public override Encoding Encoding
+ {
+ get
+ {
+ return this._encoding;
+ }
}
}
}
diff --git a/Oqtane.Server/Program.cs b/Oqtane.Server/Program.cs
index 49a5542a..2d762efd 100644
--- a/Oqtane.Server/Program.cs
+++ b/Oqtane.Server/Program.cs
@@ -34,6 +34,7 @@ namespace Oqtane.Server
WebHost.CreateDefaultBuilder(args)
.UseConfiguration(new ConfigurationBuilder()
.AddCommandLine(args)
+ .AddEnvironmentVariables()
.Build())
.UseStartup()
.ConfigureLocalizationSettings()
diff --git a/Oqtane.Server/Repository/ModuleDefinitionRepository.cs b/Oqtane.Server/Repository/ModuleDefinitionRepository.cs
index 3351a81f..793c30c2 100644
--- a/Oqtane.Server/Repository/ModuleDefinitionRepository.cs
+++ b/Oqtane.Server/Repository/ModuleDefinitionRepository.cs
@@ -48,6 +48,7 @@ namespace Oqtane.Repository
_db.Entry(moduleDefinition).State = EntityState.Modified;
_db.SaveChanges();
_permissions.UpdatePermissions(moduleDefinition.SiteId, EntityNames.ModuleDefinition, moduleDefinition.ModuleDefinitionId, moduleDefinition.PermissionList);
+ _cache.Remove("moduledefinitions");
}
public void DeleteModuleDefinition(int moduleDefinitionId)
@@ -322,10 +323,10 @@ namespace Oqtane.Repository
permission.EntityName = p.EntityName;
permission.EntityId = p.EntityId;
permission.PermissionName = p.PermissionName;
- permission.RoleId = p.RoleId;
+ permission.RoleId = null;
permission.RoleName = p.RoleName;
permission.UserId = p.UserId;
- permission.IsAuthorized = p.IsAuthorized;
+ permission.IsAuthorized = p.IsAuthorized;
permissions.Add(permission);
}
return permissions;
diff --git a/Oqtane.Server/Repository/PermissionRepository.cs b/Oqtane.Server/Repository/PermissionRepository.cs
index 44b04fa1..ba26537c 100644
--- a/Oqtane.Server/Repository/PermissionRepository.cs
+++ b/Oqtane.Server/Repository/PermissionRepository.cs
@@ -36,9 +36,10 @@ namespace Oqtane.Repository
{
if (permission.RoleId != null && string.IsNullOrEmpty(permission.RoleName))
{
- permission.RoleName = roles.Find(item => item.RoleId == permission.RoleId).Name;
+ permission.RoleName = roles.Find(item => item.RoleId == permission.RoleId)?.Name;
}
}
+ permissions = permissions.Where(item => item.UserId != null || item.RoleName != null).ToList();
entry.SlidingExpiration = TimeSpan.FromMinutes(30);
return permissions;
});
@@ -93,11 +94,7 @@ namespace Oqtane.Repository
permission.EntityId = (permission.EntityName == entityName) ? entityId : -1;
if (permission.UserId == null && permission.RoleId == null && !string.IsNullOrEmpty(permission.RoleName))
{
- var role = roles.FirstOrDefault(item => item.Name == permission.RoleName);
- if (role != null)
- {
- permission.RoleId = role.RoleId;
- }
+ permission.RoleId = roles.FirstOrDefault(item => item.Name == permission.RoleName)?.RoleId;
}
}
// add or update permissions
diff --git a/Oqtane.Server/Repository/SiteRepository.cs b/Oqtane.Server/Repository/SiteRepository.cs
index 29dede6b..b17ca189 100644
--- a/Oqtane.Server/Repository/SiteRepository.cs
+++ b/Oqtane.Server/Repository/SiteRepository.cs
@@ -431,7 +431,6 @@ namespace Oqtane.Repository
PermissionList = new List
{
new Permission(PermissionNames.View, RoleNames.Admin, true),
- new Permission(PermissionNames.View, RoleNames.Registered, true),
new Permission(PermissionNames.Edit, RoleNames.Admin, true)
},
PageTemplateModules = new List
@@ -442,7 +441,6 @@ namespace Oqtane.Repository
PermissionList = new List
{
new Permission(PermissionNames.View, RoleNames.Admin, true),
- new Permission(PermissionNames.View, RoleNames.Registered, true),
new Permission(PermissionNames.Edit, RoleNames.Admin, true)
},
Content = ""
diff --git a/Oqtane.Server/Startup.cs b/Oqtane.Server/Startup.cs
index 6ee68ec6..9e008722 100644
--- a/Oqtane.Server/Startup.cs
+++ b/Oqtane.Server/Startup.cs
@@ -16,6 +16,7 @@ using Oqtane.Repository;
using Oqtane.Security;
using Oqtane.Shared;
using Microsoft.AspNetCore.HttpOverrides;
+using Microsoft.Extensions.Logging;
namespace Oqtane
{
@@ -24,6 +25,7 @@ namespace Oqtane
private readonly bool _useSwagger;
private readonly IWebHostEnvironment _env;
private readonly string[] _installedCultures;
+ private string _configureServicesErrors;
public IConfigurationRoot Configuration { get; }
@@ -32,7 +34,8 @@ namespace Oqtane
var builder = new ConfigurationBuilder()
.SetBasePath(env.ContentRootPath)
.AddJsonFile("appsettings.json", false, true)
- .AddJsonFile($"appsettings.{env.EnvironmentName}.json", true, true);
+ .AddJsonFile($"appsettings.{env.EnvironmentName}.json", true, true)
+ .AddEnvironmentVariables();
Configuration = builder.Build();
_installedCultures = localizationManager.GetInstalledCultures();
@@ -85,7 +88,7 @@ namespace Oqtane
.AddOqtaneSingletonServices();
// install any modules or themes ( this needs to occur BEFORE the assemblies are loaded into the app domain )
- InstallationManager.InstallPackages(_env.WebRootPath, _env.ContentRootPath);
+ _configureServicesErrors += InstallationManager.InstallPackages(_env.WebRootPath, _env.ContentRootPath);
// register transient scoped core services
services.AddOqtaneTransientServices();
@@ -142,8 +145,13 @@ namespace Oqtane
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
- public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ISyncManager sync)
+ public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ISyncManager sync, ILogger logger)
{
+ if (!string.IsNullOrEmpty(_configureServicesErrors))
+ {
+ logger.LogError(_configureServicesErrors);
+ }
+
ServiceActivator.Configure(app.ApplicationServices);
if (env.IsDevelopment())
diff --git a/Oqtane.Server/wwwroot/Packages/Oqtane.Database.MySQL.nupkg.bak b/Oqtane.Server/wwwroot/Packages/Oqtane.Database.MySQL.nupkg.bak
index 5384f1c7..6375fd66 100644
Binary files a/Oqtane.Server/wwwroot/Packages/Oqtane.Database.MySQL.nupkg.bak and b/Oqtane.Server/wwwroot/Packages/Oqtane.Database.MySQL.nupkg.bak differ
diff --git a/Oqtane.Server/wwwroot/Packages/Oqtane.Database.PostgreSQL.nupkg.bak b/Oqtane.Server/wwwroot/Packages/Oqtane.Database.PostgreSQL.nupkg.bak
index 28ef718f..1fe60104 100644
Binary files a/Oqtane.Server/wwwroot/Packages/Oqtane.Database.PostgreSQL.nupkg.bak and b/Oqtane.Server/wwwroot/Packages/Oqtane.Database.PostgreSQL.nupkg.bak differ
diff --git a/Oqtane.Server/wwwroot/Packages/Oqtane.Database.SqlServer.nupkg.bak b/Oqtane.Server/wwwroot/Packages/Oqtane.Database.SqlServer.nupkg.bak
index 09bb866a..0bbc834b 100644
Binary files a/Oqtane.Server/wwwroot/Packages/Oqtane.Database.SqlServer.nupkg.bak and b/Oqtane.Server/wwwroot/Packages/Oqtane.Database.SqlServer.nupkg.bak differ
diff --git a/Oqtane.Server/wwwroot/Packages/Oqtane.Database.Sqlite.nupkg.bak b/Oqtane.Server/wwwroot/Packages/Oqtane.Database.Sqlite.nupkg.bak
index 715d4cc0..44b9b064 100644
Binary files a/Oqtane.Server/wwwroot/Packages/Oqtane.Database.Sqlite.nupkg.bak and b/Oqtane.Server/wwwroot/Packages/Oqtane.Database.Sqlite.nupkg.bak differ
diff --git a/Oqtane.Shared/Oqtane.Shared.csproj b/Oqtane.Shared/Oqtane.Shared.csproj
index e4f3c016..00e174e9 100644
--- a/Oqtane.Shared/Oqtane.Shared.csproj
+++ b/Oqtane.Shared/Oqtane.Shared.csproj
@@ -3,7 +3,7 @@
net6.0
Debug;Release
- 3.4.2
+ 3.4.3
Oqtane
Shaun Walker
.NET Foundation
@@ -11,7 +11,7 @@
.NET Foundation
https://www.oqtane.org
https://github.com/oqtane/oqtane.framework/blob/dev/LICENSE
- https://github.com/oqtane/oqtane.framework/releases/tag/v3.4.2
+ https://github.com/oqtane/oqtane.framework/releases/tag/v3.4.3
https://github.com/oqtane/oqtane.framework
Git
Oqtane
diff --git a/Oqtane.Shared/Shared/Constants.cs b/Oqtane.Shared/Shared/Constants.cs
index 4cd3122b..8dc00e73 100644
--- a/Oqtane.Shared/Shared/Constants.cs
+++ b/Oqtane.Shared/Shared/Constants.cs
@@ -4,8 +4,8 @@ namespace Oqtane.Shared
{
public class Constants
{
- public static readonly string Version = "3.4.2";
- public const string ReleaseVersions = "1.0.0,1.0.1,1.0.2,1.0.3,1.0.4,2.0.0,2.0.1,2.0.2,2.1.0,2.2.0,2.3.0,2.3.1,3.0.0,3.0.1,3.0.2,3.0.3,3.1.0,3.1.1,3.1.2,3.1.3,3.1.4,3.2.0,3.2.1,3.3.0,3.3.1,3.4.0,3.4.1,3.4.2";
+ public static readonly string Version = "3.4.3";
+ public const string ReleaseVersions = "1.0.0,1.0.1,1.0.2,1.0.3,1.0.4,2.0.0,2.0.1,2.0.2,2.1.0,2.2.0,2.3.0,2.3.1,3.0.0,3.0.1,3.0.2,3.0.3,3.1.0,3.1.1,3.1.2,3.1.3,3.1.4,3.2.0,3.2.1,3.3.0,3.3.1,3.4.0,3.4.1,3.4.2,3.4.3";
public const string PackageId = "Oqtane.Framework";
public const string ClientId = "Oqtane.Client";
public const string UpdaterPackageId = "Oqtane.Updater";
diff --git a/Oqtane.Shared/Shared/SettingKeys.cs b/Oqtane.Shared/Shared/SettingKeys.cs
index 73681945..abebdf45 100644
--- a/Oqtane.Shared/Shared/SettingKeys.cs
+++ b/Oqtane.Shared/Shared/SettingKeys.cs
@@ -19,5 +19,7 @@ namespace Oqtane.Shared
public const string DefaultContainerKey = "DefaultContainer";
public const string AvailableDatabasesSection = "AvailableDatabases";
+
+ public const string TestModeKey = "TestMode"; // optional - used for testing run-time characteristics
}
}
diff --git a/Oqtane.Test/Oqtane.Test.csproj b/Oqtane.Test/Oqtane.Test.csproj
index 5d21e440..8641026e 100644
--- a/Oqtane.Test/Oqtane.Test.csproj
+++ b/Oqtane.Test/Oqtane.Test.csproj
@@ -3,7 +3,7 @@
net6.0
Debug;Release
- 3.4.2
+ 3.4.3
Oqtane
Shaun Walker
.NET Foundation
@@ -11,7 +11,7 @@
.NET Foundation
https://www.oqtane.org
https://github.com/oqtane/oqtane.framework/blob/dev/LICENSE
- https://github.com/oqtane/oqtane.framework/releases/tag/v3.4.2
+ https://github.com/oqtane/oqtane.framework/releases/tag/v3.4.3
https://github.com/oqtane/oqtane.framework
Git
Oqtane
diff --git a/Oqtane.Updater/Oqtane.Updater.csproj b/Oqtane.Updater/Oqtane.Updater.csproj
index c3b96c4a..9cb41856 100644
--- a/Oqtane.Updater/Oqtane.Updater.csproj
+++ b/Oqtane.Updater/Oqtane.Updater.csproj
@@ -3,7 +3,7 @@
net6.0
Exe
- 3.4.2
+ 3.4.3
Oqtane
Shaun Walker
.NET Foundation
@@ -11,7 +11,7 @@
.NET Foundation
https://www.oqtane.org
https://github.com/oqtane/oqtane.framework/blob/dev/LICENSE
- https://github.com/oqtane/oqtane.framework/releases/tag/v3.4.2
+ https://github.com/oqtane/oqtane.framework/releases/tag/v3.4.3
https://github.com/oqtane/oqtane.framework
Git
Oqtane
diff --git a/README.md b/README.md
index 18f37e76..09322cd9 100644
--- a/README.md
+++ b/README.md
@@ -1,11 +1,11 @@
# Latest Release
-[3.4.1](https://github.com/oqtane/oqtane.framework/releases/tag/v3.4.1) was released on Mar 13, 2023 and is primarily focused on performance, as the permissions system has been overhauled to avoid unnecessary encoding and parsing of custom access control strings. This release also includes enhancements to connection string management, numerous stabilization and user experience improvements, and the ability to dynamically generate an XML sitemap for seach engine indexing. This release includes 62 pull requests by 6 different contributors, pushing the total number of project commits all-time over 3300. The Oqtane framework continues to evolve at a rapid pace to meet the needs of .NET developers.
-
-# Oqtane Framework
+[3.4.2](https://github.com/oqtane/oqtane.framework/releases/tag/v3.4.2) was released on Mar 29, 2023 and is primarily focused on performance, as the permissions system has been overhauled to avoid unnecessary encoding and parsing of custom access control strings. This release also includes enhancements to connection string management, numerous stabilization and user experience improvements, and the ability to dynamically generate an XML sitemap for seach engine indexing. This release includes 62 pull requests by 6 different contributors, pushing the total number of project commits all-time over 3300. The Oqtane framework continues to evolve at a rapid pace to meet the needs of .NET developers.
[](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Foqtane%2Foqtane.framework%2Fmaster%2Fazuredeploy.json)
+# Oqtane Framework
+

Oqtane is a Modular Application Framework. It leverages Blazor, an open source and cross-platform web UI framework for building single-page apps using .NET and C# instead of JavaScript. Blazor apps are composed of reusable web UI components implemented using C#, HTML, and CSS. Both client and server code is written in C#, allowing you to share code and libraries.
@@ -50,6 +50,9 @@ This project is open source, and therefore is a work in progress...
- [ ] File / New Project experience
- [ ] Folder Providers
+[3.4.2](https://github.com/oqtane/oqtane.framework/releases/tag/v3.4.2) ( Mar 29, 2023 )
+- [x] Stabilization improvements
+
[3.4.1](https://github.com/oqtane/oqtane.framework/releases/tag/v3.4.1) ( Mar 13, 2023 )
- [x] Stabilization improvements
diff --git a/azuredeploy.json b/azuredeploy.json
index 07e1838c..dc1fd89a 100644
--- a/azuredeploy.json
+++ b/azuredeploy.json
@@ -2,13 +2,40 @@
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.1",
"parameters": {
+ "sqlDatabaseEditionTierDtuCapacity": {
+ "type": "string",
+ "defaultValue": "Standard-S1-20-250",
+ "allowedValues": [
+ "Basic-Basic-5-2",
+ "Standard-S0-10-250",
+ "Standard-S1-20-250",
+ "Standard-S2-50-250",
+ "Standard-S3-100-250",
+ "Standard-S4-200-250",
+ "Standard-S6-400-250",
+ "Standard-S7-800-250",
+ "Standard-S9-1600-250",
+ "Standard-S12-3000-250",
+ "Premium-P1-125-500",
+ "Premium-P2-250-500",
+ "Premium-P4-500-500" ,
+ "Premium-P6-1000-500",
+ "Premium-P11-1750-500-1024",
+ "Premium-P15-4000-1024",
+ "GeneralPurpose-GP_Gen5_2-2-250",
+ "GeneralPurpose-GP_S_Gen5_2-2-250"
+ ],
+ "metadata": {
+ "description": "Describes the database Edition, Tier, Dtu, Gigabytes (Edition-Tier-Dtu-Gigabytes)"
+ }
+ },
"sqlServerName": {
"type": "string",
"metadata": {
"description": "The name of the sql server. It has to be unique."
}
},
- "databaseName": {
+ "sqlDatabaseName": {
"type": "string",
"metadata": {
"description": "The name of the sql databaseName. It has to be unique."
@@ -35,21 +62,29 @@
"BlazorSKU": {
"type": "string",
"allowedValues": [
- "Free",
- "Shared",
- "Basic",
- "Standard"
+ "F1",
+ "D1",
+ "B1",
+ "B2",
+ "B3",
+ "S1",
+ "S2",
+ "S3",
+ "P1",
+ "P2",
+ "P3",
+ "P4"
],
- "defaultValue": "Standard"
+ "defaultValue": "B1"
},
- "BlazorWorkerSize": {
- "type": "string",
- "allowedValues": [
- "0",
- "1",
- "2"
- ],
- "defaultValue": "0"
+ "BlazorSKUCapacity": {
+ "type": "int",
+ "defaultValue": 1,
+ "maxValue": 3,
+ "minValue": 1,
+ "metadata": {
+ "description": "Describes plan's instance count"
+ }
},
"location": {
"type": "string",
@@ -61,84 +96,83 @@
},
"variables": {
"hostingPlanName": "[concat('Oqtane-hostingplan-', uniqueString(resourceGroup().id))]",
- "databaseEdition": "Standard",
"databaseCollation": "SQL_Latin1_General_CP1_CI_AS",
- "databaseServiceObjectiveName": "Standard"
+ "databaseEditionTierDtuCapacity": "[split(parameters('sqlDatabaseEditionTierDtuCapacity'),'-')]",
+ "databaseEdition": "[variables('databaseEditionTierDtuCapacity')[0]]",
+ "databaseTier": "[variables('databaseEditionTierDtuCapacity')[1]]",
+ "databaseDtu": "[if(greater(length(variables('databaseEditionTierDtuCapacity')), 2), variables('databaseEditionTierDtuCapacity')[2], '')]",
+ "databaseMaxSizeGigaBytes":"[if(greater(length(variables('databaseEditionTierDtuCapacity')), 3), variables('databaseEditionTierDtuCapacity')[3], '')]",
+ "databaseServerlessTiers": [
+ "GP_S_Gen5_2"
+ ]
},
"resources": [
{
- "name": "[parameters('sqlServerName')]",
"type": "Microsoft.Sql/servers",
- "apiVersion": "2014-04-01",
- "location": "[resourceGroup().location]",
+ "apiVersion": "2021-11-01",
+ "name": "[parameters('sqlServerName')]",
+ "location": "[parameters('location')]",
"tags": {
- "displayName": "SqlServer"
+ "displayName": "SQL Server"
},
"properties": {
"administratorLogin": "[parameters('sqlAdministratorLogin')]",
"administratorLoginPassword": "[parameters('sqlAdministratorLoginPassword')]",
"version": "12.0"
+ }
+ },
+ {
+ "type": "Microsoft.Sql/servers/databases",
+ "apiVersion": "2021-11-01",
+ "name": "[format('{0}/{1}', parameters('sqlServerName'), parameters('sqlDatabaseName'))]",
+ "location": "[parameters('location')]",
+ "tags": {
+ "displayName": "Database"
},
- "resources": [
- {
- "name": "[parameters('databaseName')]",
- "type": "databases",
- "apiVersion": "2015-01-01",
- "location": "[resourceGroup().location]",
- "tags": {
- "displayName": "Database"
- },
- "properties": {
- "edition": "[variables('databaseEdition')]",
- "collation": "[variables('databaseCollation')]",
- "requestedServiceObjectiveName": "[variables('databaseServiceObjectiveName')]"
- },
- "dependsOn": [
- "[parameters('sqlServerName')]"
- ],
- "resources": [
- {
- "comments": "Transparent Data Encryption",
- "name": "current",
- "type": "transparentDataEncryption",
- "apiVersion": "2014-04-01-preview",
- "properties": {
- "status": "Enabled"
- },
- "dependsOn": [
- "[parameters('databaseName')]"
- ]
- }
- ]
- },
- {
- "name": "AllowAllMicrosoftAzureIps",
- "type": "firewallrules",
- "apiVersion": "2014-04-01",
- "location": "[resourceGroup().location]",
- "properties": {
- "endIpAddress": "0.0.0.0",
- "startIpAddress": "0.0.0.0"
- },
- "dependsOn": [
- "[parameters('sqlServerName')]"
- ]
- }
+ "sku": {
+ "name": "[if(equals(variables('databaseEdition'), 'GeneralPurpose'), variables('databaseTier'), variables('databaseEdition'))]",
+ "tier": "[variables('databaseEdition')]",
+ "capacity": "[if(equals(variables('databaseDtu'), ''), json('null'), int(variables('databaseDtu')))]"
+ },
+ "kind": "[concat('v12.0,user,vcore',if(contains(variables('databaseServerlessTiers'),variables('databaseTier')),',serverless',''))]",
+ "properties": {
+ "edition": "[variables('databaseEdition')]",
+ "collation": "[variables('databaseCollation')]",
+ "maxSizeBytes": "[if(equals(variables('databaseMaxSizeGigaBytes'), ''), json('null'), mul(mul(mul(int(variables('databaseMaxSizeGigaBytes')),1024),1024),1024))]",
+ "requestedServiceObjectiveName": "[variables('databaseTier')]"
+
+ },
+ "dependsOn": [
+ "[resourceId('Microsoft.Sql/servers', parameters('sqlserverName'))]"
+ ]
+ },
+ {
+ "type": "Microsoft.Sql/servers/firewallRules",
+ "apiVersion": "2021-11-01",
+ "name": "[format('{0}/{1}', parameters('sqlServerName'), 'AllowAllWindowsAzureIps')]",
+ "properties": {
+ "endIpAddress": "0.0.0.0",
+ "startIpAddress": "0.0.0.0"
+ },
+ "dependsOn": [
+ "[resourceId('Microsoft.Sql/servers', parameters('sqlServerName'))]"
]
},
{
"name": "[variables('hostingPlanName')]",
"type": "Microsoft.Web/serverfarms",
"location": "[resourceGroup().location]",
- "apiVersion": "2014-06-01",
+ "apiVersion": "2022-09-01",
"dependsOn": [],
"tags": {
"displayName": "Blazor"
},
+ "sku": {
+ "name": "[parameters('BlazorSKU')]",
+ "capacity": "[parameters('BlazorSKUCapacity')]"
+ },
"properties": {
"name": "[variables('hostingPlanName')]",
- "sku": "[parameters('BlazorSKU')]",
- "workerSize": "[parameters('BlazorWorkerSize')]",
"numberOfWorkers": 1
}
},
@@ -169,8 +203,8 @@
"name": "web",
"location": "[parameters('location')]",
"dependsOn": [
- "[resourceId('Microsoft.Web/sites', parameters('BlazorWebsiteName'))]",
- "[resourceId('Microsoft.Web/Sites/config', parameters('BlazorWebsiteName'), 'connectionstrings')]"
+ "[resourceId('Microsoft.Web/sites', parameters('BlazorWebsiteName'))]"
+ //"[resourceId('Microsoft.Web/Sites/config', parameters('BlazorWebsiteName'), 'connectionstrings')]"
],
"properties": {
"RepoUrl": "https://github.com/oqtane/oqtane.framework.git",
@@ -181,4 +215,4 @@
]
}
]
-}
+}
\ No newline at end of file