Skip to content

fix(agent): allow DHCP on isolated sites without gateway or DNS forwarders - #458

Open
ArshSSandhu wants to merge 1 commit into
mieweb:mainfrom
ArshSSandhu:fix/455-isolated-dhcp
Open

fix(agent): allow DHCP on isolated sites without gateway or DNS forwarders#458
ArshSSandhu wants to merge 1 commit into
mieweb:mainfrom
ArshSSandhu:fix/455-isolated-dhcp

Conversation

@ArshSSandhu

Copy link
Copy Markdown
Collaborator

Summary

  • Allow dnsmasq configuration to be applied when the site has an internal domain, DHCP range, and subnet mask, without requiring a gateway or DNS forwarders.
  • Suppress the DHCP router option when no gateway is configured.
  • Allow the dnsmasq servers file to remain empty when no DNS forwarders are configured.

Testing

  • npm ci
  • npm run build
  • git diff --check
  • End-to-end DHCP validation on an isolated Proxmox site remains to be completed.

Related Issue

Fixes #455

Copilot AI lite review requested due to automatic review settings August 21, 2026 19:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the agent’s dnsmasq rendering logic to support “isolated” sites (air‑gapped/no upstream network) by treating gateway and DNS forwarders as optional while still applying DHCP + internal DNS config when core DHCP settings are present.

Changes:

  • Relax dnsmasq render preconditions to require only internalDomain, dhcpRange, and subnetMask.
  • Allow an empty dnsmasq servers file when no DNS forwarders are configured.
  • Adjust DHCP router option handling for sites without a gateway (but see review comment).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
agent/src/apply.ts Loosens dnsmasq “render/skip” gating to enable isolated-site DHCP/internal DNS.
agent/templates/dnsmasq/servers.ejs Makes DNS forwarders optional and safely renders an empty servers file when absent.
agent/templates/dnsmasq/dhcp-opts.ejs Attempts to handle missing gateway for DHCP router option (needs adjustment per comment).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@@ -1 +1 @@
option:router,<%= site.gateway %>
<%_ if (site.gateway) { _%>option:router,<%= site.gateway %><%_ } else { _%>option:router<%_ } _%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow DHCP on isolated sites without requiring a gateway or DNS forwarders

2 participants