Browse Source

Update readme

Joachim M. Giæver 4 years ago
parent
commit
f130739576
3 changed files with 64 additions and 47 deletions
  1. 63 37
      README.md
  2. 0 6
      scripts/hooks/prepare-slot-certs
  3. 1 4
      snap/snapcraft.yaml

+ 63 - 37
README.md

@@ -1,87 +1,113 @@
-# home-assistant-snap
+# Home Assistant (snap)
 
-Snap (Snapcraft.yaml) recipe for the Open source home automation software that puts local control and privacy first.
+Snap (Snapcraft.yaml) recipe for the Open source home automation software, [Home Assistant](https://www.home-assistant.io/) that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts. Perfect to run on a Raspberry Pi or a local server.
 
-Our tagging is reflecting the Home Assistant version numbers.
+This page will only include specific information about the snap-version of Home Assistant. For general Home Assistant questions, see their official [Help page](https://www.home-assistant.io/help/) and [Community Forum](https://community.home-assistant.io/).
+
+Our tagging is reflecting the Home Assistant version numbers, but we might not release a tag for each version of Home Assistant.
 
 [![Get it from the Snap Store](https://snapcraft.io/static/images/badges/en/snap-store-black.svg)](https://snapcraft.io/home-assistant-snap)
+[![Donate with PayPal](https://giaever.online/paypal-donate-button.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=69NA8SXXFBDBN&source=https://git.giaever.org/joachimmg/home-assistant-snap)
 
-# Build
-Simply
+## About this project
 
-1. **Clone repo over HTTPS**
+This snap-version of Home Assistant was made with the intention of running a home automation system on multiple remote location. Snap was choosen as it is an transactional, self updating package manager, which will let us not have to travel to the location(s) to do updates on each system.
 
-```
-git clone https://git.giaever.org/joachimmg/home-assistant-snap.git
-```
+Based on this intention we have choosen a strict confinement, which should work out of the box on the [Ubuntu Core](https://ubuntu.com/core) operating system and similar. As changes to the snap on these systems are limited we have also built several other snaps that will integrate with this version or help manage devices remotely.
+
+* [Home Assistant Community Store](https://git.giaever.org/joachimmg/home-assistant-hacs)-integration gives you a powerful UI to handle downloads of all your custom needs.
+* [HASS Configurator](https://git.giaever.org/joachimmg/home-assistant-configurator)-integration to allow easy configuration of Home Assistant.
+* [acme.sh](https://git.giaever.org/joachimmg/acme-sh) (SSL): probably the easiest & smartest shell script to automatically issue & renew the free certificates from Let's Encrypt.
+* [ddclient](https://git.giaever.org/joachimmg/ddclient-snap): client used to update dynamic DNS entries for accounts on many dynamic DNS services.
+
+and we're working on a solution to extend the installation further so you can add additional libaries (curl, wget, ssh) that you will need to be able to build your system as you want.
+
+Please file all issues using the main git-repository found at [git.giaever.org](https://git.giaever.org/joachimmg/home-assistant-snap/issues).
+
+### Install from The Snap Store
+
+Make sure you have Snapd installed on your system. See [Installing snapd](https://snapcraft.io/docs/installing-snapd) for a list of distributions with and without snap pre-installed, including installation instructions for those that have not.
+
+### Build this snap from source
+
+We recommend that your download a pre-built version of this snap from [The Snap Store](https://snapcraft.io/home-assistant-snap), or at least make sure that you checkout the latest tag, as the master tag might contain faulty code during development.
 
-2. **Change directory into the cloned repository**
+1. **Clone this repo and checkout the latest tag**
 
 ```
-$ cd ~/home-assistant-snap/
+$ git clone https://git.giaever.org/joachimmg/home-assistant-snap.git
+
+# Go into directory
+$ cd ./home-assistant-snap
+
+# Checkout tag
+$ git checkout <tag>
 ```
+_**NOTE**: You can find the latest tag with `git ls-remote --tags origin`_
 
-and checkout the latest tag (e.g `$ git checkout 0.112.3`) as the master branch might not be functioning.
+2. **Build and install**
 
-3. **Build & install**
-3.1 Make sure you have snapcraft installed: 
+Make sure you have snapd (see [Installing snapd](https://snapcraft.io/docs/installing-snapd)) and latest version of Snapcraft. Install Snapcraft with
 
 ```
-sudo snap install snapcraft --classic && hash -r
+$ sudo snap install snapcraft --classic
 ```
 
-3.2 **Build with**
+Or update with
 
 ```
-$ snapcraft
+$ sudo snap refresh snapcraft
 ```
 
-3.3 **Install with** (change «packagename» to filename of the produced snap).
+2.2 **With multipass**
+
+From the «home-assistant-snap»-directory, run
 
 ```
-$ ls -al | grep .snap
-$ snap install --devmode --dangerous <packagename>.snap
-``` 
+$ snapcraft
+```
+
+Multipass will be installed and a virtual machine will boot up and build your snap. The final snap will be located in the same directory.
 
-4. **Notes on building on a Raspberry Pi**
+2.3 **With LXD** (*required* for Raspberry Pie)
 
-Snapcraft will try to install multipass for you, but on *Raspberry Pi* it will fail. You will have to use an LXD container, **before** any of the previous steps.
+Snapcraft will try to install multiplass and build the snap for you, but on *Raspberry Pi* it will fail. You will have to use an LXD container.
 
-4.1 **Install LXD on the Pi**
+Install LXD and create a container
 
 ```
 $ snap install lxd
+$ snap lxd init
 ```
 
-4.2 **Create a container**
+Make sure your user is a member of lxd-group
 
 ```
-$ sudo lxd init
+$ sudo adduser $USER lxd
 ```
 
-4.3 **Make sure your user is a member of lxd-group**
+Launch an Ubuntu 20.04 container instance
 
 ```
-sudo adduser $USER lxd
+$ lxc launch ubuntu:20.04 home-assistant-snap
 ```
 
-_(it might tell that you already are...)_
+Make sure you're in the «home-assistant-snap»-directory and go into the shell of your newly created container
 
-4.4 **Launch an Ubuntu 20.04 container instance**
 ```
-lxc launch ubuntu:20.04 home-assistant-container
+$ lxc exec -- home-assistant-snap /bin/bash
 ```
 
-4.5 **Go into the shell of the container**
+and run
 
 ```
-lxc exec -- home-assistant-container /bin/bash
+$ SNAPCRAFT_BUILD_ENVIRONMENT=host snapcraft
 ```
 
-4.6 **Continue with *step 1*, but replace *step 3.2* with the following:**
+when the build is complete, you'll have to exit the shell and pull the snap-file from the container. See `lxc file pull --help`.
+
+3. **Install new built snap**
 
 ```
-SNAPCRAFT_BUILD_ENVIRONMENT=host snapcraft
+$ sudo snap install --dangerous
 ```
-
-as we have to build within the LXD container itself and not through multipass.

+ 0 - 6
scripts/hooks/prepare-slot-certs

@@ -2,12 +2,6 @@
 
 source "${SNAP}/init"
 
-if ! [[ -d "${CERTS_DIR}" ]]; then
-    logger "Creating dir ${CERTS_DIR}"
-    mkdir "${CERTS_DIR}"
-    chmod 0700 "${CERTS_DIR}"
-fi
-
 if ! [[ -d "${SSL_DIR}" ]]; then
     logger "Creating local cert dir ${SSL_DIR}"
     mkdir "${SSL_DIR}"

+ 1 - 4
snap/snapcraft.yaml

@@ -35,10 +35,7 @@ slots:
   configurations:
     interface: content
     write:
-      - $SNAP_DATA/configuration.yaml
-      - $SNAP_DATA/scenes.yaml
-      - $SNAP_DATA/scripts.yaml
-      - $SNAP_DATA/configurations
+      - $SNAP_DATA
 
 apps:
   hass: