Web-based editor

how can i make it to auto start when raspberry start?

Hi

I think it has something to do with clicking on a file before the editor is fully loaded. Will change it so that the files are presented after the editor is fully loaded.

/Emil

The docker image is built on a RaspberryPi 3, I’m quite new on this whole docker thing so haven’t figured everything out yet.

/Emil

1 Like

I guess that the image needs to be modified for it to run on a Synology.

/Emil

Are you running the docker image or whit nodejs?

/Emil

The whole nodejs runtime is packed in the docker image. It is based on baron.
So if you go the docker way you don’t need node runtime locally.

//Emil

I looked at your docker file. Rather than using your arm arch image for hassio addon I’ll try doing full local build with your dockerfile. (When I get time :slight_smile: )

I got it working via http but as my entire setup is https is there an option to allow https in the editor - couldnt see anything at first glance … but looks good so far just the browser refuses to include an http iframe in an https session obviously…

1 Like

nodejs, no docker

HTTPS is down to the hosting of the application. The editor is basically a web application. The standalone version is run with the built-in nodejs server, so if you want https you need to serve the application with something like nginx.

The docker version runs on a base image called boron (nodejs). Maby there is a possibility to enable https in the docker image.

/Emil

When running the docker container with the command

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

This line

--mount type=bind,source="$(pwd)"/,target=/usr/src/app/configFolder

Mounts the current working local directory to the directory /usr/src/app/configFolder inside of the docker container.

So if you could specify your path to your home assistant configuration by modifying that command
Like:

--mount type=bind,source=/full/path/to/config,target=/usr/src/app/configFolder

/Emil

Or also can use -v for volume:

Not sure the pros/cons of -v vs —mount
I always used -v before

According to docker

New users should use the --mount syntax. Experienced users may be more familiar with the -v or --volume syntax, but are encouraged to use --mount, because research has shown it to be easier to use.
-Volumes | Docker Docs

1 Like

not the response I was looking for - I will give this a go when I find the time but it seems it needs to be part of your app.js which would require me to manage it - rather than you implementing it at source …

https://www.whatsthatlambda.com/nodejs/creating-an-https-server-with-nodejs-and-express?utm_source=medium&utm_medium=medium&utm_campaign=blue

Isn’t adding HTTPS/TLS via nginx/caddy/etc reverse proxy much easier?
Especially with caddy you get built in support for letsencrypt for free certificates.
It means all your certificate management is in one place rather than scattered across a bunch of microservices.

I just forked your repo and built an x86 arch image in dockerhub.

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

It’s working… but I think I found a bug. When I tried to open a file I get the following exception logged:

/usr/src/app/app.js:26
        data.forEach(function(element) {
            ^

TypeError: Cannot read property 'forEach' of undefined
    at /usr/src/app/app.js:26:13
    at FSReqWrap.oncomplete (fs.js:123:15)

One other thing I noticed is that the image that dockerhub built is quite big.
I think that size can be reduced by using boron-alpine base image.

https://hub.docker.com/_/node/

I just pushed a commit to GitHub that fixes the error, I was trying to iterate over a non-initialized array, the array is not initialized if the directory configured is empty.

/Emil

Can someone please advise on how to uninstall this docker image? I’m not having much luck using ‘sudo docker rm voxic/ha-editor’.

Thanks.

I think its actually
sudo docker image rm voxic/ha-editor

Thanks. I had to use the force parameter but that worked.

I would be keen to try it again once SSL is supported, unfortunately I don’t have the know how to implement it, great editor regardless!