28 Commits

Author SHA1 Message Date
Antony Messerli
cd1950c036
CI: Use native arm64 runner to fix QEMU build crash (#130)
* CI: Split into native per-arch build jobs to fix QEMU arm64 crash

The arm64 build was failing with 'Illegal instruction (core dumped)'
during npm install because QEMU user-mode emulation doesn't support
all arm64 instructions used by newer Node.js versions.

Split the single multi-platform build job into:
- setup: determines tags, webapp version (shared via outputs)
- build-amd64: builds on ubuntu-latest natively
- build-arm64: builds on ubuntu-24.04-arm natively (no QEMU)
- manifest: merges per-arch digests into multi-arch manifest
- comment: posts PR test instructions

Both architectures get independent Trivy scans. The amd64 and arm64
builds run in parallel so total build time should be similar or faster.

Also pins Trivy CLI to v0.69.3 to work around deleted release assets
from the Trivy supply chain attack (aquasecurity/trivy#10265).

* Address review feedback: fix BUILD_DATE, add permissions, add event fallback

- Compute BUILD_DATE in setup job and pass as output instead of using
  $(date) in build-args YAML which is not evaluated at runtime
- Add explicit permissions block (contents:read, packages:write,
  pull-requests:write) to limit GITHUB_TOKEN scope
- Add else fallback in tag strategy for unsupported event types

* Bump Alpine base image from 3.22.2 to 3.23.3 to clear Trivy CVEs

* Fix Trivy CVEs: upgrade systeminformation to 5.31.0 and zlib to >=1.3.2

- systeminformation 5.27.1->5.31.0: fixes CVE-2025-68154, CVE-2026-26280,
  CVE-2026-26318 (command injection vulnerabilities)
- zlib 1.3.1-r2->1.3.2: fixes CVE-2026-22184 (buffer overflow in untgz)

The systeminformation fix overrides the version pinned by the webapp
upstream (5.27.10) until that repo is updated.

* Fix zlib upgrade: use apk --upgrade to ensure CVE-2026-22184 is resolved

The previous 'apk add zlib>=1.3.2' wasn't upgrading zlib because it
was already installed as a transitive dependency. Use --upgrade flag
to force apk to pull the latest available version (1.3.2-r0).

* Fix Trivy arm64 scan: set TRIVY_PLATFORM to match image architecture

Trivy defaults to linux/amd64 when resolving remote image digests.
On the arm64 build job, the pushed digest is a single-platform arm64
image, so Trivy fails with 'no child with platform linux/amd64'.
Setting TRIVY_PLATFORM=linux/arm64 resolves this.
2026-03-15 15:08:28 -05:00
Copilot
dab4b8137b
CI: Fix injection risk, tag validation, Trivy gating, and Dockerfile layer consolidation (#128)
* Initial plan

* Address review feedback: fix injection risk, validate tag_suffix, rename step, conditional Trivy exit-code, single Dockerfile layer

Co-authored-by: antonym <245007+antonym@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: antonym <245007+antonym@users.noreply.github.com>
2026-03-15 14:23:00 -05:00
Antony Messerli
4884908c2b CI Improvements for testing images
* Drop forced chown during copy
* Adding PR Template
2025-12-06 13:26:38 -06:00
renovate[bot]
84dfec3d83
Update alpine Docker tag to v3.22.2 2025-10-09 01:38:03 +00:00
renovate[bot]
dc80c4b2fc
Update alpine Docker tag to v3.22.1 2025-07-16 02:12:18 +00:00
Antony Messerli
df298e7c32 Remove gosu so that ports can bind
Remove gosu so that ports can bind using root and then switch running
state to nbxyz
2025-06-19 10:18:03 -05:00
Antony Messerli
ca7a3390c2
Implement rootless Docker container with enhanced security and preserved TFTP logging (#87)
* Implement rootless Docker container with preserved TFTP logging

- Convert all processes to run as non-root user (nbxyz) for enhanced security
- Add customizable PUID/PGID environment variables for volume permission management
- Implement privilege dropping using gosu for secure initialization
- Optimize Dockerfile with multi-stage build and better caching
- Create dnsmasq wrapper script to ensure TFTP logs appear in docker logs
- Configure supervisord to properly forward dnsmasq output to container stdout
- Maintain full TFTP/PXE boot debugging functionality for users

Security improvements:
- All application processes (nginx, webapp, dnsmasq) run as nbxyz user
- Only supervisord initialization runs as root, then drops privileges
- Proper permission management for all service directories
- Configurable user/group IDs via PUID/PGID environment variables

Performance optimizations:
- Multi-stage Docker build reduces final image size
- Better layer caching for faster rebuilds
- Optimized package installation and cleanup

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Update Dockerfile

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update root/init.sh

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-06-12 00:19:27 -05:00
Antony Messerli
5cb5107718 Add container healthchecks 2025-06-07 08:36:05 -05:00
renovate[bot]
cf63959dee
Update alpine Docker tag to v3.22.0 2025-05-30 22:09:50 +00:00
Antony Messerli
426084cd61 Optimize size with multi stage build 2025-02-15 12:30:47 -06:00
renovate[bot]
3aae417a80
Update alpine Docker tag to v3.21.3 2025-02-14 22:49:57 +00:00
Antony Messerli
61e63e7b10 Bump version, add docker pulls to readme 2025-02-01 13:43:16 -06:00
Antony Messerli
6e228de407
Bump alpine version, test arm7 2024-10-23 18:09:53 -05:00
dezeroku
fe00be36f4
Replace in.tftp with dnsmasq, to add support for single-port TFTP 2024-07-13 00:20:28 +02:00
renovate[bot]
91195b0308
Update alpine Docker tag to v3.20 2024-05-22 19:55:29 +00:00
Antony Messerli
de524f8acc
Merge pull request #57 from CompPhy/master
Make web app port configurable.
2024-02-05 00:18:22 -06:00
Antony Messerli
5444fefb7b Add EXPOSE for 80 and 69/udp
This should document the default ports that are opened
by the container for cases like QNAP devices that rely on
that to populate the default ports.

Closes: https://github.com/netbootxyz/netboot.xyz/issues/1409
2024-02-04 11:59:10 -06:00
Kelly Shutt
c4014a0a6e Make web app port configurable. 2024-02-02 08:10:30 -05:00
Kelly Shutt
959f24bc59 Make nginx port configurable through ENV variable. 2024-01-11 20:38:42 -05:00
renovate[bot]
1e9a09d2bc
Update alpine Docker tag to v3.19 2023-12-08 03:59:53 +00:00
Antony Messerli
2739ca9277 Add description, cleanup, reducing size 2023-10-30 00:04:12 -05:00
Antony Messerli
b9e886003b Upgrade packages to latest in container 2023-10-16 19:50:23 -05:00
renovate[bot]
8e98727591
Update alpine Docker tag to v3.18 2023-05-28 11:20:23 +00:00
Antony Messerli
a3fc61bdcc Update to Alpine 3.17
Removes deprecated npm option, sets user to nbxyz
for tftpd, adds script for testing build
2023-01-19 00:41:50 -06:00
Renovate Bot
382b4da44b
Update dependency alpine to v3.16 2022-05-23 21:22:16 +00:00
Julien Nicoulaud
7e4f4d465a
add support for passing additional options to tftpd 2022-02-08 19:53:56 +01:00
Antony Messerli
609ee5f146
Bump to Alpine 15 2021-12-09 19:58:02 -06:00
Antony Messerli
027cd38089 first commit 2021-09-06 19:07:15 -05:00