Compare commits

...

112 Commits

20 changed files with 138 additions and 49 deletions

View File

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

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

@@ -0,0 +1,62 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"rebaseWhen": "behind-base-branch",
"dependencyDashboard": true,
"labels": ["dependencies", "no-stale"],
"commitMessagePrefix": "⬆️",
"commitMessageTopic": "{{depName}}",
"customManagers": [
{
"customType": "regex",
"fileMatch": ["/Dockerfile$", "/build.yaml$"],
"matchStringsStrategy": "any",
"matchStrings": [
"ARG BUILD_FROM=(?<depName>.*?):(?<currentValue>.*?)\\s+",
"(aarch64|amd64|armhf|armv7|i386):\\s[\"']?(?<depName>.*?):(?<currentValue>.*?)[\"']?\\s"
],
"datasourceTemplate": "docker"
},
{
"customType": "regex",
"fileMatch": ["/Dockerfile$"],
"matchStringsStrategy": "any",
"matchStrings": [
"\\s\\s(?<package>[a-z0-9-]+)=(?<currentValue>[a-z0-9-_.]+)\\s+"
],
"versioningTemplate": "loose",
"datasourceTemplate": "repology",
"depNameTemplate": "alpine_3_21/{{package}}"
},
{
"customType": "regex",
"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 # MIT License
Copyright (c) 2019-2022 Franck Nijhof Copyright (c) 2019-2025 Franck Nijhof
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -80,7 +80,7 @@ our [GitHub Repository][repository].
MIT License MIT License
Copyright (c) 2019-2022 Franck Nijhof Copyright (c) 2019-2025 Franck Nijhof
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@@ -102,7 +102,7 @@ SOFTWARE.
[aarch64-shield]: https://img.shields.io/badge/aarch64-yes-green.svg [aarch64-shield]: https://img.shields.io/badge/aarch64-yes-green.svg
[amd64-shield]: https://img.shields.io/badge/amd64-yes-green.svg [amd64-shield]: https://img.shields.io/badge/amd64-yes-green.svg
[armhf-shield]: https://img.shields.io/badge/armhf-yes-green.svg [armhf-shield]: https://img.shields.io/badge/armhf-no-red.svg
[armv7-shield]: https://img.shields.io/badge/armv7-yes-green.svg [armv7-shield]: https://img.shields.io/badge/armv7-yes-green.svg
[commits-shield]: https://img.shields.io/github/commit-activity/y/hassio-addons/addon-zerotier.svg [commits-shield]: https://img.shields.io/github/commit-activity/y/hassio-addons/addon-zerotier.svg
[commits]: https://github.com/hassio-addons/addon-zerotier/commits/main [commits]: https://github.com/hassio-addons/addon-zerotier/commits/main
@@ -118,10 +118,10 @@ SOFTWARE.
[github-actions]: https://github.com/hassio-addons/addon-zerotier/actions [github-actions]: https://github.com/hassio-addons/addon-zerotier/actions
[github-sponsors-shield]: https://frenck.dev/wp-content/uploads/2019/12/github_sponsor.png [github-sponsors-shield]: https://frenck.dev/wp-content/uploads/2019/12/github_sponsor.png
[github-sponsors]: https://github.com/sponsors/frenck [github-sponsors]: https://github.com/sponsors/frenck
[i386-shield]: https://img.shields.io/badge/i386-yes-green.svg [i386-shield]: https://img.shields.io/badge/i386-no-red.svg
[issue]: https://github.com/hassio-addons/addon-zerotier/issues [issue]: https://github.com/hassio-addons/addon-zerotier/issues
[license-shield]: https://img.shields.io/github/license/hassio-addons/addon-zerotier.svg [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/2025.svg
[patreon-shield]: https://frenck.dev/wp-content/uploads/2019/12/patreon.png [patreon-shield]: https://frenck.dev/wp-content/uploads/2019/12/patreon.png
[patreon]: https://www.patreon.com/frenck [patreon]: https://www.patreon.com/frenck
[project-stage-shield]: https://img.shields.io/badge/project%20stage-experimental-yellow.svg [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 [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-shield]: https://frenck.dev/wp-content/uploads/2019/12/github_sponsor.png
[github-sponsors]: https://github.com/sponsors/frenck [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/2025.svg
[patreon-shield]: https://frenck.dev/wp-content/uploads/2019/12/patreon.png [patreon-shield]: https://frenck.dev/wp-content/uploads/2019/12/patreon.png
[patreon]: https://www.patreon.com/frenck [patreon]: https://www.patreon.com/frenck
[project-stage-shield]: https://img.shields.io/badge/project%20stage-experimental-yellow.svg [project-stage-shield]: https://img.shields.io/badge/project%20stage-experimental-yellow.svg

View File

@@ -1,8 +1,8 @@
# Home Assistant Community Add-on: ZeroTier One # Home Assistant Community Add-on: ZeroTier One
ZeroTier delivers the capabilities of VPNs, SDN, and SD-WAN with a single [ZeroTier][zerotier] delivers the capabilities of VPNs, SDN, and SD-WAN with
system. Manage all your connected resources across both local and wide area a single system. Manage all your connected resources across both local
networks as if the whole world is a single data center. and wide area networks as if the whole world is a single data center.
People use ZeroTier to seamlessly connect laptops, desktops, phones, People use ZeroTier to seamlessly connect laptops, desktops, phones,
embedded devices, cloud resources, and apps any way they want anywhere they go. embedded devices, cloud resources, and apps any way they want anywhere they go.
@@ -14,8 +14,12 @@ can now add your Home Assistant instance using this add-on.
The installation of this add-on is pretty straightforward and not different in The installation of this add-on is pretty straightforward and not different in
comparison to installing any other Home Assistant add-on. comparison to installing any other Home Assistant add-on.
1. Search for the "ZeroTier One" add-on in the Supervisor add-on store 1. Click the Home Assistant My button below to open the add-on on your Home
and install it. Assistant instance.
[![Open this add-on in your Home Assistant instance.][addon-badge]][addon]
1. Click the "Install" button to install the add-on.
1. Create a free account at [zerotier.com][zerotier] and get a network ID. 1. Create a free account at [zerotier.com][zerotier] and get a network ID.
1. Set the "network_id" add-on option with your network ID. 1. Set the "network_id" add-on option with your network ID.
1. Start the "ZeroTier One" add-on 1. Start the "ZeroTier One" add-on
@@ -114,7 +118,7 @@ check [the contributor's page][contributors].
MIT License MIT License
Copyright (c) 2019-2022 Franck Nijhof Copyright (c) 2019-2025 Franck Nijhof
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@@ -134,6 +138,8 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
[addon-badge]: https://my.home-assistant.io/badges/supervisor_addon.svg
[addon]: https://my.home-assistant.io/redirect/supervisor_addon/?addon=a0d7b954_zerotier&repository_url=https%3A%2F%2Fgithub.com%2Fhassio-addons%2Frepository
[api]: https://www.zerotier.com/manual.shtml#4_1 [api]: https://www.zerotier.com/manual.shtml#4_1
[contributors]: https://github.com/hassio-addons/addon-zerotier/graphs/contributors [contributors]: https://github.com/hassio-addons/addon-zerotier/graphs/contributors
[discord-ha]: https://discord.gg/c5DvZ4e [discord-ha]: https://discord.gg/c5DvZ4e
@@ -143,5 +149,5 @@ SOFTWARE.
[issue]: https://github.com/hassio-addons/addon-zerotier/issues [issue]: https://github.com/hassio-addons/addon-zerotier/issues
[reddit]: https://reddit.com/r/homeassistant [reddit]: https://reddit.com/r/homeassistant
[releases]: https://github.com/hassio-addons/addon-zerotier/releases [releases]: https://github.com/hassio-addons/addon-zerotier/releases
[semver]: http://semver.org/spec/v2.0.0.htm [semver]: https://semver.org/spec/v2.0.0.html
[zerotier]: https://www.zerotier.com/ [zerotier]: https://www.zerotier.com/

View File

@@ -1,4 +1,4 @@
ARG BUILD_FROM=ghcr.io/hassio-addons/base/amd64:11.0.1 ARG BUILD_FROM=ghcr.io/hassio-addons/base:17.2.5
# hadolint ignore=DL3006 # hadolint ignore=DL3006
FROM ${BUILD_FROM} FROM ${BUILD_FROM}
@@ -6,26 +6,32 @@ FROM ${BUILD_FROM}
SHELL ["/bin/bash", "-o", "pipefail", "-c"] SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Setup base # Setup base
ARG ZERO_TIER_ONE_VERSION="1.14.2"
# hadolint ignore=DL3003 # hadolint ignore=DL3003
RUN \ RUN \
apk add --no-cache --virtual .build-dependencies \ apk add --no-cache --virtual .build-dependencies \
build-base=0.5-r2 \ build-base=0.5-r3 \
linux-headers=5.10.41-r0 \ cargo=1.83.0-r0 \
git=2.34.1-r0 \ git=2.47.2-r0 \
linux-headers=6.6-r1 \
openssl-dev=3.3.3-r0 \
pkgconf=2.3.0-r0 \
\ \
&& apk add --no-cache \ && apk add --no-cache \
libgcc=10.3.1_git20211027-r0 \ libgcc=14.2.0-r4 \
libstdc++=10.3.1_git20211027-r0 \ libstdc++=14.2.0-r4 \
\ \
&& git clone --branch "1.8.4" --depth=1 \ && git clone --branch "${ZERO_TIER_ONE_VERSION}" --depth=1 \
"https://github.com/zerotier/ZeroTierOne.git" /tmp/zerotier \ "https://github.com/zerotier/ZeroTierOne.git" /tmp/zerotier \
\ \
&& cd /tmp/zerotier \ && cd /tmp/zerotier \
&& make \ && CARGO_NET_GIT_FETCH_WITH_CLI=true make \
&& make install \ && make install \
\ \
&& apk del --no-cache --purge .build-dependencies \ && apk del --no-cache --purge .build-dependencies \
&& rm -f -r /tmp/* && rm -f -r \
/root/.cargo \
/tmp/*
# Copy root filesystem # Copy root filesystem
COPY rootfs / COPY rootfs /

View File

@@ -1,7 +1,8 @@
--- ---
build_from: build_from:
aarch64: ghcr.io/hassio-addons/base/aarch64:11.0.1 aarch64: ghcr.io/hassio-addons/base:17.2.5
amd64: ghcr.io/hassio-addons/base/amd64:11.0.1 amd64: ghcr.io/hassio-addons/base:17.2.5
armhf: ghcr.io/hassio-addons/base/armhf:11.0.1 armv7: ghcr.io/hassio-addons/base:17.2.5
armv7: ghcr.io/hassio-addons/base/armv7:11.0.1 codenotary:
i386: ghcr.io/hassio-addons/base/i386:11.0.1 base_image: codenotary@frenck.dev
signer: codenotary@frenck.dev

View File

@@ -4,14 +4,13 @@ version: dev
slug: zerotier slug: zerotier
description: Radically simplify your network with a virtual networking layer that works the same everywhere description: Radically simplify your network with a virtual networking layer that works the same everywhere
url: https://github.com/hassio-addons/addon-zerotier url: https://github.com/hassio-addons/addon-zerotier
codenotary: codenotary@frenck.dev
startup: services startup: services
init: false init: false
arch: arch:
- aarch64 - aarch64
- amd64 - amd64
- armhf
- armv7 - armv7
- i386
ports: ports:
9993/tcp: 9993 9993/tcp: 9993
ports_description: ports_description:

View File

@@ -1,4 +1,5 @@
#!/usr/bin/with-contenv bashio #!/command/with-contenv bashio
# shellcheck shell=bash
# ============================================================================== # ==============================================================================
# Home Assistant Community Add-on: ZeroTier One # Home Assistant Community Add-on: ZeroTier One
# Generates an identiy in case it does not exists yet # Generates an identiy in case it does not exists yet
@@ -42,7 +43,7 @@ bashio::log.info "ZeroTier node address: ${node}"
# Sets the auth token for the local JSON API # Sets the auth token for the local JSON API
if bashio::config.has_value 'api_auth_token'; then if bashio::config.has_value 'api_auth_token'; then
token=$(bashio::config 'api_auth_token') token=$(bashio::config 'api_auth_token')
echo "${token}" > /data/authtoken.secret echo "${token}" > /var/lib/zerotier-one/authtoken.secret
fi fi
# Ensure network folder exists # Ensure network folder exists

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 @@
#!/usr/bin/with-contenv bashio #!/command/with-contenv bashio
# shellcheck shell=bash
# ============================================================================== # ==============================================================================
# Home Assistant Community Add-on: ZeroTier One # Home Assistant Community Add-on: ZeroTier One
# Runs ZeroTier One # Runs ZeroTier One

View File

@@ -0,0 +1 @@
longrun

View File

@@ -1,9 +0,0 @@
#!/usr/bin/execlineb -S0
# ==============================================================================
# Home Assistant Community Add-on: ZeroTier One
# Take down the S6 supervision tree when ZeroTier fails
# ==============================================================================
if -n { s6-test $# -ne 0 }
if -n { s6-test ${1} -eq 256 }
s6-svscanctl -t /var/run/s6/services