Compare commits

..

21 Commits

Author SHA1 Message Date
snyk-bot
ece47698e7 fix: Dockerfile to reduce vulnerabilities
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-DEBIAN12-SYSTEMD-6277507
- https://snyk.io/vuln/SNYK-DEBIAN12-SYSTEMD-6277507
- https://snyk.io/vuln/SNYK-DEBIAN12-ZLIB-6008963
- https://snyk.io/vuln/SNYK-DEBIAN12-GNUTLS28-6474581
- https://snyk.io/vuln/SNYK-DEBIAN12-SYSTEMD-6277509
2024-07-02 08:47:41 +00:00
Conventional Changelog Action
a831772404 chore 🤖: Release v1.1.2 [skip ci] 2023-10-18 07:59:04 +00:00
Josh J
7ad182fba6 docs: update docs
fixes: #22
2023-10-18 08:55:29 +01:00
Conventional Changelog Action
fbdc16952c chore 🤖: Release v1.1.1 [skip ci] 2023-10-17 08:13:35 +00:00
Josh J
704859e91a ci: changelog needs permissions to commit to repo
consider breaking this out into another workflow to segregate permission
2023-10-17 09:09:03 +01:00
Josh J
63e3bea752 ci: must checkout before changelog 2023-10-17 08:59:47 +01:00
Josh J
fdd8bbbdda ci: needs to be able to publish security reports 2023-10-17 08:52:23 +01:00
546eeac920 Merge pull request #24 from dangeroustech/biodrone/issue22
ci: add permissions to actions file
2023-10-17 08:47:21 +01:00
Josh J
ffea17e8e8 ci: only do final build on main branch
oitherwise there's no tag to pull from
2023-10-17 08:43:10 +01:00
b144c39680 ci: only build PRs with main as base 2023-10-03 07:21:37 +00:00
a48a9286a2 ci: only build issue branches 2023-10-03 07:19:51 +00:00
511a78b182 ci: only build assigned PRs 2023-10-03 07:18:49 +00:00
2d7d9c7f3b ci: add permissions to actions file 2023-10-03 07:08:31 +00:00
46ee60cbc9 fix: set latest tag 2023-09-23 22:31:27 +00:00
bca9ec3df7 fix: 401 2023-09-23 21:49:35 +00:00
5cd683cb7a fix: remove tag to hopefully fix digest pushing 2023-09-23 21:44:42 +00:00
8d550748cd fix: push by digest again 2023-09-23 21:39:53 +00:00
f8d73263fd fix: re-setup buildx 2023-09-23 21:33:13 +00:00
2c987a3bbe fix: push by digest is breaking things 2023-09-23 21:30:17 +00:00
be55349cef fix: correct deps 2023-09-23 21:28:42 +00:00
593036c8ad fix: correct multiplatform builds
because apparently manifests are too difficult
2023-09-23 21:27:47 +00:00
6 changed files with 119 additions and 29 deletions

View File

@@ -1,20 +1,38 @@
name: Publish Docker Image name: Publish Docker Image
permissions:
actions: read
checks: read
contents: write
deployments: read
issues: read
discussions: read
packages: read
pages: read
pull-requests: read
repository-projects: read
security-events: write
statuses: read
on: on:
pull_request: pull_request:
branches:
- main
push: push:
branches: branches:
- "main" - main
env:
REGISTRY_IMAGE: registry.dangerous.tech/dangeroustech/zerotierbridge
jobs: jobs:
Docker_Release: Docker_Build:
name: "Docker Build And Release" name: Docker Build And Release
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
fail-fast: true fail-fast: true
matrix: matrix:
arch: ["amd64", "arm64"] arch: [amd64, arm64]
version: ["1.12.2"] version: [1.12.2]
steps: steps:
- name: Checkout Repository - name: Checkout Repository
uses: actions/checkout@v4 uses: actions/checkout@v4
@@ -26,14 +44,14 @@ jobs:
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
- name: Login to Registry - name: Login to Registry
id: registry_push id: login
uses: docker/login-action@v3 uses: docker/login-action@v3
with: with:
registry: registry.dangerous.tech registry: registry.dangerous.tech
username: ${{ secrets.REGISTRY_USERNAME }} username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }} password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build and Push - name: Build
id: docker_build id: docker_build
uses: docker/build-push-action@v5 uses: docker/build-push-action@v5
with: with:
@@ -43,7 +61,64 @@ jobs:
VERSION=${{ matrix.version }} VERSION=${{ matrix.version }}
push: true push: true
platforms: linux/${{ matrix.arch }} platforms: linux/${{ matrix.arch }}
tags: registry.dangerous.tech/dangeroustech/zerotierbridge:latest outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true
- name: Export Digests
run: |
mkdir -p /tmp/digests
digest="${{ steps.docker_build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@v3
with:
name: digests
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1
MergeRefs:
name: Do The Horrible Merge Thing
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs:
- Docker_Build
steps:
- name: Download digests
uses: actions/download-artifact@v3
with:
name: digests
path: /tmp/digests
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Registry
id: login
uses: docker/login-action@v3
with:
registry: registry.dangerous.tech
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY_IMAGE }}
tags: |
# set latest tag for default branch
# https://github.com/docker/metadata-action#latest-tag
type=raw,value=latest,enable={{is_default_branch}}
- name: Create manifest list and push
working-directory: /tmp/digests
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
- name: Inspect image
run: |
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
- name: Generate SBOM - name: Generate SBOM
uses: anchore/sbom-action@v0 uses: anchore/sbom-action@v0
@@ -63,13 +138,15 @@ jobs:
severity-cutoff: medium severity-cutoff: medium
fail-build: false fail-build: false
only-fixed: true only-fixed: true
by-cve: true
- name: upload Anchore scan SARIF report - name: upload Anchore scan SARIF report
uses: github/codeql-action/upload-sarif@v2 uses: github/codeql-action/upload-sarif@v2
with: with:
sarif_file: ${{ steps.scan.outputs.sarif }} sarif_file: ${{ steps.scan.outputs.sarif }}
- name: Checkout Repository
uses: actions/checkout@v4
- name: Changelog - name: Changelog
uses: TriPSs/conventional-changelog-action@v3 uses: TriPSs/conventional-changelog-action@v3
id: changelog id: changelog
@@ -77,9 +154,9 @@ jobs:
with: with:
github-token: ${{ secrets.GITHUB_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
git-message: "chore 🤖: Release {version}" git-message: "chore 🤖: Release {version}"
output-file: "CHANGELOG.md" output-file: CHANGELOG.md
tag-prefix: "v" tag-prefix: v
fallback-version: "1.0.0" fallback-version: 1.0.0
release-count: 0 # preserve all versions in changelog release-count: 0 # preserve all versions in changelog
skip-on-empty: false # otherwise we don't publish fixes skip-on-empty: false # otherwise we don't publish fixes

View File

@@ -1,3 +1,23 @@
## [1.1.2](https://github.com/dangeroustech/ZeroTierBridge/compare/v1.1.1...v1.1.2) (2023-10-18)
## [1.1.1](https://github.com/dangeroustech/ZeroTierBridge/compare/v1.1.0...v1.1.1) (2023-10-17)
### Bug Fixes
* 401 ([bca9ec3](https://github.com/dangeroustech/ZeroTierBridge/commit/bca9ec3df76f9c6ea114e099dd9317c58489d0b2))
* correct deps ([be55349](https://github.com/dangeroustech/ZeroTierBridge/commit/be55349cefbf291a9ce4233e65a785dad4ec3830))
* correct multiplatform builds ([593036c](https://github.com/dangeroustech/ZeroTierBridge/commit/593036c8ad8099a3a4e7b1ac9b1dcfbdb8e04a98))
* push by digest again ([8d55074](https://github.com/dangeroustech/ZeroTierBridge/commit/8d550748cde552ef5552e02770842d4e91f99253))
* push by digest is breaking things ([2c987a3](https://github.com/dangeroustech/ZeroTierBridge/commit/2c987a3bbe0492aaf22b26e446cb7d96a6c9115d))
* re-setup buildx ([f8d7326](https://github.com/dangeroustech/ZeroTierBridge/commit/f8d73263fdfd328ad38a77ff381e93bd8bda5750))
* remove tag to hopefully fix digest pushing ([5cd683c](https://github.com/dangeroustech/ZeroTierBridge/commit/5cd683cb7a83e37eb5b4717309d672f35b256c25))
* set latest tag ([46ee60c](https://github.com/dangeroustech/ZeroTierBridge/commit/46ee60cbc9091e93f977701a771ba9ce0216e5d1))
# [1.1.0](https://github.com/dangeroustech/ZeroTierBridge/compare/v1.0.13...v1.1.0) (2023-09-23) # [1.1.0](https://github.com/dangeroustech/ZeroTierBridge/compare/v1.0.13...v1.1.0) (2023-09-23)

View File

@@ -1,11 +1,11 @@
FROM debian:bookworm as stage FROM debian:12.6 as stage
ARG PACKAGE_BASEURL=https://download.zerotier.com/debian/bookworm/pool/main/z/zerotier-one ARG PACKAGE_BASEURL=https://download.zerotier.com/debian/bookworm/pool/main/z/zerotier-one
ARG ARCH=amd64 ARG ARCH=amd64
ARG VERSION=1.12.2 ARG VERSION=1.12.2
RUN apt-get update -qq && apt-get install -qq --no-install-recommends -y ca-certificates curl RUN apt-get update -qq && apt-get install -qq --no-install-recommends -y ca-certificates curl
RUN curl -sSL -o zerotier-one.deb "${PACKAGE_BASEURL}/zerotier-one_${VERSION}_${ARCH}.deb" RUN curl -sSL -o zerotier-one.deb "${PACKAGE_BASEURL}/zerotier-one_${VERSION}_${ARCH}.deb"
FROM debian:bookworm FROM debian:12.6
RUN mkdir /app RUN mkdir /app
WORKDIR /app WORKDIR /app
COPY --from=stage zerotier-one.deb . COPY --from=stage zerotier-one.deb .

View File

@@ -6,7 +6,7 @@ A container to provide out-of-the-box bridging functionality to a ZeroTier netwo
### Prerequisites ### Prerequisites
- Docker running as your logged in user (i.e. not having to run `sudo docker-compose xyz`) - [Linux instructions here](https://docs.docker.com/engine/install/linux-postinstall/) - Docker running as your logged in user (if `docker ps` runs then you're good, if not follow the link ->) - [Linux instructions here](https://docs.docker.com/engine/install/linux-postinstall/)
### ZeroTier UI Changes ### ZeroTier UI Changes
@@ -22,17 +22,15 @@ You also need to add a static route into ZeroTier so that the traffic is routed
**You need to edit the `ZT_NETWORKS` and `ARCH` variable in the `docker-compose.yml` file first to add your networks and make sure your acrhitecture is correct (see [this page](http://download.zerotier.com/debian/buster/pool/main/z/zerotier-one/) for examples, usually either amd64 or arm64)** **You need to edit the `ZT_NETWORKS` and `ARCH` variable in the `docker-compose.yml` file first to add your networks and make sure your acrhitecture is correct (see [this page](http://download.zerotier.com/debian/buster/pool/main/z/zerotier-one/) for examples, usually either amd64 or arm64)**
Easy one-liner for Docker Compose: Easiest way to bring up is via Docker Compose. Rename `docker-compose.yml.example` to `docker-compose.yml` and run `docker compose up -d`.
`docker-compose build && docker-compose up -d` If you want to disable bridging, set `ZT_BRIDGE=false`. This can be done after the initial networks have been joined (just change the environment variable in the `docker-compose.yml` file and run `), as the ZeroTier config persists but IPTables forwarding is done on each container startup.
If you want to disable bridging, set `ZT_BRIDGE=false`. This can be done after the initial networks have been joined (just rebuild the container), as the ZeroTier config persists but IPTables forwarding is done on each container startup.
### OG Docker ### OG Docker
`docker build -t zerotierbridge .` `docker build -t zerotierbridge .`
`docker run --privileged -e ZT_NETWORKS=NETWORK_ID_HERE -e ZT_BRIDGE=true zerotierbridge:latest` `docker run --privileged -e ZT_NETWORKS=NETWORK_1 NETWORK_2 -e ZT_BRIDGE=true zerotierbridge:latest`
Add your network ID(s) into the `ZT_NETWORKS` argument, space separated. Add your network ID(s) into the `ZT_NETWORKS` argument, space separated.
@@ -42,7 +40,7 @@ Disable bridging by passing `ZT_BRIDGE=false`. This can be done after the initia
If you would like the container to retain the same ZeroTier client ID on reboot, attach a volume as per the below. If you would like the container to retain the same ZeroTier client ID on reboot, attach a volume as per the below.
`docker run --privileged -e ZT_NETWORKS=NETWORK_ID_HERE ZT_BRIDGE=true --volume zt_config:/var/lib/zerotier-one/ zerotierbridge:latest` `docker run --privileged -e ZT_NETWORKS=NETWORK_ID_HERE ZT_BRIDGE=true -v zt_config:/var/lib/zerotier-one/ zerotierbridge:latest`
#### Caveat: Architecture #### Caveat: Architecture

View File

@@ -3,12 +3,7 @@ version: "3"
services: services:
zerotierbridge: zerotierbridge:
container_name: zerotierbridge container_name: zerotierbridge
build: image: registry.dangerous.tech/dangeroustech/zerotierbridge
context: .
dockerfile: Dockerfile
args:
ARCH: amd64
VERSION: 1.12.2
restart: always restart: always
privileged: true privileged: true
volumes: volumes:
@@ -17,4 +12,4 @@ services:
- ZT_NETWORKS=NETWORK_ID_1 NETWORK_ID_2 NETWORK_ID_3 - ZT_NETWORKS=NETWORK_ID_1 NETWORK_ID_2 NETWORK_ID_3
- ZT_BRIDGE=true - ZT_BRIDGE=true
volumes: volumes:
zt_config: zt_config:

View File

@@ -1,3 +1,3 @@
{ {
"version": "1.1.0" "version": "1.1.2"
} }