diff --git a/tests/global/src/node/.env.example b/tests/global/src/node/.env.example index 13f675d..34025ce 100644 --- a/tests/global/src/node/.env.example +++ b/tests/global/src/node/.env.example @@ -12,5 +12,9 @@ MAX_MESSAGE_SIZE= MIN_SCNEARIO_DURATION= MAX_SCNEARIO_DURATION= SERVICE_PORT= -INFLUXDB_PORT= LOGS_DIRECTORY= +INFLUXDB_HOST= +INFLUXDB_PORT= +INFLUXDB_USERNAME= +INFLUXDB_PASSWORD= +INFLUXDB_ADMIN_TOKEN= diff --git a/tests/global/src/node/.env.influxdb b/tests/global/src/node/.env.influxdb index 39e8928..431a3b9 100644 --- a/tests/global/src/node/.env.influxdb +++ b/tests/global/src/node/.env.influxdb @@ -1,6 +1,6 @@ DOCKER_INFLUXDB_INIT_MODE=setup -DOCKER_INFLUXDB_INIT_USERNAME=admin -DOCKER_INFLUXDB_INIT_PASSWORD=admin1234 -DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=admintoken +DOCKER_INFLUXDB_INIT_USERNAME=${INFLUXDB_USERNAME:-admin} +DOCKER_INFLUXDB_INIT_PASSWORD=${INFLUXDB_PASSWORD:-admin1234} +DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=${INFLUXDB_ADMIN_TOKEN:-admintoken} DOCKER_INFLUXDB_INIT_ORG=Rosen DOCKER_INFLUXDB_INIT_BUCKET=RoseNet diff --git a/tests/global/src/node/.env.service b/tests/global/src/node/.env.service index 0cd1788..8b0748b 100644 --- a/tests/global/src/node/.env.service +++ b/tests/global/src/node/.env.service @@ -8,3 +8,4 @@ MAX_MESSAGE_SIZE=${MAX_MESSAGE_SIZE:-} MIN_SCNEARIO_DURATION=${MIN_SCNEARIO_DURATION:-} MAX_SCNEARIO_DURATION=${MAX_SCNEARIO_DURATION:-} RELAY_MULTIADDRS=${RELAY_MULTIADDRS:?} +INFLUXDB_ADMIN_TOKEN=${INFLUXDB_ADMIN_TOKEN:-admintoken} diff --git a/tests/global/src/node/config.ts b/tests/global/src/node/config.ts index b0b15cb..197acfe 100644 --- a/tests/global/src/node/config.ts +++ b/tests/global/src/node/config.ts @@ -13,4 +13,5 @@ export default { minScenarioDuration: optional(process.env.MIN_SCNEARIO_DURATION, 60_000), maxScenarioDuration: optional(process.env.MAX_SCNEARIO_DURATION, 300_000), relayMultiaddrs: process.env.RELAY_MULTIADDRS!.split(','), + influxdbToken: process.env.INFLUXDB_ADMIN_TOKEN!, }; diff --git a/tests/global/src/node/docker-compose.yaml b/tests/global/src/node/docker-compose.yaml index 75bfcd6..1629abc 100644 --- a/tests/global/src/node/docker-compose.yaml +++ b/tests/global/src/node/docker-compose.yaml @@ -22,7 +22,7 @@ services: env_file: - .env.influxdb ports: - - ${INFLUXDB_PORT:-8086}:8086 + - ${INFLUXDB_HOST:-127.0.0.1}:${INFLUXDB_PORT:-8086}:8086 networks: - internal volumes: diff --git a/tests/global/src/node/metric-store.ts b/tests/global/src/node/metric-store.ts index 29ef58f..55b2124 100644 --- a/tests/global/src/node/metric-store.ts +++ b/tests/global/src/node/metric-store.ts @@ -2,9 +2,11 @@ import { InfluxDB, Point } from '@influxdata/influxdb-client'; import { serviceLogger } from './logger'; +import config from './config'; + const influxDB = new InfluxDB({ url: 'http://influxdb:8086', - token: 'admintoken', + token: config.influxdbToken, }); const writeApi = influxDB.getWriteApi('Rosen', 'RoseNet');