mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Some cleanup
This commit is contained in:
parent
2632b5c2af
commit
61a53b24fd
7 changed files with 4 additions and 7 deletions
|
|
@ -1,6 +1,5 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
|
||||
import { main } from "../src/main.js";
|
||||
import { initializePackageManager } from "../src/packagemanager/currentPackageManager.js";
|
||||
import { setEcoSystem, ECOSYSTEM_PY } from "../src/config/settings.js";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
// Constant for pip package manager name
|
||||
export const PIP_PACKAGE_MANAGER = "pip";
|
||||
|
||||
// Enum of possible Python/pip invocations for Safe Chain interception
|
||||
|
|
|
|||
|
|
@ -26,11 +26,11 @@ export async function runPip(command, args) {
|
|||
});
|
||||
return { status: result.status };
|
||||
} catch (/** @type any */ error) {
|
||||
ui.writeError(`Error executing command: ${error.message}`);
|
||||
ui.writeError(`Is '${command}' installed and available on your system?`);
|
||||
if (error.status) {
|
||||
return { status: error.status };
|
||||
} else {
|
||||
ui.writeError(`Error executing command: ${error.message}`);
|
||||
ui.writeError(`Is '${command}' installed and available on your system?`);
|
||||
return { status: 1 };
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -145,6 +145,7 @@ function handleConnect(req, clientSocket, head) {
|
|||
if (isKnownRegistry) {
|
||||
mitmConnect(req, clientSocket, isAllowedUrl);
|
||||
} else {
|
||||
// For other hosts, just tunnel the request to the destination tcp socket
|
||||
ui.writeVerbose(`Safe-chain: Tunneling request to ${req.url}`);
|
||||
tunnelRequest(req, clientSocket, head);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,8 +71,6 @@ function createUnixShims(shimsDir) {
|
|||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @param {string} shimsDir
|
||||
*
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ function wrapSafeChainCommand() {
|
|||
else
|
||||
# If the aikido command is not available, print a warning and run the original command
|
||||
printSafeChainWarning "$original_cmd"
|
||||
|
||||
command "$original_cmd" "$@"
|
||||
fi
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,7 +50,6 @@ RUN volta install pnpm@${PNPM_VERSION}
|
|||
# Install Bun
|
||||
RUN curl -fsSL https://bun.sh/install | bash
|
||||
|
||||
|
||||
# Install Python and pip (pip3)
|
||||
RUN apt-get update && apt-get install -y python${PYTHON_VERSION} python3-pip && \
|
||||
ln -sf /usr/bin/python${PYTHON_VERSION} /usr/local/bin/python3 && \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue