add buildVersion, buildNumber and buildDate to server scripts

This commit is contained in:
Alexander.Trofimov
2016-06-29 15:09:09 +03:00
parent 53d96d98da
commit 71ec2a1cb5

View File

@ -35,6 +35,10 @@ const fs = require('fs');
const config = require('config').get('license');
const constants = require('./constants');
const buildVersion = '4.0.0';
const buildNumber = 19;
const buildDate = new Date('6/29/2016');
exports.readLicense = function() {
const resMax = {count: 999999, type: constants.LICENSE_RESULT.Success};
var res = {count: 1, type: constants.LICENSE_RESULT.Error};
@ -48,7 +52,7 @@ exports.readLicense = function() {
const publicKey = '-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDRhGF7X4A0ZVlEg594WmODVVUI\niiPQs04aLmvfg8SborHss5gQXu0aIdUT6nb5rTh5hD2yfpF2WIW6M8z0WxRhwicg\nXwi80H1aLPf6lEPPLvN29EhQNjBpkFkAJUbS8uuhJEeKw0cE49g80eBBF4BCqSL6\nPFQbP9/rByxdxEoAIQIDAQAB\n-----END PUBLIC KEY-----\n';
if (verify.verify(publicKey, sign, 'hex')) {
const endDate = new Date(oLicense['end_date']);
if (endDate >= new Date() && 2 <= oLicense['version']) {
if (endDate >= buildDate && 2 <= oLicense['version']) {
res.count = Math.min(Math.max(res.count, oLicense['process'] >> 0), resMax.count);
res.type = constants.LICENSE_RESULT.Success;
} else {