Skip to content

Commit 1a4399e

Browse files
authored
Merge pull request #1101 from dcflachs/homeassistant-heyu
Add Homeassistant-heyu mod
2 parents 6360fcf + e063714 commit 1a4399e

File tree

22 files changed

+57
-107
lines changed

22 files changed

+57
-107
lines changed

.github/workflows/BuildImage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ on:
1212
env:
1313
GITHUB_REPO: "linuxserver/docker-mods" #don't modify
1414
ENDPOINT: "linuxserver/mods" #don't modify
15-
BASEIMAGE: "replace_baseimage" #replace
16-
MODNAME: "replace_modname" #replace
15+
BASEIMAGE: "homeassistant" #replace
16+
MODNAME: "heyu" #replace
1717
MOD_VERSION: ${{ inputs.mod_version }} #don't modify
1818
MULTI_ARCH: "true" #set to false if not needed
1919

Dockerfile

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,32 @@
11
# syntax=docker/dockerfile:1
22

3-
FROM scratch
3+
## Buildstage ##
4+
FROM ghcr.io/linuxserver/baseimage-alpine:3.22 AS buildstage
45

5-
LABEL maintainer="username"
6+
ARG GIT_HASH=902a4ef
67

78
# copy local files
8-
COPY root/ /
9+
COPY root/ /root-layer/
10+
11+
RUN \
12+
echo "**** install build packages ****" && \
13+
apk add --no-cache \
14+
curl build-base && \
15+
echo "**** get heyu source ****" && \
16+
mkdir -p /build && \
17+
cd /build && \
18+
curl -LsSo heyu.tar.gz https://github.com/HeyuX10Automation/heyu/archive/${GIT_HASH}.tar.gz && \
19+
tar --strip-components=1 -xf heyu.tar.gz && \
20+
echo "**** building heyu ****" && \
21+
./configure --sysconfdir=/config/heyu/ && \
22+
make && \
23+
make install prefix=/root-layer sysconfdir=/root-layer/defaults && \
24+
cd /
25+
26+
## Single layer deployed image ##
27+
FROM scratch
28+
29+
LABEL maintainer="dcflachs"
30+
31+
# Add files from buildstage
32+
COPY --from=buildstage /root-layer/ /

Dockerfile.complex

Lines changed: 0 additions & 33 deletions
This file was deleted.

README.md

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,11 @@
1-
# Rsync - Docker mod for openssh-server
1+
# Heyu - Docker mod for homeassistant
22

3-
This mod adds rsync to openssh-server, to be installed/updated during container start.
3+
This mod adds heyu to homeassistant, to be installed/updated during container start.
44

5-
In openssh-server docker arguments, set an environment variable `DOCKER_MODS=linuxserver/mods:openssh-server-rsync`
5+
In homeassistant docker arguments, set an environment variable `DOCKER_MODS=linuxserver/mods:homeassistant-heyu`
66

7-
If adding multiple mods, enter them in an array separated by `|`, such as `DOCKER_MODS=linuxserver/mods:openssh-server-rsync|linuxserver/mods:openssh-server-mod2`
7+
If adding multiple mods, enter them in an array separated by `|`, such as `DOCKER_MODS=linuxserver/mods:homeassistant-heyu|linuxserver/mods:homeassistant-hacs`
88

9-
# Mod creation instructions
9+
# Mod config instructions
1010

11-
* Fork the repo, create a new branch based on the branch `template`.
12-
* Edit the `Dockerfile` for the mod. `Dockerfile.complex` is only an example and included for reference; it should be deleted when done.
13-
* Inspect the `root` folder contents. Edit, add and remove as necessary.
14-
* After all init scripts and services are created, run `find ./ -path "./.git" -prune -o \( -name "run" -o -name "finish" -o -name "check" \) -not -perm -u=x,g=x,o=x -print -exec chmod +x {} +` to fix permissions.
15-
* Edit this readme with pertinent info, delete these instructions.
16-
* Finally edit the `.github/workflows/BuildImage.yml`. Customize the vars for `BASEIMAGE` and `MODNAME`. Set the versioning logic and `MULTI_ARCH` if needed.
17-
* Ask the team to create a new branch named `<baseimagename>-<modname>`. Baseimage should be the name of the image the mod will be applied to. The new branch will be based on the `template` branch.
18-
* Submit PR against the branch created by the team.
19-
20-
21-
## Tips and tricks
22-
23-
* Some images have helpers built in, these images are currently:
24-
* [Openvscode-server](https://github.com/linuxserver/docker-openvscode-server/pull/10/files)
25-
* [Code-server](https://github.com/linuxserver/docker-code-server/pull/95)
11+
Heyu cannot be configured through the homeassistant interface. To configure heyu edit the config file at `/config/heyu/x10.conf`

root/etc/s6-overlay/s6-rc.d/init-mod-imagename-modname-install/dependencies.d/init-mods-package-install renamed to root/etc/s6-overlay/s6-rc.d/init-mod-homeassistant-heyu-setup/dependencies.d/init-mods-package-install

File renamed without changes.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/with-contenv bash
2+
3+
# This is an install script that is designed to run after init-mods-package-install
4+
# so it can take advantage of packages installed
5+
# init-mods-end depends on this script so that later init and services wait until this script exits
6+
7+
echo "**** Setting up heyu ****"
8+
9+
mkdir -p /config/heyu
10+
mkdir -p /usr/local/var/tmp/heyu
11+
mkdir -p /usr/local/var/lock
12+
13+
if [[ ! -f /config/heyu/x10.conf ]]; then
14+
cp /defaults/x10config.sample /config/heyu/x10.conf
15+
fi
16+
17+
if [[ ! -f /config/heyu/x10.sched ]]; then
18+
cp /defaults/x10.sched.sample /config/heyu/x10.sched
19+
fi
20+
21+
echo "**** heyu setup complete ****"

root/etc/s6-overlay/s6-rc.d/init-mod-imagename-modname-add-package/type renamed to root/etc/s6-overlay/s6-rc.d/init-mod-homeassistant-heyu-setup/type

File renamed without changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/etc/s6-overlay/s6-rc.d/init-mod-homeassistant-heyu-setup/run

root/etc/s6-overlay/s6-rc.d/init-mod-imagename-modname-add-package/run

Lines changed: 0 additions & 30 deletions
This file was deleted.

root/etc/s6-overlay/s6-rc.d/init-mod-imagename-modname-add-package/up

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)