Skip to content

Commit

Permalink
Fix/use https_proxy for health checks (#169)
Browse files Browse the repository at this point in the history
* fix: use the http proxy for health checks

* chore: version bump
  • Loading branch information
jkoenig134 authored Jun 4, 2024
1 parent 6fa7a5e commit d3d0408
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 3.11.4

- health checks now use `https_proxy` if set

## 3.11.3

- upgrade the runtime version to 4.10.6
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nmshd/connector",
"version": "3.11.3",
"version": "3.11.4",
"private": true,
"description": "The Enmeshed Connector",
"homepage": "https://enmeshed.eu/integrate",
Expand Down
8 changes: 7 additions & 1 deletion src/ConnectorRuntime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { ConsumptionServices, DataViewExpander, GetIdentityInfoResponse, ModuleC
import { AccountController, CoreErrors as TransportCoreErrors } from "@nmshd/transport";
import axios from "axios";
import fs from "fs";
import { HttpsProxyAgent } from "https-proxy-agent";
import { validate as validateSchema } from "jsonschema";
import path from "path";
import { ConnectorMode } from "./ConnectorMode";
Expand Down Expand Up @@ -156,6 +157,7 @@ export class ConnectorRuntime extends Runtime<ConnectorRuntimeConfig> {
dataViewExpander: this._dataViewExpander
} = await this.login(this.accountController, consumptionController));

const httpsProxy = process.env.https_proxy ?? process.env.HTTPS_PROXY;
this.healthChecker = HealthChecker.create(
this.runtimeConfig.database.driver === "lokijs"
? undefined
Expand All @@ -166,7 +168,11 @@ export class ConnectorRuntime extends Runtime<ConnectorRuntimeConfig> {
waitQueueTimeoutMS: 1000,
serverSelectionTimeoutMS: 1000
}),
axios.create({ baseURL: this.transport.config.baseUrl }),
axios.create({
baseURL: this.transport.config.baseUrl,
proxy: false,
httpsAgent: httpsProxy ? new HttpsProxyAgent(httpsProxy) : undefined
}),
this.accountController.authenticator,
this.loggerFactory.getLogger("HealthChecker")
);
Expand Down

0 comments on commit d3d0408

Please sign in to comment.