agents get a per-agent repo limit in their permissions record, orgs are locked
max_repos (default 0, 0..=100) lives in the agent's agent-permissions record and is edited on its permissions panel. The controller applies each agent's own value as max_repo_creation at CreateForgeUser and to existing accounts on change, restart and every five minutes; agent accounts may not create organizations.
This commit is contained in:
parent
dc0d08b7fb
commit
1edeb5c55d
1 changed files with 763 additions and 58 deletions
|
|
@ -817,6 +817,21 @@ The agent's **internet** access is its own row beside it: a badge reading
|
|||
restricted, log or unrestricted. Selecting it lists the three modes; picking one does a
|
||||
`PUT` of the mode with the stored permissions beside it.
|
||||
|
||||
The **repositories** row is how many repositories the agent's forge account may
|
||||
create: a badge reading none or `up to N`, in the warning tone above 0. Selecting
|
||||
it opens a number box, 0 to 100, and **save** does a `PUT` of `max_repos` with the
|
||||
stored permissions beside it. A `PUT` that leaves `max_repos` out, and the `DELETE`
|
||||
of **use the default**, keep it. Nothing stored means 0, and the box warns that an
|
||||
agent that may create repositories can add a CI workflow to them, CI workflows run
|
||||
unsandboxed on the CI runner, and that makes it arbitrary code on the runner host.
|
||||
The controller sets the value as Forgejo's `max_repo_creation` on that agent's
|
||||
account: on a new one at creation, and on an existing one within seconds of a save
|
||||
and again after every restart. It also turns off creating organizations on every
|
||||
agent account, whatever the number. Forgejo never reports `max_repo_creation`
|
||||
back, so the controller's log (`agent max repos`) is the record of what it applied
|
||||
to each agent. The controller tries an agent whose account the forge refuses again
|
||||
every five minutes.
|
||||
|
||||
A saved change isn't instant. The hive reads the grant about every 30 seconds
|
||||
and the agent takes it at its next turn. A change to `manage_root_agent`
|
||||
restarts the agent after its current turn. The card reads
|
||||
|
|
|
|||
Loading…
Reference in a new issue