Skip to content

Commit

Permalink
Amend flags
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-fox committed Aug 18, 2022
1 parent 58c40aa commit 94cca8e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/installationguide.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ The ones relating specific JSON bindings are described in the following table.
| IOTA_MQTT_AVOID_LEADING_SLASH | mqtt.avoidLeadingSlash |
| IOTA_MQTT_CLEAN | mqtt.clean |
| IOTA_MQTT_CLIENT_ID | mqtt.clientId |
| IOTA_MQTT_DISABLED | |
| IOTA_MQTT_DISABLED | mqtt.disabled |
| IOTA_AMQP_HOST | amqp.host |
| IOTA_AMQP_PORT | amqp.port |
| IOTA_AMQP_USERNAME | amqp.username |
Expand All @@ -212,7 +212,7 @@ The ones relating specific JSON bindings are described in the following table.
| IOTA_AMQP_DURABLE | amqp.durable |
| IOTA_AMQP_RETRIES | amqp.retries |
| IOTA_AMQP_RETRY_TIME | amqp.retryTime |
| IOTA_AMQP_DISABLED | |
| IOTA_AMQP_DISABLED | amqp.disabled |
| IOTA_HTTP_HOST | http.host |
| IOTA_HTTP_PORT | http.port |
| IOTA_HTTP_TIMEOUT | http.timeout |
Expand Down
3 changes: 3 additions & 0 deletions lib/bindings/AMQPBinding.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ function start(callback) {
if (!amqpConfig) {
return config.getLogger().error(context, 'Error AMPQ is not configured');
}
if (amqpConfig.disabled) {
return config.getLogger().error(context, 'AMPQ is disabled');
}

if (amqpConfig.exchange) {
exchange = amqpConfig.exchange;
Expand Down
3 changes: 3 additions & 0 deletions lib/bindings/MQTTBinding.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,9 @@ function start(callback) {
if (!mqttConfig) {
return config.getLogger().error(context, 'Error MQTT is not configured');
}
if (mqttConfig.disabled) {
return config.getLogger().error(context, 'MQTT is disabled');
}
const rejectUnauthorized =
typeof mqttConfig.rejectUnauthorized === 'boolean' ? mqttConfig.rejectUnauthorized : true;
let rndSuffix = '_' + Math.random().toString(16).substr(2, 8);
Expand Down
4 changes: 2 additions & 2 deletions lib/configService.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ function processEnvironmentVariables() {
}

if (process.env.IOTA_MQTT_DISABLED && process.env.IOTA_MQTT_DISABLED.trim().toLowerCase() === 'true'){
delete config.mqtt;
config.mqtt.disabled = true;
}

if (anyIsSet(amqpVariables)) {
Expand Down Expand Up @@ -273,7 +273,7 @@ function processEnvironmentVariables() {
}

if (process.env.IOTA_AMPQ_DISABLED && process.env.IOTA_AMPQ_DISABLED.trim().toLowerCase() === 'true'){
delete config.amqp;
config.amqp.disabled = true;
}

if (anyIsSet(httpVariables)) {
Expand Down

0 comments on commit 94cca8e

Please sign in to comment.