balena-labs-projects / balena-sense

Take readings from a BME680 or similar sensor on a Raspberry Pi, store with InfluxDB and view with Grafana
https://balena.io/blog/balenasense-v2-updated-temperature-pressure-and-humidity-monitoring-for-raspberry-pi/
MIT License
286 stars 99 forks source link

Embed Grafana iframe #86

Open vschinazi opened 4 years ago

vschinazi commented 4 years ago

Hi Chris

I'm trying to change the security settings in Grafana so I can embed my dashboard as an iframe in my website. I was able to locate and edit the grafana.ini file in the etc/grafana folder but it seems to revert back to default after I change it. Is this the correct file to be editing or is there another "default.ini" file?

Specifically (see attached) I would like to change the security settings:

allow_embedding | false cookie_samesite | lax

to

allow_embedding | true cookie_samesite | none

Can you please let me know how to do this or if there is another way to embed the dashboard into a website.

Thank you,

Victor

Screenshot 2020-06-20 at 10 53 41

chrisys commented 4 years ago

@vschinazi I think you should be able to do this via environment variables in docker-compose.yml. They follow a convention so it could be GF_SECURITY_ALLOW_EMBEDDING=true and GF_SECURITY_COOKIE_SAMESITE=none. I've not tested these specific ones but you'll see in the compose file there are already some others set.

See here for more info: https://grafana.com/docs/grafana/latest/administration/configuration/#configure-with-environment-variables

Let us know if it works!