Watch
0
0
Fork
You've already forked hyperhive
0

forgejo: actionsFromSelf defaults to whether this host runs the swarm-controller

The controller seeds the actions/checkout mirror from its own host's
mirror list, so a forge host without it got DEFAULT_ACTIONS_URL = self
and no mirror. The default now follows
deploy.swarm-controller.enable; the module-eval check pins forge-only
(false, no warning) and forge+controller (true, mirror seeded).
This commit is contained in:
atlas 2026-10-05 12:54:03 +02:00 • committed by mara
commit 84347f122c
4 changed files with 45 additions and 8 deletions

View file

@ -117,6 +117,11 @@ let
deploy.forgejo.enable = true;
deploy.forgejo.mirrors = [ aMirror ];
};
forgeOnly = hive { deploy.forgejo.enable = true; };
forgeWithController = hive {
deploy.swarm-controller.enable = true;
deploy.forgejo.enable = true;
};
controllerWithSelfActions = hive {
deploy.swarm-controller.enable = true;
deploy.forgejo.enable = true;
@ -469,6 +474,24 @@ let
&& mirrorsOf controllerWithMirrors == [ aMirror ]
&& actionsUrlOf controllerWithMirrors == null;
}
{
# The default follows the controller, the only thing that seeds the
# checkout mirror: a forge alone must not resolve actions from itself.
name = "actionsFromSelf defaults to whether this host runs the swarm-controller";
ok =
let
actionsUrlOf =
m: m.containers.hive-forge.config.services.forgejo.settings.actions.DEFAULT_ACTIONS_URL or null;
mirrorsOf =
m: builtins.fromJSON m.systemd.services.swarm-controller.environment.SWARM_CONTROLLER_FORGE_MIRRORS;
in
!forgeOnly.services.hyperhive.deploy.forgejo.actionsFromSelf
&& actionsUrlOf forgeOnly == null
&& forgeOnly.warnings == [ ]
&& forgeWithController.services.hyperhive.deploy.forgejo.actionsFromSelf
&& actionsUrlOf forgeWithController == "self"
&& lib.elem "actions/checkout" (map (m: m.dest) (mirrorsOf forgeWithController));
}
{
name = "the old c0re org-avatar option lands on the controller's unit";
ok =