This commit is contained in:
2019-01-17 20:47:19 +00:00
parent 0959c2bbfe
commit fe3de73e1f
5 changed files with 87 additions and 15 deletions

View File

@@ -98,7 +98,7 @@ namespace AyaNova
bool LOG_SENSITIVE_DATA = false;
#if (DEBUG)
//LOG_SENSITIVE_DATA = true;
//LOG_SENSITIVE_DATA = true;
#endif
@@ -211,15 +211,15 @@ namespace AyaNova
//get the key if specified
var secretKey = ServerBootConfig.AYANOVA_JWT_SECRET;
//If no key specified make a unique one based on license ID which is unique to each customer or trialler
//If no key specified make a unique one
//This means the jwt creds won't survive a server reboot
//so in that case users need to specify an AyaNova_JWT_SECRET environment variable
if (string.IsNullOrWhiteSpace(secretKey))
{
// This ensures a key can't work on another AyaNova installation
if (AyaNova.Core.License.ActiveKey.TrialLicense)
secretKey = AyaNova.Core.License.ActiveKey.Id + "5G*QQJ8#bQ7$Xr_@sXfHq4";
else
secretKey = AyaNova.Core.License.ActiveKey.RegisteredTo + "5G*QQJ8#bQ7$Xr_@sXfHq4";
secretKey = Util.Hasher.GenerateSalt();
}
//WAS "UNLICENSED5G*QQJ8#bQ7$Xr_@sXfHq4"
//If secretKey is less than 32 characters, pad it
if (secretKey.Length < 32)
@@ -380,7 +380,7 @@ namespace AyaNova
// ******************** TESTING WIPE DB *****************************
//
//Set this to true to wipe the db and reinstall a trial license and re-seed the data
var TESTING_REFRESH_DB = true;//#######################################################################################
var TESTING_REFRESH_DB = false;//#######################################################################################
#if (DEBUG)
//TESTING
@@ -438,17 +438,17 @@ namespace AyaNova
{
context.Request.Path = "/index.html";
context.Response.StatusCode = 200;
context.Response.ContentType = "text/html";
context.Response.ContentType = "text/html";
await context.Response.SendFileAsync(Path.Combine(env.WebRootPath, "index.html"));
}
});
//Log the active user count so it's in the log record
_log.LogInformation($"BOOT: Active techs - {UserBiz.ActiveCount}" );
_log.LogInformation($"BOOT: Active techs - {UserBiz.ActiveCount}");
//Log the license info so it's on the record
_log.LogInformation($"BOOT: License -\r\n=-=-=-=-=-=-=-=-=-=-\r\n{AyaNova.Core.License.LicenseInfo}=-=-=-=-=-=-=-=-=-=-" );
_log.LogInformation($"BOOT: License -\r\n=-=-=-=-=-=-=-=-=-=-\r\n{AyaNova.Core.License.LicenseInfo}=-=-=-=-=-=-=-=-=-=-");