license checker

This commit is contained in:
Jan Prochazka
2024-07-31 16:13:59 +02:00
parent 2e847eee9b
commit d537a75d83
5 changed files with 10 additions and 4 deletions

View File

@@ -44,6 +44,7 @@ module.exports = {
isDocker: platformInfo.isDocker,
isElectron: platformInfo.isElectron,
isLicenseValid: platformInfo.isLicenseValid,
licenseError: platformInfo.licenseError,
permissions,
login,
...additionalConfigProps,

View File

@@ -1,5 +1,5 @@
function checkLicense() {
return true;
return null;
}
module.exports = {

View File

@@ -13,7 +13,8 @@ const isDocker = fs.existsSync('/home/dbgate-docker/public');
const isDevMode = process.env.DEVMODE == '1';
const isNpmDist = !!global['IS_NPM_DIST'];
const isForkedApi = processArgs.isForkedApi;
const isLicenseValid = checkLicense();
const licenseError = checkLicense();
const isLicenseValid = licenseError == null;
// function moduleAvailable(name) {
// try {
@@ -33,6 +34,7 @@ const platformInfo = {
isForkedApi,
isElectron: isElectron(),
isLicenseValid,
licenseError,
isDevMode,
isNpmDist,
isSnap: process.env.ELECTRON_SNAP == 'true',