Repository: HASS configurator

Following Balloob’s lead, here’s my repository for the HASS Configurator (and possibly some other add-ons).

Requires supervisor 0.26+ because that one enabled local builds for add-on repositories.

To add to your hass.io installation, follow these instructions and add the repository https://github.com/danielperna84/hassio-addons

Available add-ons:

6 Likes

thx a lot! Works great!

1 Like

When I try to add this in supervisor 0.37, it fails and the logs tell me github was waiting on a username in order to clone it.

17-06-27 15:42:03 INFO (MainThread) [hassio.addons.git] Clone addon http://github.com/danielperna84/hassio-addon repository
17-06-27 15:42:04 ERROR (MainThread) [hassio.addons.git] Can’t clone http://github.com/danielperna84/hassio-addon repo: Cmd(‘git’) failed due to: exit code(128)
cmdline: git clone -v http://github.com/danielperna84/hassio-addon /data/addons/git/cc9f894e
stderr: 'Cloning into ‘/data/addons/git/cc9f894e’…
fatal: could not read Username for ‘https://github.com’: No such device or address
'.
17-06-27 15:42:04 ERROR (MainThread) [hassio.addons] Can’t load from repository http://github.com/danielperna84/hassio-addon

What am I missing?

I haven’t used hass.io for a while (only had it set up while making the repository). So I don’t know if there have been any changes in hass.io that require a modification of my repository. The last time I have tested it I didn’t need to provide any credentials.

@danielperna84 for the first time ever, I installed your add-on and it works great. Latest version of everything on Hass.io so I can safely say, as of right now it works as expected. Tried file open/save/git commit. Everything is A-ok for me.

One question though, is there a git push option I’m missing somewhere? In Github desktop the change shows up just fine so the commit def works.

Nice addon! Just a question, why does the add-on create 9 additional containers at install?

I haven’t added the push option because on it’s own, the configurator is not capable of adding destinations to push to, and unsers new to the topic may not know how to use it, hence confusing them. But I might add it anyways since it still makes sense for those who set up their remotes manually.

@martikainen
I’m not too familiar with Docker, but it seems as if a few of the commands in the Dockerfile lead to those new containers. This happens because this isn’t a complete image on it’s own, but rather does everything live when installing. I believe each command creates a new “layer” where the command-result is stored.
If there is a way to optimize this without having to create an extra image I’m open for that. But I actually think that’s just how Docker works and all those layers don’t really add any overhead.

1 Like

Having another look at your log-output:
You output talks about http://github.com/danielperna84/hassio-addon, but it should be https://github.com/danielperna84/hassio-addons (with an extra s at the end and https instead of http).

You could use this to reduce the number of layer :

FROM %%BASE_IMAGE%%

# Add env
ENV LANG C.UTF-8

# Setup base
RUN apk add --no-cache python3 tzdata git \
  && pip3 install GitPython

# Copy data
COPY configurator.py run.sh /

RUN chmod a+x /configurator.py \
   && chmod a+x /run.sh

CMD ["/run.sh"]

Thanks. Changed it in my repo. New installations should now have fewer layers. :slight_smile:

@danielperna84 I tried to install your add-on in a fresh build of the latest version of Hass.io and it failed to install. The Supervisor logs show the following… Any ideas on what the issue could be?

17-07-03 22:08:14 INFO (SyncWorker_5) [hassio.dock.addon] Start build b794684e/armhf-addon-hass-configurator:0.1.0 on /data/tmp/b794684e_hass-configurator
17-07-03 22:08:55 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File “/usr/lib/python3.6/site-packages/aiohttp/web_protocol.py”, line 422, in start
resp = yield from self._request_handler(request)
File “/usr/lib/python3.6/site-packages/aiohttp/web.py”, line 306, in _handle
resp = yield from handler(request)
File “/usr/lib/python3.6/site-packages/hassio/api/util.py”, line 30, in wrap_api
answer = await method(api, *args, **kwargs)
File “/usr/lib/python3.6/site-packages/hassio/api/addons.py”, line 90, in install
addon.install(version=version), loop=self.loop)
File “/usr/lib/python3.6/site-packages/hassio/addons/addon.py”, line 278, in install
if not await self.addon_docker.install(version):
File “/usr/lib/python3.6/site-packages/hassio/dock/init.py”, line 61, in install
return await self.loop.run_in_executor(None, self._install, tag)
File “/usr/lib/python3.6/concurrent/futures/thread.py”, line 55, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/lib/python3.6/site-packages/hassio/dock/addon.py”, line 134, in _install
return self._build(tag)
File “/usr/lib/python3.6/site-packages/hassio/dock/addon.py”, line 177, in _build
path=str(build_dir), tag=build_tag, pull=True)
File “/usr/lib/python3.6/site-packages/docker/models/images.py”, line 175, in build
raise BuildError(chunk[‘error’])
docker.errors.BuildError: The command ‘/bin/sh -c apk add --no-cache python3 tzdata git && RUN pip3 install GitPython’ returned a non-zero code: 127

Thanks!

Could you try again please? Had a bug in there.

@danielperna84 Installing successfully! I haven’t been able to test the URL yet as I am currently connecting remotely but I will confirm that tonight. Thankyou!

Many thanks @danielperna84, always wanted to try your configurator but put off by the install process. Now have hass.io and the install is almost too easy, all working as it should.

Thanks again.

1 Like

Incredible addon and even better with the ease of use of a hassio install.

I note the mention of port forwarding in the instructions. I’m trying to figure out the networking logic of this - if I want remote access to configurator through the frontend (which itself is being accessed via duckdns), what port(s) do I need to forward? Applied to my pi’s IP? I’m having trouble visualizing the network route.

(though come to think of it, the password is visible in plaintext in the addon’s options page, so someone who had access to the frontend and really wanted to get access to my config files through configurator certainly could. I don’t see that ever happening, but it’s maybe worth consideration)

Well this is just awesome! Thanks for the hard work @danielperna84! Hass.io is a huge leap forward and devs like you are making it even more amazing!

1 Like

Since I’m not using hassio I’m not sure about how exactly that would be. Just had it running once to get the addon done. But I’m sure there will be someone here who can answer the question. :slight_smile:

So for you (non-hass.io install), there’s no special port forwarding needed to connect to configurator via the frontend remotely? I have it working just fine on my home network but I can’t get it working when I’m out and about.

It’s on port 3218 by default in hassio

Yes - just curious what port I’d need to forward 3218 to/from, and on what IP. (3218 internal to 3218 external? on my HA server’s IP?)