From a19c779201a75d85035e7879b8945d2f2553429d Mon Sep 17 00:00:00 2001 From: Phil Date: Sun, 27 Jul 2025 09:51:35 +0000 Subject: [PATCH 1/3] =?UTF-8?q?woodpecker.yml=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- woodpecker.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 woodpecker.yml diff --git a/woodpecker.yml b/woodpecker.yml new file mode 100644 index 0000000..89515e6 --- /dev/null +++ b/woodpecker.yml @@ -0,0 +1,22 @@ +when: + branch: main + event: push + +variables: + - &repo git.hackmi.ch/${CI_REPO_OWNER}/${CI_REPO_NAME} + +steps: + publish: + image: docker.io/woodpeckerci/plugin-docker-buildx:latest + settings: + platforms: linux/amd64 + repo: *repo + registry: git.hackmi.ch + tags: latest + username: + from_secret: git-package-user + password: + from_secret: git-package-pw + when: + branch: main + event: push \ No newline at end of file From ef564bc71ea18603d1f53bb45354f058392d62c9 Mon Sep 17 00:00:00 2001 From: Phil Date: Sun, 27 Jul 2025 09:52:05 +0000 Subject: [PATCH 2/3] =?UTF-8?q?Dockerfile=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a98c564 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM alpine:3.22.0 + +LABEL maintainer="Phil " +LABEL version="0.1" +LABEL description="Docker image for TFTP server using dnsmasq" + + +WORKDIR / + +RUN apk add --no-cache \ + bash \ + dnsmasq + +EXPOSE 69/udp + +COPY start.sh init.sh / + +RUN chmod +x start.sh init.sh + +VOLUME ["/tftp"] + +ENTRYPOINT ["./start.sh"] \ No newline at end of file From f7e955dffe981533456963f8ece0d92a261e4d2e Mon Sep 17 00:00:00 2001 From: Phil Date: Sun, 27 Jul 2025 09:54:05 +0000 Subject: [PATCH 3/3] =?UTF-8?q?Dateien=20nach=20=E2=80=9Einit.sh=E2=80=9C?= =?UTF-8?q?=20hochladen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- init.sh/init.sh | 24 ++++++++++++++++++++++++ init.sh/start.sh | 13 +++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 init.sh/init.sh create mode 100644 init.sh/start.sh diff --git a/init.sh/init.sh b/init.sh/init.sh new file mode 100644 index 0000000..7dd5e76 --- /dev/null +++ b/init.sh/init.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# Configure user and group IDs +PUID=${PUID:-1000} +PGID=${PGID:-1000} + +echo "[init] Setting up user nbxyz with PUID=${PUID} and PGID=${PGID}" + +if ! getent group ${PGID} > /dev/null 2>&1; then + addgroup --gid ${PGID} tftp +else + echo "[init] Group with GID ${PGID} already exists" +fi + +if ! getent passwd ${PUID} > /dev/null 2>&1; then + adduser -u ${PUID} -G tftp -h /tftp -s /bin/false -D tftp +else + echo "[init] User with UID ${PUID} already exists" +fi + +usermod -a -G users tftp 2>/dev/null || true + +chown -R nbxyz:nbxyz /tftp +chmod -R 7777 -R /tftp \ No newline at end of file diff --git a/init.sh/start.sh b/init.sh/start.sh new file mode 100644 index 0000000..bf28f6f --- /dev/null +++ b/init.sh/start.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# Init File +/init.sh + +# Wrapper script for dnsmasq to ensure TFTP logs are visible in docker logs +echo "[dnsmasq] Starting TFTP server on port 69" +echo "[dnsmasq] TFTP root: /config/menus" +echo "[dnsmasq] TFTP security: enabled" +echo "[dnsmasq] Logging: enabled (dhcp and queries)" + +# Start dnsmasq as root to bind to port 69, then drop privileges to tftp +exec /usr/sbin/dnsmasq --port=0 --keep-in-foreground --enable-tftp --user=tftp --tftp-secure --tftp-root=/tftp --log-facility=- --log-dhcp --log-queries "$@" \ No newline at end of file