diff --git a/conf/config.js b/conf/config.js index b1d0df9d..e1b6db41 100644 --- a/conf/config.js +++ b/conf/config.js @@ -140,7 +140,7 @@ config.iota = { * Host where MongoDB is located. If the MongoDB used is a replicaSet, this property will contain a * comma-separated list of the instance names or IPs. */ - host: 'localhost', + host: 'mongodb', /** * Port where MongoDB is listening. In the case of a replicaSet, all the instances are supposed to be listening * in the same port. @@ -173,7 +173,7 @@ config.iota = { * URL Where the IoT Agent Will listen for incoming updateContext and queryContext requests (for commands and * passive attributes). This URL will be sent in the Context Registration requests. */ - providerUrl: 'http://localhost:4041', + providerUrl: 'http://iotagent-opcua:4041', /** * Default maximum expire date for device registrations. */ @@ -217,7 +217,7 @@ config.opcua = { /** * Endpoint where the IoT Agent will listen for an active OPC UA Server. */ - endpoint: 'opc.tcp://localhost:5001/UA/CarServer', + endpoint: 'opc.tcp://iotcarsrv:5001/UA/CarServer', /** * Security Mode to access OPC UA Server. */ diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 86ff4c27..6c815f11 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -107,7 +107,7 @@ services: iotcarsrv: hostname: iotcarsrv - image: iotagent4fiware/opcuacarsrv:latest + image: iotagent4fiware/opcuacarsrv:1.3.9 networks: - hostnet ports: diff --git a/lib/configService.js b/lib/configService.js index d01fe9a2..80a2043d 100644 --- a/lib/configService.js +++ b/lib/configService.js @@ -75,14 +75,7 @@ function processEnvironmentVariables() { 'IOTA_OPCUA_SUBSCRIPTION_REQ_PUBLISHING_INTERVAL', 'IOTA_OPCUA_SUBSCRIPTION_PRIORITY' ]; - const mappingToolVariables = [ - 'IOTA_OPCUA_MT_POLLING', - 'IOTA_OPCUA_MT_AGENT_ID', - 'IOTA_OPCUA_MT_ENTITY_ID', - 'IOTA_OPCUA_MT_ENTITY_TYPE', - 'IOTA_OPCUA_MT_NAMESPACE_IGNORE', - 'IOTA_OPCUA_MT_STORE_OUTPUT' - ]; + const mappingToolVariables = ['IOTA_OPCUA_MT_POLLING', 'IOTA_OPCUA_MT_AGENT_ID', 'IOTA_OPCUA_MT_ENTITY_ID', 'IOTA_OPCUA_MT_ENTITY_TYPE', 'IOTA_OPCUA_MT_NAMESPACE_IGNORE', 'IOTA_OPCUA_MT_STORE_OUTPUT']; const protectedVariables = ['IOTA_OPCUA_SECURITY_USERNAME', 'IOTA_OPCUA_SECURITY_PASSWORD']; // Substitute Docker Secret Variables where set. @@ -103,9 +96,13 @@ function processEnvironmentVariables() { if (anyIsSet(iotaVariables)) { config.iota = { contextBroker: {}, - server : {}, + server: {}, deviceRegistry: {}, - mongodb: {} + mongodb: {}, + types: {}, + contexts: [], + contextSubscriptions: [], + events: [] }; logger.info('Config.iota erased', config.iota); } @@ -132,7 +129,7 @@ function processEnvironmentVariables() { if (process.env.IOTA_CB_PORT) { config.iota.contextBroker.port = process.env.IOTA_CB_PORT; } - + if (process.env.IOTA_CB_NGSIVERSION) { config.iota.contextBroker.ngsiVersion = process.env.IOTA_CB_NGSIVERSION; }