feat(gitea): enable Actions and packages, add the desktop runner #1

Merged
donghyeon.kang merged 4 commits from claude/gitea-actions-32c51e into main 2026-11-07 10:43:31 +00:00
Owner

What and why

The template repositories could not run CI and the backend template could not consume its split-out libraries as Maven versions: Gitea had [actions] and [packages] disabled and both units in DISABLED_REPO_UNITS, so the repository API silently ignored has_actions=true.

This PR turns both features on at the server level and adds the desktop Gitea Actions runner (owner decisions, 2026-11-07).

  • services/gitea/profiles/oidc/values/baseline.yaml: actions.ENABLED=true, packages.ENABLED=true, DISABLED_REPO_UNITS="". SSH and LFS stay off.
  • infrastructure/ci/gitea-runner/: compose file, runner config and operating guide for one runner container on the desktop host.
  • services/gitea/README.md, root README.md: decision, storage, cleanup and Maven permissions, applied state.

Live state already matches this branch. The owner applied commit 87dee1f with scripts/bootstrap/apply-gitea-oidc.sh --execute (manifest SHA-256 f082cba5ca22b97ed5a463414404b852a4cfd452a0dd40c6e3b4b5f3afd4abbc). Until this merges, applying from main would turn Actions and Packages off again.

Chosen approach and dropped alternatives

  • DISABLED_REPO_UNITS is an explicit empty value, not a removed key. The chart init container runs gitea config edit-ini --apply-env on the persistent app.ini, so a removed key would keep the old list.
  • Runner image: official docker.io/gitea/runner:5.4.1-dind, pinned by index digest. Dropped: deprecated gitea/act_runner:0.6.1 (moved to gitea/runner); the basic image with the host docker.sock (jobs would own the host daemon); -dind-rootless (Testcontainers compatibility needs separate checks).
  • Jobs reach the inner dind daemon through the runner's Docker proxy (container.docker_host: ""), so Testcontainers can work without the host socket. Job containers are unprivileged, valid_volumes is empty, sweep: true.
  • Runner cap: 6 CPU and 10g, no more than half of the desktop's 12 cores and 31GiB, because runner jobs do not take the desktop's heavy-work lock.

Risk and impact

  • The runner container is --privileged. A job can still start a privileged container on the inner daemon; only trusted repository workflows should run on it. It is registered at user scope (donghyeon.kang) only.
  • Packages, Actions logs and the runner Docker volume share the root SSD. The local PV does not enforce the 50Gi request; 31G free after setup. No per-owner package size limit or cleanup rule is set yet.
  • New repositories get the Actions and Packages units by default (Gitea DEFAULT_REPO_UNITS). Existing repositories, including both templates, stay has_actions=false, has_packages=false.
  • The rollout restarted Gitea once (single RWO pod).
  • Not verified: a real job and Testcontainers inside a job (the template CI work runs the first job); host reboot.

Verification

  • Before apply: kubectl diff of main render was empty against live; the branch render changed only the gitea-inline-config keys actions, packages, repository and the Deployment checksum/config.
  • Apply script: GITEA OIDC APPLY SUCCESS (rollout, OAuth2 source, login and redirect, branding hashes).
  • After apply, compared with the pre-apply snapshot: /api/healthz pass, web 200, OIDC start 307 to Keycloak, discovery issuer unchanged, git ls-remote and git push over HTTPS work, 24 repositories with the same flags and PR counts (one new PR in the frontend template was created by another session after the snapshot).
  • Live app.ini: [actions] ENABLED = true, [packages] ENABLED = true, DISABLED_REPO_UNITS = (empty).
  • Packages: /api/packages/donghyeon.kang/maven/com/example/x/maven-metadata.xml now answers 404 package does not exist (was Not found.), /maven/x answers 400 request parameters are invalid. The bare /maven/ stays 404 because Gitea trims the trailing slash and /maven matches no route.
  • Runner: GET /api/v1/user/actions/runners shows desktop-runner id 1, online, busy=false, label ubuntu-latest; it came back after docker restart without registering again. docker inspect: 6 CPU, 10GiB, privileged, restart always, no published ports.
  • scripts/validate/render-phase1.sh invariants pass on this branch.
  • Not run on this branch: scripts/validate/scan-platform-sensitive-source.sh is hard-wired to /home/donghyeon/workspace/platform (line 5), so it scans the desktop main checkout, not a worktree. There it fails at observability-core RC=23 because old chart caches (services/observability/*/.helm/) are left in that checkout; unrelated to this PR. Instead the branch diff was checked: its only long hex strings are five SHA-256 digests, and no password, token or private key lines.

Where to look

  • services/gitea/profiles/oidc/values/baseline.yaml (the only rendered change)
  • infrastructure/ci/gitea-runner/config.yaml (container.* keys)
  • infrastructure/ci/gitea-runner/README.md (Docker-in-job risk section, rollback)

Related

  • Central ADR-0011 (/home/donghyeon/workspace/docs/platform/adr/0011-gitea-actions-packages-desktop-runner.md on the desktop host)
  • design-docs repo-structure/README.md section 3.5 (library split to Gitea Packages)
  • Backups and rollback manifest: desktop ~/.local/state/platform-backups/gitea-actions-20261107/
## What and why The template repositories could not run CI and the backend template could not consume its split-out libraries as Maven versions: Gitea had `[actions]` and `[packages]` disabled and both units in `DISABLED_REPO_UNITS`, so the repository API silently ignored `has_actions=true`. This PR turns both features on at the server level and adds the desktop Gitea Actions runner (owner decisions, 2026-11-07). - `services/gitea/profiles/oidc/values/baseline.yaml`: `actions.ENABLED=true`, `packages.ENABLED=true`, `DISABLED_REPO_UNITS=""`. SSH and LFS stay off. - `infrastructure/ci/gitea-runner/`: compose file, runner config and operating guide for one runner container on the desktop host. - `services/gitea/README.md`, root `README.md`: decision, storage, cleanup and Maven permissions, applied state. **Live state already matches this branch.** The owner applied commit `87dee1f` with `scripts/bootstrap/apply-gitea-oidc.sh --execute` (manifest SHA-256 `f082cba5ca22b97ed5a463414404b852a4cfd452a0dd40c6e3b4b5f3afd4abbc`). Until this merges, applying from `main` would turn Actions and Packages off again. ## Chosen approach and dropped alternatives - `DISABLED_REPO_UNITS` is an explicit empty value, not a removed key. The chart init container runs `gitea config edit-ini --apply-env` on the persistent `app.ini`, so a removed key would keep the old list. - Runner image: official `docker.io/gitea/runner:5.4.1-dind`, pinned by index digest. Dropped: deprecated `gitea/act_runner:0.6.1` (moved to `gitea/runner`); the basic image with the host `docker.sock` (jobs would own the host daemon); `-dind-rootless` (Testcontainers compatibility needs separate checks). - Jobs reach the inner dind daemon through the runner's Docker proxy (`container.docker_host: ""`), so Testcontainers can work without the host socket. Job containers are unprivileged, `valid_volumes` is empty, `sweep: true`. - Runner cap: 6 CPU and 10g, no more than half of the desktop's 12 cores and 31GiB, because runner jobs do not take the desktop's heavy-work lock. ## Risk and impact - The runner container is `--privileged`. A job can still start a privileged container on the inner daemon; only trusted repository workflows should run on it. It is registered at user scope (`donghyeon.kang`) only. - Packages, Actions logs and the runner Docker volume share the root SSD. The local PV does not enforce the 50Gi request; 31G free after setup. No per-owner package size limit or cleanup rule is set yet. - New repositories get the Actions and Packages units by default (Gitea `DEFAULT_REPO_UNITS`). Existing repositories, including both templates, stay `has_actions=false`, `has_packages=false`. - The rollout restarted Gitea once (single RWO pod). - Not verified: a real job and Testcontainers inside a job (the template CI work runs the first job); host reboot. ## Verification - Before apply: `kubectl diff` of `main` render was empty against live; the branch render changed only the `gitea-inline-config` keys `actions`, `packages`, `repository` and the Deployment `checksum/config`. - Apply script: `GITEA OIDC APPLY SUCCESS` (rollout, OAuth2 source, login and redirect, branding hashes). - After apply, compared with the pre-apply snapshot: `/api/healthz` pass, web 200, OIDC start 307 to Keycloak, discovery issuer unchanged, `git ls-remote` and `git push` over HTTPS work, 24 repositories with the same flags and PR counts (one new PR in the frontend template was created by another session after the snapshot). - Live `app.ini`: `[actions] ENABLED = true`, `[packages] ENABLED = true`, `DISABLED_REPO_UNITS =` (empty). - Packages: `/api/packages/donghyeon.kang/maven/com/example/x/maven-metadata.xml` now answers `404 package does not exist` (was `Not found.`), `/maven/x` answers `400 request parameters are invalid`. The bare `/maven/` stays 404 because Gitea trims the trailing slash and `/maven` matches no route. - Runner: `GET /api/v1/user/actions/runners` shows `desktop-runner` id 1, `online`, `busy=false`, label `ubuntu-latest`; it came back after `docker restart` without registering again. `docker inspect`: 6 CPU, 10GiB, privileged, restart always, no published ports. - `scripts/validate/render-phase1.sh` invariants pass on this branch. - Not run on this branch: `scripts/validate/scan-platform-sensitive-source.sh` is hard-wired to `/home/donghyeon/workspace/platform` (line 5), so it scans the desktop `main` checkout, not a worktree. There it fails at `observability-core RC=23` because old chart caches (`services/observability/*/.helm/`) are left in that checkout; unrelated to this PR. Instead the branch diff was checked: its only long hex strings are five SHA-256 digests, and no password, token or private key lines. ## Where to look - `services/gitea/profiles/oidc/values/baseline.yaml` (the only rendered change) - `infrastructure/ci/gitea-runner/config.yaml` (`container.*` keys) - `infrastructure/ci/gitea-runner/README.md` (Docker-in-job risk section, rollback) ## Related - Central ADR-0011 (`/home/donghyeon/workspace/docs/platform/adr/0011-gitea-actions-packages-desktop-runner.md` on the desktop host) - design-docs `repo-structure/README.md` section 3.5 (library split to Gitea Packages) - Backups and rollback manifest: desktop `~/.local/state/platform-backups/gitea-actions-20261107/`
donghyeon.kang added 4 commits 2026-11-07 09:38:00 +00:00
The template repositories cannot run CI: [actions] ENABLED=false and
repo.actions in DISABLED_REPO_UNITS make Gitea ignore has_actions=true
on the repository API (200 response, value unchanged).

Turn on [actions] and drop only repo.actions from DISABLED_REPO_UNITS.
Packages stay disabled (packages.ENABLED=false, repo.packages kept).
Repositories created while the unit was disabled have no Actions unit
row, so every existing repository keeps has_actions=false until its
owner enables it. The values file is shared by the baseline and OIDC
build roots, so both renders change the same way.

Risk: new repositories get repo.actions by default (Gitea default
DEFAULT_REPO_UNITS). They run nothing without a runner in scope.
Gitea itself needs no new egress; runners connect inbound over the
existing Host Nginx -> Traefik HTTPS path.

Refs: Gitea 1.27 config cheat sheet [actions], [repository]
The backend template is moving its messaging and gRPC libraries into
separate repositories and will consume them as Maven versions from
Gitea Packages. [packages] ENABLED=false and repo.packages in
DISABLED_REPO_UNITS make the registry unavailable.

Turn on [packages] and leave DISABLED_REPO_UNITS as an explicit empty
value. The chart init container runs `gitea config edit-ini
--apply-env` against the app.ini on the data volume, so a removed key
would keep the old disabled list; an empty value overwrites it.
SSH and LFS stay off. This ships with the Actions change in the same
rollout, so Gitea restarts once.

Risk: packages are stored under /data/packages on the root SSD local
PV. The 50Gi PVC size is not enforced by a local PV; the real bound is
free space on the host root disk, shared with the host and the CI
runner. No per-owner size limit is set yet.

Verification: render-phase1.sh invariants pass; kubectl diff against
live shows only the inline-config keys actions, packages, repository
and the Deployment checksum/config annotation.

Refs: Gitea 1.27 config cheat sheet [packages], usage/packages
The template repositories need a real runner for their CI, and the
owner chose one container on the desktop host (the k3s node).

Add compose.yaml and config.yaml for the official Gitea Runner 5.4.1
dind image, pinned by index digest, plus the operating guide. The
runner has capacity 1, one ubuntu-latest label pinned to
runner-images ubuntu-24.04-v26.11.03 by digest, restart: always, and
a 6 CPU / 10g cap (no more than half of the 12 cores and 31GiB).
Jobs use the dind daemon through the runner's Docker proxy for
Testcontainers; the host Docker socket is never mounted, job
containers stay unprivileged, valid_volumes is empty, and sweep
removes what a job created.

Dropped alternatives: the deprecated gitea/act_runner 0.6.1 (moved
to gitea/runner), the basic image with the host docker.sock (jobs
would own the host daemon), and dind-rootless (Testcontainers
compatibility needs separate checks).

Risk: the runner container is privileged; a job can still start a
privileged container on the inner daemon, so only trusted repository
workflows should run here. Runner jobs do not take the desktop's
heavy-work lock; the CPU and memory caps are the only guard.

Verification: config keys checked with `gitea-runner config get`,
`docker compose config` passes, the runner registered at user scope
and the Gitea API shows desktop-runner online and idle; it came back
online after `docker restart` without registering again.
The Gitea README still said Actions and the package registry are
disabled on first deployment, and had no guidance for either.

Replace that decision with the 2026-11-07 state, add where packages
are stored and how much space they really have (a local PV does not
enforce the 50Gi request), the cleanup rules to use for Maven
SNAPSHOTs, and who may publish and read Maven packages. Record the
applied manifest SHA-256 and link the runner guide from the root
README.

Verification: statements checked against the Gitea 1.27 docs and
source (routers/api/packages/maven, modules/web/router.go), the live
app.ini, and API responses after the rollout.
donghyeon.kang merged commit 89e81309b5 into main 2026-11-07 10:43:31 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: donghyeon.kang/platform-core#1