smpallen99 / ex_admin

ExAdmin is an auto administration package for Elixir and the Phoenix Framework
MIT License
1.2k stars 272 forks source link

ExAdmin assets won't server over https #372

Closed RobinClowers closed 7 years ago

RobinClowers commented 7 years ago

I just updated to 4d4a5b374c05f641f5a1d20536bf5c95f68b41bd, and now I get insecure content warnings for the stylesheets and scripts.

RobinClowers commented 7 years ago

Possible that https://github.com/smpallen99/ex_admin/pull/315 is the culprit?

th31nitiate commented 7 years ago

Are you using a load balancer or reverse proxy to server content from phoenix?

If this occurred after an update then I would recommend revert back and check to see if the issue resolves.

RobinClowers commented 7 years ago

@th31nitiate I host on Heroku, using the Phoenix static buildpack. Yes, this is definitely because I updated ExAdmin, so clearly it's a bug...

th31nitiate commented 7 years ago

Ok, no probs. Can you help with instruction on how to reproduce the issue or can you grab a Chrome dev tools HAR recording so that we can review where the main fault might be occurring.

I can try it with a test account then we will be able to better pinpoint where the bug might be.

Have you managed to perform a roll back for the app so at least it usable in the mean time?

smpallen99 commented 7 years ago

@th31nitiate Thanks for the support on this issue. You rock!!

RobinClowers commented 7 years ago

@th31nitiate it's on a staging environment, so I haven't reverted. I've attached a HAR, you can see that the admin_lte2.css and jquery.min.js loaded over http, even though everything else is https. When I view the page source, I can see that those assets are specified with full urls, not just absolute paths. I believe this change was a result of https://github.com/smpallen99/ex_admin/pull/315.

smart-services-staging.herokuapp.com.har.zip

RobinClowers commented 7 years ago

I figured this out, I was just missing a Phoenix.Endpoint configuration.

config :smart_services, SmartServices.Endpoint,
  url: [host: System.get_env("HOST"), scheme: "https", port: 443]