Giter Site home page Giter Site logo

netbootxyz / docker-netbootxyz Goto Github PK

View Code? Open in Web Editor NEW
146.0 8.0 45.0 103 KB

netboot.xyz docker container

Home Page: https://netboot.xyz/docs/docker

Dockerfile 29.10% Shell 70.90%
netbootxyz docker ipxe tftp pxe container homelab homelabbing linux netboot

docker-netbootxyz's Introduction

docker-netbootxyz

Release Status Discord GitHub tag (latest by date)

Overview

The netboot.xyz docker image allows you to easily set up a local instance of netboot.xyz. The container is a small helper application written in node.js. It provides a simple web interface for editing menus on the fly, retrieving the latest menu release of netboot.xyz, and enables mirroring the downloadable assets from Github to your location machine for faster booting of assets.

netboot.xyz webapp

It is a great tool for developing and testing custom changes to the menus. If you have a machine without an optical drive that cannot boot from USB then having a local netboot server provides a way to install an OS. If you are looking to get started with netboot.xyz and don't want to manage iPXE menus, you should use the boot media instead of setting up a container.

The container is built upon Alpine Linux and contains several components:

  • netboot.xyz webapp
  • Nginx for hosting local assets from the container
  • tftp-hpa
  • syslog for providing tftp activity logs

Services are managed in the container by supervisord.

The container runs fine under ARM-based hosts as well as x86-64.

Usage

The netboot.xyz docker image requires an existing DHCP server to be setup and running in order to boot from it. The image does not contain a DHCP server service. Please see the DHCP configuration setup near the end of this document for ideas on how to enable your environment to talk to the container. In most cases, you will need to specify the next-server and boot file name in the DHCP configuration. Your DHCP server will need to be assigned a static IP.

Installing docker

To install docker under Debian and Ubuntu run:

sudo apt install docker.io

Download the docker image

From Github Container Registry

docker pull ghcr.io/netbootxyz/netbootxyz

From Docker Hub

docker pull netbootxyz/netbootxyz

The following snippets are examples of starting up the container.

docker-cli

docker run -d \
  --name=netbootxyz \
  -e MENU_VERSION=2.0.76             `# optional` \
  -e NGINX_PORT=80                   `# optional` \
  -e WEB_APP_PORT=3000               `# optional` \
  -p 3000:3000                       `# sets web configuration interface port, destination should match ${WEB_APP_PORT} variable above.` \
  -p 69:69/udp                       `# sets tftp port` \
  -p 8080:80                         `# optional, destination should match ${NGINX_PORT} variable above.` \
  -v /local/path/to/config:/config   `# optional` \
  -v /local/path/to/assets:/assets   `# optional` \
  --restart unless-stopped \
  ghcr.io/netbootxyz/netbootxyz

Updating the image with docker-cli

docker pull ghcr.io/netbootxyz/netbootxyz   # pull the latest image down
docker stop netbootxyz                      # stop the existing container
docker rm netbootxyz                        # remove the image
docker run -d ...                           # previously ran start command

Start the container with the same parameters used above. If the same folders are used your settings will remain. If you want to start fresh, you can remove the paths and start over.

docker-compose

  1. Copy docker-compose.yml.example to docker-compose.yml
  2. Edit as needed
  3. Run docker-compose up -d netbootxyz to start containers in the background

Updating the image with docker-compose

docker-compose pull netbootxyz     # pull the latest image down
docker-compose up -d netbootxyz    # start containers in the background

Accessing the container services

Once the container is started, the netboot.xyz web application can be accessed by the web configuration interface at http://localhost:3000 or via the specified port.

Downloaded web assets will be available at http://localhost:8080 or the specified port. If you have specified the assets volume, the assets will be available at http://localhost:8080.

If you wish to start over from scratch, you can remove the local configuration folders and upon restart of the container, it will load the default configurations.

Local Mirror Access

If you want to pull the Live Images images down from your own mirror, modify the boot.cfg file and override the default live_endpoint setting from https://github.com/netbootxyz and set it to your deployment IP or domain, e.g. http://192.168.0.50:8080. It will then redirect asset download to the local location you set for assets on port 8080 and you can download the assets by using the local assets menu down to your local server. This can result in a much faster boot and load time.

Parameters

Container images are configured using parameters passed at runtime (such as those above). These parameters are separated by a colon and indicate <external>:<internal> respectively. For example, -p 8080:80 would expose port 80 from inside the container to be accessible from the host's IP on port 8080 outside the container.

Parameter Function
-p 3000 Web configuration interface.
-p 69/udp TFTP Port.
-p 80 NGINX server for hosting assets.
-e WEB_APP_PORT=3000 Specify a different port for the web configuration interface to listen on.
-e NGINX_PORT=80 Specify a different port for NGINX service to listen on.
-e MENU_VERSION=2.0.76 Specify a specific version of boot files you want to use from netboot.xyz (unset pulls latest)
-v /config Storage for boot menu files and web application config
-v /assets Storage for netboot.xyz bootable assets (live CDs and other files)

DHCP Configurations

This image requires the usage of a DHCP server in order to function properly. If you have an existing DHCP server, usually you will need to make some small adjustments to make your DHCP server forward requests to the netboot.xyz container. You will need to typically set your next-server and boot-file-name parameters in the DHCP configuration. This tells DHCP to forward requests to the TFTP server and then select a boot file from the TFTP server.

Examples

These are a few configuration examples for setting up a DHCP server. The main configuration you will need to change are next-server and filename/boot-file-name. Next-server tells your client to check for a host running tftp and retrieve a boot file from there. Because the docker image is hosting a tftp server, the boot files are pulled from it and then it will attempt to load the iPXE configs directly from the host. You can then modify and adjust them to your needs. See booting from TFTP for more information.

isc-dhcp-server

To install the DHCP server under Debian and Ubuntu run:

sudo apt install isc-dhcp-server

You must edit two files to configure isc-dhcp-server. Edit /etc/default/isc-dhcp-server and configure at least one of the INTERFACES variables with the name of the interface you want to run the DHCP server on:

INTERFACESv4="eth0"

You'll also need a /etc/dhcp/dhcpd.conf looking something like this:

option arch code 93 = unsigned integer 16;

subnet 192.168.0.0 netmask 255.255.255.0 {
  range 192.168.0.34 192.168.0.254;       # Change this range as appropriate for your network
  next-server 192.168.0.33;               # Change this to the address of your DHCP server
  option subnet-mask 255.255.255.0;
  option routers 192.168.0.1;             # Change this to the address of your router
  option broadcast-address 192.168.0.255;
  option domain-name "mynetwork.lan";     # This is optional
  option domain-name-servers 1.1.1.1;
  if exists user-class and ( option user-class = "iPXE" ) {
    filename "http://boot.netboot.xyz/menu.ipxe";
  } elsif option arch = encode-int ( 16, 16 ) {
    filename "http://boot.netboot.xyz/ipxe/netboot.xyz.efi";
    option vendor-class-identifier "HTTPClient";
  } elsif option arch = 00:07 {
    filename "netboot.xyz.efi";
  } else {
    filename "netboot.xyz.kpxe";
  }
}

Now you can try starting the DHCP server:

sudo systemctl start isc-dhcp-server

To make the dhcp server start automatically on boot:

sudo systemctl enable isc-dhcp-server

netboot.xyz boot file types

The following bootfile names can be set as the boot file in the DHCP configuration. They are baked into the Docker image:

bootfile name description
netboot.xyz.kpxe Legacy DHCP boot image file, uses built-in iPXE NIC drivers
netboot.xyz-undionly.kpxe Legacy DHCP boot image file, use if you have NIC issues
netboot.xyz.efi UEFI boot image file, uses built-in UEFI NIC drivers
netboot.xyz-snp.efi UEFI w/ Simple Network Protocol, attempts to boot all net devices
netboot.xyz-snponly.efi UEFI w/ Simple Network Protocol, only boots from device chained from
netboot.xyz-arm64.efi DHCP EFI boot image file, uses built-in iPXE NIC drivers
netboot.xyz-arm64-snp.efi UEFI w/ Simple Network Protocol, attempts to boot all net devices
netboot.xyz-arm64-snponly.efi UEFI w/ Simple Network Protocol, only boots from device chained from
netboot.xyz-rpi4-snp.efi UEFI for Raspberry Pi 4, attempts to boot all net devices

docker-netbootxyz's People

Contributors

antonym avatar compphy avatar danboid avatar dezeroku avatar fawaf avatar nicoulaj avatar renovate-bot avatar renovate[bot] avatar timfreund avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-netbootxyz's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

dockerfile
Dockerfile
  • alpine 3.19
github-actions
.github/workflows/build.yml
  • actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
.github/workflows/release.yml
  • actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
  • docker/setup-buildx-action v3
  • docker/setup-qemu-action v3
  • docker/login-action v3
  • docker/login-action v3
  • docker/metadata-action v5
  • docker/build-push-action v5
  • anothrNick/github-tag-action 1.67.0

  • Check this box to trigger a request for Renovate to run again on this repository

Offer a lightweight version without the web app

The current docker container uses about 700MiB of memory while in use, mostly because of node.js app. The app itself, however, is not something most use a lot, so it would be nice if you offered an alternative docker image with bare tftp setup only.

Add config mount option for TFTP files

Heya!

I'm currently trying to set up this Docker Container on my Synology NAS, however I can't bind Port 69 to the Docker container since Synology reserves that port for its own TFTP server functionality.

My suggestion here would be to give a separate mount config option for the TFTP files so I can set a separate location and use the internal Synology TFTP server instead of the Docker integrated one to serve those files. However I'm not sure how easy this would be to do and how easy it'd be to update those files in case the Docker container itself updates.

Thanks already for reading!

Asset paths broken for downloading from local mirror?

Neat tool! Just stumbled on it. Having some issues with getting local assets to load properly though. Have made the change to the live_endpoint setting in boot.cfg. Short version: When I download the local assets and confirm they are on my file structure (IP:8080 in browser), the first two files are found locally but the .iso or squashfsh insists on downloading again. This is happening accross ubuntu, proxmox etc.

A couple related obvervations:
One appears to be obvious - the url for squashfs asset for ubuntu netboot 22.04 seems to be incorrect.
image
In fact, looking further several other versions of ubuntu netboot suffer from the same issue?

Next - the proxmox ve ISO tries to download even when i've successfully downloaded the three files locally (and confirmed in the docker file system). The first two files load fine from the local server but the iso does not.

Version info:
image

Super useful tool, thanks again. Let me know if any further details or testing would be helpful.

After migrating from linuxserver, ghcr.io/netbootxyz/netbootxyz:0.7.1-nbxyz1 doesn't seem to work

$ supervisorctl status
unix:///run/supervisord.sock no such file

Would recommend adding file=/run/supervisord.sock or moving your customizations to /etc/supervisor.d/container.ini or something, so it picks up defaults so status can work

Eventually i found /supervisord.log

2024-03-30 17:54:44,375 INFO Set uid to user 0 succeeded
2024-03-30 17:54:44,392 INFO supervisord started with pid 14
2024-03-30 17:54:45,395 INFO spawned: 'syslog-ng' with pid 15
2024-03-30 17:54:45,396 INFO spawned: 'nginx' with pid 16
2024-03-30 17:54:45,398 INFO spawned: 'webapp' with pid 17
2024-03-30 17:54:45,399 INFO spawned: 'in.tftpd' with pid 18
2024-03-30 17:54:45,401 INFO spawned: 'messages-log' with pid 19
2024-03-30 17:54:45,444 WARN exited: messages-log (exit status 1; not expected)
2024-03-30 17:54:45,450 WARN exited: nginx (exit status 1; not expected)
2024-03-30 17:54:46,452 INFO success: syslog-ng entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-03-30 17:54:46,453 INFO spawned: 'nginx' with pid 28
2024-03-30 17:54:46,453 INFO success: webapp entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-03-30 17:54:46,453 INFO success: in.tftpd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-03-30 17:54:46,455 INFO spawned: 'messages-log' with pid 29
2024-03-30 17:54:46,477 WARN exited: nginx (exit status 1; not expected)
2024-03-30 17:54:47,528 INFO success: messages-log entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-03-30 17:54:48,531 INFO spawned: 'nginx' with pid 30
2024-03-30 17:54:48,549 WARN exited: nginx (exit status 1; not expected)
2024-03-30 17:54:49,550 INFO gave up: nginx entered FATAL state, too many start retries too quickly
2024-03-30 18:06:11,755 INFO Set uid to user 0 succeeded
2024-03-30 18:06:11,776 INFO supervisord started with pid 14
2024-03-30 18:06:12,778 INFO spawned: 'syslog-ng' with pid 15
2024-03-30 18:06:12,780 INFO spawned: 'nginx' with pid 16
2024-03-30 18:06:12,781 INFO spawned: 'webapp' with pid 17
2024-03-30 18:06:12,783 INFO spawned: 'in.tftpd' with pid 18
2024-03-30 18:06:12,784 INFO spawned: 'messages-log' with pid 19
2024-03-30 18:06:12,814 WARN exited: nginx (exit status 1; not expected)
2024-03-30 18:06:13,827 INFO success: syslog-ng entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-03-30 18:06:13,828 INFO spawned: 'nginx' with pid 28
2024-03-30 18:06:13,829 INFO success: webapp entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-03-30 18:06:13,829 INFO success: in.tftpd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-03-30 18:06:13,829 INFO success: messages-log entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-03-30 18:06:13,845 WARN exited: nginx (exit status 1; not expected)
2024-03-30 18:06:15,848 INFO spawned: 'nginx' with pid 29
2024-03-30 18:06:15,865 WARN exited: nginx (exit status 1; not expected)
2024-03-30 18:06:16,866 INFO gave up: nginx entered FATAL state, too many start retries too quickly

So would recommend running nginx in foreground mode, with supervisor logging to stdout which will help people in the future

netbootxyz:/# cat /var/log/nginx/error.log
2024/03/30 17:54:45 [emerg] 16#16: getpwnam("abc") failed in /config/nginx/nginx.conf:1
2024/03/30 17:54:46 [emerg] 28#28: getpwnam("abc") failed in /config/nginx/nginx.conf:1
2024/03/30 17:54:48 [emerg] 30#30: getpwnam("abc") failed in /config/nginx/nginx.conf:1
2024/03/30 18:06:12 [emerg] 16#16: getpwnam("abc") failed in /config/nginx/nginx.conf:1
2024/03/30 18:06:13 [emerg] 28#28: getpwnam("abc") failed in /config/nginx/nginx.conf:1
2024/03/30 18:06:15 [emerg] 29#29: getpwnam("abc") failed in /config/nginx/nginx.conf:1

This is where i started to get confused. Looks like user doesn't match users in passwd

netbootxyz:/# getent passwd | tail -n 2
nginx:x:100:101:nginx:/var/lib/nginx:/sbin/nologin
nbxyz:x:911:1001::/config:/bin/false

okay, so it should be nbxyz not abc

cat /config/nginx/nginx.conf
user abc;
worker_processes 4;
pid /run/nginx.pid;
include /etc/nginx/modules/*.conf;

events {
        worker_connections 768;
}

http {
        sendfile on;
        tcp_nopush on;
        tcp_nodelay on;
        keepalive_timeout 65;
        types_hash_max_size 2048;
        client_max_body_size 0;
        include /etc/nginx/mime.types;
        default_type application/octet-stream;
        access_log /config/log/nginx/access.log;
        error_log /config/log/nginx/error.log;
        gzip on;
        gzip_disable "msie6";
        include /config/nginx/site-confs/*;

}
daemon off;

That doesn't seem to match https://github.com/netbootxyz/docker-netbootxyz/blob/master/root/defaults/nginx.conf, which was committed 3 years ago.

I checked the dockerhub version

Unable to chain custom.ipxe using just boot.cfg and custom.ipxe

I want to minimize the amount of modified iPXE files so I only created custom.ipxe and modified boot.cfg. However I cannot seem to get the menu item custom-user in menu.ipxe. It looks like it is has two issues:


1. Misconfigured setting for the Docker version which does not generate custom-user menu item

netbootxyz/netboot.xyz/blob/development/roles/netbootxyz/defaults/main.yml
custom_generate_menus: false

and this results in not creating a line in
netbootxyz/netboot.xyz/blob/development/roles/netbootxyz/templates/menu/menu.ipxe

{% if custom_generate_menus | bool %}
item --gap Custom User Menus: ||
item custom-user ${space} Custom User Menus
{% endif %}

with the resulting menu.ipxe file

:main_menu
clear menu
set space:hex 20:20
set space ${space:string}
isset ${next-server} && menu ${site_name} v${version} - next-server: ${next-server} || menu ${site_name}
item --gap Default:
item local ${space} Boot from local hdd
(...)
isset ${github_user} && item --gap Custom Github Menu: ||
isset ${github_user} && item custom-github ${space} ${github_user}'s Custom Menu ||
isset ${custom_url} && item --gap Custom URL Menu: ||
isset ${custom_url} && item custom-url ${space} Custom URL Menu ||
isset ${menu} && set timeout 0 || set timeout ${boot_timeout}
choose --timeout ${timeout} --default ${menu} menu || goto local
(...)

  1. When you create custom.ipxe in the web environment, shouldn't line 137 in

netbootxyz/netboot.xyz/blob/development/roles/netbootxyz/templates/menu/menu.ipxe.j2
be changed from

:custom-user
chain custom/custom.ipxe
goto main_menu

to

:custom-user
chain custom.ipxe
goto main_menu

TFTP sending wrong IP address

I currently face the issue where the TFTP server seems to answer with the wrong IP address (from Docker). I am using the default docker-compose.yml file.

10.10.0.103 is my client, 10.10.3.6 is the next-server and 192.168.192.2 is the IP address of the Docker container running netboot.xyz.
The following is the tcpdump output on the host machine (where Docker is **running).

11:53:56.340862 IP 10.10.0.103.1024 > 10.10.3.6.69:  46 RRQ "netboot.xyz.kpxe" octet blksize 1432 tsize 0
11:53:56.340922 IP 10.10.0.103.1024 > 192.168.192.2.69:  46 RRQ "netboot.xyz.kpxe" octet blksize 1432 tsize 0
11:53:56.340926 IP 10.10.0.103.1024 > 192.168.192.2.69:  46 RRQ "netboot.xyz.kpxe" octet blksize 1432 tsize 0
11:53:56.723268 IP 10.10.0.103.1024 > 10.10.3.6.69:  46 RRQ "netboot.xyz.kpxe" octet blksize 1432 tsize 0
11:53:56.723308 IP 10.10.0.103.1024 > 192.168.192.2.69:  46 RRQ "netboot.xyz.kpxe" octet blksize 1432 tsize 0
11:53:56.723315 IP 10.10.0.103.1024 > 192.168.192.2.69:  46 RRQ "netboot.xyz.kpxe" octet blksize 1432 tsize 0
11:53:57.492147 IP 10.10.0.103.1024 > 10.10.3.6.69:  46 RRQ "netboot.xyz.kpxe" octet blksize 1432 tsize 0
11:53:57.492206 IP 10.10.0.103.1024 > 192.168.192.2.69:  46 RRQ "netboot.xyz.kpxe" octet blksize 1432 tsize 0
11:53:57.492214 IP 10.10.0.103.1024 > 192.168.192.2.69:  46 RRQ "netboot.xyz.kpxe" octet blksize 1432 tsize 0
11:53:59.029670 IP 10.10.0.103.1024 > 10.10.3.6.69:  46 RRQ "netboot.xyz.kpxe" octet blksize 1432 tsize 0
11:53:59.029734 IP 10.10.0.103.1024 > 192.168.192.2.69:  46 RRQ "netboot.xyz.kpxe" octet blksize 1432 tsize 0
11:53:59.029743 IP 10.10.0.103.1024 > 192.168.192.2.69:  46 RRQ "netboot.xyz.kpxe" octet blksize 1432 tsize 0
11:54:02.106092 IP 10.10.0.103.1024 > 10.10.3.6.69:  46 RRQ "netboot.xyz.kpxe" octet blksize 1432 tsize 0
11:54:02.106157 IP 10.10.0.103.1024 > 192.168.192.2.69:  46 RRQ "netboot.xyz.kpxe" octet blksize 1432 tsize 0
11:54:02.106164 IP 10.10.0.103.1024 > 192.168.192.2.69:  46 RRQ "netboot.xyz.kpxe" octet blksize 1432 tsize 0

The following is the tcpdump output on docker container itself (please don't mind the time offset).

10:53:56.340927 eth0  In  IP 10.10.0.103.1024 > 192.168.192.2.69: TFTP, length 46, RRQ "netboot.xyz.kpxe" octet blksize 1432 tsize 0
10:53:56.723316 eth0  In  IP 10.10.0.103.1024 > 192.168.192.2.69: TFTP, length 46, RRQ "netboot.xyz.kpxe" octet blksize 1432 tsize 0
10:53:57.492217 eth0  In  IP 10.10.0.103.1024 > 192.168.192.2.69: TFTP, length 46, RRQ "netboot.xyz.kpxe" octet blksize 1432 tsize 0
10:53:59.029745 eth0  In  IP 10.10.0.103.1024 > 192.168.192.2.69: TFTP, length 46, RRQ "netboot.xyz.kpxe" octet blksize 1432 tsize 0
10:54:02.106165 eth0  In  IP 10.10.0.103.1024 > 192.168.192.2.69: TFTP, length 46, RRQ "netboot.xyz.kpxe" octet blksize 1432 tsize 0

I tried running the Docker container with network_mode: host which leads to the fact that no Docker internal IP address is shown in the TCPdump output but it fails to start fully because of nginx (I have somehting running on port 80 on the hardware server so nginx cannot bind on it).

What do I need to configure in order to get this up and running?

usage of local assets

I have hosted my own copy of netbookxyz via docker, and I downloaded some assets and want to boost network installation from those local resources.
For exmaple I downloaded Proxmox VE and modified proxmox.ipxe to use local resources by setting live_endpoint to my own server ip:

**set live_endpoint http://192.168.1.100:8080**

:boot
set kernel_url ${live_endpoint}/asset-mirror/releases/download/7.0-1-24e3084c/
imgfree
kernel ${kernel_url}vmlinuz vga=791 video=vesafb:ywrap,mtrr ramdisk_size=16777216 rw quiet ${params} initrd=initrd.magic ${cmdline}
initrd ${kernel_url}initrd
initrd ${kernel_url}proxmox.iso /proxmox.iso
boot

However, when i tried to boot the Proxmox installer it still tried to retrive all the resources from github.
So what's the correct approach to use local assets please?

Unable to Find Menus for netbootxyz Initialization

Issue Description:
When attempting to use Docker Compose with netbootxyz, I encountered an error related to the program's inability to locate the menus. The specific error message I received is as follows:

netbootxyz  | [netbootxyz-init] Downloading netboot.xyz at 2.0.47
netbootxyz  | tar: /tmp/menus.tar.gz: Cannot open: No such file or directory
netbootxyz  | tar: Error is not recoverable: exiting now

I attempted to resolve the issue by removing the ENV responsible for the MENU_VERSION, as it was marked as #OPTIONAL. However, the problem persisted even after removing the ENV, resulting in the same error message.

Without the ENV, the error message appears as follows:

netbootxyz  | [netbootxyz-init] Downloading netboot.xyz at 
netbootxyz  | tar: /tmp/menus.tar.gz: Cannot open: No such file or directory
netbootxyz  | tar: Error is not recoverable: exiting now

I am currently unsure about the cause of this issue, and I have been unable to find any information regarding the storage location of the menu files on the GitHub repository. Any assistance or guidance in resolving this problem would be greatly appreciated.

Make port 80 configurable in nginx.

Is there a specific reason why port 80 is the default for nginx here? This is a blocker for host network binding because it could conflict with a lot of other services on the host.

Your own deployment document suggests port 8080 as the access port, so why not use this as the default in nginx? Even if you do keep port 80 as the default, can it at least get an override through environment variable?

Reverse proxying does not work

LABEL build_version=netboot.xyz version: 0.6.7-nbxyz21 Build-date: 2022-12-09T02:25:23

Hello,

I am attempting to run docker-netbootxyz behind a reverse proxy so that I can have the administrative interface located at http://example.com/netbootxyz and the assets at http://example.com/assetsxyz. I am running netbootxyz as a Docker Stack (not just a service), with host-based rather than overlay networking which is better for maintaining stateful connections, and I use HAProxy and Apache to accomplish the reverse proxying.

Setting it up this way mostly seems to work just fine except that the webpage never progresses past saying "Getting Dashboard" with a pulsating disc, at which time I see this in Chrome's debugging console:

polling.js:311          GET https://example.com/socket.io/?EIO=4&transport=polling&t=OLK-hzD 503 (Service Unavailable)
create @ polling.js:311
Request @ polling.js:255
request @ polling.js:207
doPoll @ polling.js:232
poll @ polling.js:98
doOpen @ polling.js:58
open @ transport.js:49
open @ socket.js:162
Socket @ socket.js:103
open @ manager.js:108
Manager @ manager.js:39
lookup @ index.js:29
(anonymous) @ netbootxyz-web.js:9

If I then examine netbootxyz-web.js, the issue is plainly obvious at line 9. As you will notice in my Apache configuration, I have attempted to remedy the situation by adding the line ProxyHTMLURLMap /socket.io /netbootxyz/socket.io, which has no effect because ProxyHTMLURLMap evidently does not have the proper context to match that line, so "/socket.io" never gets modified, and it looks like it's the wrong thing to do here, anyway.

I can't recall the exact method that I've used in the past, but I know that I can work around this by piping netbootxyz-web.js through a shell script before it is served out by Apache. Nevertheless, anyone else that would like to reverse-proxy netbootxyz would likely bump into this issue, so it's worth mentioning. I will continue to work on this as time permits and post any findings.

Here are the relevant sections of my configurations.

docker-compose.yaml

version: "3.8"
  netbootxyz:
    image: ghcr.io/netbootxyz/netbootxyz
    deploy:
      mode: global
    ports:
      - target: 69
        published: $NETBOOTXYZ_TFTP_PORT
        protocol: udp
        mode: host
      - target: 80
        published: $NETBOOTXYZ_ASSETS_PORT
        mode: host
      - target: 3000
        published: $NETBOOTXYZ_CONFIG_PORT
        mode: host
    volumes:
      - netbootxyz_config:/config
      - netbootxyz_assets:/assets
    environment: [TZ]

volumes:
  netbootxyz_assets:
    name: netbootxyz_assets
    driver_opts:
      type: "nfs"
      o: "addr=server"
      device: ":/netbootxyz"
  netbootxyz_config:
    name: netbootxyz_config

haproxy.cfg

backend netbootxyz
    option httpchk OPTIONS *
    http-check send hdr Host localhost
    http-request redirect prefix / drop-query append-slash if { path /netbootxyz }
    server netbootxyz proxy_mod_proxy:80 check resolvers default # ssl verify none

backend assetsxyz
    option httpchk OPTIONS *
    http-check send hdr Host localhost
    http-request redirect prefix / drop-query append-slash if { path /assetsxyz }
    server assetsxyz proxy_mod_proxy:80 check resolvers default # ssl verify none

extra/proxy-html.conf

ProxyRequests Off

ProxyHTMLURLMap http://netbootxyz:3000/ /netbootxyz/
<Location /netbootxyz/>
    Header edit Set-Cookie expr=^(.*[Dd]omain)=([^;]+)(.*)$ \1=example.com\3
    Header edit Set-Cookie expr=^(.*[Pp]ath)=([^;]+)(.*)$ \1=/netbootxyz\3
    ProxyHTMLEnable On
    ProxyHTMLExtended On
    ProxyPass http://netbootxyz:3000/
    ProxyPassReverse http://netbootxyz:3000/
    ProxyHTMLURLMap /socket.io /netbootxyz/socket.io
    ProxyHTMLURLMap / /netbootxyz/
    RequestHeader unset Accept-Encoding
</Location>

ProxyHTMLURLMap http://netbootxyz:80/ /assetsxyz/
<Location /assetsxyz/>
    Header edit Set-Cookie expr=^(.*[Dd]omain)=([^;]+)(.*)$ \1=example.com\3
    Header edit Set-Cookie expr=^(.*[Pp]ath)=([^;]+)(.*)$ \1=/assetsxyz\3
    ProxyHTMLEnable On
    ProxyHTMLExtended On
    ProxyPass http://netbootxyz:80/
    ProxyPassReverse http://netbootxyz:80/
    ProxyHTMLURLMap / /assetsxyz/
    RequestHeader unset Accept-Encoding
</Location>

local assets aren't used - correct / default path missing from README

I have set up a local instance of netboot.xyz 2.0.59 under Ubuntu 22.04.

I have used its web interface to download all of the assets for a couple of distros. They seemed to download fine but netboot doesn't utilise them, it still downloads them from the internet every time.

I presume this is because I haven't configured the assets path correctly when I was setting up the container. What is the correct default assets path to use when setting up the container? We should add this path to the netboot.xyz docker container docs.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.