@tiledesk/tiledesk-server 2.3.91 → 2.3.92

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tiledesk/tiledesk-server",
3
3
  "description": "The Tiledesk server module",
4
- "version": "2.3.91",
4
+ "version": "2.3.92",
5
5
  "scripts": {
6
6
  "start": "node ./bin/www",
7
7
  "pretest": "mongodb-runner start",
@@ -1,6 +1,19 @@
1
1
  const apps = require("@tiledesk/tiledesk-apps");
2
2
  var winston = require('../../config/winston');
3
3
 
4
+ var config = require('../../config/database'); // get db config file
5
+
6
+ let configSecretOrPubicKay = process.env.GLOBAL_SECRET || config.secret;
7
+
8
+ var pKey = process.env.GLOBAL_SECRET_OR_PUB_KEY;
9
+ // console.log("pKey",pKey);
10
+
11
+ if (pKey) {
12
+ configSecretOrPubicKay = pKey.replace(/\\n/g, '\n');
13
+ }
14
+
15
+ // console.log("configSecretOrPubicKay",configSecretOrPubicKay);
16
+
4
17
  class Listener {
5
18
 
6
19
  listen(config) {
@@ -12,7 +25,7 @@ class Listener {
12
25
  }
13
26
 
14
27
  apps.startApp({
15
- ACCESS_TOKEN_SECRET: process.env.APPS_ACCESS_TOKEN_SECRET || 'nodeauthsecret',
28
+ ACCESS_TOKEN_SECRET: process.env.APPS_ACCESS_TOKEN_SECRET || configSecretOrPubicKay,
16
29
  MONGODB_URI: process.env.APPS_MONGODB_URI || config.databaseUri,
17
30
  KALEYRA_ENABLED: process.env.KALEYRA_ENABLED || config.kaleyra_enabled
18
31
  }, () => {