BudgetSmartHome / hubitat2prom

Use the Hubitat.com Maker API to present Prometheus Metrics
13 stars 12 forks source link

Control App config using ENV Variables #6

Open jonesalexr opened 3 years ago

jonesalexr commented 3 years ago

Instead (or addition) to having to have a yml file control endpoint, API Key, and optional attributes, let them be passed through docker commandline. The app in existing state already has environment variables, they just dont seem to be used. A good sample project that uses these is below. https://hub.docker.com/r/scyto/unifibrowser https://grafana.com/docs/grafana/latest/installation/docker/

So Ideally docker command would look like the below. docker run --name hubitat2prom -p:5000:5000 -e HE_URI=http://192.168.1.12/apps/api/1006/devices -e HE_ACCESS_TOKEN=123456 -e HE_ATTRIBUTES=battery,humidity,illuminence,level,switch,temperature proffalken/hubitat2prom:latest

screenshot below showing what the current env var for this docker shows. 2021-02-25 10_48_35-Clipboard

patoarvizu commented 3 years ago

+1

Specially being able to inject the access token via an environment variable. It would make it easier to run this on container orchestration platforms (Kubernetes, Nomad) securely.

otakup0pe commented 3 months ago

This seems to be currently supported via the HE_URI, HE_ACCESS, and HE_METRICS environment variables...