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

Online dependencies #177

Open
Nixellion opened this issue Dec 20, 2019 · 12 comments
Open

Online dependencies #177

Nixellion opened this issue Dec 20, 2019 · 12 comments

Comments

@Nixellion
Copy link

Yesterday had internet outage for a couple hours and wanted to create a binary sensor to ping google and notify me when internet gets back. Unforunately I could not use Configurator because it was trying to load google fonts and something else, and it took forever to load.

TLDR; It would be great if configurator did not have any online dependencies like fonts.

@danielperna84
Copy link
Owner

This is related to issue #145 and #73 and has been discussed there already. The readme also states this early at the top:

IMPORTANT: The configurator fetches JavaScript libraries, CSS and fonts from CDNs. Hence it does NOT work when your client device is offline. And it is only available for Python 3.

It is more than just fonts. Here is a branch where I started implementing this by including most of the libraries. But with the AceExplorer it's a ton of files that would have to be included, and in the current state the included webserver isn't capatble of delivering the files at the structure the AceEditor expects them. So even though I could get part of this offline, the main library (the editor) is a problem that causes a lot of work.
Whoever feels the need to implement his can freely do so and create a PR once done. As mentioned before, I've done it already for CSS etc., so there's a rough guideline how it could be done.

@danielperna84
Copy link
Owner

I now have applied the changes from the branch mentioned above into the current devel-branch. So at least some files will by served locally due to the change. Not included is the Ace Editor and the CSS/fonts of materialize. Serving those with my primitive implementation wont's work without modifying the libraries, and for that I'm too lazy. But with my latest commit it should be easier for someone else to take care of that.

@Misiu
Copy link

Misiu commented Jan 27, 2020

@danielperna84 I think than moving to offline support is a good decision.
I just wanted to ask why you use Ace Editor? Home Assistant is using Codemirror.

@danielperna84
Copy link
Owner

@Misiu
Because I have created the configurator long before Home Assistant had text editing capability, and back then Ace Editor seemed to be a good choice. It was easy to implement and did it's job.

@fake-name
Copy link

I just hit this issue too. I have 3rd party scripts blocked by default, and the editor both fails to work and has no error feedback.

The entire point of homeassistant is to not rely on cloud anything. I was extremely surprised anything depends on files served from anywhere on the internet.

@pubdc
Copy link

pubdc commented Feb 4, 2023

Indeed : the file-editor wont work unless it can access CloudFlare. One of the main reasons I opted for HA is that everything is local and secure and won't halt if the house goes offline. So I am disappointed about the need to access CloudFlare. Furthermore it is not an elegant failure : it just refuses to access/open the file, there is no error message that states "hey I cant access cloudflare"

@starsoccer
Copy link

+1 to the above. HA keeps pushing it self as the no cloud solution yet when it actually comes to there being no cloud it fails and features that dont really need cloud outright break

@demlak
Copy link

demlak commented May 26, 2024

any news on this? whatabout caching those files localy?

I am not a coder.. what about ace.config.set("basePath", "https://url.to.a/folder/that/contains-ace-modes"); --> https://ace.c9.io/#about=&nav=howto

@JanMR21
Copy link

JanMR21 commented Jul 10, 2024

This happens to me too, I am running the adguard add on which filters out all cloudflare resources... because - well - there is this privacy issue...

@OdinVex
Copy link

OdinVex commented Sep 8, 2024

any news on this? whatabout caching those files localy?

I am not a coder.. what about ace.config.set("basePath", "https://url.to.a/folder/that/contains-ace-modes"); --> https://ace.c9.io/#about=&nav=howto

They can be used locally with relative URIs. It makes zero sense for this project to use online-only resources unless their aim were malicious, frankly.

@danielperna84
Copy link
Owner

They can be used locally with relative URIs. It makes zero sense for this project to use online-only resources unless their aim were malicious, frankly.

Actually, this project dates back to when HAOS didn't even exist, and everyone had to do manual core-installations. For that reason I chose to include everything within one single Python file, which was easy to "install" for novice users. Because of that, the included "webserver" isn't really a webserver, but instead has hardcoded paths, which deliver only a limited set of resources. So no routing whatsoever. Therefore it's not just as easy as using relative paths, because the backend has to be completely rewritten to support nested paths, while not breaking the existing functionality. For some stuff it was easy to add the paths quickly. But the Ace editor has a gazillion files, nested within sub-folders.

Feel free to contribute. I have become a parent and bought a house, both consuming all of my time until further notice.

@OdinVex
Copy link

OdinVex commented Sep 8, 2024

The web browser can use relative paths to access static local resources. It's about packaging and use. I've found too many issues with HAOS and "privacy/it's really just upsell-ware", I've only been following up to note.

Congratulations on the life-happenings. :]

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

No branches or pull requests

9 participants