feat(pm-agent): pin the first published agent-runner digest, start dry, and fix the token scopes
Rebased #61 onto the CI image pipeline (#81). This commit makes the remaining in-git blockers to going live go away: - deployment.yaml and PM_WORKER_IMAGE pin images run 340's digest (sha256:c4eba5b3..., tag sha-523cd9118f95 = main), read from the registry. Renovate markers unchanged. - PM_DRY_RUN=true and PM_REQUIRE_LABEL=agent for the first run. Dry run is required, not just cautious: the run-340 image's baked worker template predates imagePullSecrets, so admission would deny its Jobs until CI re-publishes after this merge and Renovate bumps. - Token scopes: Gitea 1.24.3 scopes GET /api/v1/user (the dispatcher's first call) under read:user. The documented list was missing it. Now read:user, write:repository, write:issue, read:package everywhere. - Org-package read documented as a team (Packages=Read, no repos), not just a scope. - sops is toolbox-only; the .examples say so and give the in-place edit. - runbook: key-name check no longer emits Secret values before the pipe. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
a7eadd4054
commit
7f0cbc7ba2
8 files changed
+219
-29
No files matched your search
@@ -60,11 +60,21 @@
|
||||
# Keycloak service-account token therefore cannot authenticate to Gitea's API or to
|
||||
# git-over-HTTP. Do not "upgrade" this to Keycloak without re-reading that.
|
||||
#
|
||||
# Scopes: `write:repository` and `write:issue`. Nothing else — in particular NOT
|
||||
# `write:admin`, NOT `write:organization`, NOT `write:user`.
|
||||
# Scopes, exactly these four (one token serves both Secrets — see
|
||||
# pm-agent-registry.sops.yaml.example):
|
||||
# read:user GET /user, the dispatcher's startup identity check. Gitea 1.24.3
|
||||
# puts the whole /api/v1/user group behind the `user` scope
|
||||
# category (routers/api/v1/api.go), so without it the dispatcher
|
||||
# CrashLoops on its first call even with an otherwise-valid token.
|
||||
# write:repository the clone, the branch push, the pull-request create, and the
|
||||
# dispatcher's reads of pulls/branches/commits.
|
||||
# write:issue reading open issues and posting issue comments.
|
||||
# read:package the kubelet's image pull (pm-agent-registry).
|
||||
# Nothing else — in particular NOT `write:admin`, NOT `write:organization`, NOT
|
||||
# `write:user`. (Until 2026-10-30 this list said two scopes; `read:user` was missing
|
||||
# and `read:package` lived only in the registry template.)
|
||||
#
|
||||
# `write:repository` covers the clone, the branch push and the pull-request create;
|
||||
# `write:issue` covers reading and posting issue comments. (The repository's OTHER CI
|
||||
# (The repository's OTHER CI
|
||||
# token, `SETTINGS_API_TOKEN`, is a separate credential with `read:admin` — do not
|
||||
# conflate them, and do not give this service that one. The 2026-10-02 measurement on
|
||||
# PR #38 recorded in infra/gitea/approval-policy.json is about that token, not this one.)
|
||||
@@ -94,6 +104,17 @@
|
||||
#
|
||||
# (4) COPY, FILL, ENCRYPT, COMMIT:
|
||||
#
|
||||
# `sops` IS IN THE PINNED TOOLBOX, NOT ON THE HOST (measured 2026-10-30: absent from the
|
||||
# workstation's PATH; sops 3.9.4 and vi in the toolbox). The simplest path needs no
|
||||
# plaintext file at all — edit the committed, already-encrypted file in place, from a
|
||||
# worktree, the way runbooks/vpn-remote-access.md does for its key:
|
||||
#
|
||||
# ./infra/devcontainer/dev.sh run sops platform/pm-agent/pm-agent-credentials.sops.yaml
|
||||
#
|
||||
# It opens vi on the decrypted document; replace the REPLACE-ME value(s), save, quit, and
|
||||
# sops re-encrypts on write. If you take the cp route below instead, run the `sops -e -i`
|
||||
# line through `./infra/devcontainer/dev.sh run` as well, and delete any plaintext temp file.
|
||||
#
|
||||
# cp platform/pm-agent/pm-agent-credentials.sops.yaml.example \
|
||||
# platform/pm-agent/pm-agent-credentials.sops.yaml
|
||||
# $EDITOR platform/pm-agent/pm-agent-credentials.sops.yaml # the two real values
|
||||
@@ -120,7 +141,7 @@ metadata:
|
||||
type: Opaque
|
||||
stringData:
|
||||
# Gitea token for the dedicated, NON-ADMIN `pm-agent` account.
|
||||
# Scopes: write:repository, write:issue.
|
||||
# Scopes: read:user, write:repository, write:issue, read:package.
|
||||
gitea-token: REPLACE-ME-gitea-token
|
||||
# Output of `claude setup-token` on a subscription account. One year's validity.
|
||||
claude-code-oauth-token: REPLACE-ME-claude-code-oauth-token
|
||||
Reference in new issue
Block a user