fluxflow-cli 2.10.1 → 2.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fluxflow.js +34 -11
- package/package.json +1 -1
package/dist/fluxflow.js
CHANGED
|
@@ -2711,8 +2711,20 @@ var init_exec_command = __esm({
|
|
|
2711
2711
|
return new Promise((resolve) => {
|
|
2712
2712
|
const attempt = (usePowerShell) => {
|
|
2713
2713
|
const command = adjustWindowsCommand(rawCommand, usePowerShell);
|
|
2714
|
-
|
|
2715
|
-
|
|
2714
|
+
let shell = isWin ? usePowerShell ? "powershell.exe" : "cmd.exe" : process.env.SHELL || "bash";
|
|
2715
|
+
let shellArgs = isWin ? usePowerShell ? ["-NoProfile", "-Command", command] : ["/c", command] : ["-c", command];
|
|
2716
|
+
if (systemSettings.networkAccess === false && !isWin) {
|
|
2717
|
+
const originalShell = shell;
|
|
2718
|
+
const originalArgs = [...shellArgs];
|
|
2719
|
+
if (process.platform === "linux") {
|
|
2720
|
+
shell = "unshare";
|
|
2721
|
+
shellArgs = ["-n", "-r", originalShell, ...originalArgs];
|
|
2722
|
+
} else if (process.platform === "darwin") {
|
|
2723
|
+
const sbProfile = '(version 1)\n(allow default)\n(deny network-outbound)\n(allow network-outbound (remote ip "localhost:*"))\n(allow network-outbound (remote ip "127.0.0.1:*"))\n';
|
|
2724
|
+
shell = "sandbox-exec";
|
|
2725
|
+
shellArgs = ["-p", sbProfile, originalShell, ...originalArgs];
|
|
2726
|
+
}
|
|
2727
|
+
}
|
|
2716
2728
|
if (pty) {
|
|
2717
2729
|
try {
|
|
2718
2730
|
const ptyProcess = pty.spawn(shell, shellArgs, {
|
|
@@ -2765,11 +2777,11 @@ ${finalOutput}`);
|
|
|
2765
2777
|
if (isWin && usePowerShell && err.code === "ENOENT") {
|
|
2766
2778
|
return false;
|
|
2767
2779
|
}
|
|
2768
|
-
runStandardSpawn(resolve, command, rawCommand, netEnv, onChunk, usePowerShell);
|
|
2780
|
+
runStandardSpawn(resolve, command, rawCommand, netEnv, onChunk, usePowerShell, systemSettings);
|
|
2769
2781
|
return true;
|
|
2770
2782
|
}
|
|
2771
2783
|
} else {
|
|
2772
|
-
runStandardSpawn(resolve, command, rawCommand, netEnv, onChunk, usePowerShell);
|
|
2784
|
+
runStandardSpawn(resolve, command, rawCommand, netEnv, onChunk, usePowerShell, systemSettings);
|
|
2773
2785
|
return true;
|
|
2774
2786
|
}
|
|
2775
2787
|
};
|
|
@@ -2782,12 +2794,23 @@ ${finalOutput}`);
|
|
|
2782
2794
|
}
|
|
2783
2795
|
});
|
|
2784
2796
|
};
|
|
2785
|
-
runStandardSpawn = (resolve, command, rawCommand, netEnv, onChunk, usePowerShell = true) => {
|
|
2797
|
+
runStandardSpawn = (resolve, command, rawCommand, netEnv, onChunk, usePowerShell = true, systemSettings = {}) => {
|
|
2786
2798
|
const isWin = process.platform === "win32";
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
shell
|
|
2799
|
+
let shell = isWin ? usePowerShell ? "powershell.exe" : "cmd.exe" : process.env.SHELL || "bash";
|
|
2800
|
+
let shellArgs = isWin ? usePowerShell ? ["-NoProfile", "-Command", command] : ["/c", command] : ["-c", command];
|
|
2801
|
+
if (systemSettings.networkAccess === false && !isWin) {
|
|
2802
|
+
const originalShell = shell;
|
|
2803
|
+
const originalArgs = [...shellArgs];
|
|
2804
|
+
if (process.platform === "linux") {
|
|
2805
|
+
shell = "unshare";
|
|
2806
|
+
shellArgs = ["-n", "-r", originalShell, ...originalArgs];
|
|
2807
|
+
} else if (process.platform === "darwin") {
|
|
2808
|
+
const sbProfile = '(version 1)\n(allow default)\n(deny network-outbound)\n(allow network-outbound (remote ip "localhost:*"))\n(allow network-outbound (remote ip "127.0.0.1:*"))\n';
|
|
2809
|
+
shell = "sandbox-exec";
|
|
2810
|
+
shellArgs = ["-p", sbProfile, originalShell, ...originalArgs];
|
|
2811
|
+
}
|
|
2812
|
+
}
|
|
2813
|
+
const child = isWin ? spawn(shell, shellArgs, { cwd: process.cwd(), env: { ...process.env, ...netEnv } }) : spawn(shell, shellArgs, {
|
|
2791
2814
|
cwd: process.cwd(),
|
|
2792
2815
|
env: {
|
|
2793
2816
|
...process.env,
|
|
@@ -2854,7 +2877,7 @@ ${finalOutput}`);
|
|
|
2854
2877
|
child.on("error", (err) => {
|
|
2855
2878
|
if (isWin && usePowerShell && err.code === "ENOENT") {
|
|
2856
2879
|
const cmdCommand = adjustWindowsCommand(rawCommand, false);
|
|
2857
|
-
return runStandardSpawn(resolve, cmdCommand, rawCommand, netEnv, onChunk, false);
|
|
2880
|
+
return runStandardSpawn(resolve, cmdCommand, rawCommand, netEnv, onChunk, false, systemSettings);
|
|
2858
2881
|
}
|
|
2859
2882
|
activeChildProcess = null;
|
|
2860
2883
|
const errorMsg = err instanceof Error ? err.message : String(err);
|
|
@@ -9083,7 +9106,7 @@ ${boxBottom}` };
|
|
|
9083
9106
|
}
|
|
9084
9107
|
if (!forcePrompt && !decision) {
|
|
9085
9108
|
if (systemSettings2.networkAccess === false) {
|
|
9086
|
-
const networkCmdRegex = /\b(curl|wget|
|
|
9109
|
+
const networkCmdRegex = /\b(curl|wget|httpie|fetch|axial|yarn|npm|pnpm|bun|deno|pip|pip3|poetry|uv|gem|cargo|go\s+(get|install)|composer|nuget|ssh|scp|ping|sftp|rsync|docker|podman|kubectl|helm|git\s+(clone|push|pull|fetch)|ftp|telnet|nc|netcat|socat|traceroute|tracert|dig|nslookup|host|nmap|gcloud|aws|az|terraform|ansible-playbook|nix|nix-env)\b/i;
|
|
9087
9110
|
if (networkCmdRegex.test(cmdTrimmed)) {
|
|
9088
9111
|
decision = "deny";
|
|
9089
9112
|
isNetworkDeny = true;
|