mirror of
https://github.com/basnijholt/compose-farm.git
synced 2026-02-03 14:13:26 +00:00
fix: Pass local_host to _get_glances_address in containers route (#172)
The get_containers_rows_by_host endpoint was missing the local_host parameter when calling _get_glances_address, causing it to use the external IP instead of the container name for the local host. This caused "Connection timed out" errors on the live-stats page when the web UI container couldn't reach its own host via the external IP (hairpin NAT issue).
This commit is contained in:
@@ -253,7 +253,8 @@ async def get_containers_rows_by_host(host_name: str) -> HTMLResponse:
|
|||||||
return HTMLResponse("")
|
return HTMLResponse("")
|
||||||
|
|
||||||
host = config.hosts[host_name]
|
host = config.hosts[host_name]
|
||||||
glances_address = _get_glances_address(host_name, host, config.glances_stack)
|
local_host = config.get_local_host_from_web_stack()
|
||||||
|
glances_address = _get_glances_address(host_name, host, config.glances_stack, local_host)
|
||||||
|
|
||||||
t0 = time.monotonic()
|
t0 = time.monotonic()
|
||||||
containers, error = await fetch_container_stats(host_name, glances_address)
|
containers, error = await fetch_container_stats(host_name, glances_address)
|
||||||
|
|||||||
Reference in New Issue
Block a user