psa_car_controller
psa_car_controller copied to clipboard
Ingress not work correct with https
Describe the bug If you open PSA Ingress in local environment http://homeassistant.local:8123/ it works fine If you open it using external connection like https://blabla/ it does not work completely / or from ext. using the HA APP.
Control show nothing Settings does not open
To Reproduce Steps to reproduce the behavior:
- open psa from ext.
- in Browser log you will see:
react-dom.production.min.js:132 Mixed Content: Mixed Content: The page at 'https://[blanked]/b9f12d83_psacc/ingress' was loaded over HTTPS, but requested an insecure frame 'http://homeassistant.local:8123/api/hassio_ingress/gzt7uvsRxyoWUTvw9tEmLwHoSqZW-xThNRmIx50jLS4/control?header=false'. This request has been blocked; the content must be served over HTTPS.
plotly-2.27.0.min.js:8 Mixed Content: The page at 'https://[blanked]/b9f12d83_psacc/ingress' was loaded over HTTPS, but requested an insecure resource 'http://[blanked]/api/hassio_ingress/gzt7uvsRxyoWUTvw9tEmLwHoSqZW-xThNRmIx50jLS4/assets/sprites/osm-liberty.json'. This request has been blocked; the content must be served over HTTPS.
plotly-2.27.0.min.js:8 Mixed Content: The page at 'https://[blanked]/b9f12d83_psacc/ingress' was loaded over HTTPS, but requested an insecure resource 'http://[blanked]/api/hassio_ingress/gzt7uvsRxyoWUTvw9tEmLwHoSqZW-xThNRmIx50jLS4/assets/sprites/osm-liberty.png'. This request has been blocked; the content must be served over HTTPS.
Environment (please complete the following information):
- OS: HASO using the NGINX Home Assistant SSL proxy addon
- v3.2.0
Notice in one file i found already the issue: style.json - only the "sprite" part used http the rest is fine
{
"glyphs": "https://api.maptiler.com/fonts/{fontstack}/{range}.pbf",
"layers": [
{
"id": "osm",
"source": "osm",
"type": "raster"
}
],
"sources": {
"osm": {
"attribution": "Map tiles by <a target=\"_top\" rel=\"noopener\" href=\"https://tile.openstreetmap.org/\">OpenStreetMap tile servers</a>, under the <a target=\"_top\" rel=\"noopener\" href=\"https://operations.osmfoundation.org/policies/tiles/\">tile usage policy</a>. Data by <a target=\"_top\" rel=\"noopener\" href=\"http://openstreetmap.org\">OpenStreetMap</a>",
"tileSize": 256,
"tiles": [
"https://tile.openstreetmap.org/{z}/{x}/{y}.png"
],
"type": "raster"
}
},
"sprite": "http://[blanked]/api/hassio_ingress/gzt7uvsRxyoWUTvw9tEmLwHoSqZW-xThNRmIx50jLS4/assets/sprites/osm-liberty",
"version": 8
}
no issue with psacc outside ha
Guess so it might be something to do with the ingress implementation
after a while i came up to search in the code what could be the cause:
So request.url_root does not resolve fine behind ingress, if you remove "request.url_root"
views.py (and in api.py, config_oauth.py and config_views.py)
dbc.Tab(label="Control", tab_id="control", children=html.Iframe(
src=request.url_root + "control?header=false",
style={"position": "absolute",
"height": "100%",
"width": "100%",
"border": "none"}))
],
It will not construct the full URL which is fine but shows like this:
which works out fine for HA