shell scripts blocked by default only when listen-api

This commit is contained in:
Jan Prochazka 2022-06-12 20:02:48 +02:00
parent 773abc6dff
commit 53e5f1378c
2 changed files with 7 additions and 2 deletions

View File

@ -39,8 +39,8 @@ const platformInfo = {
environment: process.env.NODE_ENV, environment: process.env.NODE_ENV,
platform, platform,
runningInWebpack: !!process.env.WEBPACK_DEV_SERVER_URL, runningInWebpack: !!process.env.WEBPACK_DEV_SERVER_URL,
allowShellConnection: !!process.env.SHELL_CONNECTION || !!isElectron(), allowShellConnection: !processArgs.listenApiChild || !!process.env.SHELL_CONNECTION || !!isElectron(),
allowShellScripting: !!process.env.SHELL_SCRIPTING || !!isElectron(), allowShellScripting: !processArgs.listenApiChild || !!process.env.SHELL_SCRIPTING || !!isElectron(),
defaultKeyfile: path.join(os.homedir(), '.ssh/id_rsa'), defaultKeyfile: path.join(os.homedir(), '.ssh/id_rsa'),
}; };

View File

@ -12,6 +12,7 @@ const isForkedApi = process.argv.includes('--is-forked-api');
const pluginsDir = getNamedArg('--plugins-dir'); const pluginsDir = getNamedArg('--plugins-dir');
const workspaceDir = getNamedArg('--workspace-dir'); const workspaceDir = getNamedArg('--workspace-dir');
const listenApi = process.argv.includes('--listen-api'); const listenApi = process.argv.includes('--listen-api');
const listenApiChild = process.argv.includes('--listen-api-child') || listenApi;
function getPassArgs() { function getPassArgs() {
const res = []; const res = [];
@ -21,6 +22,9 @@ function getPassArgs() {
if (global['PLUGINS_DIR']) { if (global['PLUGINS_DIR']) {
res.push('--plugins-dir', global['PLUGINS_DIR']); res.push('--plugins-dir', global['PLUGINS_DIR']);
} }
if (listenApiChild) {
res.push('listen-api-child');
}
return res; return res;
} }
@ -32,4 +36,5 @@ module.exports = {
pluginsDir, pluginsDir,
workspaceDir, workspaceDir,
listenApi, listenApi,
listenApiChild,
}; };