From 49152080293ae9ea4c743c0727372b4220da3567 Mon Sep 17 00:00:00 2001 From: Yaakov Date: Sun, 29 May 2022 22:02:51 +1000 Subject: [PATCH 01/10] Add Dockerfile and first attempt at CI --- .drone.yml | 40 ++++++++++++++++++++++++++++++++++++++++ Dockerfile | 10 ++++++++++ README | 8 +++++++- 3 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 .drone.yml create mode 100644 Dockerfile diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..9967f52 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,40 @@ +kind: pipeline +name: default + +steps: +- name: docker + image: plugins/docker + settings: + registry: + from_secret: docker-registry + username: + from_secret: docker-username + password: + from_secret: docker-password + repo: public/pe1chl-elproxy + tags: + - latest + +--- + +kind: secret +name: docker-registry +get: + path: kv/data/drone-ci/yaakov/docker-registry + name: registry + +--- + +kind: secret +name: docker-username +get: + path: kv/data/drone-ci/yaakov/docker-registry + name: username + +--- + +kind: secret +name: docker-password +get: + path: kv/data/drone-ci/yaakov/docker-registry + name: password diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bd6f474 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM alpine:latest as build +RUN apk --no-cache add make gcc musl-dev linux-headers nettle-dev +WORKDIR /build +COPY . /build +RUN make + +FROM alpine:latest as runtime +RUN apk --no-cache add nettle +COPY --from=build /build/elproxy /app/elproxy +CMD [ "sh", "-c", "/app/elproxy $ELPROXY_CONFIG $ELPROXY_DEBUG" ] \ No newline at end of file diff --git a/README b/README index 3c8957a..f97cd6a 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -Echolink Proxy/Relay server - PE1CHL +# Echolink Proxy/Relay server - PE1CHL This Echolink Proxy/Relay server can run multiple echolink proxies and/or relays on a single machine, provided it has multiple IPv4 addresses on the @@ -114,3 +114,9 @@ graph the statistiscs like number of used proxies. When this file disappears for no apparent reason, it probably is systemd doing it. Configure RemoveIPC=no in /etc/systemd/logind.conf to keep it at bay. + +# Docker image instructions - VK2BSD +To run this container, mount your configuration file, then set the following environment variables: +- `ELPROXY_CONFIG` to the path to your configuration file +- `ELPROXY_DEBUG` (optional) to a non-zero value to enable debug output logging +Make sure to set `Daemonize=0` in your configuration file, otherwise the container will simply exit. From 0a1b8e18e25638896eea0746a0ce8be0e007f6c9 Mon Sep 17 00:00:00 2001 From: Yaakov Date: Sun, 29 May 2022 22:04:43 +1000 Subject: [PATCH 02/10] only trigger CI on main branch --- .drone.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.drone.yml b/.drone.yml index 9967f52..d646772 100644 --- a/.drone.yml +++ b/.drone.yml @@ -14,6 +14,9 @@ steps: repo: public/pe1chl-elproxy tags: - latest + when: + branch: + - main --- From 91b68d0046c9bf282cce366cb6b2bb105c731585 Mon Sep 17 00:00:00 2001 From: Yaakov Date: Sun, 29 May 2022 22:07:56 +1000 Subject: [PATCH 03/10] push to right registry --- .drone.yml | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/.drone.yml b/.drone.yml index d646772..20e4f4c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -5,13 +5,12 @@ steps: - name: docker image: plugins/docker settings: - registry: - from_secret: docker-registry + registry: registry.yaakov.online username: from_secret: docker-username password: from_secret: docker-password - repo: public/pe1chl-elproxy + repo: registry.yaakov.online/public/pe1chl-elproxy tags: - latest when: @@ -20,14 +19,6 @@ steps: --- -kind: secret -name: docker-registry -get: - path: kv/data/drone-ci/yaakov/docker-registry - name: registry - ---- - kind: secret name: docker-username get: From ec59cb2a466b9804a62ffcc6269323dbfdf6f72e Mon Sep 17 00:00:00 2001 From: Yaakov Date: Mon, 30 May 2022 21:36:26 +1000 Subject: [PATCH 04/10] add container to readme --- README | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README b/README index f97cd6a..665dafe 100644 --- a/README +++ b/README @@ -120,3 +120,5 @@ To run this container, mount your configuration file, then set the following env - `ELPROXY_CONFIG` to the path to your configuration file - `ELPROXY_DEBUG` (optional) to a non-zero value to enable debug output logging Make sure to set `Daemonize=0` in your configuration file, otherwise the container will simply exit. + +You can get a pre-built image by running `docker pull registry.yaakov.online/public/pe1chl-elproxy`. From d75e628d3c86fd94bce109ad52fd6d9adcaf3e15 Mon Sep 17 00:00:00 2001 From: Yaakov Date: Sun, 16 Jun 2024 14:22:24 +1000 Subject: [PATCH 05/10] try convert from Drone to Actions --- .drone.yml | 34 ---------------------------------- .forgejo/workflows/ci.yaml | 30 ++++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 34 deletions(-) delete mode 100644 .drone.yml create mode 100644 .forgejo/workflows/ci.yaml diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index 20e4f4c..0000000 --- a/.drone.yml +++ /dev/null @@ -1,34 +0,0 @@ -kind: pipeline -name: default - -steps: -- name: docker - image: plugins/docker - settings: - registry: registry.yaakov.online - username: - from_secret: docker-username - password: - from_secret: docker-password - repo: registry.yaakov.online/public/pe1chl-elproxy - tags: - - latest - when: - branch: - - main - ---- - -kind: secret -name: docker-username -get: - path: kv/data/drone-ci/yaakov/docker-registry - name: username - ---- - -kind: secret -name: docker-password -get: - path: kv/data/drone-ci/yaakov/docker-registry - name: password diff --git a/.forgejo/workflows/ci.yaml b/.forgejo/workflows/ci.yaml new file mode 100644 index 0000000..e999d37 --- /dev/null +++ b/.forgejo/workflows/ci.yaml @@ -0,0 +1,30 @@ +name: Build Container Image + +on: + push: + branches: + - 'main' + +jobs: + docker: + runs-on: docker + steps: + - + name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - + name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.REGISTRY_USER }} + password: ${{ secrets.REGISTRY_PASSWORD }} + - + name: Build and push + uses: docker/build-push-action@v5 + with: + push: true + tags: ${{ secrets.REGISTRY_URL }}/public/pe1chl-elproxy:latest + From 2ef1d3c409f5312f46ac375238a2e7bff58c212b Mon Sep 17 00:00:00 2001 From: Yaakov Date: Sun, 16 Jun 2024 16:54:15 +1000 Subject: [PATCH 06/10] try this --- .forgejo/workflows/ci.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.forgejo/workflows/ci.yaml b/.forgejo/workflows/ci.yaml index e999d37..b107458 100644 --- a/.forgejo/workflows/ci.yaml +++ b/.forgejo/workflows/ci.yaml @@ -8,6 +8,8 @@ on: jobs: docker: runs-on: docker + container: + image: ghcr.io/catthehacker/ubuntu:act-22.04 steps: - name: Set up QEMU From 0da0caa38bc1dae3e76a05bc9b249b29fd2629e4 Mon Sep 17 00:00:00 2001 From: Yaakov Date: Sun, 16 Jun 2024 16:55:10 +1000 Subject: [PATCH 07/10] whitespace --- .forgejo/workflows/ci.yaml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.forgejo/workflows/ci.yaml b/.forgejo/workflows/ci.yaml index b107458..edf64f8 100644 --- a/.forgejo/workflows/ci.yaml +++ b/.forgejo/workflows/ci.yaml @@ -11,20 +11,16 @@ jobs: container: image: ghcr.io/catthehacker/ubuntu:act-22.04 steps: - - - name: Set up QEMU + - name: Set up QEMU uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - - name: Login to Docker Hub + - name: Login to Docker Hub uses: docker/login-action@v3 with: username: ${{ secrets.REGISTRY_USER }} password: ${{ secrets.REGISTRY_PASSWORD }} - - - name: Build and push + - name: Build and push uses: docker/build-push-action@v5 with: push: true From 2ebac5379b074b4b3a2be530130f0afb55530436 Mon Sep 17 00:00:00 2001 From: Yaakov Date: Sun, 16 Jun 2024 22:28:09 +1000 Subject: [PATCH 08/10] default images --- .forgejo/workflows/ci.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.forgejo/workflows/ci.yaml b/.forgejo/workflows/ci.yaml index edf64f8..6211034 100644 --- a/.forgejo/workflows/ci.yaml +++ b/.forgejo/workflows/ci.yaml @@ -7,9 +7,7 @@ on: jobs: docker: - runs-on: docker - container: - image: ghcr.io/catthehacker/ubuntu:act-22.04 + runs-on: ubuntu-latest steps: - name: Set up QEMU uses: docker/setup-qemu-action@v3 From a75fb32b33108d586d7518b34c2af01ecb0e5f7d Mon Sep 17 00:00:00 2001 From: Yaakov Date: Sun, 16 Jun 2024 22:37:01 +1000 Subject: [PATCH 09/10] wrong secret name --- .forgejo/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/workflows/ci.yaml b/.forgejo/workflows/ci.yaml index 6211034..d2b6dfb 100644 --- a/.forgejo/workflows/ci.yaml +++ b/.forgejo/workflows/ci.yaml @@ -16,7 +16,7 @@ jobs: - name: Login to Docker Hub uses: docker/login-action@v3 with: - username: ${{ secrets.REGISTRY_USER }} + username: ${{ secrets.REGISTRY_USERNAME }} password: ${{ secrets.REGISTRY_PASSWORD }} - name: Build and push uses: docker/build-push-action@v5 From 3ccf7bb41a5144a0c807e2c7e4b6102cf6668224 Mon Sep 17 00:00:00 2001 From: Yaakov Date: Sun, 16 Jun 2024 22:39:36 +1000 Subject: [PATCH 10/10] =?UTF-8?q?log=20in=20to=20correct=20registry=20?= =?UTF-8?q?=F0=9F=A4=A6=E2=80=8D=E2=99=82=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .forgejo/workflows/ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.forgejo/workflows/ci.yaml b/.forgejo/workflows/ci.yaml index d2b6dfb..d5cdbd1 100644 --- a/.forgejo/workflows/ci.yaml +++ b/.forgejo/workflows/ci.yaml @@ -16,6 +16,7 @@ jobs: - name: Login to Docker Hub uses: docker/login-action@v3 with: + registry: ${{ secrets.REGISTRY_URL }} username: ${{ secrets.REGISTRY_USERNAME }} password: ${{ secrets.REGISTRY_PASSWORD }} - name: Build and push