Compare commits
8 Commits
@@ -1,4 +1,4 @@
|
||||
ARG BUILD_FROM=ghcr.io/hassio-addons/base:12.2.1
|
||||
ARG BUILD_FROM=ghcr.io/hassio-addons/base:13.0.0
|
||||
# hadolint ignore=DL3006
|
||||
FROM ${BUILD_FROM}
|
||||
|
||||
@@ -10,17 +10,17 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
RUN \
|
||||
apk add --no-cache --virtual .build-dependencies \
|
||||
build-base=0.5-r3 \
|
||||
cargo=1.60.0-r2 \
|
||||
git=2.36.2-r0 \
|
||||
linux-headers=5.16.7-r1 \
|
||||
openssl-dev=1.1.1q-r0 \
|
||||
pkgconf=1.8.0-r0 \
|
||||
cargo=1.64.0-r2 \
|
||||
git=2.38.2-r0 \
|
||||
linux-headers=5.19.5-r0 \
|
||||
openssl-dev=3.0.7-r0 \
|
||||
pkgconf=1.9.3-r0 \
|
||||
\
|
||||
&& apk add --no-cache \
|
||||
libgcc=11.2.1_git20220219-r2 \
|
||||
libstdc++=11.2.1_git20220219-r2 \
|
||||
libgcc=12.2.1_git20220924-r4 \
|
||||
libstdc++=12.2.1_git20220924-r4 \
|
||||
\
|
||||
&& git clone --branch "1.10.1" --depth=1 \
|
||||
&& git clone --branch "1.10.2" --depth=1 \
|
||||
"https://github.com/zerotier/ZeroTierOne.git" /tmp/zerotier \
|
||||
\
|
||||
&& cd /tmp/zerotier \
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
---
|
||||
build_from:
|
||||
aarch64: ghcr.io/hassio-addons/base:12.2.1
|
||||
amd64: ghcr.io/hassio-addons/base:12.2.1
|
||||
armhf: ghcr.io/hassio-addons/base:12.2.1
|
||||
armv7: ghcr.io/hassio-addons/base:12.2.1
|
||||
i386: ghcr.io/hassio-addons/base:12.2.1
|
||||
aarch64: ghcr.io/hassio-addons/base:13.0.0
|
||||
amd64: ghcr.io/hassio-addons/base:13.0.0
|
||||
armhf: ghcr.io/hassio-addons/base:13.0.0
|
||||
armv7: ghcr.io/hassio-addons/base:13.0.0
|
||||
i386: ghcr.io/hassio-addons/base:13.0.0
|
||||
codenotary:
|
||||
base_image: codenotary@frenck.dev
|
||||
signer: codenotary@frenck.dev
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/command/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
# ==============================================================================
|
||||
# Home Assistant Community Add-on: ZeroTier One
|
||||
# Generates an identiy in case it does not exists yet
|
||||
@@ -0,0 +1 @@
|
||||
oneshot
|
||||
1
zerotier/rootfs/etc/s6-overlay/s6-rc.d/init-zerotier/up
Normal file
1
zerotier/rootfs/etc/s6-overlay/s6-rc.d/init-zerotier/up
Normal file
@@ -0,0 +1 @@
|
||||
/etc/s6-overlay/s6-rc.d/init-zerotier/run
|
||||
27
zerotier/rootfs/etc/s6-overlay/s6-rc.d/zerotier/finish
Executable file
27
zerotier/rootfs/etc/s6-overlay/s6-rc.d/zerotier/finish
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/command/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
# ==============================================================================
|
||||
# Home Assistant Community Add-on: ZeroTier One
|
||||
# Take down the S6 supervision tree when ZeroTier fails
|
||||
# ==============================================================================
|
||||
declare exit_code
|
||||
readonly exit_code_container=$(</run/s6-linux-init-container-results/exitcode)
|
||||
readonly exit_code_service="${1}"
|
||||
readonly exit_code_signal="${2}"
|
||||
readonly service="ZeroTier One"
|
||||
|
||||
bashio::log.info \
|
||||
"Service ${service} exited with code ${exit_code_service}" \
|
||||
"(by signal ${exit_code_signal})"
|
||||
|
||||
if [[ "${exit_code_service}" -eq 256 ]]; then
|
||||
if [[ "${exit_code_container}" -eq 0 ]]; then
|
||||
echo $((128 + $exit_code_signal)) > /run/s6-linux-init-container-results/exitcode
|
||||
fi
|
||||
[[ "${exit_code_signal}" -eq 15 ]] && exec /run/s6/basedir/bin/halt
|
||||
elif [[ "${exit_code_service}" -ne 0 ]]; then
|
||||
if [[ "${exit_code_container}" -eq 0 ]]; then
|
||||
echo "${exit_code_service}" > /run/s6-linux-init-container-results/exitcode
|
||||
fi
|
||||
exec /run/s6/basedir/bin/halt
|
||||
fi
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/command/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
# ==============================================================================
|
||||
# Home Assistant Community Add-on: ZeroTier One
|
||||
# Runs ZeroTier One
|
||||
1
zerotier/rootfs/etc/s6-overlay/s6-rc.d/zerotier/type
Normal file
1
zerotier/rootfs/etc/s6-overlay/s6-rc.d/zerotier/type
Normal file
@@ -0,0 +1 @@
|
||||
longrun
|
||||
@@ -1,11 +0,0 @@
|
||||
#!/command/with-contenv bashio
|
||||
# ==============================================================================
|
||||
# Home Assistant Community Add-on: ZeroTier One
|
||||
# Take down the S6 supervision tree when ZeroTier fails
|
||||
# ==============================================================================
|
||||
if [[ "${1}" -ne 0 ]] && [[ "${1}" -ne 256 ]]; then
|
||||
bashio::log.warning "ZeroTier crashed, halting add-on"
|
||||
/run/s6/basedir/bin/halt
|
||||
fi
|
||||
|
||||
bashio::log.info "ZeroTier stopped, restarting..."
|
||||
Reference in New Issue
Block a user