Web-based editor

Thank!

Will look in to https myself when I have some spare time.

/Emil

1 Like

I recommend to install portainer - its a GUI for this kind of thing:

I love it :slight_smile:

Great - thanks.
That worked well.

I updated the dockerfile to use boron-alpine and its giving a much smaller image (3-4x smaller)

I submitted a PR to your repo with the change.

Well it doesn’t really make sense to use a reverse proxy or so as node does support https you just need to support in in the app - all you need to do is point it to the same cert/key path and thats it from a management perspective- especially when not using letsencrypt which is useless unless you use a vpc or dedicated machine from my experience … for the moment I got an insecure temporary solution but surely would like to include it from within the hassui

Noticed this morning that boron-alpine doesn’t have support for arm64. Changed to node:alpine base image. Seems to be running well. Still 112mb image size.

/Emil

1 Like

Thanks for the info. I couldn’t find a matrix with arch support per tag.

same problem here so I just tested with standard node:alpine and it works =)

Which architecture are you building for?

/Emil

Any tips on how to handle certificates?
Self-signed or what?

/Emil

I’m getting dockerhub to build the images. I guess it’s defaulting to x86 which is what I need

I’ve got this up and running partially. I can run it stand alone via node app.js, but when I add it to a systemd service the page returns “Internal Server Error”. Any ideas? This is my ha-editor.service file.

[Unit]
Description=ha-editor.js - Home Assistant Web Config Editor
#After=network.target

[Service]
ExecStart=/usr/local/bin/node /home/pi/ha-editor/app.js
#Type=simple
User=pi
Group=pi
Restart=always
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=ha-editor
Environment=NODE_ENV=production PORT=3000

[Install]
WantedBy=multi-user.target

I used this to run it at boot. Works nice for me.

I think I found the issue. For whatever reason (I’m not an expert) I needed to add the “WorkingDirectory” variable. So for anyone else that runs into this, my ha-editor.service file looks like:
[Unit]
Description=ha-editor.js - Home Assistant Web Config Editor
#After=network.target

[Service]
WorkingDirectory=/home/pi/ha-editor/
ExecStart=/usr/local/bin/node /home/pi/ha-editor/app.js
#Type=simple
User=pi
Group=pi
Restart=always
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=ha-editor
Environment=NODE_ENV=production PORT=3000

[Install]
WantedBy=multi-user.target

With docker you can use the --restart=always switch to make docker auto start the container when docker starts.

I think I did post this before https://medium.com/netscape/everything-about-creating-an-https-server-using-node-js-2fc5c48a8d4e

It will be great to have this project with https support , i am waiting for this change

1 Like

@voxic There’s no reason not to use -v instead of --mount in this case. Users will specify -v /home/assistant/config/path:/usr/src/app/configFolder which produces the same result and is familiar syntax to most users (majority of other containerized apps are using -v, I know Docker recommends mount for some reason).

You can set up an automated build on Docker Hub that will build an x86 arch version of this in addition to your arm version. Would be very helpful as, obviously, unless you are using an RPi you cannot use this image. I assume node:alpine is Multiarch (confirmed, it is).

With regard to https, since HASS makes it easy to setup letsencrypt many many users are using https and so your app does not appear in the iframe since it is only serving http. For those of us using reverse proxy already the solution is easy, just set up another location pointing to your app. But for others this will be confusing. I’m not sure if using a self-signed cert will cause the panel_iframe: component to complain, however.

1 Like

Nice post.
Please can you advise how to configure docker hub to build multi arch?
I forked the repo for this so I coukd get x86 builds but multiarch would be much nicer - esp to wrap as a hassio addon

I was thinking that you could just set up an auto build, which will build x86, then also push the already built arm image tagged as e.g. arm (reponame/ha-editor:arm). You could also use a manifest to make running/pulling transparent to the end user no matter the arch.

I think that you could also create a new branch in your repo and change the Dockerfile so that the base image is explicitly arm, e.g. arm32v7/node. Then you can configure auto build on Docker hub and build both branches of your repo. I think the result will be one Hub repo with two differently tagged images.

Hi! How’d you install it? I’m not using Docker. Thanks!