From 7f6d1546f201854918207602c67e76b9a0bd3d72 Mon Sep 17 00:00:00 2001 From: Jonatan Nilsson Date: Sat, 2 Apr 2022 20:13:35 +0000 Subject: [PATCH] util: Do not expose the entire application config, only relevant parts --- api/util.mjs | 7 ++++++- client/module.js | 2 ++ package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/api/util.mjs b/api/util.mjs index 2f55f35..673ca91 100644 --- a/api/util.mjs +++ b/api/util.mjs @@ -22,7 +22,12 @@ export function getConfig(ctx) { applications: [] } for (let app of ctx.core.applications) { - merge[app.name] = app.config + merge[app.name] = { + provider: app.config.provider || null, + url: app.config.url || null, + port: app.config.port || null, + scAllowStop: app.config.scAllowStop || null, + } merge.applications.push(app.name) } return defaults(ctx.db.config, merge) diff --git a/client/module.js b/client/module.js index cfc22f6..2b930c4 100644 --- a/client/module.js +++ b/client/module.js @@ -10,6 +10,8 @@ const core = { status: {}, } +window.core = core + socket.on('core.config', function(res) { core.apps = [] let keys = Object.keys(res) diff --git a/package.json b/package.json index ea97cc7..b1e682e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sc-manager", - "version": "2.0.2", + "version": "2.0.3", "description": "", "main": "index.js", "scripts": {