My Docker Stack

It was a heck of a try: :cry:

2018-02-22 18:08:48 ERROR (MainThread) [homeassistant.config] Invalid config for [http]: not a file for dictionary value @ data[‘http’][‘ssl_certificate’]. Got ‘/certs/live/mydomain.duckdns.org/fullchain1.pem’
not a file for dictionary value @ data[‘http’][‘ssl_key’]. Got ‘/certs/live/mydomain.duckdns.org/privkey1.pem’.

And inside the home assistant docker container /certs/live/mydomain.duckdns.org/ exists?

yup

[screenshot removed]

and just to be sure, i enter the container by:

sudo docker exec -it home-assistant /bin/bash

correct?

Are you using Portainer? It’s got a GUI for it.

i have it installed but i’m not accessing the container with it.

I looked around in it and can’t find the equivalent information in the GUI page for the container

i recently moved from venv to docker on my raspi3. works well except the SSL certs issue that I can see few other have the same problem.

how do you plan to upgrade your HASS? do you destroy the container and recreate? or update HASS within the container?
also, i made changes to the original container, such as ability to shutdown another linux computer, that requires generating ssh key and transfer it across the other linux computer. any suggestion what to do so that I dont have to keep generating keys everytime i destory and create new container?

Thanks!

There’s a GUI to console in.

It’s a container. You don’t modify the contents of the container. To update you just docker-compose down docker-compose pull docker-compose up -d.

If you aren’t running docker compose, just docker kill, docker rm, docker pull homeassistant/hhome-assistant, and the docker command you used to create it

Never modify the container. Use bind mounts

I had run HA in a container for a while before Tradfri came out, then it wasn’t working so I had moved away from it. This post inspired me to get everything working in containers again. Everything is back up, but 2 of my scripts are nonfunctional. Does anyone have experience with the following:

  • Using GIT to pull configs from a docker container? (configs are committed to repo, then pulled down with a script through HASS)
  • Upgrade the HASS container from a script triggered within HASS? (This might be impossible. not sure)

This can be a little tricky but you can do this with a combo. Ha-dockermon combined with a docker container that is mounted to the same volume bind mount as your ha config. So a single docker container that does a git pull, and call the start/restart of that script from home assistant with ha-dockermon switch.

Maybe a script that SSHes into the host itself, does a docker pull, then automates the docker kill, rm, and start?

You might be able to control the Hass Docker container with something like this:

Or, like @flamingm0e said, just use a shell_command in hass that SSHes into the host and automates the update process.

yep i got that, I have -v bind mounts to host directory where HASS config are stored. However, to allow the container to shutdown/suspend another computer, you need to allow the container (HASS within the container) to be able to connect via ssh to a linux machine and execute a command remotely.

do you have this kind of setup by any chance? Here’s the link to Wake On Lan page that also shows a guide on how to suspend a linux machine - https://home-assistant.io/components/switch.wake_on_lan/

cheers

For anyone interested, i also have a Rancher setup for home-assistant:

:joy::joy::joy::joy::joy::joy::joy::joy:

yay!

I finally got it!

Here is the config that worked:

http:
  api_password: !secret http_password
  server_port: 8124
  base_url: mydomain.duckdns.org:8124
  ssl_certificate: /config/certs/live/mydomain.duckdns.org/fullchain.pem
  ssl_key: /config/certs/live/mydoman.duckdns.org/privkey.pem

notice the slight difference by adding the /config/… at the beginning of the path.

2 Likes

interesting, might give it a try and report back.

What does it do?

That makes no sense whatsoever.

This is from an earlier attempt when you mounted the wrong location…

If you run https://www.rancher.com as your docker manager, you can import the catalogue, and run home-assistant and some dependant services with a single click.

If you don’t run rancher, it is useless to you :stuck_out_tongue:

It’s using the /docker/ha-config/certs directory from the try before that one when i used:

I don’t know why it worked. :crazy_face:

I’m just happy it did.

It’s just unfortunate that one success brings the next challenge because now the ssl-cert-check command i use doesn’t find the new certs because the command is being run from inside the HA container on a command installed outside the container on the host. or at least that’s why I’m thinking it doesn’t work. :thinking: i really have no idea…