Ensure Install Wizard will only be displayed if the Master database connection string in appsettings.json is not specified. This addresses a potential security issue where the Install Wizard could be displayed in an existing installation if the Master database connection failed during startup.

This commit is contained in:
Shaun Walker
2021-03-30 17:48:49 -04:00
parent 5cd1d3a7af
commit 09c040128a
8 changed files with 63 additions and 32 deletions

View File

@ -25,14 +25,12 @@ namespace Oqtane.Infrastructure
public void Upgrade(Tenant tenant, string version)
{
// core framework upgrade logic - note that you can check if current tenant is Master if you only want to execute logic once
var pageTemplates = new List<PageTemplate>();
// core framework upgrade logic - note that you can check if current tenant is Master if you only want to execute the logic once
switch (version)
{
case "0.9.0":
// add a page to all existing sites on upgrade
// this code is commented out on purpose - it provides an example of how to programmatically add a page to all existing sites on upgrade
var pageTemplates = new List<PageTemplate>();
//pageTemplates.Add(new PageTemplate
//{
// Name = "Test",
@ -68,7 +66,12 @@ namespace Oqtane.Infrastructure
case "2.0.2":
if (tenant.Name == TenantNames.Master)
{
Directory.Delete(Utilities.PathCombine(_environment.WebRootPath, "Modules", "Templates", "Internal", Path.DirectorySeparatorChar.ToString()), true);
// remove Internal module template files as they are no longer supported
var internalTemplatePath = Utilities.PathCombine(_environment.WebRootPath, "Modules", "Templates", "Internal", Path.DirectorySeparatorChar.ToString());
if (Directory.Exists(internalTemplatePath))
{
Directory.Delete(internalTemplatePath, true);
}
}
break;
}