Skip to content

fix: change default network_mode from host to bridge#49

Merged
dasirra merged 6 commits into
developfrom
build/43-sec-change-default-network-from-host-to-bridge
Mar 26, 2026
Merged

fix: change default network_mode from host to bridge#49
dasirra merged 6 commits into
developfrom
build/43-sec-change-default-network-from-host-to-bridge

Conversation

@dasirra

@dasirra dasirra commented Mar 25, 2026

Copy link
Copy Markdown
Owner

Summary

Changes the default Docker network mode from host to bridge with explicit port mappings (18789, 18790), eliminating unrestricted container access to the host network stack. Documents the legacy host mode as an optional override and adds a network mode selection screen to the install wizard.

Source

Closes #43

What Changed

Docker Compose

  • docker-compose.yaml: replaced network_mode: "host" with network_mode: bridge and added explicit ports mappings for ports 18789 and 18790
  • docker-compose.override.example.yaml: added a fully commented-out example block showing how to restore host mode via override, with ports: !reset [] to clear the incompatible port mappings and a clear isolation warning

Install Wizard

  • install.sh: added "Screen 4: Network Mode" between the Git Identity and integration setup sections
    • Defaults to bridge; pre-selects based on current override file state on reconfigure
    • On host selection: warns about loss of isolation, writes docker-compose.override.yaml if absent (or checks for existing host config)
    • On bridge selection: warns if an existing override file still enforces host mode

Tasks

Task Status Notes
Update docker-compose.yaml to bridge + ports DONE
Document host override in override example DONE
Add network mode screen to install wizard DONE
Code review fixes DONE Removed misleading NETWORK_MODE env var, added bridge→host cleanup warning

Code Review

Two MUST_FIX and two SHOULD_FIX issues were found and resolved:

  • Removed misleading NETWORK_MODE env var (was written to .env but never consumed by Docker Compose)
  • Bridge re-selection now warns if override file still enforces host mode
  • Host re-selection detects pre-existing configuration instead of giving redundant manual instructions
  • Fixed misleading "remove/rename" comment in override example

Built autonomously by /build

dasirra and others added 4 commits March 25, 2026 21:35
Reduces container network exposure by defaulting to bridge mode.
Adds explicit port mappings for gateway (18789) and bridge (18790) ports.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds a commented-out section showing how advanced users can switch back
to host network mode, with a warning about loss of network isolation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Prompts the user to choose bridge (default) or host network mode,
saves the selection to .env, and writes the override file if host
mode is selected.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@dasirra dasirra changed the base branch from main to develop March 26, 2026 08:44
Daniel Sierra Ramos and others added 2 commits March 26, 2026 09:59
…ard screen

- Remove explicit network_mode: bridge (let Compose use its project network)
- Add extra_hosts for host.docker.internal so container can reach host services
- Remove network mode wizard screen (bridge is the secure default; host mode
  is documented in docker-compose.override.example.yaml for power users)
- Add Compose version requirement comment for !reset YAML tag

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dasirra dasirra marked this pull request as ready for review March 26, 2026 09:17
@dasirra dasirra merged commit 3d4caf8 into develop Mar 26, 2026
1 check passed
@dasirra dasirra deleted the build/43-sec-change-default-network-from-host-to-bridge branch March 26, 2026 09:17
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.

sec: change default network_mode from host to bridge

1 participant