Skip to content
This repository has been archived by the owner on May 5, 2021. It is now read-only.

[Feature] Support configuration with environment variables #146

Open
forzagreen opened this issue Aug 6, 2019 · 4 comments
Open

[Feature] Support configuration with environment variables #146

forzagreen opened this issue Aug 6, 2019 · 4 comments
Assignees
Milestone

Comments

@forzagreen
Copy link

It would be nice if wizzy can load json files containing environment variables. This is useful for conf/wizzy.json and datasources.
The conf/wizzy.json file would look like:

{
  "config": {
    "grafana": {
      "url": "https://mygrafana.example.com",
      "username": "${ADMIN_USERNAME}",
      "password": "${ADMIN_PASSWORD}"
    }
  }
}

Example of a datasource datasources/my-influxdb.json:

{
  "orgId": 1,
  "name": "my-influxdb",
  "type": "influxdb",
  "url": "http://localhost:8086",
  "user": "${DB_USER}",
  "password": "${DB_PASSWORD}",
  "database": "${DB_NAME}"
}

It can achieved e.g. with Mustache.js.

FYI, Grafana support using environment variables in its config file: cf. https://grafana.com/docs/installation/configuration/#using-environment-variables

@Sytten
Copy link
Member

Sytten commented Aug 6, 2019

I also agree with this idea, I have some dashboards that could use variables before export.

@johnsudaar
Copy link
Collaborator

I thought of that too. It would be really nice. Actually I'm asking if integrating an entire templating engine wouldn't be nice. Having thinks like conditions loops and support for environment variables would be really nice.

@johnsudaar
Copy link
Collaborator

johnsudaar commented Aug 6, 2019

I think that i'll try to PoC adding a templating engine to the current js files.

Edit: The PoC is available at #148

@Sytten Sytten added this to the 0.7.0 milestone Aug 9, 2019
@Sytten Sytten modified the milestones: 0.7.0, 0.8.0 Aug 25, 2019
@Sytten
Copy link
Member

Sytten commented Aug 25, 2019

Postponed to 0.8.0

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

No branches or pull requests

3 participants