After changing to a docker installation on rpi3, I am struggling to get the ssl expiry sensor working:
My configuration:
# Sensor to read number of days left on TLS/SSL certificate
- platform: command_line
name: SSL cert expiry
unit_of_measurement: days
scan_interval: 10800
command: "ssl-cert-check -b -c /etc/letsencrypt/live/lbbakery.dk/cert.pem | awk '{ print $NF }'"
Which was done following the official docs:
I have searched the forums and can appreciate it is an issue about exposing the script to docker, but cannot find a definitive answer/example.
Has anyone got this working?
Thanks.
Now, in both the parameter and the command above I used ‘path-in-container’, but simply change that to something you want. In the docker run command I linked to, the Home Assistant config is placed in the /config directory in the container itself. So, for something like this I would suggest something like /certs.
ssl-cert-check is not included in the HA docker image
$ docker exec -it homeassistant bash
I have no name!@7e5700cee030:/usr/src/app$ which ssl-cert-check
I have no name!@7e5700cee030:/usr/src/app$ ssl-cert-check
bash: ssl-cert-check: command not found
Hmm, well that explains it
Anyone know of a work around?
At the moment, I am experiencing that the benefits of running ha in docker are less than the limitations it gives (although I will freely admit that I am still very much at a basic level when working with docker).
Build your own image from the HA image and add the packages you need. But you need to build your image for every HA update
Install the packages in the container manually. But you have to do this for every container you create
Use ssh to log in to your host and run the command there. But this rather breaks the limited access container philosophy of docker.
The dilemma is, as I see it, that the point of docker is to isolate your program from its environment, whereas the point of HA is to control your environment. I’d like to use HA with docker (I have plenty of other containers running), there are just too many problems like this for me to make the leap.
Thanks for your input.
Number 3 kind of brings me back to where I am. I have ssl-cert-check installed on my host and want to get the output into the ha instance.