licensing system change, all internal active, no more scheduleable resources / tech licensing
This commit is contained in:
@@ -76,9 +76,9 @@ namespace rockfishCore.Controllers
|
|||||||
//if there is an active trial for this db then can't do this they must request we re-release it or completely zap the database instead
|
//if there is an active trial for this db then can't do this they must request we re-release it or completely zap the database instead
|
||||||
long MustBeOlderThan = 0;
|
long MustBeOlderThan = 0;
|
||||||
if (r.Perpetual)
|
if (r.Perpetual)
|
||||||
MustBeOlderThan = DateUtil.DateToEpoch(DateTime.Now.AddDays((RavenKeyFactory.PERPETUAL_TRIAL_PERIOD_DAYS * -1)));
|
MustBeOlderThan = DateUtil.DateToEpoch(DateTime.Now.AddDays((RavenKeyFactory.TRIAL_PERIOD_DAYS * -1)));
|
||||||
else
|
else
|
||||||
MustBeOlderThan = DateUtil.DateToEpoch(DateTime.Now.AddHours((RavenKeyFactory.SUBSCRIPTION_TRIAL_PERIOD_HOURS * -1)));
|
MustBeOlderThan = DateUtil.DateToEpoch(DateTime.Now.AddDays((RavenKeyFactory.TRIAL_PERIOD_DAYS * -1)));
|
||||||
|
|
||||||
|
|
||||||
if (await ct.TrialRequest.Where(z => z.DbId == r.DbId && z.DtProcessed != null && z.DtProcessed > MustBeOlderThan).AnyAsync())
|
if (await ct.TrialRequest.Where(z => z.DbId == r.DbId && z.DtProcessed != null && z.DtProcessed > MustBeOlderThan).AnyAsync())
|
||||||
|
|||||||
@@ -6,31 +6,7 @@ using Org.BouncyCastle.Security;
|
|||||||
using Org.BouncyCastle.Crypto;
|
using Org.BouncyCastle.Crypto;
|
||||||
using Org.BouncyCastle.OpenSsl;
|
using Org.BouncyCastle.OpenSsl;
|
||||||
|
|
||||||
/*
|
|
||||||
Sample key:
|
|
||||||
[KEY
|
|
||||||
{
|
|
||||||
"Key": {
|
|
||||||
"LicenseFormat": "8",
|
|
||||||
"Id": "1660594773",
|
|
||||||
"RegisteredTo": "AAA TEST DEVELOPMENT",
|
|
||||||
"DBID": "1q3Q8MedzUQ/VQVWjQiLs3o/7nSbNFUpF5KzkM/Ny0M=",
|
|
||||||
"Perpetual": true,
|
|
||||||
"LicenseExpiration": "5555-01-01T00:00:00",
|
|
||||||
"MaintenanceExpiration": "2023-08-15T00:00:00",
|
|
||||||
"Features": [
|
|
||||||
{
|
|
||||||
"Name": "ServiceTechs",
|
|
||||||
"Count": 100
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
KEY]
|
|
||||||
[SIGNATURE
|
|
||||||
VaVGBaXjnh1A7etqYp9bu5XkGaLxD2AplT+DERaIL8gHqSEj+1s3seEZpuRBJAvof5j++Si3ZCuesYL2M6IQUwmimYMwbQPH07MixOYxgc4kKMO53AwTmtBxwEzUYdhMn5i3g/2xOpJoXTsyqOJ0v1ZidFswQs8vVtxBO8uanlMKzFpXZE8K0cI8ZII9nRdBoUERO+JoEE16l/UAgi6O7KT8l1r225RodFhAThrdAT5ntIJ0JaTHPaMgnYb25VGS9LYQUWU7nkA+IsfddjxZW70a8IHXvQ1B5oV6srFVdkS4wY0dgbT+k7VJBDhMmltRDdOUH
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
namespace rockfishCore.Util
|
namespace rockfishCore.Util
|
||||||
@@ -38,8 +14,9 @@ namespace rockfishCore.Util
|
|||||||
//Key generator controller
|
//Key generator controller
|
||||||
public static class RavenKeyFactory
|
public static class RavenKeyFactory
|
||||||
{
|
{
|
||||||
public const int PERPETUAL_TRIAL_PERIOD_DAYS = 5;
|
//Sept 2022 decided all trial periods are 7 days, they can keep renewing a new trial by erasing data or request a longer period case by case
|
||||||
public const int SUBSCRIPTION_TRIAL_PERIOD_HOURS = 48;
|
public const int TRIAL_PERIOD_DAYS = 7;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Unlicensed token
|
//Unlicensed token
|
||||||
@@ -50,8 +27,7 @@ namespace rockfishCore.Util
|
|||||||
|
|
||||||
//LICENSE USER COUNT FEATURES
|
//LICENSE USER COUNT FEATURES
|
||||||
|
|
||||||
//PERPETUAL Scheduleable users
|
|
||||||
private const string ACTIVE_SERVICE_TECHS_FEATURE_NAME = "ServiceTechs";
|
|
||||||
|
|
||||||
//SUBSCRIPTION
|
//SUBSCRIPTION
|
||||||
private const string ACTIVE_INTERNAL_USERS_FEATURE_NAME = "ActiveInternalUsers";
|
private const string ACTIVE_INTERNAL_USERS_FEATURE_NAME = "ActiveInternalUsers";
|
||||||
@@ -113,11 +89,7 @@ namespace rockfishCore.Util
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (f.Feature == ACTIVE_SERVICE_TECHS_FEATURE_NAME)
|
|
||||||
{
|
|
||||||
sb.AppendLine($"Scheduleable resources: {f.Count}");
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
//default for items added later not tokenized
|
//default for items added later not tokenized
|
||||||
if (f.Count > 0)
|
if (f.Count > 0)
|
||||||
sb.AppendLine($"{f.Feature}: {f.Count}");
|
sb.AppendLine($"{f.Feature}: {f.Count}");
|
||||||
@@ -252,15 +224,15 @@ namespace rockfishCore.Util
|
|||||||
if (Perpetual)
|
if (Perpetual)
|
||||||
{
|
{
|
||||||
//trial period time limit
|
//trial period time limit
|
||||||
k.MaintenanceExpiration = k.LicenseExpiration = DateTime.UtcNow.AddDays(PERPETUAL_TRIAL_PERIOD_DAYS);
|
k.MaintenanceExpiration = k.LicenseExpiration = DateTime.UtcNow.AddDays(TRIAL_PERIOD_DAYS);
|
||||||
//enough techs to easily cover huge amounts of seeding (it's actually only 15 at the moment but you never know this is some buffer)
|
//5k inside staff users will cover huge seeding level easily
|
||||||
k.Features.Add(new LicenseFeature() { Feature = ACTIVE_SERVICE_TECHS_FEATURE_NAME, Count = 250 });
|
k.Features.Add(new LicenseFeature() { Feature = ACTIVE_INTERNAL_USERS_FEATURE_NAME, Count = 5000 });
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//SUBSCRIPTION
|
//SUBSCRIPTION
|
||||||
//trial period time limit
|
//trial period time limit
|
||||||
k.MaintenanceExpiration = k.LicenseExpiration = DateTime.UtcNow.AddHours(SUBSCRIPTION_TRIAL_PERIOD_HOURS);
|
k.MaintenanceExpiration = k.LicenseExpiration = DateTime.UtcNow.AddDays(TRIAL_PERIOD_DAYS);
|
||||||
|
|
||||||
//20k customer contacts will cover huge seeding level easily
|
//20k customer contacts will cover huge seeding level easily
|
||||||
//5k inside staff users will cover huge seeding level easily
|
//5k inside staff users will cover huge seeding level easily
|
||||||
@@ -283,13 +255,14 @@ namespace rockfishCore.Util
|
|||||||
k.Perpetual = Perpetual;
|
k.Perpetual = Perpetual;
|
||||||
if (Perpetual)
|
if (Perpetual)
|
||||||
{
|
{
|
||||||
k.MaintenanceExpiration = k.LicenseExpiration = DateTime.UtcNow.AddDays(PERPETUAL_TRIAL_PERIOD_DAYS);
|
k.MaintenanceExpiration = k.LicenseExpiration = DateTime.UtcNow.AddDays(TRIAL_PERIOD_DAYS);
|
||||||
k.Features.Add(new LicenseFeature() { Feature = ACTIVE_SERVICE_TECHS_FEATURE_NAME, Count = 250 });
|
//5k inside staff users will cover huge seeding level easily
|
||||||
|
k.Features.Add(new LicenseFeature() { Feature = ACTIVE_INTERNAL_USERS_FEATURE_NAME, Count = 5000 });
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//SUBSCRIPTION
|
//SUBSCRIPTION
|
||||||
k.MaintenanceExpiration = k.LicenseExpiration = DateTime.UtcNow.AddHours(SUBSCRIPTION_TRIAL_PERIOD_HOURS);
|
k.MaintenanceExpiration = k.LicenseExpiration = DateTime.UtcNow.AddDays(TRIAL_PERIOD_DAYS);
|
||||||
|
|
||||||
//20k customer contacts will cover huge seeding level easily
|
//20k customer contacts will cover huge seeding level easily
|
||||||
//5k inside staff users will cover huge seeding level easily
|
//5k inside staff users will cover huge seeding level easily
|
||||||
|
|||||||
@@ -75,8 +75,8 @@ app.ravLicense = (function () {
|
|||||||
|
|
||||||
if ($("#perpetual").prop("checked")) {
|
if ($("#perpetual").prop("checked")) {
|
||||||
features.push({
|
features.push({
|
||||||
Feature: "ServiceTechs",
|
Feature: "ActiveInternalUsers",
|
||||||
Count: Number($("#techcount").val())
|
Count: Number($("#perpetusercount").val())
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if (!$("#licenseExpires").prop("checked")) {
|
if (!$("#licenseExpires").prop("checked")) {
|
||||||
@@ -137,7 +137,7 @@ app.ravLicense = (function () {
|
|||||||
onPerpetualChanged = function (event) {
|
onPerpetualChanged = function (event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
$("#perpettechcountblock").toggleClass("d-none");
|
$("#perpetusercountblock").toggleClass("d-none");
|
||||||
$("#subusercountblock").toggleClass("d-none");
|
$("#subusercountblock").toggleClass("d-none");
|
||||||
$("#subcustcountblock").toggleClass("d-none");
|
$("#subcustcountblock").toggleClass("d-none");
|
||||||
|
|
||||||
|
|||||||
@@ -96,14 +96,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="perpettechcountblock" class="col-sm-6 d-none">
|
<div id="perpetusercountblock" class="col-sm-6 d-none">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="techcount">Scheduleable users</label>
|
<label for="perpetusercount">Internal users</label>
|
||||||
<input
|
<input
|
||||||
class="form-control"
|
class="form-control"
|
||||||
type="number"
|
type="number"
|
||||||
id="techcount"
|
id="perpetusercount"
|
||||||
name="techcount"
|
name="perpetusercount"
|
||||||
value="1"
|
value="1"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user