Web-based editor

I understand that HASSIO is using a dockerised approach, so this should lead to strighhtforward integration :+1:

Created a docker image, it runs, but I’m having issues with writing to the config files, there is no problem reading. Any docker experts here?

This is how I get it to run:
Install docker, see https://www.raspberrypi.org/blog/docker-comes-to-raspberry-pi/

sudo docker pull voxic/ha-editor

cd /home/homeassistant/.homeassistant/
sudo docker run -d -p 3000:3000 --mount type=bind,source="$(pwd)"/,target=/usr/src/app/configFolder voxic/ha-editor

https://hub.docker.com/r/voxic/ha-editor/

I’ll give it a try installing the docker tonight and let know how I get on. Re your write issues I have a GUI within Synology that allows me to specify write or ready only. Sorry its no help but a quick search of the docker docs should help.

Thanks! But I just solved it! The docker image is now running fine. The error was actually not with the image, I had messed up the saving function when I implemented support for folders.

//Emil

2 Likes

hi I am pretty new to linux so might have ballsed it right up, but i followed the instructions and get the following error

module.js:328
throw err;
^

Error: Cannot find module ‘express’
at Function.Module._resolveFilename (module.js:326:15)
at Function.Module._load (module.js:277:25)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object. (/home/security/ha-editor/app.js:4:15)
at Module._compile (module.js:410:26)
at Object.Module._extensions…js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Function.Module.runMain (module.js:442:10)

Hi!

Sounds like you missed the step to install dependencys.
After you have cloned the repo with git.
Go in to the directory and run npm install

/Emil

I have done that… i just re did it, and still the same error ?

Any errors or warnings during npm install? What platform do you run?

//Emil

Ubuntu 16.04 No issues when installing

if you look under ha-editor/node_modules/ is there a folder named express?

if not, try npm install express --save

you can also try the docker image, got that one running earlier today.

Install docker

sudo docker pull voxic/ha-editor

cd homeassistant_config_dir
sudo docker run -d -p 3000:3000 --mount type=bind,source="$(pwd)"/,target=/usr/src/app/configFolder voxic/ha-editor

//Emil

i will try the docker, never used docker before.

I did the first thing you said try and get the following message when it completes

npm WARN [email protected] No repository field.

When i run the app again still get

module.js:328
throw err;
^

Error: Cannot find module ‘body-parser’
at Function.Module._resolveFilename (module.js:326:15)
at Function.Module._load (module.js:277:25)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object. (/home/security/ha-editor/app.js:7:18)
at Module._compile (module.js:410:26)
at Object.Module._extensions…js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Function.Module.runMain (module.js:442:10)

OK, Are you sure that you did run npm install inside of the ha-editor folder? Because the errors that you experience are all linked to dependencies not being installed.

Try the npm install command once again, if that doesn’t work you will have to do npm install body-parser --save
And will have to do that a couple more times for all of the dependencies.

These are the dependencies that ha-editor relies on:
“body-parser”
“bootstrap”
“ejs”
“express”
“jquery”
“monaco-editor”

/Emil

I have the same problem with raspberry pi, i have tried without the docker, didnt had errors when install npm (sudo apt-get install npm)

I verified the release that is currently on github, there is no problem there.

Are you able to run the command node in it self?

Here is a guide to install node and npm for raspberry pi.

yes, i am able to run node commands

it is now working , but it is doesnt show the files, do i need to enter the internal ip to the duck address?
i have http ssl

Port 3000 is the same as the Grafana plugin from bestlibre

But easy to remap it with docker… e.g.
docker run -d -p 3333:3000 -v /usr/share/hassio/homeassistant:/usr/src/app/configFolder voxic/ha-editor

I have created a hassio addon config.json for local install, but I am getting errors when starting it.
I think the image in dockerhub is for ARM64 arch - is this correct?

I changed port in APP.JS … Wirke nice but error message appears anyway

Finally got around to trying to install the Docker on my Synology. The GUI detects port 3000 but doesn’t run. Getting the following error in docker logs:

Start container voxic-ha-editor1 failed: rpc error: code = 2 desc = "oci runtime error: exec format error"

I have it setup at follows:

/docker/hass (the location of my Home Assistant configurations.yaml etc)
`/config’ (Mount Path)

Should the mount path be /usr/src/app/configFolder voxic/ha-editor

Any ideas?

anyway to have node.js as part of the docker?