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