From 0af6ea1dd05a8727430b39ee6d8d05c3de45eb0f Mon Sep 17 00:00:00 2001 From: damocles Date: Sun, 31 May 2026 13:51:03 +0200 Subject: [PATCH] =?UTF-8?q?nix/hive-c0re:=20pin=20HIVE=5FFORGE=5FURL=20to?= =?UTF-8?q?=20127.0.0.1=20=E2=80=94=20agents=20can't=20resolve=20forge.=20(#761)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nix/modules/hive-c0re.nix | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/nix/modules/hive-c0re.nix b/nix/modules/hive-c0re.nix index 67995565..22171979 100644 --- a/nix/modules/hive-c0re.nix +++ b/nix/modules/hive-c0re.nix @@ -307,9 +307,21 @@ in HYPERHIVE_SWARM_NAME = config.services.hyperhive.swarmName; } // lib.optionalAttrs config.services.hyperhive.forge.enable { - # Agents poll this URL for Forgejo notifications. Derived from - # services.hyperhive.forge.{domain,httpPort} so it tracks forge config changes. - HIVE_FORGE_URL = "http://${config.services.hyperhive.forge.domain}:${toString config.services.hyperhive.forge.httpPort}"; + # Agents poll this URL for Forgejo notifications + run all + # `hive-forge` calls against it. Pinned to `127.0.0.1` for + # the in-cluster path: every agent container shares the + # host's network namespace so loopback reaches the forge + # container directly, no DNS lookup needed (closes #761). + # + # Post-#754 `cfg.domain` defaults to `forge.` + # for the external gateway vhost. Using that value here + # would route every in-cluster call through DNS for an + # external hostname agents can't resolve from inside their + # nspawn — every `hive-forge` invocation would fail with + # "Name or service not known". The external gateway URL + # is for operator browsers + cross-host clients; internal + # callers stay on loopback. + HIVE_FORGE_URL = "http://127.0.0.1:${toString config.services.hyperhive.forge.httpPort}"; } // lib.optionalAttrs config.services.hyperhive.matrix.gui.enable { # Availability flag for `/api/state.matrix_gui_enabled`. The