mirror of
https://github.com/open-webui/terminals.git
synced 2026-11-05 01:37:21 +00:00
[GH-ISSUE #57] issue: Docker backend publishes every terminal's port 8000 on all host interfaces even when TERMINALS_NETWORK is set #30
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
open-webui/terminals#30
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @silentoplayz on GitHub (Sep 10, 2026).
Original GitHub issue: https://github.com/open-webui/terminals/issues/57
Summary
With TERMINALS_NETWORK set, every terminal container the Docker backend starts still has its port 8000 published on the Docker host, on every interface, at a random high port. The orchestrator does not use that port in this mode, because it reaches the container by name on the named network. Every user's terminal is therefore reachable from any network the Docker host sits on. The terminal's own API key still gates commands and files. The health and config endpoints and the OpenAPI document answer without a key.
Expected Behavior
When TERMINALS_NETWORK names a network, terminal containers are reachable only on that network, by name. The README and the docs describe the setting that way. Containers communicate by name when it is set, and TERMINALS_DOCKER_HOST is described as relevant only without it. No host port is published in that mode. Without a network, the published port is bound to the address the orchestrator uses to reach it, which defaults to 127.0.0.1, rather than to every interface.
Actual Behavior
Running docker port on a terminal container shows port 8000 bound to 0.0.0.0 and to [::] on the host at a random port. The container sits on the named network, and the orchestrator talks to it by name. From a container on a different Docker network, and through the host's LAN address, /health, /api/config, and the OpenAPI document endpoint return 200 without any key. /files/cwd and /execute return 401. The published port has no consumer, since the orchestrator's routing uses the container name whenever a network is configured.
Steps to Reproduce
Observed: step 3 shows port 8000 bound to 0.0.0.0 and [::], and step 4 returns a status of ok. /api/config and the OpenAPI document endpoint answer the same way, and /files/cwd and /execute return 401.
Logs, Screenshots, and Config
ghcr.io/open-webui/terminals:latest, digest5d2fd44366a4, built 2026-08-31), Docker backend,TERMINALS_NETWORK=owui-t8-netThe orchestrator container itself was published on 127.0.0.1 only. The code on
mainate15903afis the same as in the image.From a container on the default bridge, which is not the terminals' network, through the Docker host's gateway address (the host's LAN address gave the same results):
Additional Information
Anchor commit
e15903af532d61b8264f354128edbca3e3ebd418onmain. The Docker backend setsPublishAllPortsfor every container regardless of the network setting (docker.py#L102) and setsNetworkModeonly when a network is named (#L139). The routing code reads the published port only when no network is configured (#L253-L268), so with a network configured the publication is never used. Terminal API keys come fromsecrets.token_urlsafe(24), so the protected endpoints are not open to guessing. The unauthenticated ones reveal a status line and three feature flags, plus the OpenAPI document.A minimal fix publishes only when no network is named:
When no network is named, the binding could also be narrowed to the address the orchestrator uses. An explicit
PortBindingsentry withHostIpset toTERMINALS_DOCKER_HOST(default 127.0.0.1) would do that. I left it out of the diff because that setting may hold a hostname rather than an address.@owui-terminator[bot] commented on GitHub (Sep 10, 2026):
🔍 Related Issues Found
I found some existing issues that might be related. Please check if any of these are duplicates or contain helpful solutions:
This issue is about configuring a custom Docker network for terminals containers. The new issue is the same feature area and specifically depends on
TERMINALS_NETWORKbehavior, making it the closest related report.by arp-mbender
💡 If your issue is a duplicate, please close it and add any additional details to the existing issue instead.
This comment was generated automatically. React with 👍 if helpful, 👎 if not.