mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Compare commits
1 commit
main
...
0.0.1-no-p
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
40a79e2019 |
3 changed files with 24 additions and 23 deletions
|
|
@ -20,8 +20,8 @@ export async function main(args) {
|
||||||
process.on("SIGINT", handleProcessTermination);
|
process.on("SIGINT", handleProcessTermination);
|
||||||
process.on("SIGTERM", handleProcessTermination);
|
process.on("SIGTERM", handleProcessTermination);
|
||||||
|
|
||||||
const proxy = createSafeChainProxy();
|
// const proxy = createSafeChainProxy();
|
||||||
await proxy.startServer();
|
// await proxy.startServer();
|
||||||
|
|
||||||
// Global error handlers to log unhandled errors
|
// Global error handlers to log unhandled errors
|
||||||
process.on("uncaughtException", (error) => {
|
process.on("uncaughtException", (error) => {
|
||||||
|
|
@ -64,9 +64,9 @@ export async function main(args) {
|
||||||
// Write all buffered logs
|
// Write all buffered logs
|
||||||
ui.writeBufferedLogsAndStopBuffering();
|
ui.writeBufferedLogsAndStopBuffering();
|
||||||
|
|
||||||
if (!proxy.verifyNoMaliciousPackages()) {
|
// if (!proxy.verifyNoMaliciousPackages()) {
|
||||||
return 1;
|
// return 1;
|
||||||
}
|
// }
|
||||||
|
|
||||||
const auditStats = getAuditStats();
|
const auditStats = getAuditStats();
|
||||||
if (auditStats.totalPackages > 0) {
|
if (auditStats.totalPackages > 0) {
|
||||||
|
|
@ -77,18 +77,18 @@ export async function main(args) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (proxy.hasSuppressedVersions()) {
|
// if (proxy.hasSuppressedVersions()) {
|
||||||
ui.writeInformation(
|
// ui.writeInformation(
|
||||||
`${chalk.yellow(
|
// `${chalk.yellow(
|
||||||
"ℹ"
|
// "ℹ"
|
||||||
)} Safe-chain: Some package versions were suppressed due to minimum age requirement.`
|
// )} Safe-chain: Some package versions were suppressed due to minimum age requirement.`
|
||||||
);
|
// );
|
||||||
ui.writeInformation(
|
// ui.writeInformation(
|
||||||
` To disable this check, use: ${chalk.cyan(
|
// ` To disable this check, use: ${chalk.cyan(
|
||||||
"--safe-chain-skip-minimum-package-age"
|
// "--safe-chain-skip-minimum-package-age"
|
||||||
)}`
|
// )}`
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
|
|
||||||
// Returning the exit code back to the caller allows the promise
|
// Returning the exit code back to the caller allows the promise
|
||||||
// to be awaited in the bin files and return the correct exit code
|
// to be awaited in the bin files and return the correct exit code
|
||||||
|
|
@ -100,9 +100,10 @@ export async function main(args) {
|
||||||
// Returning the exit code back to the caller allows the promise
|
// Returning the exit code back to the caller allows the promise
|
||||||
// to be awaited in the bin files and return the correct exit code
|
// to be awaited in the bin files and return the correct exit code
|
||||||
return 1;
|
return 1;
|
||||||
} finally {
|
|
||||||
await proxy.stopServer();
|
|
||||||
}
|
}
|
||||||
|
// finally {
|
||||||
|
// // await proxy.stopServer();
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleProcessTermination() {
|
function handleProcessTermination() {
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import { mergeSafeChainProxyEnvironmentVariables } from "../../registryProxy/reg
|
||||||
export async function runYarnCommand(args) {
|
export async function runYarnCommand(args) {
|
||||||
try {
|
try {
|
||||||
const env = mergeSafeChainProxyEnvironmentVariables(process.env);
|
const env = mergeSafeChainProxyEnvironmentVariables(process.env);
|
||||||
await fixYarnProxyEnvironmentVariables(env);
|
// await fixYarnProxyEnvironmentVariables(env);
|
||||||
|
|
||||||
const result = await safeSpawn("yarn", args, {
|
const result = await safeSpawn("yarn", args, {
|
||||||
stdio: "inherit",
|
stdio: "inherit",
|
||||||
|
|
|
||||||
|
|
@ -40,9 +40,9 @@ function getSafeChainProxyEnvironmentVariables() {
|
||||||
const caCertPath = getCombinedCaBundlePath();
|
const caCertPath = getCombinedCaBundlePath();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
HTTPS_PROXY: proxyUrl,
|
// HTTPS_PROXY: proxyUrl,
|
||||||
GLOBAL_AGENT_HTTP_PROXY: proxyUrl,
|
// GLOBAL_AGENT_HTTP_PROXY: proxyUrl,
|
||||||
NODE_EXTRA_CA_CERTS: caCertPath,
|
// NODE_EXTRA_CA_CERTS: caCertPath,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue