feat: Introduce getLicense graphQL query

This commit is contained in:
Faruk AYDIN
2023-02-14 22:01:34 +01:00
parent 1847ad5622
commit 1dfb22d02e
7 changed files with 67 additions and 4 deletions

View File

@@ -32,6 +32,7 @@ type AppConfig = {
bullMQDashboardPassword: string;
telemetryEnabled: boolean;
requestBodySizeLimit: string;
licenseKey: string;
};
const host = process.env.HOST || 'localhost';
@@ -40,7 +41,7 @@ const port = process.env.PORT || '3000';
const serveWebAppSeparately =
process.env.SERVE_WEB_APP_SEPARATELY === 'true' ? true : false;
let apiUrl = (new URL(`${protocol}://${host}:${port}`)).toString();
let apiUrl = new URL(`${protocol}://${host}:${port}`).toString();
apiUrl = apiUrl.substring(0, apiUrl.length - 1);
// use apiUrl by default, which has less priority over the following cases
@@ -48,14 +49,14 @@ let webAppUrl = apiUrl;
if (process.env.WEB_APP_URL) {
// use env. var. if provided
webAppUrl = (new URL(process.env.WEB_APP_URL)).toString();
webAppUrl = new URL(process.env.WEB_APP_URL).toString();
webAppUrl = webAppUrl.substring(0, webAppUrl.length - 1);
} else if (serveWebAppSeparately) {
// no env. var. and serving separately, sign of development
webAppUrl = 'http://localhost:3001'
webAppUrl = 'http://localhost:3001';
}
let webhookUrl = (new URL(process.env.WEBHOOK_URL || apiUrl)).toString();
let webhookUrl = new URL(process.env.WEBHOOK_URL || apiUrl).toString();
webhookUrl = webhookUrl.substring(0, webhookUrl.length - 1);
const appEnv = process.env.APP_ENV || 'development';
@@ -91,6 +92,7 @@ const appConfig: AppConfig = {
webhookUrl,
telemetryEnabled: process.env.TELEMETRY_ENABLED === 'false' ? false : true,
requestBodySizeLimit: '1mb',
licenseKey: process.env.LICENSE_KEY,
};
if (!appConfig.encryptionKey) {