From 4a189cab44186d9186b5dc28a002eaa8ebb9a707 Mon Sep 17 00:00:00 2001 From: Durran Jordan Date: Fri, 17 Nov 2017 11:51:13 +0100 Subject: [PATCH 1/2] COMPASS-2342: Adding compass readonly config --- package.json | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/package.json b/package.json index 234afd65361..15b1af2c71a 100644 --- a/package.json +++ b/package.json @@ -78,6 +78,32 @@ "index" ] } + "compass-readonly": { + "name": "mongodb-compass-readonly", + "productName": "MongoDB Compass Readonly", + "bundleId": "com.mongodb.compass.readonly", + "plugins-directory": ".mongodb/compass-readonly/plugins", + "readonly": true, + "plugins": [ + "node_modules/@mongodb-js/compass-crud", + "node_modules/@mongodb-js/compass-collection-stats", + "node_modules/@mongodb-js/compass-connect", + "node_modules/@mongodb-js/compass-auth-kerberos", + "node_modules/@mongodb-js/compass-auth-ldap", + "node_modules/@mongodb-js/compass-auth-x509", + "node_modules/@mongodb-js/compass-document-validation", + "node_modules/@mongodb-js/compass-deployment-awareness", + "node_modules/@mongodb-js/compass-query-history", + "node_modules/@mongodb-js/compass-security", + "node_modules/@mongodb-js/compass-serverstats", + "node_modules/@mongodb-js/compass-server-version", + "node_modules/@mongodb-js/compass-ssh-tunnel-status", + "node_modules/@mongodb-js/compass-status" + ], + "styles": [ + "index" + ] + }, }, "build": { "win32": { From 1cb0ce62861dac6205ea410f66e1f640857ba8a9 Mon Sep 17 00:00:00 2001 From: Durran Jordan Date: Fri, 17 Nov 2017 11:57:32 +0100 Subject: [PATCH 2/2] COMPASS-2343: Adding HADRON_READONLY env var --- package.json | 4 ++-- src/setup-hadron-distribution.js | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 15b1af2c71a..29fd001a783 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,7 @@ "styles": [ "index" ] - } + }, "compass-readonly": { "name": "mongodb-compass-readonly", "productName": "MongoDB Compass Readonly", @@ -103,7 +103,7 @@ "styles": [ "index" ] - }, + } }, "build": { "win32": { diff --git a/src/setup-hadron-distribution.js b/src/setup-hadron-distribution.js index 9de3df3741b..d39b85aaf1f 100644 --- a/src/setup-hadron-distribution.js +++ b/src/setup-hadron-distribution.js @@ -9,8 +9,11 @@ if (!process.env.HADRON_DISTRIBUTION) { process.env.HADRON_DISTRIBUTION = distribution; } -const name = pkg.config.hadron.distributions[process.env.HADRON_DISTRIBUTION].name; +const config = pkg.config.hadron.distributions[process.env.HADRON_DISTRIBUTION]; +const name = config.name; +const readonly = config.readonly; process.env.HADRON_PRODUCT = name || 'mongodb-compass'; +process.env.HADRON_READONLY = readonly || false; if (pkg.distribution) { process.env.NODE_ENV = 'production';