This commit is contained in:
@@ -44,7 +44,7 @@ namespace AyaNova.Api.ControllerHelpers
|
||||
//Only SuperUser account (id=1) can login or do anything, treats as if server was set to closed even if they change it to open
|
||||
//only way to reset it is to fetch a valid license
|
||||
//
|
||||
var msg = $"{reason}\r\nOnly *the* SuperUser account can login to make changes";
|
||||
var msg = $"{reason}\r\nLogin as SuperUser to start evaluation / install license";
|
||||
SetState(ServerState.OpsOnly, msg);
|
||||
SYSTEM_LOCK = true;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace AyaNova.Api.Controllers
|
||||
//https://superuser.com/questions/361297/what-colour-is-the-dark-green-on-old-fashioned-green-screen-computer-displays
|
||||
var errorBlock = string.Empty;
|
||||
if (serverState.IsSystemLocked)
|
||||
errorBlock = $@"<div class=""error""><h1>SERVER ERROR</h1><h2>{serverState.Reason}</h2></div>";
|
||||
errorBlock = $@"<div class=""error""><h1>SERVER LOCKED</h1><h2>{serverState.Reason}</h2></div>";
|
||||
var resp = $@"<!DOCTYPE html>
|
||||
<html lang=""en"">
|
||||
<head>
|
||||
@@ -444,7 +444,7 @@ namespace AyaNova.Api.Controllers
|
||||
DBSchemaVersion = AySchema.currentSchema,
|
||||
ServerLocalTime = DateUtil.ServerDateTimeString(System.DateTime.UtcNow),
|
||||
ServerTimeZone = TimeZoneInfo.Local.Id,
|
||||
ServerDbId= AyaNova.Core.License.ServerDbId,
|
||||
ServerDbId = AyaNova.Core.License.ServerDbId,
|
||||
License = AyaNova.Core.License.LicenseInfoAsJson
|
||||
}
|
||||
});
|
||||
|
||||
@@ -9,6 +9,7 @@ using AyaNova.Biz;
|
||||
using AyaNova.Models;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using AyaNova.Util;
|
||||
|
||||
|
||||
namespace AyaNova.Api.Controllers
|
||||
@@ -135,8 +136,38 @@ namespace AyaNova.Api.Controllers
|
||||
return Accepted();
|
||||
|
||||
}
|
||||
//------------
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get server configuration
|
||||
/// </summary>
|
||||
/// <returns>Active server configuration</returns>
|
||||
[HttpGet("active-configuration")]
|
||||
public ActionResult GetActiveConfiguration()
|
||||
{
|
||||
if (!Authorized.HasReadFullRole(HttpContext.Items, AyaType.ServerState))
|
||||
return StatusCode(403, new ApiNotAuthorizedResponse());
|
||||
|
||||
|
||||
return Ok(ApiOkResponse.Response(
|
||||
new
|
||||
{
|
||||
AYANOVA_DEFAULT_TRANSLATION = ServerBootConfig.AYANOVA_DEFAULT_TRANSLATION,
|
||||
AYANOVA_USE_URLS = ServerBootConfig.AYANOVA_USE_URLS,
|
||||
AYANOVA_DB_CONNECTION = ServerBootConfig.AYANOVA_DB_CONNECTION,
|
||||
AYANOVA_FOLDER_USER_FILES = ServerBootConfig.AYANOVA_FOLDER_USER_FILES,
|
||||
AYANOVA_FOLDER_BACKUP_FILES = ServerBootConfig.AYANOVA_FOLDER_BACKUP_FILES,
|
||||
AYANOVA_BACKUP_PG_DUMP_PATH = ServerBootConfig.AYANOVA_BACKUP_PG_DUMP_PATH,
|
||||
AYANOVA_LOG_PATH = ServerBootConfig.AYANOVA_LOG_PATH,
|
||||
AYANOVA_LOG_LEVEL = ServerBootConfig.AYANOVA_LOG_LEVEL,
|
||||
AYANOVA_LOG_ENABLE_LOGGER_DIAGNOSTIC_LOG = ServerBootConfig.AYANOVA_LOG_ENABLE_LOGGER_DIAGNOSTIC_LOG
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
//------------
|
||||
|
||||
}
|
||||
}
|
||||
@@ -19,16 +19,19 @@ namespace AyaNova.Util
|
||||
#endif
|
||||
|
||||
//TEST MODE - BOOT WILL ERASE DB AND GENERATE SAMPLE DATA EVERY TIME
|
||||
//** Not intended for end users
|
||||
internal static bool AYANOVA_SERVER_TEST_MODE { get; set; }
|
||||
internal static decimal AYANOVA_SERVER_TEST_MODE_TZ_OFFSET { get; set; }
|
||||
internal static string AYANOVA_SERVER_TEST_MODE_SEEDLEVEL { get; set; }
|
||||
|
||||
//CONTENTROOTPATH
|
||||
//** Not intended for end users
|
||||
internal static string AYANOVA_CONTENT_ROOT_PATH { get; set; } //Note: set in startup.cs, not in program.cs as it requires startup IHostingEnvironment
|
||||
|
||||
|
||||
//LANGUAGE / Translation
|
||||
internal static string AYANOVA_DEFAULT_TRANSLATION { get; set; }
|
||||
//** Not intended for end users
|
||||
internal static long AYANOVA_DEFAULT_TRANSLATION_ID { get; set; } //internal setting set at boot by TranslationBiz::ValidateTranslations
|
||||
|
||||
//API
|
||||
@@ -37,6 +40,7 @@ namespace AyaNova.Util
|
||||
|
||||
//DATABASE
|
||||
internal static string AYANOVA_DB_CONNECTION { get; set; }
|
||||
//** Not intended for end users
|
||||
internal static bool AYANOVA_PERMANENTLY_ERASE_DATABASE { get; set; }
|
||||
|
||||
//FILE FOLDERS
|
||||
|
||||
Reference in New Issue
Block a user