Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Support to configure the Token using an env var #109

Open
cmoulliard opened this issue Dec 2, 2021 · 0 comments
Open

Comments

@cmoulliard
Copy link

Feature request

It is not possible for the moment to configure the token of an influxdb server using an ENV var

msg.token=env.get('INFLUXDB_TOKEN')
msg.url=env.get('INFLUXDB_URL')

node.log("Influxdb token: " + msg.token)
node.log("Influxdb url: " + msg.url)
-->
2 Dec 10:47:49 - [info] [function:To influxdb] Influxdb token: 5eCjcHxxxxxxx0iOXaMKCG8qVZanwMme0A==
2 Dec 10:47:49 - [info] [function:To influxdb] Influxdb url: http://localhost:80862 

as the influxdb out client will report the following error


ERROR: Write to InfluxDB failed. d [HttpError]: unauthorized access
    at IncomingMessage.<anonymous> (/Users/cmoullia/code/cmoulliard/node-red/flows/node_modules/@influxdata/influxdb-client/dist/index.js:16:10547)
    at IncomingMessage.emit (events.js:412:35)
    at endReadableNT (internal/streams/readable.js:1317:12)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  statusCode: 401,
  statusMessage: 'Unauthorized',
  body: '{"code":"unauthorized","message":"unauthorized access"}',
  contentType: 'application/json; charset=utf-8',
  json: { code: 'unauthorized', message: 'unauthorized access' },
  code: 'unauthorized',
  _retryAfter: 0
}

Would it be possible to support such an option to set a node server property ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant