File Editor - Docker there are container that could help?

Hi all,
I would know if there is a possibility to have a sort of file editor to use with core version, something like a program that I can run in a docker container and has a web interface.
just to be able to modify the configuration.yaml code from any pc without install programs on that pc.
Do you know something that would fit?

Bearded Tinker’s Youtube channel has a lot of Docker how-to videos like this one for VSCode which is one of the best file editors around:

it seams great! thanks

unfortunately the docker image is not for Arm7 so it does not work on raspberry pi

Using default tag: latest
latest: Pulling from codercom/code-server
no matching manifest for linux/arm/v7 in the manifest list entries

Sorry about that, I had not realised you were running a PI.

I don’t own a PI so unfortunately I can’t help you, I did however come across the following which might be of some use …

I assume there must be a reason why you don’t want to run HA Supervised on your PI (which includes the Add on Store to easily install many add-ons including VScode).

At the end i solved with this docker: causticlab/hass-configurator-docker:arm
with it you can use the addon configurator on home assistant core, I applied this solution to home assistant core that is running on docker. then if you add the following code to your configuration.yaml you will have access to the configurator directly from home assistant

panel_iframe:
  file_editor:
    title: 'File Editor'
    url: https://domain.duckdns.org:port (e.g. myhome.duckdns.org:3218)
    icon: mdi:wrench-outline

here the docker command

sudo docker run -d --name configurator --restart always -v /home/homeassistant/.homeassistant:/home/homeassistant/.homeassistant -v /docker/configurator:/config -p 3218:3218 causticlab/hass-configurator-docker:arm

Hi @Luca_Garofalo , I found your solution when i was starten to install HA Docker and would like to add the File Editor container. I installed it as a docker container, but when i start the file editor it ends-up at a totally weird location in the file system; Obvious, i did something wrong, hopefully you can help me.
Mij docker-composer looks like this:

## File Editor (Configurator)
  file_editor:
    container_name: configurator
    image: causticlab/hass-configurator-docker:arm
    restart: unless-stopped
    volumes:
      - /home/iotstack/docker/configurator:/config
      - /home/iotstack/docker/homeassistant/.homeassistant:/home/docker/homeassistant/.homeassistant
    ports:
      - "3218:3218"

And my iframe cfg in configuration.yaml is this:

panel_iframe:
  file_editor:
    title: 'File Editor'
    url: http://192.168.178.240:3218
    icon: mdi:wrench-outline

With this configuration i end op here in the file system:

Can you tell me what i am doing wrong here?

Ended up in the same pickle, complete noob here. did you figure out what to do?

You’re seeing that because File Editor opens first inside the docker’s environment; that’s the run file inside /app. You just need to change the base path for File Manager to Home Assistant’s config. Technically it needs to be done in settings.conf outside docker so the file isn’t erased when you re-image but for some reason, my settings.conf didn’t work there, so I changed it inside File Manger in docker until I can work out what i did wrong.

Steps:
1.) Log into docker’s FIle Manager: here are the steps How to edit file within Docker container or edit a file after I shell into a Docker container? | Jhooq

Shot version: get the container name and log into docker

docker ps -a
docker exec -u 0 -it $container /bin/bash

2.) You’re inside /app; cd out to root.
3.) HA is located wherever you designated in that first line when you created it.

Example from mine:
-v /media/stella/homeassistant:/config \
-v /media/stella/ha_addons/configurator:/data \

I found HA at /config off root.

4.) While still inside docker File Manager, find the configurator.py file and open for editing

sudo nano ./usr/local/lib/python3.9/site-packages/hass_configurator/configurator.py

5.) At the top are all the settings you have in settings.conf. You can hard code them here as a temp measure but it will vanish when you update the image

"BASEPATH": /path/to/home/assistant/whereyourhaconfigurationfilesare <--mine was "/config"
"ENFORCE_BASEPATH": true

6.) Make any other changes to settings you need, save, and log out of docker
7.) Restart File Manager in docker.

Which reminds me to add ‘find out what the hell is up with settings.conf’ to my to-do list soon.

@seperis Thank you for your reaction! Yes, i should have known that the weird location was inside the docker container for Configurator (File Editor)…
I am going to try your solution, but i hope you will find a solution to make it persistant via settings.conf.

You can install GitHub - htmltiger/config-editor: Home Assistant Configuration Editor Helper from HACS and its companion card. Simpler than running a whole docker container.

I’m an idiot; just put the settings.conf file inside of config in Home Assistant. Ugh, that was stupid obvious.

My HA config files (configuration.yaml, etc.) are at /~/homeassistant/.config, so I placed a file named settings.conf there with this content:

"BASEPATH": /~/homeassistant/.config
"ENFORCE_BASEPATH": true

but I still get the folder run.sh in the sidebar when I try to open a file. Where should I place this file or these lines? Thanks.

I used the file editor itself to modify /usr/lib/python3.5/site-packages/hass_configurator/configurator.py. I set BASEPATH = “/~/homeassistant/.config/”. then I restarted HA and configurator. Now the sidebar shows the filesystem as /homeassistant/~/.config but when I go up the file system I find that is a folder still in the docker container. How can I point configurator out of docker into the root file system, to /~/homeassistant/.config where my yaml files are? Thanks to anyone who knows the answer to this.

When I try to add the repository to HACS, it says Repository ‘htmltiger/config-editor’ exists in the store, but I can’t find it within HACs or HA integrations.

If you search in HACS for “config editor” and “config editor card” you should find them.

OK, I found a pdf How to add config editor to HA and managed to work through that. I now have an editor in the sidebar. I had to give up on configurator; no matter what I did I couldn’t get it to reference files outside its docker instance. Thanks to all who helped.

As you are referencing a local IP address in an iframe I take it this doesn’t work outside your home network? Unless some other port forwarding and docker container network configuration was done?