Skip to content

Commit

Permalink
fix configService
Browse files Browse the repository at this point in the history
  • Loading branch information
manfredipist committed Mar 1, 2024
1 parent a4a0000 commit c4aed93
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
6 changes: 3 additions & 3 deletions conf/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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.
*/
Expand Down
2 changes: 1 addition & 1 deletion docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ services:

iotcarsrv:
hostname: iotcarsrv
image: iotagent4fiware/opcuacarsrv:latest
image: iotagent4fiware/opcuacarsrv:1.3.9
networks:
- hostnet
ports:
Expand Down
19 changes: 8 additions & 11 deletions lib/configService.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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);
}
Expand All @@ -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;
}
Expand Down

0 comments on commit c4aed93

Please sign in to comment.