Grafana - bestlibre - anonymous viewer access in separate org

I’ve installed the addon and cannot work out how to pass environment variables. I’m using the main org. for trying/testing with password but would like to expose an open org for charting in Home assistant. On grafana docker documentation it says that it should be possible to do this using environment variables but not sure if that is supported in this addon?

Before I had this installed on the pi3 separately next to Hassbian and it was easy enough to modify grafana.ini to allow anonymous viewer access to org. “open”.

I’ve updated the file in the container, I’ve tried begging the options section but to no avail.

A big thank you for providing these - installing them is about as painless as it can get!

Thx!
Jhh

I will look into it. It is not possible with the add-on in its current version, but I have an idea to use the add-on config for that purpose.

That would be great! I’ve learned a bit by “stealing” from your python_exec into a local addon but it seems awkward to create a new addon just for an additional hardcoded parameter. As I’m not more advanced than a script kiddie this would be very much appreciated.

That would give me everything I had on Hassbian.

Almost migrated!
Jhh

I have pushed a new version which should allow to use environment variables to configure grafana. It is the same mechanism as the influxdb addon. Can you test it and tell me if it’s working ?

1 Like

I don’t think it is picking up the env_vars:

{
  "env_var": [
    {
      "name": "GF_AUTH.ANONYMOUS_ENABLED",
      "value": "true"
    }
  ]
}

and the log has the following - I see it picking up /data but not my variable - this is on a fresh install of Grafana (don’t have enough in there yet so threw it away and started again):

t=2017-09-22T16:58:00+0200 lvl=info msg="Starting Grafana" logger=main version=4.4.3 commit=54c79c5 compiled=2017-08-07T10:50:18+0200
t=2017-09-22T16:58:00+0200 lvl=info msg="Config loaded from" logger=settings file=/usr/share/grafana/conf/defaults.ini
t=2017-09-22T16:58:00+0200 lvl=info msg="Config loaded from" logger=settings file=/etc/grafana/grafana.ini
t=2017-09-22T16:58:00+0200 lvl=info msg="Config overridden from command line" logger=settings arg="default.paths.data=/data"
t=2017-09-22T16:58:00+0200 lvl=info msg="Config overridden from command line" logger=settings arg="default.paths.logs=/var/log/grafana"
t=2017-09-22T16:58:00+0200 lvl=info msg="Config overridden from command line" logger=settings arg="default.paths.plugins=/data/plugins"
t=2017-09-22T16:58:00+0200 lvl=info msg="Config overridden from command line" logger=settings arg="default.log.mode=console"
t=2017-09-22T16:58:00+0200 lvl=info msg="Config overridden from Environment variable" logger=settings var="GF_PATHS_DATA=/data"
t=2017-09-22T16:58:00+0200 lvl=info msg="Config overridden from Environment variable" logger=settings var="GF_PATHS_PLUGINS=/data/plugins"
t=2017-09-22T16:58:00+0200 lvl=info msg="Path Home" logger=settings path=/usr/share/grafana
t=2017-09-22T16:58:00+0200 lvl=info msg="Path Data" logger=settings path=/data
t=2017-09-22T16:58:00+0200 lvl=info msg="Path Logs" logger=settings path=/var/log/grafana
t=2017-09-22T16:58:00+0200 lvl=info msg="Path Plugins" logger=settings path=/data/plugins
t=2017-09-22T16:58:00+0200 lvl=info msg="Initializing DB" logger=sqlstore dbtype=sqlite3
t=2017-09-22T16:58:00+0200 lvl=info msg="Starting DB migration" logger=migrator
t=2017-09-22T16:58:00+0200 lvl=info msg="Executing migration" logger=migrator id="copy data account to org"
t=2017-09-22T16:58:00+0200 lvl=info msg="Skipping migration condition not fulfilled" logger=migrator id="copy data account to org"
t=2017-09-22T16:58:00+0200 lvl=info msg="Executing migration" logger=migrator id="copy data account_user to org_user"
t=2017-09-22T16:58:00+0200 lvl=info msg="Skipping migration condition not fulfilled" logger=migrator id="copy data account_user to org_user"
t=2017-09-22T16:58:00+0200 lvl=info msg="Starting plugin search" logger=plugins
t=2017-09-22T16:58:01+0200 lvl=info msg="Initializing Alerting" logger=alerting.engine
t=2017-09-22T16:58:01+0200 lvl=info msg="Initializing CleanUpService" logger=cleanup
t=2017-09-22T16:58:01+0200 lvl=info msg="Initializing Stream Manager"
t=2017-09-22T16:58:01+0200 lvl=info msg="Initializing HTTP Server" logger=http.server address=0.0.0.0:3000 protocol=http subUrl= socket=

The setting hasn’t been changed when I check in server settings section in Grafana.

Thx!

I know how to solve it, thanks to @macburry pr on the influxdb addon. Will do so ASAP.

EDIT : It should be ok now

1 Like

Thanks! That works fine now - I could even add the parameter to set Org_name Open to be the one available for anonymous access even though it does not exist when the container is created.

Note: the parameter settings higher up in the thread are wrong, here below is correct, dots need to be replaced with underscores.

{
  "env_var": [
    {
      "name": "GF_AUTH_ANONYMOUS_ENABLED",
      "value": "true"
    }
  ]
}

Jhh