docs/integrations, hive-c0re nix: the agent config input is the local applied mirror
forge.md said the meta flake fetches agent-configs over git+http through a credential helper. The input is git+file://<applied> (meta.rs), and hive-c0re's own git reads use forge::reader_token(). Fix the same claim in the comments above the hive-c0re gitconfig and the credential helper. No code change.
This commit is contained in:
parent
0441bca2c9
commit
66c1a564a4
2 changed files with 17 additions and 15 deletions
|
|
@ -117,11 +117,13 @@ Two things live in the `agent-configs` Forgejo organization:
|
||||||
hive-c0re pushes nothing to this org; it only reads from it.
|
hive-c0re pushes nothing to this org; it only reads from it.
|
||||||
Repos stay private, so an agent can't read another
|
Repos stay private, so an agent can't read another
|
||||||
agent's config. (Agents remain read-only collaborators on `core/meta`.)
|
agent's config. (Agents remain read-only collaborators on `core/meta`.)
|
||||||
hive-c0re also references this repo as the agent's **persistent meta
|
The agent's **persistent meta flake input** is the hive's local `applied`
|
||||||
flake input** (`agent-<n>.url = git+http://<forge>/agent-configs/<n>.git`;
|
mirror of this repo (`agent-<n>.url = git+file://<applied>`; see
|
||||||
see [config-changes.md § Meta flake](../agent-lifecycle/config-changes.md#meta-flake)), fetching it as the `core`
|
[config-changes.md § Meta flake](../agent-lifecycle/config-changes.md#meta-flake)),
|
||||||
user via a git credential helper that reads the live forge-core token —
|
so building never depends on the forge being reachable. hive-c0re's own git
|
||||||
so the config lives on the forge, not a hand-synced local checkout.
|
reads of this repo, which fill the mirror, authenticate with the hive's read
|
||||||
|
token through `forge::reader_token()` (see
|
||||||
|
[How a hive reads the forge](#how-a-hive-reads-the-forge)).
|
||||||
- The dashboard links each container's deployed config commit to this
|
- The dashboard links each container's deployed config commit to this
|
||||||
config repo on the swarm's forge (`swarm.forge.publicUrl`; `null` means no
|
config repo on the swarm's forge (`swarm.forge.publicUrl`; `null` means no
|
||||||
link), so operators can go straight from the SW4RM tab into
|
link), so operators can go straight from the SW4RM tab into
|
||||||
|
|
|
||||||
|
|
@ -43,12 +43,11 @@ let
|
||||||
# (mid-path globs aren't supported, so per-agent repos can't be listed);
|
# (mid-path globs aren't supported, so per-agent repos can't be listed);
|
||||||
# in practice these processes only ever touch hyperhive's own repos.
|
# in practice these processes only ever touch hyperhive's own repos.
|
||||||
#
|
#
|
||||||
# The agent config inputs now live on the forge
|
# The agent config inputs are local `git+file` mirrors of the applied repos
|
||||||
# (`git+http://${forge.domain}/agent-configs/<n>.git`, see meta.rs render),
|
# (meta.rs render), so the meta flake fetches nothing from the forge. The
|
||||||
# so hive-core's `nix flake update` of those inputs is an authenticated
|
# `[credential]` stanza points git at the `hive-forge` helper below, scoped
|
||||||
# `git+http` fetch. The `[credential]` stanza points git at the `hive-forge`
|
# to the forge host, for any `git+http` fetch from it as the forge `core`
|
||||||
# helper below (scoped to the forge host) so the fetch authenticates as the
|
# user. hive-c0re's own forge reads use `forge::reader_token()` instead.
|
||||||
# forge `core` user with no token in any URL or lock.
|
|
||||||
safeDirGitconfig = pkgs.writeText "hyperhive-safe-gitconfig" ''
|
safeDirGitconfig = pkgs.writeText "hyperhive-safe-gitconfig" ''
|
||||||
[safe]
|
[safe]
|
||||||
directory = *
|
directory = *
|
||||||
|
|
@ -66,12 +65,13 @@ let
|
||||||
lowSpeedTime = 30
|
lowSpeedTime = 30
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# git credential helper for hive-core's authenticated fetches of the
|
# git credential helper answering for the forge host as `core`. Reads the
|
||||||
# agent-config repos on the forge. Reads the live forge-core admin token
|
# live forge-core admin token
|
||||||
# (`/var/lib/hyperhive/forge-core-token` — paths.rs `FORGE_CORE_TOKEN`) on
|
# (`/var/lib/hyperhive/forge-core-token` — paths.rs `FORGE_CORE_TOKEN`) on
|
||||||
# every invocation, so it never holds a stale copy and survives token
|
# every invocation, so it never holds a stale copy and survives token
|
||||||
# rotation. Scoped to the forge host by the `[credential]` stanza above;
|
# rotation; prints nothing where that file is absent. Scoped to the forge
|
||||||
# implements the git credential-helper protocol (only `get` answers).
|
# host by the `[credential]` stanza above; implements the git
|
||||||
|
# credential-helper protocol (only `get` answers).
|
||||||
forgeCredHelper = pkgs.writeShellScriptBin "git-credential-hive-forge" ''
|
forgeCredHelper = pkgs.writeShellScriptBin "git-credential-hive-forge" ''
|
||||||
[ "''${1:-}" = "get" ] || exit 0
|
[ "''${1:-}" = "get" ] || exit 0
|
||||||
if [ -r /var/lib/hyperhive/forge-core-token ]; then
|
if [ -r /var/lib/hyperhive/forge-core-token ]; then
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue