wizzy
wizzy copied to clipboard
[Feature] Support configuration with environment variables
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
I also agree with this idea, I have some dashboards that could use variables before export.
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.
I think that i'll try to PoC adding a templating engine to the current js files.
Edit: The PoC is available at #148
Postponed to 0.8.0