Skip to content

Commit 2813979

Browse files
authored
COMPASS-2343: Adding HADRON_READONLY env var (#1335)
* COMPASS-2342: Adding compass readonly config * COMPASS-2343: Adding HADRON_READONLY env var
1 parent b6f7f25 commit 2813979

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

package.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,32 @@
7777
"styles": [
7878
"index"
7979
]
80+
},
81+
"compass-readonly": {
82+
"name": "mongodb-compass-readonly",
83+
"productName": "MongoDB Compass Readonly",
84+
"bundleId": "com.mongodb.compass.readonly",
85+
"plugins-directory": ".mongodb/compass-readonly/plugins",
86+
"readonly": true,
87+
"plugins": [
88+
"node_modules/@mongodb-js/compass-crud",
89+
"node_modules/@mongodb-js/compass-collection-stats",
90+
"node_modules/@mongodb-js/compass-connect",
91+
"node_modules/@mongodb-js/compass-auth-kerberos",
92+
"node_modules/@mongodb-js/compass-auth-ldap",
93+
"node_modules/@mongodb-js/compass-auth-x509",
94+
"node_modules/@mongodb-js/compass-document-validation",
95+
"node_modules/@mongodb-js/compass-deployment-awareness",
96+
"node_modules/@mongodb-js/compass-query-history",
97+
"node_modules/@mongodb-js/compass-security",
98+
"node_modules/@mongodb-js/compass-serverstats",
99+
"node_modules/@mongodb-js/compass-server-version",
100+
"node_modules/@mongodb-js/compass-ssh-tunnel-status",
101+
"node_modules/@mongodb-js/compass-status"
102+
],
103+
"styles": [
104+
"index"
105+
]
80106
}
81107
},
82108
"build": {

src/setup-hadron-distribution.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ if (!process.env.HADRON_DISTRIBUTION) {
99
process.env.HADRON_DISTRIBUTION = distribution;
1010
}
1111

12-
const name = pkg.config.hadron.distributions[process.env.HADRON_DISTRIBUTION].name;
12+
const config = pkg.config.hadron.distributions[process.env.HADRON_DISTRIBUTION];
13+
const name = config.name;
14+
const readonly = config.readonly;
1315
process.env.HADRON_PRODUCT = name || 'mongodb-compass';
16+
process.env.HADRON_READONLY = readonly || false;
1417

1518
if (pkg.distribution) {
1619
process.env.NODE_ENV = 'production';

0 commit comments

Comments
 (0)