From 526e4c48ef0240f8cbf447f609a17983a207b36c Mon Sep 17 00:00:00 2001 From: Stefan Haun Date: Sun, 1 Jan 2023 11:12:02 +0100 Subject: [PATCH 1/4] Add GitHub workflow for docker builds --- .github/workflows/docker-image.yml | 53 ++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/docker-image.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..c728b4b --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,53 @@ +name: Docker Image + +on: + push: + branches: + - 'master' + tags: + - 'v*' + pull_request: + branches: + - 'master' + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v3 + with: + images: ffmd/wg-docker + tags: | + # 1.2.3 + type=semver,pattern={{version}} + # disabled if major zero + type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }} + # generate lates from default branch + type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} From 9c92e9f6bb8db69d199b70d4de2d4bc7fcb7ab25 Mon Sep 17 00:00:00 2001 From: Stefan Haun Date: Sun, 1 Jan 2023 11:15:11 +0100 Subject: [PATCH 2/4] Add a GitHub workflow for releases We do not have a real schema for releases yet (as containers build from master branches), but add an action anyways to be prepared. --- .github/workflows/create-github-release.yml | 39 +++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/create-github-release.yml diff --git a/.github/workflows/create-github-release.yml b/.github/workflows/create-github-release.yml new file mode 100644 index 0000000..046efd6 --- /dev/null +++ b/.github/workflows/create-github-release.yml @@ -0,0 +1,39 @@ +name: Create Release + +on: + push: + tags: + - 'v*' + +jobs: + release: + name: "Create release" + runs-on: ubuntu-22.04 + steps: + - name: "Check-out" + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: "Generate release changelog" + id: generate-release-changelog + uses: heinrichreimer/github-changelog-generator-action@v2.3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + onlyLastTag: "true" # set to false if no tags exist (buggy with only one tag) + stripHeaders: "true" + stripGeneratorNotice: "true" + + - name: Extract the VERSION name + id: get-version + run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/} + + - name: "Create GitHub release" + uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ github.ref }} + name: "${{ steps.get-version.outputs.VERSION }}" + body: "${{ steps.generate-release-changelog.outputs.changelog }}" + prerelease: ${{ startsWith(steps.get-version.outputs.VERSION, 'v0.') }} + token: ${{ secrets.GITHUB_TOKEN }} + draft: True From 445bae13284fc4fb16032d6079095cd189218dc2 Mon Sep 17 00:00:00 2001 From: Stefan Haun Date: Sun, 1 Jan 2023 11:37:21 +0100 Subject: [PATCH 3/4] Adapt docker-compose file to ffmd image repository --- docker-compose.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 8c6cf48..7bade68 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,12 +1,12 @@ version: "3" services: wg: - image: klausdieter371/wg-docker + image: ffmd/wg-docker network_mode: "host" privileged: true - cap_add: + cap_add: - NET_ADMIN - devices: + devices: - /dev/net/tun:/dev/net/tun sysctls: - net.ipv6.conf.all.forwarding=1 From bea69d71370e85788609224e4d4e7907f880865c Mon Sep 17 00:00:00 2001 From: Stefan Haun Date: Sun, 1 Jan 2023 11:37:37 +0100 Subject: [PATCH 4/4] Adapt README to ffmd docker repository --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1b1302f..494b0d8 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Docker Container running a Freifunk Gateway. It contains the following component An image can be pulled from dockerhub: ``` -docker pull klausdieter371/wg-docker +docker pull ffmd/wg-docker ``` # Building the Image @@ -34,7 +34,7 @@ docker run -a stdin -a stdout -a stderr -it --rm --name wg \ --privileged \ --sysctl net.ipv6.conf.all.forwarding=1 \ --sysctl net.ipv6.conf.all.accept_redirects=0 \ ---sysctl net.ipv4.conf.all.rp_filter=0 klausdieter371/wg-docker +--sysctl net.ipv4.conf.all.rp_filter=0 ffmd/wg-docker ``` The required settings are: