Browse Source

Get ridd of the hass-term

Joachim M. Giæver 4 years ago
parent
commit
a1056653c8

+ 1 - 1
README.md

@@ -28,7 +28,7 @@ Please file all issues using the main git-repository found at [git.giaever.org](
 
 * **How do I configure Home Assistant from this snap**
     * If your using Home Assistant on a desktop or server edition you will be able to use your favourite text editor. The configurations files is store in `/var/snap/home-assistant-snap/current`. You will need to have root access.
-    * If you can't locate the configuration files (it may differ on some distributions), log into the daemon' shell with `sudo snap run --shell home-assistant-snap.hass` and execute `echo $SNAP_DATA`. This should return a path similar that is mentioned above, but containing a digit (the revision number of the current running version). When you have figured out the path, it's wise to exchange the `revision number` with `current`, as this number will change frequently and `current` will always be linked to the currently used revision.
+    * If you can't locate the configuration files (it may differ on some distributions), log into the daemon' shell with `sudo snap run --shell home-assistant-snap` and execute `echo $SNAP_DATA`. This should return a path similar that is mentioned above, but containing a digit (the revision number of the current running version). When you have figured out the path, it's wise to exchange the `revision number` with `current`, as this number will change frequently and `current` will always be linked to the currently used revision.
     * If you don't have root access or want to be able to update the configurations through a web solution, have a look at the [home-assistant-configurator](https://git.giaever.org/joachimmg/home-assistant-configurator). 
 * **How can I secure my Home Assistant with SSL (HTTPS)?**
     * Install [acme-sh](https://git.giaever.org/joachimmg/acme-sh) and connect `acme-sh`'s and home-assistant-snap's slot/plug with `snap connect acme-sh:certs home-assistant-snap:certs`. 

+ 1 - 1
scripts/bin/certs-daemon

@@ -51,7 +51,7 @@ if [ "${DOMAIN}" != "--not-set" ]; then
         if [ "${i}" -ne 0 ]; then
             cp -f "${DOMAIN_DIR}/.time" "${SSL_DIR}/.time"
             logger "${SNAP_NAME}: Certificates (${DOMAIN}) changed for ${SNAP_NAME}-${UUID}, restart"
-            snapctl restart "${SNAP_NAME}.hass"
+            snapctl restart "${SNAP_NAME}"
         fi
         gpg_close_agent
     else

+ 0 - 4
scripts/bin/slot-certs

@@ -1,4 +0,0 @@
-#!/usr/bin/env bash
-source "${SNAP}/init"
-
-exec $@

+ 1 - 2
snap/hooks/connect-slot-components

@@ -1,3 +1,2 @@
 #!/usr/bin/env bash
-
-snapctl restart "${SNAP_NAME}.hass"
+snapctl restart "${SNAP_NAME}"

+ 1 - 1
snap/hooks/disconnect-slot-certs

@@ -4,4 +4,4 @@ source "${SNAP}/init"
 logger "Disconnect ${SNAP_NAME}:certs (uuid: ${UUID})"
 
 rm -rf "${SSL_DIR}"
-snapctl restart "${SNAP_NAME}.hass"
+snapctl restart "${SNAP_NAME}"

+ 1 - 0
snap/hooks/unprepare-slot-components

@@ -4,3 +4,4 @@ logger "Disconnect 'custom_components' (HACS) from ${SNAP_NAME}"
 CC="${SNAP_DATA}/custom_components"
 logger "Removing ${CC}"
 rm -rf "${CC}"
+snapctl restart "${SNAP_NAME}"

+ 5 - 5
snap/snapcraft.yaml

@@ -45,10 +45,8 @@ hooks:
       - network-bind
 
 apps:
-  hass:
+  home-assistant-snap:
     command: bin/hass --config $SNAP_DATA
-    command-chain:
-      - bin/slot-certs
     daemon: simple
     environment:
       PIP_USER: 1
@@ -62,7 +60,9 @@ apps:
       - physical-memory-control
     slots: 
       - components
-  certs-daemon:
+  check-config:
+    command: bin/hass --script check_config
+  renew-cert:
     command: bin/certs-daemon
     daemon: oneshot
     restart-condition: always
@@ -72,7 +72,7 @@ apps:
     plugs:
       - network
       - network-bind
-  refresh-certs:
+  force-renew-cert:
     command: bin/certs-daemon
     slots:
       - certs