fix(cloudflared): use --host 0.0.0.0 instead of --bind-addr for code-server

The --bind-addr flag caused code-server to fail entirely (app not
responding on any interface). The correct override for the
coder/code-server image is --host 0.0.0.0, which overrides the
entrypoint's --host 127.0.0.1.

Changes:
- Migration: Replace --bind-addr with --host 0.0.0.0, also handle
  existing broken templates by detecting --bind-addr and replacing it
- Runtime safety net: _ensure_web_bind_address uses --host 0.0.0.0
- Test fixture: Updated compose template to match

Quality gates: pytest 42 passed
This commit is contained in:
2026-05-29 16:36:09 +02:00
parent 3c57c8b78b
commit 1efbc289ba
3 changed files with 68 additions and 32 deletions
+2 -4
View File
@@ -629,7 +629,7 @@ def _ensure_web_bind_address(compose_path: str, tool_type_name: str) -> None:
from pathlib import Path
KNOWN_BIND_FIXES = {
"code-server": "--bind-addr 0.0.0.0:8443",
"code-server": "--host 0.0.0.0",
"jupyter-notebook": "start-notebook.sh --ip=0.0.0.0",
}
@@ -669,9 +669,7 @@ def _ensure_web_bind_address(compose_path: str, tool_type_name: str) -> None:
break
compose_file.write_text(yaml.dump(compose_data, default_flow_style=False))
logger.info(
"Injected bind address for %s: %s", tool_type_name, bind_command
)
logger.info("Injected bind address for %s: %s", tool_type_name, bind_command)
@router.post(