mirror of
https://github.com/alexhopeoconnor/dnsmasq-webui.git
synced 2026-10-04 04:18:13 +10:00
- Parsers: Superpower for all (Directive, FileLine, Include, DhcpHost, Leases, Hosts) - Shared ConfParserHelpers (Token, OptionalCommentPrefix) - DnsmasqConfOptionRegistry + DnsmasqOptionKind: typed options (ConfFile, ConfDir, Domain, DhcpRange, Server, Local, Address, DhcpOption, DhcpHost, Path, Flag, etc.) - EnsureManagedConfigHostedService: append conf-dir= to main config if missing, then create managed file; DnsmasqOptions + Dockerfile comments for permissions - Renames: ConfigLine->DnsmasqConfLine, ConfigSet->DnsmasqConfigSet, etc. - Test harness: entrypoint in scripts/, prepare-test-mount improvements - Status/Reload API and UI: stdout+stderr, exit code
47 lines
1.4 KiB
YAML
47 lines
1.4 KiB
YAML
# Run the app with real dnsmasq and a DHCP client so hosts/leases are real.
|
||
# Prepare mount: ./scripts/prepare-test-mount.sh [--prepare-only | --no-build | --recreate | --source DIR | --mount DIR]
|
||
# Or set TESTDATA_MOUNT to override the data volume (default: ./testdata-mount).
|
||
#
|
||
# app builds from Dockerfile.dnsmasq (app + dnsmasq in one container; app is main process).
|
||
# ReloadCommand/StatusCommand use pkill/pgrep (procps in image). cap_add NET_ADMIN for dnsmasq.
|
||
#
|
||
# Networks: testnet 172.28.0.0/16 so dnsmasq can hand out 172.28.0.10–50.
|
||
services:
|
||
app:
|
||
build:
|
||
context: .
|
||
dockerfile: Dockerfile.dnsmasq
|
||
ports:
|
||
- "8080:8080"
|
||
cap_add:
|
||
- NET_ADMIN
|
||
environment:
|
||
DNSMASQ_CONF: /data/dnsmasq-test.conf
|
||
Dnsmasq__MainConfigPath: /data/dnsmasq-test.conf
|
||
Dnsmasq__ManagedFileName: zz-dnsmasq-webui.conf
|
||
Dnsmasq__HostsPath: /data/hosts
|
||
Dnsmasq__ReloadCommand: "pkill -HUP -x dnsmasq"
|
||
Dnsmasq__StatusCommand: "pgrep -x dnsmasq"
|
||
volumes:
|
||
- ${TESTDATA_MOUNT:-./testdata-mount}:/data
|
||
networks:
|
||
testnet:
|
||
ipv4_address: 172.28.0.2
|
||
# no depends_on: app is the only service the client needs
|
||
|
||
dhcp-client:
|
||
image: alpine:3.20
|
||
command: ["sh", "-c", "sleep 5 && udhcpc -i eth0 -f -n"]
|
||
networks:
|
||
testnet: {}
|
||
depends_on:
|
||
- app
|
||
|
||
networks:
|
||
testnet:
|
||
driver: bridge
|
||
ipam:
|
||
config:
|
||
- subnet: 172.28.0.0/16
|
||
gateway: 172.28.0.1
|