feat(monitors): route checks through an outbound HTTP proxy
Deployments with restricted egress could not run checks at all: got does not read HTTP_PROXY/HTTPS_PROXY (unlike curl or axios), and NODE_USE_ENV_PROXY only affects Node's built-in fetch, which got does not use. Even a correctly built proxy agent was discarded, because HttpProvider overwrote options.agent on every request. Proxy selection is resolved per check and applied where the agent is chosen. NO_PROXY handling is delegated to proxy-from-env rather than reimplemented, so wildcards, host lists and port-qualified entries behave exactly as operators expect from curl. Infrastructure monitors are excluded by default. Hardware and pagespeed checks both delegate to HttpProvider, so a naive global proxy would also capture Capture agents — which normally sit on the internal network, where proxying them fails or hairpins. PROXY_MONITOR_TYPES is the escape hatch for deployments whose agents genuinely are behind the proxy, and accepts "none" to disable proxying without unsetting the environment variables. Values that are not real monitor types, or that open raw sockets and cannot be proxied (ping, port, docker, grpc, websocket, dns, game), are dropped and logged so a typo cannot silently disable proxying. Agents are cached by proxy URL and TLS mode. Keying on TLS matters: sharing one agent between a strict monitor and an ignoreTlsErrors monitor would leak the relaxed setting across monitors. Caching also preserves pooling, so 50 monitors share tunnels instead of dialling the proxy per check. Both new dependencies were already present transitively (76K total). Notification providers still call out directly and are unaffected; that is a known follow-up for the same class of deployment.
This commit is contained in:
1 parent
a719edb0fc
commit
705c19f7c8
10 files changed
+471
-30
No files matched your search
@@ -49,6 +49,7 @@
|
||||
"got": "14.4.7",
|
||||
"handlebars": "^4.7.8",
|
||||
"helmet": "^8.0.0",
|
||||
"https-proxy-agent": "^9.1.0",
|
||||
"isomorphic-dompurify": "^2.26.0",
|
||||
"jmespath": "^0.16.0",
|
||||
"jsdom": "^26.1.0",
|
||||
@@ -58,6 +59,7 @@
|
||||
"multer": "^1.4.5-lts.2",
|
||||
"nodemailer": "9.0.5",
|
||||
"ping": "0.4.4",
|
||||
"proxy-from-env": "^2.1.0",
|
||||
"re2": "^1.24.1",
|
||||
"sharp": "0.35.3",
|
||||
"ssl-checker": "2.0.10",
|
||||
|
||||
Reference in new issue
Block a user