Home Assistant Supervised (previously known as Hass.io) on Synology DSM as native package (not supported or working atm)

Thank you, I did finally find the source and the PR myself. I’m looking through the code right now trying to get my head around it. I would like to get this working, so I’m going to try to do some troubleshooting on my own. I know that not everyone has the same setup as me, but if I can help in any way, I’d like to do so.

So far, what I’ve done is remove all trace of the Hass.io synology package, remove all configs, docker images, containers, etc. so that I’m at a clean starting point. For good measure, I then rebooted my synology. I then reinstalled the Hass.io package from the package manager.

I do see where you’re checking for the 172.30.32.0 route, and if it doesn’t exist, add it. When I start the package, it’s starting the hassio_supervisor container. This is where my setup breaks apart.

In the logs for hassio_supervisor, I get messages that it can’t connect to host.
In the container /etc/resolv.conf sets the nameserver to 127.0.0.11 (the container’s IP)
There is nothing in the container listening on port 53.

Later in the logs, I see that there is no CoreDNS plugin Docker image, so then it tries to fetch update data, but it can’t reach out to the internet.

For me, this sounds like a chicken and the egg problem. No DNS, try to set it up, can’t because we don’t have DNS.

I see you mentioned a bug in the Synology port of Docker. What’s the bug? I’ll dig around after I finish this post, but if there’s some way I could help push that along, I’d be happy to help.

As for a wiki, I’d be happy to contribute my findings if there’s a place for me to put them.

I don’t have much time left today, heading out shortly, but I would like to get this working, and I would love to finally give back to the community. Let me know how I can help. I’ll try to read over these posts to get some more information.

Finally, thanks for the work you’re doing here. I appreciate it!

Look at these:

And so on…

I think that this might be the solution (42) but I have not had time to test it.
The thing is that the gui might do other things than the cli/api of docker exactly how to test this is not clear.

It would be great if you could get it to work from cli so we can update the package to setup the networking.

Hi @fredrike

Uff…
Are you able to explain this a bit more? I’m looking into this, but it seems I can’t understand how this should be setup. Documentation on Synology page doesn’t give me enough info :confused:

I mean, if I’m looking here:
https://www.synology.com/en-global/knowledgebase/DSM/help/DSM/AdminCenter/application_appportalias
then I don’t know which part should I use, esspecially as I wrote, I can’t select HASS.IO as application so non fits.

If I go to
https://www.synology.com/en-global/knowledgebase/DSM/help/WebStation/application_webserv_virtualhost

this also doesn’t tell me too much :confused:

So, to further document what’s going on, and maybe someone else can help me with this later. Originally, I had installed Synology’s Active Directory (which I believe is just samba under the covers). That required DNS, which I was fine with. When docker sets up hassio_supervisor, it’s telling the container to use 127.0.0.11 as it’s DNS server. That isn’t listening to DNS. I stopped AD and DNS and started the hassio service, and now it appears to be starting up. I do use DNS for other things internally, so I would like to recover that in the future, but I can live with it for now.

I have to run, but I suspect that I’ll pick this up again either tonight (around midnight US Eastern) or tomorrow morning.

Sure, go to Control PanelApplication PortalReverse Proxy and fill like this:

1 Like

Let’s start with scratching down notes in the Gdoc document below and I’ll compile it to a wiki page on

https://docs.google.com/document/d/1GvOX4zTPJinXNJ4WqtHcQUSiQ0HVdRMg2tHVkmJh60k/edit?usp=sharing

1 Like

Hi

Thank you. I’ve added this as you showed (except of course hostname.
All port forwarding of course moved to Synology (433,80,8123, 3218).
However, this still don’t work :confused:

When I’m starting this from HassIO then it can’t start (stops after 1 second).
When I want to start container, I have this error message:

Start container addon_core_letsencrypt failed: {“message”:“driver failed programming external connectivity on endpoint addon_core_letsencrypt (73564e0d57267bfa1a66c68a09c2b6bf31aaa9d891bf7b7f81b091a3f3b4f0ae): Error starting userland proxy: listen tcp 0.0.0.0:80: bind: address already in use”}.

You should use the Let’s Encrypt functionality of Synology (I believe I’ve already sent you a link for it).

Hi
I have cert from Synology directly, but I was pretty sure I need second one. Wrong?
I’m just not sure how to setup then HTTPS, but let me check later and I will write my findings :slight_smile:

Thank you :slight_smile:

Ok, I have no idea how to proceed…
I found out that certificates should be located here:
/usr/syno/etc/certificate/_archive

but if I want to get into with WinSCP or putty, I have “permission denided”
If I add this to config, I have following message:

Invalid config for [http]: not a file for dictionary value @ data[‘http’][‘ssl_certificate’]. Got ‘/usr/syno/etc/certificate/_archive/fullchain.pem’
not a file for dictionary value @ data[‘http’][‘ssl_key’]. Got ‘/usr/syno/etc/certificate/_archive/privkey.pem’. (See /config/configuration.yaml, line 6).

Ideas?
UPDATE:
I copied with root permissions certifiates to /config/CERT/ and added full path:

/volume1/HassIO/HassIOFred/homeassistant/CERT/fullchain.pem (and priv)
and
/CERT/fullchain.pem

but nothing works…

UPDATE2:
Works :slight_smile:

I added to config following:

  ssl_certificate: /config/CERT/fullchain.pem
  ssl_key: /config/CERT/privkey.pem

CONFIG OK :slight_smile:

I’m just wondering how to NOT copy manually certificates every 3 months to different folder. Any ideas?

1 Like

H! This is really helpful… I would love to hear more more detailed / summarized info on how you made it

If you are using the built in Reverse Proxy of Synology as I suggested your NAS will handle certificate renewal (no need for the Let’s Encrypt addon). You can add as many subdomains you like under Subject Alternative Name.

https://www.synology.com/en-global/knowledgebase/DSM/help/DSM/AdminCenter/connection_certificate

You will have an unencrypted connection between Synology’s build in Nginx and HA, but as that is using loopback network interface you have other problems if someone breaks into your nas…

So, just change base_url to something like this, and let Synology handle the rest.

base_url: hassio.example.com

Stop complicating things :stuck_out_tongue:.

FWIW, I found the LetsEncrypt on Synology meant i had to manually renew every month or three, and I guess I got lazy?

I use the nginx/letsencrypt-companion, but since we cannot set the environment on the homeassistant container to drive the nginx/companion, I use a socat-based proxy: depends on homeassistant, has the environment variables to drive LetsEncrypt certificate automation, and socat-forwards tcp/80 to the homeassistant tcp/8123. It’s all hands-off from that point.

I finally wrote it up a few weeks ago:

https://tech.chickenandporn.com/2020/01/20/homeassistant-via-hass-io-with-letsencrypt/

I recall also that the Synology/LetsEncrypt didn’t let me do wildcard Subject-Alternative, so I’d need to manually change it every time I added a container. It’s partly laziness, partly risk-of-forgetting, so this workflow allows me to keep the LetsEncrypt certs in the same docker-compose.yaml config in a “gitops” workflow.

Hi all,
First off all thank you very much, @fredrike for putting in so much time and effort next to a demanding job and a long commute!

I’ll try to be as brief as possible. I’m a complete newb but have read all posts above.

Fresh install from Synocommunity, Latest Docker version (18.09.0-0506), followed instructions in first comments. Everything works great.
UNTIL
My Nas (DS1019+) reboots. Then the hass.io package is running, but none of the Docker containers has turned on. The “hassio_supervisor” container continuous to spawn and disappear. When I try to start the “homeassistant” container manually, the message reads: [Docker API failed. Please visit Docker Log for more information.]
When I manually try to start the “hassio_supervisor” container, it reads [container {“message”: “No such container: hassio_supervisor”} does not exist.]

Basically, all I can do is uninstall the Hassio Package from the package center. When I re-install, I’m good until my nas reboots. Then the containers are corrupt again.
I hope someone can help me get around this issue.

Thanks!

Update question:
I orginally installed this via the Dropbox package.
Just added the SynoCommunity link and see an option there for Hass.io Beta to be Updated.
Is it as simple as clicking ‘Update’? Do I need to Stop the currently Running Hass.io before Updating?
Any way to backup the current package just in case before doing so?
I already made a Snapshot in the Hass.io Supervisor tab.
Thanks!

We are all newb :slight_smile:. Thanks for reading through the whole thread.

I’ve never heard about such a problem, can you get an other Docker image to stay active between reboots?

Yes, but you will not gain anything new (the package on SynoCommunity) is the same as the one I had posted here. There is no need to do anything else but better safe than sorry.

Hi @fredrike, thanks for your reply. This weekend I switched to using home-assistant(core) rather than Hass.io. I thought it would be a lot more difficult than it really is. Currently, I have about 10 docker containers running while my synology reboots every night. (Due to a memory/cpu leak in sonarr and mono) All of them are fine when I check on them in the morning.

So, since i’m the only one reporting such an issue, and I’ve since moved on, maybe don’t worry about it too much? If you are going to persue this; let me know if there is anything I can do to help.

Kind regards,

1 Like

So it is not a graceful reboot, it is a crash on the NAS. That might explain things. It seems like the Synology Docker package have some issues with containers created outside of DSM (the Hass.io package is creating it’s own containers) and remembering them.

One fix for you might be to do a graceful reboot before it crashes and from that hope that it will work.
Or, change Sonarr installation, I’m running linuxserver/sonarr:latest and it is quite stable for me.

Sorry for being unclear. I’ve created a daily task that reboots the NAS every night. This way I’m certain the CPU load will remain normal.

Thank you for the advice on running Sonarr. I’ll deffinitly look into that soon!
(I’ve been using the synocommunity app but I thnk the problem is with Mono)

I would have hoped that the synology Docker app would shutdown “gracefully” when I command the NAS to reboot. But I’ll admit that I don’t know enough about any of this.
Currently, I create my dockercontainers and install the images through commandline. Basically, I follow the instructions of Bearded Tinker on Youtube.
https://youtu (.) be/pcnvmAOah_Y

Perhaps if I create the hass.io dockers in the same way, I will have less of an issue? Anyway, I’d prefer to run hass.io when possible since it’s a lot easier to use. (I miss the snapshots!) However, my setup is really coming along and I’ve learned a lot in the past weekend. So I’m good for now.

Thank you for the quick response! I was wondering if the SynoCommunity version would update me as Hass.io Supervisor shows me as being on 0.104.3. There is an option to update Core to 0.105.3 in the Supervisor but I wasn’t sure if that was a better way to do it with your install or if I should do it from ‘outside’ by updating the package via SynoCommunity.