home-assistant / addons

:heavy_plus_sign: Docker add-ons for Home Assistant
https://home-assistant.io/hassio/
Apache License 2.0
1.54k stars 1.5k forks source link

File editor wont load files without an internet connection #3699

Closed magiva closed 3 weeks ago

magiva commented 2 months ago

Describe the issue you are experiencing

I load file editor, select a file to load and nothing loads the editor looks weird too with a blank horizontal bar top right, i can type in it but it doesnt do anything

image

Log: INFO:2024-07-24 14:16:37,138:hass_configurator.configurator:172.30.32.2 - "GET /api/listdir?path=. HTTP/1.1" 200 - INFO:2024-07-24 14:16:38,200:hass_configurator.configurator:127.0.0.1 - "GET / HTTP/1.1" 200 - INFO:2024-07-24 14:16:40,234:hass_configurator.configurator:172.30.32.2 - "GET /api/file?filename=/homeassistant/configuration.yaml HTTP/1.1" 200 -

What type of installation are you running?

Home Assistant OS

Which operating system are you running on?

Home Assistant Operating System

Which add-on are you reporting an issue with?

File editor

What is the version of the add-on?

5.8.0

Steps to reproduce the issue

  1. open file editor
  2. select file to open
  3. observe that nothing has been loaded ...

System Health information

There are currently no repairs available

Anything in the Supervisor logs that might be useful for us?

nothing and nothing related to file, editor or add-on

Anything in the add-on logs that might be useful for us?

No response

Additional information

No response

as-kholin commented 2 months ago

Adding a single data point - I cannot reproduce.

Using HAOS 2024.7.3 and File Editor 5.8.0, I am not seeing the behavior you describe.

The horizontal bar you describe is normal - that is where File Editor tells you what file you are viewing/editing - but I cannot reproduce the issue you are seeing from my side where the file does not load, and it does not tell you the file name on that bar - Selection dialog appears to be working the same as any other time, and no issues loading files

image

System Information provided for comparative diagnosis.

System Information

version | core-2024.7.3

Home Assistant OS -- | -- installation_type | Home Assistant OS dev | false hassio | true docker | true user | root virtualenv | false python_version | 3.12.4 os_name | Linux os_version | 6.6.33-haos arch | x86_64 timezone | America/Chicago config_dir | /config
Home Assistant Supervisor host_os | Home Assistant OS 12.4 -- | -- update_channel | stable supervisor_version | supervisor-2024.06.2 agent_version | 1.6.0 docker_version | 26.1.4 healthy | true supported | true host_connectivity | true supervisor_connectivity | true ntp_synchronized | true virtualization | kvm board | ova supervisor_api | ok version_api | ok installed_addons | File editor (5.8.0), (others redacted)
Dashboards dashboards | 8 -- | -- resources | 6 views | 14 mode | storage
Recorder oldest_recorder_run | July 20, 2024 at 01:00 -- | -- current_recorder_run | July 28, 2024 at 00:49 estimated_db_size | 497.14 MiB database_engine | sqlite database_version | 3.45.3
magiva commented 2 months ago

i found the reason to be that i block cloudflare.com

image

as soon as i set it as trusted. it loads. why would i need to have outside access to cloudflare to be able load locally ?

magiva commented 2 months ago

image

This needs to be a disconnected system, how can it be fixed so it runs fully locally, i always thought that was the point of home assistant.

Likqez commented 1 month ago

Hi, I didn't find the source code for the file-editor add-on here on GitHub. But if it indeed is OSS, you could potentially remove the dependencies by serving the Cloudflare JS locally. As you stated, The functionality shouldn't require an active connection to 3rd parties.

It's also possible that the cdn portions are from https://github.com/ajaxorg/ace, which is used to power the File-editor.

Good Luck.

OdinVex commented 1 month ago

Who maintains this add-on? They're the ones that could look into fixing this privacy (and functionality) issue...

Edit: Add-on info shows https://github.com/home-assistant/addons/tree/master/configurator as source. Edit: I'd recommend setting up SSH and using FileZilla for now...

Likqez commented 1 month ago

Edit: Add-on info shows https://github.com/home-assistant/addons/tree/master/configurator as source.

Yes, but do you actually see any source in there? I did some more digging and it seems like this is the UI portion of the source.

The README.md states:

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.

But i think we could circumvent that and help create a PR there that fixes the issue.

OdinVex commented 1 month ago

Edit: Add-on info shows https://github.com/home-assistant/addons/tree/master/configurator as source.

Yes, but do you actually see any source in there? I did some more digging and it seems like this is the UI portion of the source.

The README.md states:

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.

But i think we could circumvent that and help create a PR there that fixes the issue.

The link I linked to was "official" and has commits from 7m and 10m ago versus 2 years for the link you sent. Going by official link and age.

Likqez commented 1 month ago

Yes @OdinVex, but taking a look at the offical repositories Dockerfile you see that they uses pip3 install hass-configurator which is the repo I mentioned. Our problem is from the UI, the official repository however doesn't have any source code representing the UI.

TBH. it's just a shitty documented repository, where you actually have to dig to find out what dependencies they are using.

OdinVex commented 1 month ago

Yes @OdinVex, but taking a look at the offical repositories Dockerfile you see that they uses pip3 install hass-configurator which is the repo I mentioned. Our problem is from the UI, the official repository however doesn't have any source code representing the UI.

TBH. it's just a shitty documented repository, where you actually have to dig to find out what dependencies they are using.

I see now, similar in concept to Arch's AUR's PKGBUILD files.

Likqez commented 1 month ago

For all,

TLDR:

This is a duplicate of: https://github.com/danielperna84/hass-configurator/issues/177 which describes the situation! Check that out.

The Source code responsible for the UI and the external CDN requests: danielperna84/hass-configurator

WIP build(but stale) trying to get rid of CDN dependencies on the offline Branch.

If we implement this offline functionality, we will get it into home assistant! See https://github.com/home-assistant/addons/issues/1820#issuecomment-779136167

starsoccer commented 3 weeks ago

+1 would be great to get this working totally offline

frenck commented 3 weeks ago

As per above, this is an issue with/feature request for the upstream hass-configurator. Please track the issue on their end instead.

Thanks! 👍

../Frenck

magiva commented 3 weeks ago

hilarious

On Wed, 25 Sept 2024, 09:25 Franck Nijhof, @.***> wrote:

As per above, this is an issue with/feature request for the upstream hass-configurator. Please track the issue on their end instead.

Thanks! 👍

../Frenck

— Reply to this email directly, view it on GitHub https://github.com/home-assistant/addons/issues/3699#issuecomment-2373266279, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZMQZP6MIK37LKWJA67DV3ZYJQNPAVCNFSM6AAAAABLMLY63SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNZTGI3DMMRXHE . You are receiving this because you authored the thread.Message ID: @.***>

frenck commented 3 weeks ago

@magiva Sorry?