Use COMPLEMENT_HOSTNAME_RUNNING_COMPLEMENT config for ExtraHosts in Docker#825
Merged
MadLittleMods merged 2 commits intomainfrom Dec 19, 2025
Merged
Use COMPLEMENT_HOSTNAME_RUNNING_COMPLEMENT config for ExtraHosts in Docker#825MadLittleMods merged 2 commits intomainfrom
COMPLEMENT_HOSTNAME_RUNNING_COMPLEMENT config for ExtraHosts in Docker#825MadLittleMods merged 2 commits intomainfrom
Conversation
MadLittleMods
commented
Dec 8, 2025
| // Note: this feature of docker landed in Docker 20.10, | ||
| // see https://github.com/moby/moby/pull/40007 | ||
| extraHosts = []string{"host.docker.internal:host-gateway"} | ||
| extraHosts = []string{fmt.Sprintf("%s:host-gateway", cfg.HostnameRunningComplement)} |
Collaborator
Author
There was a problem hiding this comment.
This is the main change.
Using the value from our config instead of hard-coded.
Reference: COMPLEMENT_HOSTNAME_RUNNING_COMPLEMENT -> HostnameRunningComplement
MadLittleMods
commented
Dec 8, 2025
| HostnameRunningDocker = "localhost" | ||
| // HostnameRunningComplement is the hostname of Complement from the perspective of a Homeserver. | ||
| HostnameRunningComplement = "host.docker.internal" | ||
| ) |
Collaborator
Author
There was a problem hiding this comment.
Removing as these seem unused
MadLittleMods
commented
Dec 8, 2025
| // Note: this feature of docker landed in Docker 20.10, | ||
| // see https://github.com/moby/moby/pull/40007 | ||
| extraHosts = []string{"host.docker.internal:host-gateway"} | ||
| extraHosts = []string{fmt.Sprintf("%s:host-gateway", cfg.HostnameRunningComplement)} |
Collaborator
Author
There was a problem hiding this comment.
It looks like this regressed in #389
(previously, we we're using HostnameRunningComplement here)
devonh
approved these changes
Dec 19, 2025
Contributor
devonh
left a comment
There was a problem hiding this comment.
Seems reasonable to me. Hopefully this is transparent to people and nobody sees any breakages in their own setups.
Collaborator
Author
|
Thanks for the review @devonh 🐊 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use
COMPLEMENT_HOSTNAME_RUNNING_COMPLEMENTconfig forExtraHostsin DockerThis isn't spawning from any problem (and I'm not making this change to fix anything specifically although probably fixes podman support). Internally, at Element, we're playing around with adding our own self-hosted GitHub runners and this piece of code was pointed out. I noticed it hard-coded
host.docker.internalinstead of using the config (fromCOMPLEMENT_HOSTNAME_RUNNING_COMPLEMENT) which seemed a bit suspect.It looks like this regressed in #389 (previously, we we're using
HostnameRunningComplementhere)Pull Request Checklist