mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 20:46:01 +00:00
license checking
This commit is contained in:
@@ -43,6 +43,7 @@ module.exports = {
|
||||
allowShellScripting: platformInfo.allowShellScripting,
|
||||
isDocker: platformInfo.isDocker,
|
||||
isElectron: platformInfo.isElectron,
|
||||
isLicenseValid: platformInfo.isLicenseValid,
|
||||
permissions,
|
||||
login,
|
||||
...additionalConfigProps,
|
||||
|
||||
7
packages/api/src/utility/checkLicense.js
Normal file
7
packages/api/src/utility/checkLicense.js
Normal file
@@ -0,0 +1,7 @@
|
||||
function checkLicense() {
|
||||
return true;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
checkLicense,
|
||||
};
|
||||
@@ -3,6 +3,7 @@ const os = require('os');
|
||||
const path = require('path');
|
||||
const processArgs = require('./processArgs');
|
||||
const isElectron = require('is-electron');
|
||||
const { checkLicense } = require('./checkLicense');
|
||||
|
||||
const platform = process.env.OS_OVERRIDE ? process.env.OS_OVERRIDE : process.platform;
|
||||
const isWindows = platform === 'win32';
|
||||
@@ -12,6 +13,7 @@ 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();
|
||||
|
||||
// function moduleAvailable(name) {
|
||||
// try {
|
||||
@@ -30,6 +32,7 @@ const platformInfo = {
|
||||
isElectronBundle: isElectron() && !isDevMode,
|
||||
isForkedApi,
|
||||
isElectron: isElectron(),
|
||||
isLicenseValid,
|
||||
isDevMode,
|
||||
isNpmDist,
|
||||
isSnap: process.env.ELECTRON_SNAP == 'true',
|
||||
|
||||
Reference in New Issue
Block a user