Compare commits

...

18 Commits

19 changed files with 112 additions and 39 deletions

View File

@@ -1,8 +0,0 @@
---
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: daily
time: "06:00"

59
.github/renovate.json vendored Normal file
View File

@@ -0,0 +1,59 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"rebaseWhen": "behind-base-branch",
"dependencyDashboard": true,
"labels": ["dependencies", "no-stale"],
"commitMessagePrefix": "⬆️",
"commitMessageTopic": "{{depName}}",
"regexManagers": [
{
"fileMatch": ["/Dockerfile$", "/build.yaml$"],
"matchStringsStrategy": "any",
"matchStrings": [
"ARG BUILD_FROM=(?<depName>.*?):(?<currentValue>.*?)\\s+",
"(aarch64|amd64|armhf|armv7|i386):\\s[\"']?(?<depName>.*?):(?<currentValue>.*?)[\"']?\\s"
],
"datasourceTemplate": "docker"
},
{
"fileMatch": ["/Dockerfile$"],
"matchStringsStrategy": "any",
"matchStrings": [
"\\s\\s(?<package>[a-z0-9-]+)=(?<currentValue>[a-z0-9-_.]+)\\s+"
],
"versioningTemplate": "loose",
"datasourceTemplate": "repology",
"depNameTemplate": "alpine_3_17/{{package}}"
},
{
"fileMatch": ["/Dockerfile$"],
"matchStrings": [
"ARG ZERO_TIER_ONE_VERSION=[\"']?(?<currentValue>.+?)[\"']?\\s+"
],
"datasourceTemplate": "github-releases",
"depNameTemplate": "zerotier/ZeroTierOne"
}
],
"packageRules": [
{
"matchDatasources": ["repology"],
"automerge": true
},
{
"groupName": "Add-on base image",
"matchDatasources": ["docker"]
},
{
"groupName": "Add-on base image",
"matchDatasources": ["docker"],
"matchUpdateTypes": ["minor", "patch"],
"automerge": true
},
{
"matchDatasources": ["github-releases"],
"matchDepNames": ["zerotier/ZeroTierOne"],
"matchUpdateTypes": ["minor", "patch"],
"automerge": true
}
]
}

View File

@@ -1,6 +1,6 @@
# MIT License
Copyright (c) 2019-2022 Franck Nijhof
Copyright (c) 2019-2023 Franck Nijhof
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -80,7 +80,7 @@ our [GitHub Repository][repository].
MIT License
Copyright (c) 2019-2022 Franck Nijhof
Copyright (c) 2019-2023 Franck Nijhof
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -121,7 +121,7 @@ SOFTWARE.
[i386-shield]: https://img.shields.io/badge/i386-yes-green.svg
[issue]: https://github.com/hassio-addons/addon-zerotier/issues
[license-shield]: https://img.shields.io/github/license/hassio-addons/addon-zerotier.svg
[maintenance-shield]: https://img.shields.io/maintenance/yes/2022.svg
[maintenance-shield]: https://img.shields.io/maintenance/yes/2023.svg
[patreon-shield]: https://frenck.dev/wp-content/uploads/2019/12/patreon.png
[patreon]: https://www.patreon.com/frenck
[project-stage-shield]: https://img.shields.io/badge/project%20stage-experimental-yellow.svg

View File

@@ -67,7 +67,7 @@ If you are more interested in stable releases of our add-ons:
[forum]: https://community.home-assistant.io/t/home-assistant-community-add-on-zerotier-one/109091?u=frenck
[github-sponsors-shield]: https://frenck.dev/wp-content/uploads/2019/12/github_sponsor.png
[github-sponsors]: https://github.com/sponsors/frenck
[maintenance-shield]: https://img.shields.io/maintenance/yes/2022.svg
[maintenance-shield]: https://img.shields.io/maintenance/yes/2023.svg
[patreon-shield]: https://frenck.dev/wp-content/uploads/2019/12/patreon.png
[patreon]: https://www.patreon.com/frenck
[project-stage-shield]: https://img.shields.io/badge/project%20stage-experimental-yellow.svg

View File

@@ -118,7 +118,7 @@ check [the contributor's page][contributors].
MIT License
Copyright (c) 2019-2022 Franck Nijhof
Copyright (c) 2019-2023 Franck Nijhof
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,4 +1,4 @@
ARG BUILD_FROM=ghcr.io/hassio-addons/base/amd64:12.0.0
ARG BUILD_FROM=ghcr.io/hassio-addons/base:13.1.4
# hadolint ignore=DL3006
FROM ${BUILD_FROM}
@@ -6,21 +6,22 @@ FROM ${BUILD_FROM}
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Setup base
ARG ZERO_TIER_ONE_VERSION="1.10.6"
# hadolint ignore=DL3003
RUN \
apk add --no-cache --virtual .build-dependencies \
build-base=0.5-r2 \
cargo=1.60.0-r2 \
git=2.36.1-r0 \
linux-headers=5.16.7-r1 \
openssl-dev=1.1.1o-r0 \
pkgconf=1.8.0-r0 \
build-base=0.5-r3 \
cargo=1.64.0-r2 \
git=2.38.4-r1 \
linux-headers=5.19.5-r0 \
openssl-dev=3.0.8-r1 \
pkgconf=1.9.4-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.8.9" --depth=1 \
&& git clone --branch "${ZERO_TIER_ONE_VERSION}" --depth=1 \
"https://github.com/zerotier/ZeroTierOne.git" /tmp/zerotier \
\
&& cd /tmp/zerotier \

View File

@@ -1,10 +1,10 @@
---
build_from:
aarch64: ghcr.io/hassio-addons/base/aarch64:12.0.0
amd64: ghcr.io/hassio-addons/base/amd64:12.0.0
armhf: ghcr.io/hassio-addons/base/armhf:12.0.0
armv7: ghcr.io/hassio-addons/base/armv7:12.0.0
i386: ghcr.io/hassio-addons/base/i386:12.0.0
aarch64: ghcr.io/hassio-addons/base:13.1.4
amd64: ghcr.io/hassio-addons/base:13.1.4
armhf: ghcr.io/hassio-addons/base:13.1.4
armv7: ghcr.io/hassio-addons/base:13.1.4
i386: ghcr.io/hassio-addons/base:13.1.4
codenotary:
base_image: codenotary@frenck.dev
signer: codenotary@frenck.dev

View File

@@ -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

View File

@@ -0,0 +1 @@
oneshot

View File

@@ -0,0 +1 @@
/etc/s6-overlay/s6-rc.d/init-zerotier/run

View 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

View File

@@ -1,4 +1,5 @@
#!/command/with-contenv bashio
# shellcheck shell=bash
# ==============================================================================
# Home Assistant Community Add-on: ZeroTier One
# Runs ZeroTier One

View File

@@ -0,0 +1 @@
longrun

View File

@@ -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..."