Skip to content

Commit

Permalink
Fix for config service
Browse files Browse the repository at this point in the history
Co-authored-by: Walter Domenico Vergara <[email protected]>
  • Loading branch information
manfredipist and walterwootz committed Mar 25, 2024
1 parent f5fd0b4 commit f4bc9c2
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/configService.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ function processEnvironmentVariables() {
}

if (process.env.IOTA_TIMESTAMP) {
config.iota.timestamp = process.env.IOTA_TIMESTAMP;
config.iota.timestamp = process.env.IOTA_TIMESTAMP === 'true' ? true : false;
}

if (process.env.IOTA_CB_HOST) {
Expand Down Expand Up @@ -191,15 +191,15 @@ function processEnvironmentVariables() {
}

if (process.env.IOTA_EXPLICITATTRS) {
config.iota.explicitAttrs = process.env.IOTA_EXPLICITATTRS;
config.iota.explicitAttrs = process.env.IOTA_EXPLICITATTRS === 'true' ? true : false;
}

if (process.env.IOTA_EXTENDED_FORBIDDEN_CHARACTERS) {
config.iota.extendedForbiddenCharacters = process.env.IOTA_EXTENDED_FORBIDDEN_CHARACTERS;
}

if (process.env.IOTA_AUTOPROVISION) {
config.iota.autoprovision = process.env.IOTA_AUTOPROVISION;
config.iota.autoprovision = process.env.IOTA_AUTOPROVISION === 'true' ? true : false;
}

if (anyIsSet(opcUAVariables)) {
Expand Down Expand Up @@ -240,15 +240,15 @@ function processEnvironmentVariables() {
}

if (process.env.IOTA_OPCUA_UNIQUE_SUBSCRIPTION) {
config.opcua.uniqueSubscription = process.env.IOTA_OPCUA_UNIQUE_SUBSCRIPTION;
config.opcua.uniqueSubscription = process.env.IOTA_OPCUA_UNIQUE_SUBSCRIPTION === 'true' ? true : false;
}

if (process.env.IOTA_OPCUA_SUBSCRIPTION_NOTIFICATIONS_PER_PUBLISH) {
config.opcua.subscription.maxNotificationsPerPublish = process.env.IOTA_OPCUA_SUBSCRIPTION_NOTIFICATIONS_PER_PUBLISH;
}

if (process.env.IOTA_OPCUA_SUBSCRIPTION_PUBLISHING_ENABLED) {
config.opcua.subscription.publishingEnabled = process.env.IOTA_OPCUA_SUBSCRIPTION_PUBLISHING_ENABLED;
config.opcua.subscription.publishingEnabled = process.env.IOTA_OPCUA_SUBSCRIPTION_PUBLISHING_ENABLED === 'true' ? true : false;
}

if (process.env.IOTA_OPCUA_SUBSCRIPTION_REQ_LIFETIME_COUNT) {
Expand Down Expand Up @@ -280,11 +280,11 @@ function processEnvironmentVariables() {
});

if (process.env.IOTA_OPCUA_MT_ENABLED) {
config.mappingTool.enabled = process.env.IOTA_OPCUA_MT_ENABLED;
config.mappingTool.enabled = process.env.IOTA_OPCUA_MT_ENABLED === 'true' ? true : false;
}

if (process.env.IOTA_OPCUA_MT_POLLING) {
config.mappingTool.polling = process.env.IOTA_OPCUA_MT_POLLING;
config.mappingTool.polling = process.env.IOTA_OPCUA_MT_POLLING === 'true' ? true : false;
}

if (process.env.IOTA_OPCUA_MT_AGENT_ID) {
Expand All @@ -304,7 +304,7 @@ function processEnvironmentVariables() {
}

if (process.env.IOTA_OPCUA_MT_STORE_OUTPUT) {
config.mappingTool.storeOutput = process.env.IOTA_OPCUA_MT_STORE_OUTPUT;
config.mappingTool.storeOutput = process.env.IOTA_OPCUA_MT_STORE_OUTPUT === 'true' ? true : false;
}
}

Expand Down

0 comments on commit f4bc9c2

Please sign in to comment.