mahendrapaipuri/grafana-dashboard-reporter-app

Can't create reports under https

Alan1810 opened this issue · 7 comments

Hi,

I'm using grafana in front of haproxy under https. I have an error "error generating report" when i try to generate a report.

The url used is : https://<Server>/api/plugins/mahendrapaipuri-dashboardreporter-app/resources/report?dashUid=jLdsyDbWz&from=now-1M%2FM&to=now-1M%2FM&var-datasource=000000001&var-zone=xxx

  • grafana log file :

logger=http.server t=2024-03-28T09:14:48.55601014+01:00 level=info msg="HTTP Server Listen" address=0.0.0.0:3000 protocol=https subUrl= socket= logger=plugin.mahendrapaipuri-dashboardreporter-app t=2024-03-28T09:17:18.303597619+01:00 level=info msg="chrome executable provided by grafana-image-renderer will be used" pluginID=mahendrapaipuri-dashboardreporter-app chrome=/var/lib/grafana/plugins/grafana-image-renderer/chrome/linux-124.0.6351.0/chrome-linux64/chrome endpoint=callResource logger=plugin.mahendrapaipuri-dashboardreporter-app t=2024-03-28T09:17:18.344329972+01:00 level=error msg="error generating report" endpoint=callResource err="error fetching dashboard iLdsyDbWz: error executing request for https://localhost:3000/api/dashboards/uid/jLdsyDbWz?var-datasource=000000001&var-zone=xxx: Get \"https://localhost:3000/api/dashboards/uid/jLdsyDbWz?var-datasource=000000001&var-zone=xxx\": tls: failed to verify certificate: x509: certificate relies on legacy Common Name field, use SANs instead" pluginID=mahendrapaipuri-dashboardreporter-app logger=context userId=1 orgId=1 uname=admin t=2024-03-28T09:17:18.345307952+01:00 level=error msg="Request Completed" method=GET path=/api/plugins/mahendrapaipuri-dashboardreporter-app/resources/report status=500 remote_addr=X.X.X.X time_ms=54 duration=54.222984ms size=24 referer= handler=/api/plugins/:pluginId/resources/* status_source=downstream

Is there a way to disable certificate verify like in grafana-reporter with option ssl-check=false ?

grafana open source: 10.4.1
grafana-image-renderer : 3.10.1
OS : Ubuntu 22.04.4

As I understand, you are running Grafana instance with TLS enabled.

At the moment, no, there is no way to skip TLS verify but this should be easy to implement and it is a valid use case. We can add another configurable option which can be set either by provisioning or using Grafana UI to allow skipping TLS verify.

I should be able to add this feature and make a new release next week. Cheers for reporting this bug.

Thank you.
Waiting for next release to test it.

Regards

Hello @Alan1810 , could you please try this patch? You can download the plugin artifacts from CI artifacts. You will need to set skipTlsCheck to true in the plugin provisioning config file.

Hello @mahendrapaipuri,

I don't an environment to compile and no direct access to internet. Is there a way to have a release ?

Best regards

@Alan1810 Alright, here is the nighly release. Would you be able to test with this? Cheers

Hi @mahendrapaipuri,

The nightly release works fine. Thank you for your works.

Is there a way to modify the output ? For example, the number of page is present at the bottom of each page and in the dashboard title.

Best regards

Cheers @Alan1810 for testing it out.

Could you please open a new issue about the output customization? I will close this one as the PR has been merged.