Skip to content
This repository was archived by the owner on Oct 23, 2024. It is now read-only.

Commit 7d0e30f

Browse files
authored
Support config portal hostname and ip_address by env (#428)
1 parent 3805967 commit 7d0e30f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

source/portal/index.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,16 @@ config.rabbit = config.rabbit || {};
4242
config.rabbit.host = config.rabbit.host || 'localhost';
4343
config.rabbit.port = config.rabbit.port || 5672;
4444

45+
// Parse portal hostname and ip_address variables from ENV.
46+
if (config.portal.ip_address.indexOf('$') == 0) {
47+
config.portal.ip_address = process.env[config.portal.ip_address.substr(1)];
48+
log.info('ENV: config.portal.ip_address=' + config.portal.ip_address);
49+
}
50+
if (config.portal.hostname.indexOf('$') == 0) {
51+
config.portal.hostname = process.env[config.portal.hostname.substr(1)];
52+
log.info('ENV: config.portal.hostname=' + config.portal.hostname);
53+
}
54+
4555
global.config = config;
4656

4757

0 commit comments

Comments
 (0)