Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

indirect proxy mode uses http:// links #136

Closed
mboogert opened this issue Mar 21, 2018 · 4 comments
Closed

indirect proxy mode uses http:// links #136

mboogert opened this issue Mar 21, 2018 · 4 comments
Assignees
Labels

Comments

@mboogert
Copy link

Expected Behavior
Graphs are rendered using https:// links.

Current Behavior
Graphs are rendered using http:// links.

Your Environment
Icinga Web 2 Grafana version (System - About): 1.2.1
Icinga Web 2 version and modules (System - About): 2.5.1
Version used (icinga2 --version): 2.8.1
Operating System and version: CentOS 7

=====

When using indirect proxy mode, our external grafana instance is connected using http://. This causes mixed content in Firefox for example.

If the link is curled from a shell, there's a proper 302 to redirect to https://.

@Mikesch-mp
Copy link
Owner

I know its a small thing, but why you dont set the protocol to https for the module?

@Mikesch-mp Mikesch-mp self-assigned this Mar 21, 2018
@Mikesch-mp Mikesch-mp added the bug label Mar 21, 2018
@mboogert
Copy link
Author

mboogert commented Mar 21, 2018

The protocol is set to https.

===== /etc/icingaweb2/modules/grafana/config.ini

[grafana]
host = "*****"
protocol = "https"
height = "280"
width = "640"
enableLink = "no"
datasource = "influxdb"
defaultdashboard = "icinga2-default"
defaultdashboardstore = "db"
accessmode = "indirectproxy"
theme = "light"
defaultorgid = "1"
timerangeAll = "1w/w"
defaultdashboardpanelid = "1"
shadows = "0"
debug = "0"
authentication = "token"
apitoken = "*****"
ssl_verifypeer = "1"
ssl_verifyhost = "1"
version = "0"

@Mikesch-mp
Copy link
Owner

Indirect uses pictures as reference from a controller inside same module, rest is exactly the same code. So if you use https to access icingaweb2 it will pull the graphs by crontroller over https (https://host/icingweb2/grafana/img....), the controller will fetch the image from grafana with the configured protocol. So there is no possible way to pull pictures via http from grafana if you configured https. If you enable debug mode you will see how it is fetching images.
Please post full config (i miss the publichost part) and a screenshot where you see that http is used.

Best regards,
Carsten

@Mikesch-mp Mikesch-mp reopened this Mar 21, 2018
@Mikesch-mp Mikesch-mp added Feedback and removed bug labels Mar 23, 2018
@fpoulain
Copy link

fpoulain commented Oct 27, 2020

Hi,

Experiencing the same here. It appears on my side that in library/Grafana/ProvidedHook/Grapher.php line 352 and after, $this->getView()->serverUrl() doesn't return the good scheme (http and not https). It is probably related with the fact that icingaweb2 is behind a reverse proxy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants