alexjustesen / speedtest-tracker

Speedtest Tracker is a self-hosted internet performance tracking application that runs speedtest checks against Ookla's Speedtest service.
https://speedtest-tracker.dev/
MIT License
2.48k stars 90 forks source link

āš ļø Embedding the public dashboard - BREAKING CHANGE #1024

Open alexjustesen opened 6 months ago

alexjustesen commented 6 months ago

āš ļø Breaking change

For those embedding their Speedtest Tracker public dashboards as of 0.14.2 this will be broken and stop functioning. TL;DR: Not secure, don't like that.

šŸ“œ Description

As of v0.14.1 embedding the public dashboard into something like Home Assistant's dashboard or using an iframe was broken because of CORS and requiring a CSRF token to validate the request.

0.14.2-beta series tested removing CSRF protections on the dashboard. During exploration of this solution it was discovered that in Livewire, the package used to provide reactivity, there currently isn't a good way of disabling this on a specific route.

The solution was to disable CSRF protection on ALL livewire/* requests which could open an attack surface for dashboards exposed to the internet. This isn't an acceptable solution IMO.

šŸ”— Past linked issues

šŸ¤” Proposed solution

Develop a new dashboard that is specifically for embedding into websites or other dashboards like Home Assistant. The dashboard should improve upon the current performance issues and not compromise security for features.

šŸ›£ļø Possible solutions

šŸ™‹ā€ā™‚ļø FAQs

šŸ‘‡ I'll be tracking all research and updates in the comments below. Feel free to ask any questions or provide input.

alexjustesen commented 6 months ago

1027 removes code related to embedding the public dashboard.

alexjustesen commented 6 months ago

Design idea, the dashboard should be big and bold so KPI's, charts and data are easily readable.

image Tempest weather station dashboard

ZoXx commented 5 months ago

any news here?

alexjustesen commented 5 months ago

any news here?

None yet, DQ issues need to be resolved first.

fischerphilipp commented 3 months ago

Not sure if this is news, but with the latest Home Assistant release (2024.4) I can simply embed the public dashboard via the new "Webpage" dashboard type. I just tried it and it works perfectly

ZoXx commented 3 months ago

iobroker hasnt this feature. Need still public dashboard site for seeing it.

fischerphilipp commented 3 months ago

Unfortunately I have to correct myself: Embedding the public dashboard works until you try to select a time interval other than the default "last 24h". If you select "last week" or "last month" you get a browser error saying "This page has expired. Would you like to refresh the page?"

ZoXx commented 2 months ago

Any news @alexjustesen ? šŸ™‚

alexjustesen commented 1 month ago

Explore using https://wire-elements.dev/blog/embed-livewire-components-using-wire-extender