Skip to content

Model endpoints: treat container host aliases as local and name the HTTPS switch - #73

Open
oldeucryptoboi wants to merge 1 commit into
cbtw-apac:mainfrom
oldeucryptoboi:fix/base-url-container-host-aliases
Open

oldeucryptoboi wants to merge 1 commit into
cbtw-apac:mainfrom
oldeucryptoboi:fix/base-url-container-host-aliases

Conversation

@oldeucryptoboi

Copy link
Copy Markdown

Closes #69

Why

The standard developer setup, a model server on the host and the worker in Docker, reaches Ollama at http://host.docker.internal:11434. validate_base_url treated that host as remote and rejected plain HTTP, so the worker crash-looped on remote provider base URLs must use HTTPS. The switch existed but was undocumented and unnamed in the error.

What

  • transport.py: is_local_hostname() covers localhost, loopback IPs, and the container-runtime aliases host.docker.internal, gateway.docker.internal, host.lima.internal, host.containers.internal. The host allowlist still applies to them.
  • The HTTPS error names security.require_https_for_remote_endpoints and security.allowed_base_url_hosts.
  • docs/users/configuration/config-file-reference.md: new "Provider endpoint policy" section documenting both keys.
  • New tests/models/unit/test_transport_base_url.py.

Checks

ruff clean on the touched files; python -m pytest packages/harborrag-adapters/tests/models 481 passed.

🤖 Generated with Claude Code

…TTPS switch

A model server on the developer's machine (Ollama, LM Studio, a LiteLLM
proxy) is reached from a container through host.docker.internal or one of
its Lima and Podman equivalents. validate_base_url treated those as remote
and rejected plain HTTP, so the worker crash-looped on
"remote provider base URLs must use HTTPS" in the most common local setup.

Loopback now includes host.docker.internal, gateway.docker.internal,
host.lima.internal and host.containers.internal. The allowlist still applies
to them. The error for a genuinely remote plain-HTTP endpoint names the two
keys that relax the rule, and the configuration reference documents both.

Closes cbtw-apac#69

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 17, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 1f183c04-350c-4ea7-b727-a5e1c7ca9b4b


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

HTTPS-only rule blocks Ollama on the Docker host, and the error does not name the switch

2 participants