Compare commits

...

113 Commits

35 changed files with 2044 additions and 663 deletions

View File

@@ -1,19 +0,0 @@
root = true
[*]
charset = utf-8
end_of_line = lf
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
ident_size = 4
[*.md]
ident_size = 2
trim_trailing_whitespace = false
[*.json]
ident_size = 2
[{.gitignore,.gitkeep,.editorconfig}]
ident_size = 2

1839
.github/SECURITY.md vendored Normal file

File diff suppressed because it is too large Load Diff

View File

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

85
.github/labels.yml vendored
View File

@@ -1,85 +0,0 @@
---
- name: "breaking-change"
color: ee0701
description: "A breaking change for existing users."
- name: "bugfix"
color: ee0701
description: "Inconsistencies or issues which will cause a problem for users or implementors."
- name: "documentation"
color: 0052cc
description: "Solely about the documentation of the project."
- name: "enhancement"
color: 1d76db
description: "Enhancement of the code, not introducing new features."
- name: "refactor"
color: 1d76db
description: "Improvement of existing code, not introducing new features."
- name: "performance"
color: 1d76db
description: "Improving performance, not introducing new features."
- name: "new-feature"
color: 0e8a16
description: "New features or options."
- name: "maintenance"
color: 2af79e
description: "Generic maintenance tasks."
- name: "ci"
color: 1d76db
description: "Work that improves the continue integration."
- name: "dependencies"
color: 1d76db
description: "Upgrade or downgrade of project dependencies."
- name: "in-progress"
color: fbca04
description: "Issue is currently being resolved by a developer."
- name: "stale"
color: fef2c0
description: "There has not been activity on this issue or PR for quite some time."
- name: "no-stale"
color: fef2c0
description: "This issue or PR is exempted from the stable bot."
- name: "security"
color: ee0701
description: "Marks a security issue that needs to be resolved asap."
- name: "incomplete"
color: fef2c0
description: "Marks a PR or issue that is missing information."
- name: "invalid"
color: fef2c0
description: "Marks a PR or issue that is missing information."
- name: "beginner-friendly"
color: 0e8a16
description: "Good first issue for people wanting to contribute to the project."
- name: "help-wanted"
color: 0e8a16
description: "We need some extra helping hands or expertise in order to resolve this."
- name: "hacktoberfest"
description: "Issues/PRs are participating in the Hacktoberfest."
color: fbca04
- name: "hacktoberfest-accepted"
description: "Issues/PRs are participating in the Hacktoberfest."
color: fbca04
- name: "priority-critical"
color: ee0701
description: "This should be dealt with ASAP. Not fixing this issue would be a serious error."
- name: "priority-high"
color: b60205
description: "After critical issues are fixed, these should be dealt with before any further issues."
- name: "priority-medium"
color: 0e8a16
description: "This issue may be useful, and needs some attention."
- name: "priority-low"
color: e4ea8a
description: "Nice addition, maybe... someday..."
- name: "major"
color: b60205
description: "This PR causes a major version bump in the version number."
- name: "minor"
color: 0e8a16
description: "This PR causes a minor version bump in the version number."

View File

@@ -1,57 +0,0 @@
---
name-template: "v$RESOLVED_VERSION"
tag-template: "v$RESOLVED_VERSION"
change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
sort-direction: ascending
categories:
- title: "🚨 Breaking changes"
labels:
- "breaking-change"
- title: "✨ New features"
labels:
- "new-feature"
- title: "🐛 Bug fixes"
labels:
- "bugfix"
- title: "🚀 Enhancements"
labels:
- "enhancement"
- "refactor"
- "performance"
- title: "🧰 Maintenance"
labels:
- "maintenance"
- "ci"
- title: "📚 Documentation"
labels:
- "documentation"
- title: "⬆️ Dependency updates"
labels:
- "dependencies"
version-resolver:
major:
labels:
- "major"
- "breaking-change"
minor:
labels:
- "minor"
- "new-feature"
patch:
labels:
- "bugfix"
- "chore"
- "ci"
- "dependencies"
- "documentation"
- "enhancement"
- "performance"
- "refactor"
default: patch
template: |
## Whats changed
$CHANGES

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_18/{{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

@@ -12,171 +12,5 @@ on:
workflow_dispatch:
jobs:
information:
name: Gather add-on information
runs-on: ubuntu-latest
outputs:
architectures: ${{ steps.information.outputs.architectures }}
build: ${{ steps.information.outputs.build }}
description: ${{ steps.information.outputs.description }}
name: ${{ steps.information.outputs.name }}
slug: ${{ steps.information.outputs.slug }}
target: ${{ steps.information.outputs.target }}
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v2.3.4
- name: 🚀 Run add-on information action
id: information
uses: frenck/action-addon-information@v1.0.0
lint-addon:
name: Lint Add-on
needs:
- information
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v2.3.4
- name: 🚀 Run Add-on Lint
uses: frenck/action-addon-linter@v2.1
with:
community: true
path: "./${{ needs.information.outputs.target }}"
lint-hadolint:
name: Hadolint
needs:
- information
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v2.3.4
- name: 🚀 Run Hadolint
uses: brpaz/hadolint-action@v1.3.1
with:
dockerfile: "./${{ needs.information.outputs.target }}/Dockerfile"
lint-json:
name: JSON Lint
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v2.3.4
- name: 🚀 Run JQ
run: |
shopt -s globstar
cat **/*.json | jq '.'
lint-markdown:
name: MarkdownLint
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v2.3.4
- name: 🚀 Run mdl
uses: actionshub/markdownlint@2.0.2
lint-shellcheck:
name: Shellcheck
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v2.3.4
- name: 🚀 Run Shellcheck
uses: ludeeus/action-shellcheck@1.1.0
env:
SHELLCHECK_OPTS: -s bash
lint-yamllint:
name: YAMLLint
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v2.3.4
- name: 🚀 Run YAMLLint
uses: frenck/action-yamllint@v1.1
lint-prettier:
name: Prettier
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v2.3.4
- name: 🚀 Run Prettier
uses: creyD/prettier_action@v3.3
with:
prettier_options: --write **/*.{json,js,md,yaml}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build:
name: Build ${{ matrix.architecture }}
needs:
- information
- lint-addon
- lint-hadolint
- lint-json
- lint-markdown
- lint-prettier
- lint-shellcheck
- lint-yamllint
runs-on: ubuntu-latest
strategy:
matrix:
architecture: ${{ fromJson(needs.information.outputs.architectures) }}
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v2.3.4
- name: 🏗 Set up build cache
id: cache
uses: actions/cache@v2.1.4
with:
path: /tmp/.docker-cache
key: docker-${{ github.ref }}-${{ matrix.architecture }}-${{ github.sha }}
restore-keys: |
docker-${{ github.ref }}-${{ matrix.architecture }}
- name: 🏗 Set up QEMU
uses: docker/setup-qemu-action@v1.0.2
- name: 🏗 Set up Docker Buildx
uses: docker/setup-buildx-action@v1.1.2
- name: Compose build flags
id: flags
run: |
echo "::set-output name=date::$(date +"%Y-%m-%dT%H:%M:%SZ")"
from=$(jq --raw-output ".build_from.${{ matrix.architecture }}" "${{ needs.information.outputs.build }}")
echo "::set-output name=from::${from}"
if [[ "${{ matrix.architecture}}" = "amd64" ]]; then
echo "::set-output name=platform::linux/amd64"
elif [[ "${{ matrix.architecture }}" = "i386" ]]; then
echo "::set-output name=platform::linux/386"
elif [[ "${{ matrix.architecture }}" = "armhf" ]]; then
echo "::set-output name=platform::linux/arm/v6"
elif [[ "${{ matrix.architecture }}" = "armv7" ]]; then
echo "::set-output name=platform::linux/arm/v7"
elif [[ "${{ matrix.architecture }}" = "aarch64" ]]; then
echo "::set-output name=platform::linux/arm64/v8"
else
echo "::error ::Could not determine platform for architecture ${{ matrix.architecture }}"
exit 1
fi
- name: 🚀 Build
uses: docker/build-push-action@v2.4.0
with:
push: false
context: ${{ needs.information.outputs.target }}
file: ${{ needs.information.outputs.target }}/Dockerfile
cache-from: |
type=local,src=/tmp/.docker-cache
ghcr.io/hassio-addons/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:edge
cache-to: type=local,mode=max,dest=/tmp/.docker-cache
platforms: ${{ steps.flags.outputs.platform }}
build-args: |
BUILD_ARCH=${{ matrix.architecture }}
BUILD_DATE=${{ steps.flags.outputs.date }}
BUILD_DESCRIPTION=${{ needs.information.outputs.description }}
BUILD_FROM=${{ steps.flags.outputs.from }}
BUILD_NAME=${{ needs.information.outputs.name }}
BUILD_REF=${{ github.sha }}
BUILD_REPOSITORY=${{ github.repository }}
BUILD_VERSION=edge
workflows:
uses: hassio-addons/workflows/.github/workflows/addon-ci.yaml@main

View File

@@ -13,194 +13,8 @@ on:
- completed
jobs:
information:
if: |
github.event_name == 'release'
|| (
github.event_name == 'workflow_run'
&& github.event.workflow_run.conclusion == 'success'
)
name: Gather add-on information
runs-on: ubuntu-latest
outputs:
architectures: ${{ steps.information.outputs.architectures }}
build: ${{ steps.information.outputs.build }}
description: ${{ steps.information.outputs.description }}
environment: ${{ steps.release.outputs.environment }}
name: ${{ steps.information.outputs.name }}
slug: ${{ steps.information.outputs.slug }}
target: ${{ steps.information.outputs.target }}
version: ${{ steps.release.outputs.version }}
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v2.3.4
- name: 🚀 Run add-on information action
id: information
uses: frenck/action-addon-information@v1.0.0
- name: Gather version and environment
id: release
run: |
sha="${{ github.sha }}"
environment="edge"
version="${sha:0:7}"
if [[ "${{ github.event_name }}" = "release" ]]; then
version="${{ github.event.release.tag_name }}"
version="${version,,}"
version="${version#v}"
environment="stable"
if [[ "${{ github.event.release.prerelease }}" = "true" ]]; then
environment="beta"
fi
fi
echo "::set-output name=environment::${environment}"
echo "::set-output name=version::${version}"
deploy:
name: 👷 Build & Deploy ${{ matrix.architecture }}
needs: information
runs-on: ubuntu-latest
strategy:
matrix:
architecture: ${{ fromJson(needs.information.outputs.architectures) }}
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v2.3.4
- name: 🏗 Set up build cache
id: cache
uses: actions/cache@v2.1.4
with:
path: /tmp/.docker-cache
key: docker-${{ github.ref }}-${{ matrix.architecture }}-${{ github.sha }}
restore-keys: |
docker-${{ github.ref }}-${{ matrix.architecture }}
- name: 🏗 Set up QEMU
uses: docker/setup-qemu-action@v1.0.2
- name: 🏗 Set up Docker Buildx
uses: docker/setup-buildx-action@v1.1.2
- name: Compose build flags
id: flags
run: |
echo "::set-output name=date::$(date +"%Y-%m-%dT%H:%M:%SZ")"
from=$(jq --raw-output ".build_from.${{ matrix.architecture }}" "${{ needs.information.outputs.build }}")
echo "::set-output name=from::${from}"
if [[ "${{ matrix.architecture}}" = "amd64" ]]; then
echo "::set-output name=platform::linux/amd64"
elif [[ "${{ matrix.architecture }}" = "i386" ]]; then
echo "::set-output name=platform::linux/386"
elif [[ "${{ matrix.architecture }}" = "armhf" ]]; then
echo "::set-output name=platform::linux/arm/v6"
elif [[ "${{ matrix.architecture }}" = "armv7" ]]; then
echo "::set-output name=platform::linux/arm/v7"
elif [[ "${{ matrix.architecture }}" = "aarch64" ]]; then
echo "::set-output name=platform::linux/arm64/v8"
else
echo "::error ::Could not determine platform for architecture ${{ matrix.architecture }}"
exit 1
fi
- name: 🏗 Login to GitHub Container Registry
uses: docker/login-action@v1.8.0
with:
registry: ghcr.io
username: ${{ secrets.GHCR_USERNAME }}
password: ${{ secrets.GHCR_PASSWORD }}
- name: 🚀 Build and push
uses: docker/build-push-action@v2.4.0
with:
push: true
# yamllint disable rule:line-length
tags: |
ghcr.io/hassio-addons/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:${{ needs.information.outputs.environment }}
ghcr.io/hassio-addons/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:${{ needs.information.outputs.version }}
# yamllint enable rule:line-length
context: ${{ needs.information.outputs.target }}
file: ${{ needs.information.outputs.target }}/Dockerfile
cache-from: |
type=local,src=/tmp/.docker-cache
ghcr.io/hassio-addons/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:edge
cache-to: type=local,mode=max,dest=/tmp/.docker-cache
platforms: ${{ steps.flags.outputs.platform }}
build-args: |
BUILD_ARCH=${{ matrix.architecture }}
BUILD_DATE=${{ steps.flags.outputs.date }}
BUILD_DESCRIPTION=${{ needs.information.outputs.description }}
BUILD_FROM=${{ steps.flags.outputs.from }}
BUILD_NAME=${{ needs.information.outputs.name }}
BUILD_REF=${{ github.sha }}
BUILD_REPOSITORY=${{ github.repository }}
BUILD_VERSION=${{ needs.information.outputs.version }}
publish-edge:
name: 📢 Publish to edge repository
if: needs.information.outputs.environment == 'edge'
needs:
- information
- deploy
environment:
name: ${{ needs.information.outputs.environment }}
runs-on: ubuntu-latest
steps:
- name: 🚀 Dispatch repository updater update signal
uses: peter-evans/repository-dispatch@v1.1.3
with:
token: ${{ secrets.DISPATCH_TOKEN }}
repository: hassio-addons/repository-edge
event-type: update
client-payload: >
{
"addon": "${{ needs.information.outputs.slug }}",
"name": "${{ needs.information.outputs.name }}",
"repository": "${{ github.repository }}",
"version": "${{ needs.information.outputs.version }}"
}
publish-beta:
name: 📢 Publish to beta repository
if: |
needs.information.outputs.environment == 'beta' ||
needs.information.outputs.environment == 'stable'
needs:
- information
- deploy
environment:
name: ${{ needs.information.outputs.environment }}
runs-on: ubuntu-latest
steps:
- name: 🚀 Dispatch repository updater update signal
uses: peter-evans/repository-dispatch@v1.1.3
with:
token: ${{ secrets.DISPATCH_TOKEN }}
repository: hassio-addons/repository-beta
event-type: update
client-payload: >
{
"addon": "${{ needs.information.outputs.slug }}",
"name": "${{ needs.information.outputs.name }}",
"repository": "${{ github.repository }}",
"version": "${{ github.event.release.tag_name }}"
}
publish-stable:
name: 📢 Publish to stable repository
if: needs.information.outputs.environment == 'stable'
needs:
- information
- deploy
environment:
name: ${{ needs.information.outputs.environment }}
runs-on: ubuntu-latest
steps:
- name: 🚀 Dispatch repository updater update signal
uses: peter-evans/repository-dispatch@v1.1.3
with:
token: ${{ secrets.DISPATCH_TOKEN }}
repository: hassio-addons/repository
event-type: update
client-payload: >
{
"addon": "${{ needs.information.outputs.slug }}",
"name": "${{ needs.information.outputs.name }}",
"repository": "${{ github.repository }}",
"version": "${{ github.event.release.tag_name }}"
}
workflows:
uses: hassio-addons/workflows/.github/workflows/addon-deploy.yaml@main
secrets:
CAS_API_KEY: ${{ secrets.CAS_API_KEY }}
DISPATCH_TOKEN: ${{ secrets.DISPATCH_TOKEN }}

View File

@@ -3,20 +3,10 @@ name: Sync labels
# yamllint disable-line rule:truthy
on:
push:
branches:
- main
paths:
- .github/labels.yml
schedule:
- cron: "34 5 * * *"
workflow_dispatch:
jobs:
labels:
name: ♻️ Sync labels
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v2.3.4
- name: 🚀 Run Label Syncer
uses: micnncim/action-label-syncer@v1.2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
workflows:
uses: hassio-addons/workflows/.github/workflows/labels.yaml@main

View File

@@ -8,14 +8,5 @@ on:
workflow_dispatch:
jobs:
lock:
name: 🔒 Lock closed issues and PRs
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v2.0.3
with:
github-token: ${{ github.token }}
issue-lock-inactive-days: "30"
issue-lock-reason: ""
pr-lock-inactive-days: "1"
pr-lock-reason: ""
workflows:
uses: hassio-addons/workflows/.github/workflows/lock.yaml@main

15
.github/workflows/pr-labels.yaml vendored Normal file
View File

@@ -0,0 +1,15 @@
---
name: PR Labels
# yamllint disable-line rule:truthy
on:
pull_request_target:
types:
- opened
- labeled
- unlabeled
- synchronize
jobs:
workflows:
uses: hassio-addons/workflows/.github/workflows/pr-labels.yaml@main

View File

@@ -8,11 +8,5 @@ on:
- main
jobs:
update_release_draft:
name: ✏️ Draft release
runs-on: ubuntu-latest
steps:
- name: 🚀 Run Release Drafter
uses: release-drafter/release-drafter@v5.15.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
workflows:
uses: hassio-addons/workflows/.github/workflows/release-drafter.yaml@main

View File

@@ -8,33 +8,5 @@ on:
workflow_dispatch:
jobs:
stale:
name: 🧹 Clean up stale issues and PRs
runs-on: ubuntu-latest
steps:
- name: 🚀 Run stale
uses: actions/stale@v3.0.18
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 30
days-before-close: 7
remove-stale-when-updated: true
stale-issue-label: "stale"
exempt-issue-labels: "no-stale,help-wanted"
stale-issue-message: >
There hasn't been any activity on this issue recently, so we
clean up some of the older and inactive issues.
Please make sure to update to the latest version and
check if that solves the issue. Let us know if that works for you
by leaving a comment 👍
This issue has now been marked as stale and will be closed if no
further activity occurs. Thanks!
stale-pr-label: "stale"
exempt-pr-labels: "no-stale"
stale-pr-message: >
There hasn't been any activity on this pull request recently. This
pull request has been automatically marked as stale because of that
and will be closed if no further activity occurs within 7 days.
Thank you for your contributions.
workflows:
uses: hassio-addons/workflows/.github/workflows/stale.yaml@main

View File

@@ -1,6 +1,6 @@
# MIT License
Copyright (c) 2019-2021 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

@@ -58,7 +58,7 @@ This is an active open-source project. We are always open to people who want to
use the code or contribute to it.
We have set up a separate document containing our
[contribution guidelines](CONTRIBUTING.md).
[contribution guidelines](.github/CONTRIBUTING.md).
Thank you for being involved! :heart_eyes:
@@ -80,7 +80,7 @@ our [GitHub Repository][repository].
MIT License
Copyright (c) 2019-2021 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/2021.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/2021.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

@@ -1,8 +1,8 @@
# Home Assistant Community Add-on: ZeroTier One
ZeroTier delivers the capabilities of VPNs, SDN, and SD-WAN with a single
system. Manage all your connected resources across both local and wide area
networks as if the whole world is a single data center.
[ZeroTier][zerotier] delivers the capabilities of VPNs, SDN, and SD-WAN with
a single system. Manage all your connected resources across both local
and wide area networks as if the whole world is a single data center.
People use ZeroTier to seamlessly connect laptops, desktops, phones,
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
comparison to installing any other Home Assistant add-on.
1. Search for the "ZeroTier One" add-on in the Supervisor add-on store
and install it.
1. Click the Home Assistant My button below to open the add-on on your Home
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. Set the "network_id" add-on option with your network ID.
1. Start the "ZeroTier One" add-on
@@ -114,7 +118,7 @@ check [the contributor's page][contributors].
MIT License
Copyright (c) 2019-2021 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
@@ -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
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
[contributors]: https://github.com/hassio-addons/addon-zerotier/graphs/contributors
[discord-ha]: https://discord.gg/c5DvZ4e
@@ -143,5 +149,5 @@ SOFTWARE.
[issue]: https://github.com/hassio-addons/addon-zerotier/issues
[reddit]: https://reddit.com/r/homeassistant
[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/

View File

@@ -1,4 +1,4 @@
ARG BUILD_FROM=ghcr.io/hassio-addons/base/amd64:9.1.7
ARG BUILD_FROM=ghcr.io/hassio-addons/base:14.1.0
# hadolint ignore=DL3006
FROM ${BUILD_FROM}
@@ -6,26 +6,32 @@ FROM ${BUILD_FROM}
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Setup base
ARG ZERO_TIER_ONE_VERSION="1.12.1"
# hadolint ignore=DL3003
RUN \
apk add --no-cache --virtual .build-dependencies \
build-base=0.5-r2 \
linux-headers=5.7.8-r0 \
git=2.30.2-r0 \
build-base=0.5-r3 \
cargo=1.71.1-r0 \
git=2.40.1-r0 \
linux-headers=6.3-r0 \
openssl-dev=3.1.2-r0 \
pkgconf=1.9.5-r0 \
\
&& apk add --no-cache \
libgcc=10.2.1_pre1-r3 \
libstdc++=10.2.1_pre1-r3 \
libgcc=12.2.1_git20220924-r10 \
libstdc++=12.2.1_git20220924-r10 \
\
&& git clone --branch "1.6.4" --depth=1 \
&& git clone --branch "${ZERO_TIER_ONE_VERSION}" --depth=1 \
"https://github.com/zerotier/ZeroTierOne.git" /tmp/zerotier \
\
&& cd /tmp/zerotier \
&& make \
&& CARGO_NET_GIT_FETCH_WITH_CLI=true make \
&& make install \
\
&& apk del --no-cache --purge .build-dependencies \
&& rm -f -r /tmp/*
&& rm -f -r \
/root/.cargo \
/tmp/*
# Copy root filesystem
COPY rootfs /

View File

@@ -1,9 +0,0 @@
{
"build_from": {
"aarch64": "ghcr.io/hassio-addons/base/aarch64:9.1.7",
"amd64": "ghcr.io/hassio-addons/base/amd64:9.1.7",
"armhf": "ghcr.io/hassio-addons/base/armhf:9.1.7",
"armv7": "ghcr.io/hassio-addons/base/armv7:9.1.7",
"i386": "ghcr.io/hassio-addons/base/i386:9.1.7"
}
}

10
zerotier/build.yaml Normal file
View File

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

View File

@@ -1,29 +0,0 @@
{
"name": "ZeroTier One",
"version": "dev",
"slug": "zerotier",
"description": "Radically simplify your network with a virtual networking layer that works the same everywhere",
"url": "https://github.com/hassio-addons/addon-zerotier",
"startup": "services",
"init": false,
"arch": ["aarch64", "amd64", "armhf", "armv7", "i386"],
"ports": {
"9993/tcp": 9993
},
"ports_description": {
"9993/tcp": "ZeroTier's primary port"
},
"host_network": true,
"privileged": ["NET_ADMIN", "SYS_ADMIN"],
"devices": ["/dev/net/tun"],
"map": ["ssl:rw"],
"options": {
"networks": [],
"api_auth_token": ""
},
"schema": {
"networks": ["match(^!secret [a-zA-Z0-9_\\-]+$|[0-9a-z]{16})"],
"api_auth_token": "str",
"log_level": "list(trace|debug|info|notice|warning|error|fatal)?"
}
}

35
zerotier/config.yaml Normal file
View File

@@ -0,0 +1,35 @@
---
name: ZeroTier One
version: dev
slug: zerotier
description: Radically simplify your network with a virtual networking layer that works the same everywhere
url: https://github.com/hassio-addons/addon-zerotier
codenotary: codenotary@frenck.dev
startup: services
init: false
arch:
- aarch64
- amd64
- armhf
- armv7
- i386
ports:
9993/tcp: 9993
ports_description:
9993/tcp: ZeroTier's primary port
host_network: true
privileged:
- NET_ADMIN
- SYS_ADMIN
devices:
- /dev/net/tun
map:
- ssl:rw
options:
networks: []
api_auth_token: ""
schema:
networks:
- match(^!secret [a-zA-Z0-9_\-]+$|[0-9a-z]{16})
api_auth_token: str
log_level: list(trace|debug|info|notice|warning|error|fatal)?

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
# 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
if bashio::config.has_value 'api_auth_token'; then
token=$(bashio::config 'api_auth_token')
echo "${token}" > /data/authtoken.secret
echo "${token}" > /var/lib/zerotier-one/authtoken.secret
fi
# 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
# 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