24 Commits

Author SHA1 Message Date
Antony Messerli
988fe91078 Decouple Secure Boot download from menu first-run check
Address review feedback:
- Move Secure Boot download to its own conditional block that checks
  for the secureboot-x86_64 directory, so existing installs pick up
  Secure Boot binaries on the next container restart
- Resolve MENU_VERSION once at the top (from env, menuversion.txt,
  or GitHub API) so it's available to both blocks
- Use curl -fsSL for autoexec.ipxe download to fail on HTTP errors
  instead of silently saving HTML error pages
- Update README note to reflect that Secure Boot downloads run
  independently of menu downloads
2026-03-15 17:35:59 -05:00
Antony Messerli
b74d8a0e1b Add error handling for Secure Boot archive extraction and file checks
Address review feedback:
- Wrap tar extraction in error check so cp loops are skipped on failure
- Add per-file existence checks with warnings if iPXE archive layout changes
- Use nullglob for secureboot-* glob to avoid iterating literal pattern
2026-03-15 17:02:50 -05:00
Antony Messerli
ee9d2300bb Download Secure Boot binaries directly from upstream iPXE release
Pull signed EFI binaries unmodified from the iPXE project release
(ipxeboot.tar.gz) and the autoexec.ipxe boot script from the
netboot.xyz release. This preserves provenance of the Microsoft-signed
and iPXE Secure Boot CA-signed binaries rather than redistributing
them through netboot.xyz.

The iPXE Secure Boot version defaults to v2.0.0 and can be overridden
via the IPXE_SB_VERSION environment variable.

Documents the upstream source and version for both the signed binaries
and the boot script in init.sh comments and README.
2026-03-15 16:56:27 -05:00
Antony Messerli
263fb8aaf0 Add UEFI Secure Boot support
Download Secure Boot tarballs (secureboot-x86_64.tar.gz,
secureboot-arm64.tar.gz) from netboot.xyz releases during container
init. These contain Microsoft-signed iPXE shim binaries and a
templated autoexec.ipxe that chains into the netboot.xyz menu system.

Files are extracted into /config/menus/secureboot-{x86_64,arm64}/
and served via TFTP alongside existing boot files. Gracefully skips
download if the release doesn't include Secure Boot assets (e.g.
older pinned MENU_VERSION).

Also adds Secure Boot DHCP configuration examples and boot file
documentation to the README.
2026-03-15 16:29:52 -05:00
Antony Messerli
ed111b6cbc Let master process run as root to bind to 80, workers run as nbxyz 2025-06-19 11:09:26 -05: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
4c5e9d6676
Fix nginx permission error for log directory access (#88)
The nginx service was failing to start due to permission denied errors
when trying to access /var/lib/nginx/logs/error.log. This directory is
a symlink to /var/log/nginx which was owned by the nginx user instead
of the nbxyz user that runs the service.

Added proper ownership setup for /var/log/nginx directory to ensure
nginx can write logs when running as the nbxyz user.
2025-06-12 00:42:02 -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
Antony Messerli
1d5de02310 Add donate links to logs 2025-02-03 21:06:37 -06:00
Antony Messerli
9f6022b3a0
Merge pull request #78 from netbootxyz/limit_envsub
Limit envsub to only variable being changed
2024-12-30 14:07:34 -06:00
Antony Messerli
683adc2626 Limit envsub to only variable being changed 2024-12-30 12:49:45 -06:00
dezeroku
fe00be36f4
Replace in.tftp with dnsmasq, to add support for single-port TFTP 2024-07-13 00:20:28 +02:00
Antony Messerli
de524f8acc
Merge pull request #57 from CompPhy/master
Make web app port configurable.
2024-02-05 00:18:22 -06:00
Kelly Shutt
c4014a0a6e Make web app port configurable. 2024-02-02 08:10:30 -05:00
dezeroku
cdae9b6897
Separate init script from the start script 2024-01-31 02:15:07 +01:00
Kelly Shutt
959f24bc59 Make nginx port configurable through ENV variable. 2024-01-11 20:38:42 -05:00
Antony Messerli
a3ef0c6588
Update donate.txt 2023-02-06 14:53:15 -06:00
Antony Messerli
51e9e3df03 Revert adding user to tftpd
Error: cannot set groups for user nbxyz
2023-01-19 01:14:58 -06: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
Antony Messerli
da43d1dd48
Drop rpi image 2022-04-21 22:12:10 -05:00
Julien Nicoulaud
7e4f4d465a
add support for passing additional options to tftpd 2022-02-08 19:53:56 +01:00
Antony Messerli
5e89aaf8eb Add a few more arm options 2021-10-11 09:43:17 -05:00
Antony Messerli
027cd38089 first commit 2021-09-06 19:07:15 -05:00