feat: Add configurable proxy for outgoing traffic to prevent SSRF

This commit is contained in:
Maksim Eltyshev
2026-02-09 13:33:27 +01:00
parent aa3ebd5add
commit 538280d197
12 changed files with 174 additions and 8 deletions
+15 -6
View File
@@ -26,12 +26,21 @@ module.exports = {
async fn(inputs) {
try {
await promisifyExecFile(`${sails.config.appPath}/.venv/bin/python3`, [
`${sails.config.appPath}/utils/send_notifications.py`,
JSON.stringify(inputs.services),
inputs.title,
JSON.stringify(inputs.bodyByFormat),
]);
await promisifyExecFile(
`${sails.config.appPath}/.venv/bin/python3`,
[
`${sails.config.appPath}/utils/send_notifications.py`,
JSON.stringify(inputs.services),
inputs.title,
JSON.stringify(inputs.bodyByFormat),
],
{
env: {
HTTP_PROXY: sails.config.custom.outgoingProxy,
HTTPS_PROXY: sails.config.custom.outgoingProxy,
},
},
);
} catch (error) {
sails.log.error(`Error sending notifications: ${error.stderr || error.message}`);
}