Add support for configuring the IP address that is advertised to the API server. (#875)

This is needed when running in fargate as ip.address() will return the wrong ip address.
This commit is contained in:
RJ Burnham
2024-08-23 13:33:16 +01:00
committed by GitHub
parent 2790e6d9ad
commit eccef54b04
3 changed files with 6 additions and 1 deletions

View File

@@ -12,6 +12,7 @@ const {
JAMBONES_TIME_SERIES_HOST,
JAMBONES_ESL_LISTEN_ADDRESS,
PORT,
HTTP_IP,
NODE_ENV,
} = require('../config');
const Registrar = require('@jambonz/mw-registrar');
@@ -193,7 +194,8 @@ function installSrfLocals(srf, logger) {
let localIp;
try {
localIp = ip.address();
// Either use the configured IP address or call ip.address() to find it
localIp = HTTP_IP || ip.address();
} catch (err) {
logger.error({err}, 'installSrfLocals - error detecting local ipv4 address');
}