Comment out the proxy for testing purposes

This commit is contained in:
Sander Declerck 2026-01-09 15:34:44 +01:00
parent 6d2d943e18
commit 40a79e2019
No known key found for this signature in database
3 changed files with 24 additions and 23 deletions

View file

@ -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() {

View file

@ -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",

View file

@ -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,
}; };
} }