Skip to content

Make show_toolbar_with_docker work when host.docker.internal is not the gateway - #2424

Closed
lowbyteguy wants to merge 1 commit into
django-commons:mainfrom
lowbyteguy:fix/docker-gateway-fallback
Closed

Make show_toolbar_with_docker work when host.docker.internal is not the gateway#2424
lowbyteguy wants to merge 1 commit into
django-commons:mainfrom
lowbyteguy:fix/docker-gateway-fallback

Conversation

@lowbyteguy

Copy link
Copy Markdown

Description

On OrbStack, host.docker.internal resolves to 0.250.250.254, which is unrelated to the container network, so the address computed by show_toolbar_with_docker never matches REMOTE_ADDR and the toolbar is not shown.

This keeps the existing host.docker.internal check first and adds a fallback that derives the candidate gateways from the container's own addresses, as suggested in the issue.

Fixes #2419

Checklist:

  • I have added the relevant tests for this change.
  • I have added an item to the Pending section of docs/changes.rst.

AI/LLM Usage

  • This PR includes code generated with the help of an AI/LLM

…he gateway

show_toolbar_with_docker resolved host.docker.internal and shifted the last
octet to .1 to guess the Docker host address. On some runtimes, such as
OrbStack, that name resolves to an address unrelated to the container network
(0.250.250.254), so the computed address never matched REMOTE_ADDR and the
toolbar was never shown.

Add a second fallback that derives the candidate gateways from the container's
own addresses, keeping the existing host.docker.internal check first.

Fixes django-commons#2419
@tim-schilling

Copy link
Copy Markdown
Member

Closing as a duplicate of #2422

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.

show_toolbar_with_docker doesn't work on orbstack

2 participants