-
Notifications
You must be signed in to change notification settings - Fork 163
Doesn't work offline (<urlopen error [Errno -3] Try again>) #145
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
Comments
That's simply a design decision I have made. The configurator is completly contained within one single (~5000 lines of code) Python script for easy installation. No dependencies, no complex directory structures, and a simple embedded webserver. When I started with the configurator I just wanted users to do a Therefore: working as designed. And this will not change, because including all those libraries (and even images) in that one script will make the script even more huge and bloated. That's just not worth the effort. 😉 |
To bad, to sad. Wanted really to try your software... Actually I'm using the hassio addon - so there is no difference between one or many files at all.. For people who are concerned about privacy all these external resources hosted by a few CDN's is a nightmare anyways. They provide the technical solution to track you over the whole web... and bloated for me is a website that need's to connect to more than one domain and is slowing down rendering the page because of this unnecessary connections. Even google (with one of the biggest and fastest cdn's out there) is slowing down the web in a horrible way:
Source: https://www.bbc.com/news/technology-47252725 I tried decentraleyes (https://decentraleyes.org/), a local cdn emulation. But your software still don't work/render (the used libraries probably aren't locally delivered with this browser addon). Anyway - your project, your decisions. Thank's for doing this and have it open source! As it probably useful for many people (just not for me right now)! Could you just do me a last favor and list the used (external) libraries? Maybe there is a way... 😃 |
I had another look at the code. I thought the urlopen error would be caused by fetching which is the latest release. But the code already catches exceptions in those cases. So the error has to be caused by something else. Does the log provide more information? Maybe a traceback with the relevant lines in the code? Apart from the version-info the configurator itself should not try to access any other resources. Only the client has to be onle with access to the CDNs. |
hi @danielperna84 Problem is that not only the server (hass[io] with hass-configurator) is offline but also the client due to no network connections available at all. Thomas Rientjes suggested, https://git.synz.io/Synzvato/decentraleyes/issues/345#note_4281
But thru lack of skills (and network connections) this is sadly not possible for me. Would it be possible to have a option in hass-configurator to serve the libraries locally instead via CDN? So that it would work like now for anybody with internet connections but have a option (which would be activated manually) to store the libraries on the (hass[io]) server and serve them to the clients? |
Nevermind. It actually says in the log that the problem is with the release. It's just a warning though, so as said before, that message has no impact on functionality. I think the best solution for you would simply be to use the IDE Add-on instead of the configurator. Even though your request is valid, it's too much effort to implement this for less than 1% of users who would benefit from this. Especially if another project already solves the issue. |
Thank's! I didn't know that this one exists! Solves all my problems! 🔝 |
@danielperna84 like @rradar I was searching for an option to use Configurator in an offline environment. Because of the CDN resources the add-on won't work. I'm aware that you wanted a simple wget install, but as @rradar wrote, without CDN everything will work faster. IDE Add-on is an option, but I really like Configurator, I don't need the whole IDE with projects, console, etc. Your add-on is ideal and many users will choose it because it is simple, intuitive and does it work just fine. Please reconsider removing CDN's. I'm sure there is an option to wget an installer that will download everything needed. This is the issue I created: home-assistant/addons#760 |
@Misiu But there's one big problem: some of these libraries reference hosted resources. Ace editor has many files regarding language support that would need to be included, and the css points to various fonts. All in all this is a lot of work, which includes modifying the libraries to not point to hosted resources. So far I have only started doing this for the packaged variant (the one that's also used in hassio). It would only work with that variant anyways I guess. So, if you really want this, you can fork this repository, checkout the branch called offline, have a look what I have done there for jQuery and the configurators own css, and then do all that for the Ace editor, the css of Materialize (the fonts are missing). The Material Design Icons (also css + fonts) also have to be included. Basically anything that still points to hosted resources in any css or js file. Edit: |
@danielperna84 thank You for that :) |
In the mentioned branch you'll see, that I already have devided up the html and css into different files. So yes, for the pip-version (which the hassio-addon uses) this is an option. I don't know yet how to handle this for the single-file version. I am considering to not continue development on that one. The major features are available and there's not much to be done anyways. |
Hello,
I just read this one here on github:
Before I wrote this one here on a true home assistant offline environment.
Can't get this addon showing anything. The side asks for credentials - when entered it loads very long and doesn't show much (nothing rendered in browser - source code see down in this issue).
I think it's related to dependencies which are stored in the world wide web. (see hassio addon log line with '<urlopen error [Errno -3] Try again>')
Is there any way to include all dependencies that this addon doesn't need internet? I don't see any reason that this would be necessary at all... maybe for phony home calls.. but... seriously? These libraries should be very static... and home assistant works great offline - the configurator should so too! 😃 👍
Bonus: serving the used libraries locally does speed up the page loading in any case (compared to cdn stored libraries) 🌟
Source code for empty site:
And tha hassio addon log:
The text was updated successfully, but these errors were encountered: