Skip to content

Commit 25ef084

Browse files
committed
use a config file for dnsmasq
1 parent 040c56f commit 25ef084

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

root/defaults/dnsmasq.conf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# TFTP config
2+
enable-tftp
3+
user=nbxyz
4+
tftp-secure
5+
tftp-root=/config/menus

root/etc/supervisor.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ directory=/app
2222
priority = 3
2323

2424
[program:dnsmasq]
25-
command=/usr/sbin/dnsmasq --port=0 --keep-in-foreground --enable-tftp --user=nbxyz --tftp-secure --tftp-root=/config/menus %(ENV_TFTPD_OPTS)s
25+
command=/usr/sbin/dnsmasq --conf-file=/config/dnsmasq/dnsmasq.conf --port=0 --keep-in-foreground %(ENV_TFTPD_OPTS)s
2626
stdout_logfile=/config/tftpd.log
2727
redirect_stderr=true
2828
priority = 4

root/init.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,21 @@ mkdir -p \
55
/assets \
66
/config/nginx/site-confs \
77
/config/log/nginx \
8+
/config/dnsmasq \
89
/run \
910
/var/lib/nginx/tmp/client_body \
1011
/var/tmp/nginx
1112

1213
# copy config files
13-
[[ ! -f /config/nginx/nginx.conf ]] && \
14+
[[ ! -f /config/nginx/nginx.conf ]] &&
1415
cp /defaults/nginx.conf /config/nginx/nginx.conf
15-
[[ ! -f /config/nginx/site-confs/default ]] && \
16-
envsubst < /defaults/default > /config/nginx/site-confs/default
16+
[[ ! -f /config/nginx/site-confs/default ]] &&
17+
envsubst </defaults/default >/config/nginx/site-confs/default
18+
19+
# create dnsmasq config
20+
if [[ ! -f /config/dnsmasq/dnsmasq.conf ]]; then
21+
cp /defaults/dnsmasq.conf /config/dnsmasq/dnsmasq.conf
22+
fi
1723

1824
# Ownership
1925
chown -R nbxyz:nbxyz /assets
@@ -67,7 +73,7 @@ if [[ ! -f /config/menus/remote/menu.ipxe ]]; then
6773
/config/menus/remote/netboot.xyz-arm64-snponly.efi -sL \
6874
"https://github.com/netbootxyz/netboot.xyz/releases/download/${MENU_VERSION}/netboot.xyz-arm64-snponly.efi"
6975
# layer and cleanup
70-
echo -n "${MENU_VERSION}" > /config/menuversion.txt
76+
echo -n "${MENU_VERSION}" >/config/menuversion.txt
7177
cp -r /config/menus/remote/* /config/menus
7278
rm -f /tmp/menus.tar.gz
7379
fi

0 commit comments

Comments
 (0)