Skip to content

Add advanced networking: port ranges/UDP, DNS search/opt, IPAM config, connection inspection - #11

Merged
djpfs merged 5 commits into
mainfrom
copilot/add-advanced-network-features
Aug 14, 2026
Merged

Add advanced networking: port ranges/UDP, DNS search/opt, IPAM config, connection inspection#11
djpfs merged 5 commits into
mainfrom
copilot/add-advanced-network-features

Conversation

Copilot AI commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Implements four advanced networking capabilities from issue #7: configurable port forwarding (UDP + ranges), robust internal DNS, IPAM-based custom subnets, and connection inspection.

Port forwarding

parsePortSpec now returns [PublishPort] and handles protocol suffixes and port ranges:

ports:
  - "8080-8082:80-82"      # range: expands to 3 PublishPort entries
  - "5353:53/udp"           # protocol suffix
  - "127.0.0.1:8443:443/tcp"

DNS (dns_search, dns_opt)

New fields on ServiceConfig, wired into DNSConfiguration.searchDomains and options. A DNS config object is only created when at least one of dns, dns_search, or dns_opt is set; nameservers are never injected implicitly.

dns_search:
  - example.com
dns_opt:
  - "ndots:5"

Custom networks / IPAM

NetworkConfig gains an ipam field (IPAMConfig[IPAMPool]) for subnet, IP range, and gateway customization:

networks:
  backend:
    ipam:
      config:
        - subnet: "172.28.0.0/16"
          ip_range: "172.28.5.0/24"
          gateway: "172.28.5.254"

External networks (external: true + name:) continue to work as before.

Connection inspection

New inspectConnections(project:) async throws -> [ServiceConnections] on ComposeOrchestrator returns each service's live Attachments and PublishPorts. Containers not yet created (BackendError.notFound) are silently skipped; all other errors propagate.

Copilot AI linked an issue Aug 14, 2026 that may be closed by this pull request
Copilot AI and others added 2 commits August 14, 2026 02:50
…, connection inspection

Co-authored-by: djpfs <43576725+djpfs@users.noreply.github.com>
…x DNS nameservers behavior

Co-authored-by: djpfs <43576725+djpfs@users.noreply.github.com>
@djpfs
djpfs requested a lite review from Copilot August 14, 2026 02:52
Copilot AI changed the title [WIP] Add configurable port forwarding and robust DNS features Add advanced networking: port ranges/UDP, DNS search/opt, IPAM config, connection inspection Aug 14, 2026
Copilot AI requested a review from djpfs August 14, 2026 02:52

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 extends ComposeEngine’s networking support by enhancing port spec parsing (UDP + ranges), adding DNS search/options fields to the service model and container configuration, introducing IPAM fields on network configs, and adding a new API to inspect live container connections.

Changes:

  • Updated parsePortSpec to return multiple PublishPort entries, supporting protocol suffixes and port ranges.
  • Added dns_search / dns_opt to ServiceConfig and wired them into ContainerConfiguration.DNSConfiguration.
  • Added NetworkConfig.ipam model types and tests, plus a new inspectConnections(project:) API for connection snapshots.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
Tests/ComposeEngineTests/ComposeEngineTests.swift Adds/updates tests for UDP + ranged ports, DNS search/options decoding, and IPAM decoding.
Sources/ComposeEngine/Models/ComposeModels.swift Extends Compose model types with DNS search/options on services and IPAM config on networks.
Sources/ComposeEngine/ComposeOrchestrator.swift Implements connection inspection API, updates port publishing to consume multiple ports, and wires DNS search/options into container config.

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

Comment thread Sources/ComposeEngine/ComposeOrchestrator.swift Outdated
Comment thread Sources/ComposeEngine/Models/ComposeModels.swift

@djpfs djpfs left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

resolve the comments

Co-authored-by: djpfs <43576725+djpfs@users.noreply.github.com>
Copilot AI requested a review from djpfs August 14, 2026 03:04
@djpfs
djpfs marked this pull request as ready for review August 14, 2026 03:11
@djpfs

djpfs commented Aug 14, 2026

Copy link
Copy Markdown
Owner

@copilot resolve the merge conflicts on this branch.

Co-authored-by: djpfs <43576725+djpfs@users.noreply.github.com>

Copilot AI commented Aug 14, 2026

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts on this branch.

Resolved and committed in 2c9f98d.

Copilot AI requested a review from djpfs August 14, 2026 06:19
@djpfs
djpfs merged commit 31aff8a into main Aug 14, 2026
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.

Adicionar recursos avançados de rede

3 participants