mirror of
https://github.com/alexhopeoconnor/dnsmasq-webui.git
synced 2026-10-04 04:18:13 +10:00
- Effective config: track value sources (ConfigValueSource, EffectiveConfigSources) and show readonly badges/tooltips for non-managed files. Multi-value options use ValueWithSource/PathWithSource for JSON. StatusClient uses camelCase serialization for reliable deserialization. - Parsing: align with dnsmasq (conf-file/conf-dir order, suffix filter, case- sensitive keys). DnsmasqConfIncludeParser and DnsmasqConfigSetService build effective config and sources. New DnsmasqConfigSetServiceTests. - UI: rename Overview/Home to Dnsmasq (page, nav, doc comments). Add EffectiveConfigOptionItem and EffectiveConfigMultiValueRow components. Dnsmasq.razor uses them; Hosts.razor shows addn-hosts with source. Encode server-derived strings in markup to avoid XSS. - Home section namespace: Components.Home -> Components.Dnsmasq (LogsSection, StatusSection, _Imports). - Test data: expand testdata (README, resolv.dnsmasq, hosts.extra, dnsmasq.d configs). dhcp.conf static IP aligned with testnet. - agents.md: add agent instructions for test harness and conventions.
# Test data Source for the Docker test harness: `scripts/prepare-test-mount.sh` syncs this dir to `testdata-mount/`, which is bind-mounted as `/data`. Unit tests use the copy in the test output dir (copied at build via the .csproj). ## Layout | File / dir | Purpose | |------------|--------| | **dnsmasq-test.conf** | Harness main config (`/data/dnsmasq-test.conf`). DNS + DHCP; `conf-dir=/data/dnsmasq.d`, multiple server/addn-hosts/address/dhcp-range. | | **dnsmasq.conf** | Minimal main (conf-dir only). Used by unit tests when conf-dir is absent. | | **dnsmasq.conf.example** | Commented example; not used by harness or tests. | | **dnsmasq.d/** | Included configs (alphabetical order). | | **dnsmasq.d/01-other.conf** | `domain=local`. Not managed. | | **dnsmasq.d/02-servers.conf** | Extra `server=` / `local=` (readonly in UI). | | **dnsmasq.d/03-more.conf** | `resolv-file=`, `dhcp-option=`. Not managed. | | **dnsmasq.d/dhcp.conf** | `dhcp-host=`; managed by app in real use, used as-is in harness. | | **hosts** | First addn-hosts file; system hosts when `Dnsmasq:SystemHostsPath` points here. | | **hosts.extra** | Second addn-hosts file. | | **resolv.dnsmasq** | Minimal file for resolv-file= in 03-more.conf; must exist so dnsmasq does not fail/warn. | | **leases** | Sample DHCP leases for harness leases table. | Harness usage (start/stop/tidy): see **agents.md** in the repo root.