genielabs / HomeGenie

HomeGenie, the programmable automation intelligence
https://homegenie.it
GNU General Public License v3.0
392 stars 155 forks source link

When using SSL proxy, HomeGenie reports non-secure content loading #190

Closed Fmstrat closed 9 years ago

Fmstrat commented 9 years ago

When using an nginx SSL proxy, HomeGenie reports non-secure content loading. The output from Firebug:

Blocked loading mixed active content "http://fonts.googleapis.com/css?family=Oxygen:400,700&subset=latin,latin-ext" https://automation:21443/hg/html/js/jquery-2.0.2.min.js Line 4

The offending line of code: https://github.com/genielabs/HomeGenie/blob/7215410355c98ccce564e4b68d5d0865947df476/BaseFiles/Common/html/js/api/homegenie.webapp.js#L128

Recommended fix would be to incorporate the Google fonts locally, thus not requiring a request out to Google servers on every page load. Then reference the font files using relative URLs.

Fmstrat commented 9 years ago

The above fix handles the Google fonts, but it also seems like the Weather Underground widget is grabbing images via HTTP as well.

genemars commented 9 years ago

I've trying incorporating google fonts but unsucessful. Any suggestion is welcome.

genemars commented 9 years ago

Requesting https images from weather underground won't work. Perhaps these should be copied locally and referenced with relative urls.

Fmstrat commented 9 years ago

Looks like we can replace http://icons.wxug.com/i/c/e/partlycloudy.gif with https://api.wunderground.com/i/c/e/partlycloudy.gif and it works.

Fmstrat commented 9 years ago

Also should change:

  webserviceurl = "http://api.wunderground.com/api/" + apikey + "/forecast/lang:" + language + "/q/" + location + ".json";

to:

  webserviceurl = "https://api.wunderground.com/api/" + apikey + "/forecast/lang:" + language + "/q/" + location + ".json";
Fmstrat commented 9 years ago

I tried to fix both occurrences of the API pull and icon selections in program.xml, but I'm not 100% sure how all this works. program.xml gets written to every time I refresh the WU widget, so perhaps this code is somewhere else?

Fmstrat commented 9 years ago

OK, figured it out I think, HomeGenie seems to keep things in memory or in a database and is compiling from the in-app editor. I made the changes there, compiled, diffed the program.xml, and put the changes into the master branch. Pull request above.