Author SHA1 Message Date
poli0981andClaude Opus 5.5 5df2e10712 docs(migration): reserve MuteVault's fuzz slot in the cron registry
Ops lint / actionlint + Python (pull_request) Successful in 24s
The tracker in GITEA-MIGRATION.md section 8 keeps 15:17 Sat for
MuteVault's future fuzz workflow, but the registry table did not list
it, so the slot looked free. Add it as reserved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-05 16:44:17 +07:00
poli0981andClaude Opus 5.5 9593953b1f docs(migration): register MutePeek, new on Gitea, and its cron slots
MutePeek, a Rust + GPUI read-only file previewer, was created on Gitea
and has nothing to migrate. Its bootstrap (workspace + CI) arrives as
PR chore/ci-bootstrap (Gitea #1) and calls this repo at v2026.11.5 for
the security scan and Qodana.

- Status table: one row.
- Cron registry:
  - 14:51 Sun: mutepeek security, live with the bootstrap;
  - 15:39 Wed: mutepeek qodana, live with the bootstrap;
  - 14:21 Sat: mutepeek fuzz, reserved until fuzz.yml lands in 0.1.
- Tracker: one row. Actions is on; QODANA_TOKEN and DISCORD_CI_WEBHOOK
  are still to create, and the GitLab mirror is not set up yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-05 16:44:10 +07:00
poli0981 42bb1671da Merge pull request 'chore(deps): update all non-major dependencies' (#23) from renovate/all-minor-patch into main
Ops lint / actionlint + Python (push) Successful in 20s
Reviewed-on: #23
2026-12-05 03:28:22 +00:00
renovate-bot Bot 58a7d759c3 chore(deps): update all non-major dependencies
Ops lint / actionlint + Python (pull_request) Successful in 27s
2026-12-04 13:50:54 +00:00
poli0981 2c9b038e24 Merge pull request 'feat(maintainer): add-runner.ps1 for a second, Docker-only runner' (#26) from feat/add-runner into main
Ops lint / actionlint + Python (push) Successful in 29s
Reviewed-on: #26
2026-12-04 12:54:12 +00:00
poli0981andClaude Opus 5.5 e032513d26 feat(maintainer): add-runner.ps1 for a second, Docker-only runner
Ops lint / actionlint + Python (pull_request) Successful in 37s
D15 decided a second gitea-runner registration on the PC for the long
data jobs; this script sets it up. It finds the first runner through
its running gitea-runner process, else its scheduled task (the exe
itself or a .ps1 that starts it), and prints what it saw when it
cannot. It writes a config.yaml of its own (capacity 3 by
default, the ubuntu-* labels copied from the first runner, separate
cache and work folders, docker_host and network copied over, a per-job
container limit), registers it with a token it asks for and never
stores, and runs it at logon from a wrapper that waits for Docker
Desktop and restarts the daemon when it exits: the first runner's task
once started before Docker and stayed down. With PowerShell from the
Store, the task calls the stable WindowsApps alias, not the versioned
install path.

-SplitExistingRunner backs up the first runner's config.yaml, drops its
docker labels so it only takes windows-latest jobs, and restarts it.
Restarting either runner asks first, since it cuts a running job.
Running the script again changes capacity, labels or limits without
registering again. -DryRun shows every step.

The runbook lists the script, and D15 now says capacity 3 by default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MnPQKxkPgL2sb8BqwHKv5k
2026-12-04 19:49:07 +07:00
poli0981andClaude Opus 5.5 e2bc0aa43b docs(migration): register ReelPilot, new on Gitea, and its cron slots
Ops lint / actionlint + Python (pull_request) Successful in 17s
Ops lint / actionlint + Python (push) Successful in 12s
ReelPilot was created on Gitea and has nothing to migrate. Its CI
bootstrap (Gitea #1) keeps CI local (ruff, mypy, pytest on 3.11, 3.14
and 3.15, ci-ok) and calls this repo at v2026.11.5 for the security
scan and Qodana.

- Status table: one row.
- Cron registry, both slots live from the bootstrap merge:
  - 14:39 Sat: reelpilot security;
  - 15:21 Thu: reelpilot qodana.
- Tracker: one row. QODANA_TOKEN is set; DISCORD_CI_WEBHOOK is still
  to create.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 15:02:03 +07:00
poli0981 672951e9d2 Merge pull request 'docs(migration): register MuteVault, new on Gitea, and its cron slots' (#24) from docs/mutevault into main
Ops lint / actionlint + Python (push) Successful in 17s
Reviewed-on: #24
2026-12-02 14:12:52 +00:00
poli0981andClaude Opus 5.5 5cc475c5d0 docs(migration): MuteVault already has QODANA_TOKEN
Ops lint / actionlint + Python (pull_request) Successful in 23s
The tracker row said both of its CI secrets were missing. QODANA_TOKEN
was created at repository level before the bootstrap merged, and its
Qodana run on main used it. Only DISCORD_CI_WEBHOOK is still missing,
at both repository and user level.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 20:59:25 +07:00
poli0981andClaude Opus 5.5 1c244f96b2 docs(migration): register MuteVault, new on Gitea, and its cron slots
Ops lint / actionlint + Python (pull_request) Successful in 32s
MuteVault was created on Gitea and has nothing to migrate. Its bootstrap
PR (Gitea #1) adds its CI, which calls this repo at v2026.11.5.

- Status table: a row pointing at its own docs/15_BUILD_RELEASE.md §4
  and §14.
- Cron registry, both slots live from the bootstrap merge:
  - 13:57 Tue: mutevault security;
  - 14:09 Fri: mutevault qodana.
- Tracker: one row. Secrets QODANA_TOKEN and DISCORD_CI_WEBHOOK are
  still to create. 17 15 * * 6 is kept for its future fuzz workflow and
  registered with that change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 20:52:26 +07:00
poli0981 73ae7fb17c Merge pull request 'docs(migration): MarkLens is done, and what it found' (#21) from docs/marklens-done into main
Ops lint / actionlint + Python (push) Successful in 44s
Reviewed-on: #21
2026-11-27 07:34:31 +00:00
poli0981andClaude Opus 5.5 d0c1d411d3 docs(migration): MarkLens is done, and what it found
Ops lint / actionlint + Python (pull_request) Successful in 7s
The first Flutter repo: Gitea #2 and #3 fast-forwarded, v1.1.0
released to R2 with the latest.json update feed (D8), branch protection
on main, maintenance mode. What the move found, for the next repos:

- No Flutter setup action fits host mode (subosito's bash steps can hit
  WSL): a pinned, checksummed SDK install into the runner tool cache.
- docker run -v $PWD inside a Docker job mounts a host path, so the
  Linux floor is the ubuntu-22.04 label again.
- Renovate proposes ubuntu v26 for Dockerfile bases and newer runs-on
  labels; a repo that pins an Ubuntu label on purpose needs a rule
  (candidate for the preset).
- gitleaks reads a Sonar project key as an API key; apt in the runner's
  Docker network can lose a DNS lookup; the artifact service can time
  out on CreateArtifact (re-run failed jobs).

The tracker row, the status row and the 15:23 Fri cron slot are live;
the runbook notes pub.dev in the release-age rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 14:30:04 +07:00
poli0981 2fa31bb8ef Merge pull request 'docs(migration): jsonPrism is done, and what it found' (#20) from docs/jsonprism-done into main
Ops lint / actionlint + Python (push) Successful in 6s
Reviewed-on: #20
2026-11-27 05:48:52 +00:00
poli0981andClaude Opus 5.5 fcf83b8a9e docs(migration): jsonPrism is done, and what it found
Ops lint / actionlint + Python (pull_request) Successful in 17s
- migration/jsonprism.md: done 2026-11-27 (Gitea #2, v2.3.0 on R2, the site
  deployed by the CI `deploy` job) and the findings: the runner that started
  before Docker Desktop, SSH refused but HTTPS fine, two Discord secrets not
  carried over, Renovate's runner-label and JDK proposals, the Kotlin
  build-cache CVE held with the Tauri template, gitleaks and the beacon
  token, the release dry run from the branch, the npm Tauri CLI in
  gen/android, production smoke as a local reusable, the keystore alias
  masking the app name in logs, one runner for every queue, keyboxd.
- migration/README.md: jsonPrism done; its 13:19 Friday security slot is
  live.
- GITEA-MIGRATION.md §8: the jsonPrism row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 12:11:22 +07:00
poli0981andClaude Opus 5.5 826c9e65d5 docs(migration): RepoLens's private mirror, report token and webhook
Ops lint / actionlint + Python (pull_request) Successful in 6s
Ops lint / actionlint + Python (push) Successful in 6s
RepoLens's GitLab push mirror (2026-11-27) was created public, which
exposed the private source and LICENSE's internal note; it is private
now. The guide says so, with the lesson for other private repos: check
the mirror's visibility right after creating it. It also records the
report token (Guest role drops labels, expires 2027-11-26), the live
system webhook and how its first deliveries were checked (no Test
Delivery for system hooks), and which maintainer steps remain. The
tracker marks the mirror.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 09:21:12 +07:00
poli0981 31794691e2 Merge pull request 'chore(deps): update actions/setup-node action to v7' (#17) from renovate/actions-setup-node-7.x into main
Ops lint / actionlint + Python (push) Successful in 7s
Reviewed-on: #17
2026-11-27 02:14:39 +00:00
poli0981 4639777798 Merge pull request 'chore(deps): update ruby/setup-ruby action to v1.345.0' (#16) from renovate/all-minor-patch into main
Ops lint / actionlint + Python (push) Canceled after 0s
Reviewed-on: #16
2026-11-27 02:14:17 +00:00
poli0981andClaude Opus 5.5 644d04df7d docs(migration): RepoLens is done, and what it found
Ops lint / actionlint + Python (pull_request) Successful in 12s
Ops lint / actionlint + Python (push) Successful in 14s
RepoLens merged as Gitea #2 (fast-forward, 9 commits), deployed by its
CI deploy job, and released v1.6.0 with the dependency refresh (#3, #4).
Its guide records what the anonymous Gitea reads, the system webhook,
the job container and the UI merge taught; the tracker, the status
table and the cron registry (13:11 smoke, 14:33 Tue security) follow.

The repository went private on Gitea at the owner's request, so it
gets no GitLab mirror.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 20:51:56 +07:00
renovate-bot Bot 82fcdd1096 chore(deps): update actions/setup-node action to v7
Ops lint / actionlint + Python (pull_request) Successful in 11s
2026-11-26 13:44:09 +00:00
renovate-bot Bot 6fd21bfab4 chore(deps): update ruby/setup-ruby action to v1.345.0
Ops lint / actionlint + Python (pull_request) Successful in 13s
2026-11-26 13:44:04 +00:00
poli0981 e6084f031e Merge pull request 'docs: ops v2026.11.5 is out, HashTool and CommandForge pin it' (#15) from docs/ops-v2026.11.5 into main
Ops lint / actionlint + Python (push) Successful in 7s
Reviewed-on: #15
2026-11-26 07:14:55 +00:00
poli0981andClaude Opus 5.5 497fb914a1 docs: ops v2026.11.5 is out, HashTool and CommandForge pin it
Ops lint / actionlint + Python (pull_request) Successful in 6s
The runbook's tagging note named v2026.11.1 as the tag before the notifier
fix; it now names the latest tag, v2026.11.5 (signed, b93b371): the release
notifier knows the Velopack apps released from Gitea and the security scan
restores .NET without ICU. The HashTool and CommandForge guides record their
pin bumps (HashTool #3, CommandForge #4); HashTool's NuGetAudit job runs on
ubuntu-latest again, which checked the ICU fix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 13:46:32 +07:00
12 changed files with 695 additions and 26 deletions

No files matched your search

@@ -84,7 +84,7 @@ jobs:
- name: Setup Node.js ${{ inputs.node-version }}
if: ${{ inputs.package-manager != 'none' }}
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
uses: actions/setup-node@8fccf151e3ba8038c300f83b40c8fd1e94f9c5ce # v7.2.0
with:
node-version: ${{ inputs.node-version }}
cache: ${{ inputs.package-manager }}
@@ -156,7 +156,7 @@ jobs:
- name: Setup Node.js ${{ inputs.node-version }}
if: ${{ inputs.package-manager != 'none' }}
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
uses: actions/setup-node@8fccf151e3ba8038c300f83b40c8fd1e94f9c5ce # v7.2.0
with:
node-version: ${{ inputs.node-version }}
cache: ${{ inputs.package-manager }}
+1 -1
View File
@@ -169,7 +169,7 @@ jobs:
- name: Setup Node.js
if: ${{ inputs.package-manager != 'none' }}
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
uses: actions/setup-node@8fccf151e3ba8038c300f83b40c8fd1e94f9c5ce # v7.2.0
with:
node-version: ${{ inputs.node-version-file == '' && inputs.node-version || '' }}
node-version-file: ${{ inputs.node-version-file }}
+1 -1
View File
@@ -35,7 +35,7 @@ jobs:
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup Ruby ${{ inputs.ruby-version }}
uses: ruby/setup-ruby@78c62f2208e480ce3d5ae4dfd9b9e181acf48b63 # v1.344.0
uses: ruby/setup-ruby@7eaac3fe3108dfb746bef3a3c1a21344d57923c7 # v1.348.0
with:
ruby-version: ${{ inputs.ruby-version }}
bundler-cache: true # bundle install + cache automatically
+2 -2
View File
@@ -75,7 +75,7 @@ jobs:
uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1
- name: Setup Node.js ${{ inputs.node-version }}
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
uses: actions/setup-node@8fccf151e3ba8038c300f83b40c8fd1e94f9c5ce # v7.2.0
with:
node-version: ${{ inputs.node-version }}
cache: ${{ inputs.package-manager }}
@@ -138,7 +138,7 @@ jobs:
uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1
- name: Setup Node.js ${{ inputs.node-version }}
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
uses: actions/setup-node@8fccf151e3ba8038c300f83b40c8fd1e94f9c5ce # v7.2.0
with:
node-version: ${{ inputs.node-version }}
cache: ${{ inputs.package-manager }}
+10 -6
View File
@@ -260,7 +260,7 @@ Open questions: <…>
- Move all 13 reusable workflows to `.gitea/workflows/`. Gitea 1.27+ expands reusable workflows server-side (nested calls, inputs, outputs, matrix supported); cross-instance URLs are not supported.
- Apply §3.2 rules to each. Drop macOS/Swift jobs (keep the files for future, disabled with a header comment).
- Replace caller-side assumptions (`github.event.repository.*` fields that Gitea may not populate) with explicit `inputs`. **VERIFY** per workflow.
- Tag releases of the ops repo (`vYYYY.MM.N`) and have callers pin the **commit SHA** of the tag. `v2026.11.1` (2026-11-23) predates the notifier fix; tag the next release after merging, and pin that.
- Tag releases of the ops repo (`vYYYY.MM.N`) and have callers pin the **commit SHA** of the tag. Latest: **`v2026.11.5`** (2026-11-26, `b93b3711b3049a879cfdfd515f7e72c23864da8f`, signed): the release-pipeline notifier names the Velopack apps released from Gitea, and `security.yml` restores .NET on Docker runners without ICU. HashTool and CommandForge pin it; the other migrated repos stay on their tag until their next change.
- How Gitea runs a called workflow (source): it expands the call on the server. `owner/repo/…@ref` reads that repo on this instance, never `DEFAULT_ACTIONS_URL`. `./…` inside a called workflow resolves to the called workflow's own repo and commit, so the ops reusables call each other with `./`. A job-level `if:` sees the caller's `github.event_name`. Called jobs get only the secrets in the caller's `secrets:` map, plus the job token.
- `workflow_run` on Gitea (source): `workflow_run` has no `name` and no `head_commit`, and `head_branch` is empty for tag runs. Use `github.event.workflow.name`, `workflow_run.display_title` (the commit title) and the ref after `@` in `workflow_run.path`. The ops notifiers do.
- `.gitea/workflows/ops-lint.yml` lints every workflow here (actionlint + shellcheck; `.github/actionlint.yaml` ignores only the Gitea features actionlint does not know) and the Python.
@@ -317,7 +317,7 @@ Runner workflow `.gitea/workflows/renovate.yml` in the same repo: runs self-host
**github.com without a token** (nothing GitHub-specific, §3.6). With no github.com token, Renovate skips every `github-tags` / `github-releases` dependency as `github-token-required`, every action pin included. The fix has two parts, and needs both: `RENOVATE_GITHUB_TOKEN_WARN=false` lets those dependencies reach the lookup, and the preset's package rule sends it to `git-tags` (`git ls-remote`, with annotated tags resolved to their commit). The switch alone fails, because `github-tags` asks GitHub's GraphQL API, which refuses unauthenticated calls (403). Measured 2026-11-23 on ticktune's 7 workflows under `.gitea/workflows`: 38 of 38 action pins resolved, no call to `api.github.com`. Still not covered: a `github-releases` dependency fails, visibly on the Dependency Dashboard, and PRs get no release notes from GitHub. Actions pinned to a branch (`@<sha> # main`) go through `github-digest`, which needs the API too; the second rule reads the branch head over git (`git-refs`).
**Vulnerabilities.** OSV alerts open their own PRs, labelled `dependencies` + `security`, without the 3-day release age that holds every other npm, NuGet, crates.io and PyPI update; the Dependency Dashboard lists the open advisories.
**Vulnerabilities.** OSV alerts open their own PRs, labelled `dependencies` + `security`, without the 3-day release age that holds every other npm, NuGet, crates.io, PyPI and pub.dev update (pub.dev joined on 2026-11-27, renovate-config #7, for MarkLens: the block above is the file as first shipped); the Dependency Dashboard lists the open advisories.
**Which repos.** Gitea autodiscovery lists the repos the bot owns or collaborates on, and Renovate keeps the ones it can push to. So add `renovate-bot` as a **Write** collaborator on each repo (`poli0981` is a user, not an org: there are no teams). Create the labels `dependencies` and `security` in each repo: Renovate drops a missing label silently. `maintainer/gitea-repo-setup.ps1` (ops repo) does both steps for every repo; run it with `-DryRun` first. Onboarding stays on. A repo the bot can see without a `renovate.json` gets a "Configure Renovate" PR that proposes `local>poli0981/renovate-config`, because Renovate finds the preset by this repo's name.
@@ -361,6 +361,7 @@ Qodana CLI scan for any stack; replaces `JetBrains/qodana-action`.
- `tools/migration-inventory.py`: the read-only inventory of §3.1.
- `maintainer/gitea-repo-setup.ps1`: for every repo of `poli0981`, add `renovate-bot` as a Write collaborator and create the labels `dependencies` + `security` (`-DryRun`, `-Only`, `-Exclude`). Token: repository Read and Write, issue Read and Write, user Read.
- `maintainer/add-runner.ps1`: register another gitea-runner on the PC, by default the Docker-only runner of D15 (`ubuntu-*` labels, capacity 3, its own folder under `%LOCALAPPDATA%`), and start it at logon once Docker Desktop answers. `-SplitExistingRunner` leaves the first runner the host (`windows`) labels only; run it again to change capacity, labels or the per-job container limits. `-DryRun` first.
- [`migration/`](migration/README.md): per-repo guides, the cron-slot registry, the shared decisions D1–D16 and the `gh` → Gitea API table.
---
@@ -398,7 +399,7 @@ Qodana CLI scan for any stack; replaces `JetBrains/qodana-action`.
- CI on `ubuntu-latest`: install, lint, typecheck, build, test.
- Deploy job on `main`: `wrangler deploy` with `CLOUDFLARE_API_TOKEN`/`CLOUDFLARE_ACCOUNT_ID`. Disconnect Cloudflare's GitHub integration for the project (maintainer, dashboard).
- Scheduled data refresh jobs (e.g. freeitchgames.win catalog): keep as a scheduled workflow, daily, inside 13:00–16:00 UTC (decided: delays when the PC is off are accepted). Update user-facing text that promises a time (e.g. "updated daily around 20:00–23:00 Vietnam time, may be delayed").
- **RepoLens:** its data source was the GitHub API (GraphQL, with the suspended account's token). It moves to the Gitea REST API in its own change after the CI migration: [migration/repolens.md](migration/repolens.md).
- **RepoLens:** its data source was the GitHub API (GraphQL, with the suspended account's token). It reads the Gitea REST API anonymously since 2026-11-26 (v1.6.0); what that took is in [migration/repolens.md](migration/repolens.md).
### 5.4 Chrome extension: WXT + Svelte 5 (BookmarkMagic)
- CI on `ubuntu-latest`: build + zip. Store submission stays manual or uses store API secrets (repo-level).
@@ -479,17 +480,20 @@ None (2026-11-23). A new question goes into [`migration/README.md`](migration/RE
| HashTool | dotnet | ☑ merged 2026-11-26 (Gitea #2) | ☑ | ☑ | ☑ | ☑ 1.3.1 on R2 (`vpk upload s3` win + linux, rclone for `<version>/`), Gitea release by CI | ☑ | `43 13 * * 1` (security), `53 13 * * 4` (qodana) |
| youtube-generator | web + tauri | ☑ merged 2026-11-26 (Gitea #2, #3, #4) | ☑ | ☑ | ☑ | ☑ v1.7.0 on R2, site deployed by the CI `deploy` job | ☑ | `37 13 * * 3` (security), `53 15 * * 1` (rust) |
| youtube-auto-post | python | ☐ | ☐ | ☐ | ☐ | n/a | ☐ | proposed |
| jsonPrism | web + tauri | ☐ | ☐ | ☐ | ☐ | ☐ | ☐ | proposed |
| MarkLens | flutter | ☐ | ☐ | ☐ | ☐ | ☐ | ☐ | proposed |
| jsonPrism | web + tauri | ☑ merged 2026-11-27 (Gitea #2) | ☑ (two Discord webhooks missing, see its guide) | ☑ | ☑ | ☑ v2.3.0 on R2, site deployed by the CI `deploy` job | ☑ | `19 13 * * 5` (security) |
| MarkLens | flutter | ☑ merged 2026-11-27 (Gitea #2, #3) | ☑ | ☑ | ☑ | ☑ v1.1.0 on R2 with the `latest.json` feed, Gitea release by CI | ☑ | `23 15 * * 5` (security) |
| captureimg | dotnet | ☐ | ☐ | ☐ | ☐ | ☐ | ☐ | proposed |
| QuoteAtlas | web + tauri | not on Gitea yet | ☐ | ☐ | ☐ | ☐ | ☐ | proposed |
| AppLedger | dotnet | not on Gitea yet | ☐ | ☐ | ☐ | ☐ | ☐ | proposed |
| WardSweep | rust + dotnet | ☐ | ☐ | ☐ | ☐ | ☐ | ☐ | proposed |
| free-steam-games-list | data + web + tauri | ☑ merged 2026-11-24 (Gitea #1) | ☑ | ☑ | ☑ | ☑ v4.8.0 / apps 2.6.0 on R2 | ☐ | `3 13 * * *` (data-daily), `49 15 * * 2` (security) |
| free-games-itchio-list | data + web + tauri | ☑ merged 2026-11-25 (Gitea #1) | ☑ | ☑ | ☑ | ☑ v4.7.0 on R2 | ☑ | `27 13 * * *` (update), `49 13 * * *` (refresh), `1 15 * * 3` (security) |
| RepoLens | web | ☐ | ☐ | ☐ | ☐ | n/a | ☐ | proposed |
| RepoLens | web | ☑ merged 2026-11-26 (Gitea #2) | ☑ | ☑ | ☑ | ☑ v1.6.0 deployed by the CI `deploy` job | ☑ private (2026-11-27) | `11 13 * * *` (smoke), `33 14 * * 2` (security) |
| content | content (submodule of poli0981-dev) | ☑ main on Gitea 2026-11-24 | n/a | n/a | n/a | n/a | ☑ | none |
| CommandForge | dotnet | ☑ merged 2026-11-26 (Gitea #2, #3) | ☑ | ☑ | ☑ | ☑ v2.3.0 on R2 (`vpk upload s3`), Gitea release by CI | ☑ | `11 14 * * 5` (security) |
| mutevault | rust + extension (new on Gitea, no migration) | ☑ bootstrap merged 2026-12-02 (Gitea #1) | partly: `QODANA_TOKEN` ☑, `DISCORD_CI_WEBHOOK` ☐ (repo or user level) | ☑ | ☑ | n/a until its M5 (Velopack + Store) | ☐ | `57 13 * * 2` (security), `9 14 * * 5` (qodana); `17 15 * * 6` kept for its future fuzz workflow, registered with it |
| reelpilot | python (new on Gitea, no migration) | ☑ CI bootstrap merged 2026-12-03 (Gitea #1) | partly: `QODANA_TOKEN` ☑, `DISCORD_CI_WEBHOOK` ☐ (repo or user level) | ☑ | ☑ | n/a (no releases yet) | ☐ | `39 14 * * 6` (security), `21 15 * * 4` (qodana) |
| mutepeek | rust + GPUI (new on Gitea, no migration) | ☐ bootstrap PR `chore/ci-bootstrap` (Gitea #1), 2026-12-05 | ☐ `QODANA_TOKEN`, `DISCORD_CI_WEBHOOK` | ☑ | ☐ | n/a until its first release (Velopack + Store) | ☐ | `51 14 * * 0` (security), `39 15 * * 3` (qodana); `21 14 * * 6` reserved for its fuzz workflow (0.1) |
| any repo not listed (not inventoried) | | | | | | | | |
The cron slots themselves are registered in [migration/README.md](migration/README.md#cron-slots-utc--the-registry).
+20 -9
View File
@@ -39,16 +39,19 @@ For a repo without a guide, the same prompt works with only the runbook: §3.1 s
| `HashTool` (`E:\hash`) | Avalonia/.NET 10 + NativeAOT CLI, Velopack win/linux (osx dropped) | **Done.** Merged 2026-11-26 (Gitea #2); 1.3.1 released to R2 | [hashtool.md](hashtool.md) |
| `youtube-generator` (`E:\youtube`) | web (Workers) + Tauri + Android | **Done.** Merged 2026-11-26 (Gitea #2, #3, #4); v1.7.0 released to R2, the site deployed by the CI `deploy` job | [youtube-generator.md](youtube-generator.md) |
| `youtube-auto-post` | Python bot on a schedule | not started | [youtube-auto-post.md](youtube-auto-post.md) |
| `jsonPrism` | web + API (Workers) + Tauri + Android | not started | [jsonprism.md](jsonprism.md) |
| `MarkLens` (`E:\marklens`) | Flutter desktop (Windows, Linux) | not started | [marklens.md](marklens.md) |
| `jsonPrism` | web + API (Workers) + Tauri + Android | **Done.** Merged 2026-11-27 (Gitea #2); v2.3.0 released to R2, the site deployed by the CI `deploy` job | [jsonprism.md](jsonprism.md) |
| `MarkLens` (`E:\marklens`) | Flutter desktop (Windows, Linux) | **Done.** Merged 2026-11-27 (Gitea #2, #3); v1.1.0 released to R2 with the `latest.json` update feed, the first Flutter repo; maintenance mode | [marklens.md](marklens.md) |
| `captureimg` (`E:\capture\captureimg`) | .NET/WPF, Velopack | not started | [captureimg.md](captureimg.md) |
| `QuoteAtlas` (`E:\qoute`) | web + Tauri + Android | **not on Gitea yet** (origin is still GitHub) | [quoteatlas.md](quoteatlas.md) |
| `AppLedger` (`E:\appledger`) | .NET/WPF, Velopack, never released | **not on Gitea yet** (origin is still GitHub) | [appledger.md](appledger.md) |
| `WardSweep` (`E:\wardsweep`) | Rust broker + .NET/WPF UI, Velopack | not started | [wardsweep.md](wardsweep.md) |
| `free-steam-games-list` (`E:\2`) | Python data pipeline + SvelteKit on Workers + Tauri + Android | **Done.** Data restored 2026-11-24 (49 GitHub-only data commits pushed, the Worker reads Gitea); migration merged as Gitea #1; v4.8.0 / apps 2.6.0 released to R2 | [free-steam-games-list.md](free-steam-games-list.md) |
| `free-games-itchio-list` (`E:\game`) | Python data pipeline + React on Workers + Tauri + Android | **Done.** Catalog restored 2026-11-24 from the live site (+235 games); migration merged as Gitea #1; v4.7.0 released to R2 | [free-games-itchio-list.md](free-games-itchio-list.md) |
| `RepoLens` (`E:\repo`) | SvelteKit on Workers, data from the GitHub API | not started; **the site has no data source** | [repolens.md](repolens.md) |
| `RepoLens` (`E:\repo`) | SvelteKit on Workers, data from the Gitea API | **Done.** Merged 2026-11-26 (Gitea #2); deployed by the CI `deploy` job, v1.6.0; repository private on Gitea | [repolens.md](repolens.md) |
| `CommandForge` (`E:\cmd`) | .NET/WPF, Velopack | **Done.** Merged 2026-11-26 (Gitea #2, #3); v2.3.0 released to R2, the first Velopack app there | [commandforge.md](commandforge.md) |
| `mutevault` (`E:\mutevault`) | Rust + GPUI desktop and a WXT extension, Velopack + Microsoft Store; pre-implementation | **Born on Gitea**, nothing to migrate. Bootstrap (workspace + CI) merged 2026-12-02 (Gitea #1). Its CI and Git rules are its own `docs/15_BUILD_RELEASE.md` §4 and §14, calling this repo at v2026.11.5 | — |
| `reelpilot` (`E:\reelpilot`) | Python (stdlib only, runs on DaVinci Resolve's ResolvePython) | **Born on Gitea**, nothing to migrate. CI bootstrap merged 2026-12-03 (Gitea #1): local `CI` (ruff, mypy, pytest 3.11/3.14/3.15, `ci-ok`) plus the ops security scan and Qodana at v2026.11.5 | — |
| `mutepeek` (`E:\mutepeek`) | Rust + GPUI read-only file previewer, Velopack + Microsoft Store; pre-implementation | **Born on Gitea**, nothing to migrate. Bootstrap (workspace + CI) through PR `chore/ci-bootstrap` (Gitea #1), 2026-12-05. Its CI and Git rules are its own `docs/15_BUILD_RELEASE.md` §4 and `docs/15c_FORGE_GIT.md` §14, calling this repo at v2026.11.5 | — |
| any repo not listed | — | not inventoried | run the inventory |
## Cron slots (UTC) — the registry
@@ -58,9 +61,9 @@ Every scheduled workflow gets its own slot inside 13:00–16:00 UTC (runbook §3
| Slot (UTC) | Days | Repo · workflow | Status |
|---|---|---|---|
| 13:03 | daily | free-steam-games-list · data-daily | live |
| 13:11 | daily | RepoLens · production smoke | proposed |
| 13:11 | daily | RepoLens · production smoke | live |
| 13:17 | daily | softharbor · quarantine | live |
| 13:19 | Fri | jsonPrism · security | proposed |
| 13:19 | Fri | jsonPrism · security | live |
| 13:23 | daily | pipdock · security-scan | proposed |
| 13:27 | daily | free-games-itchio-list · update (ingest) | live |
| 13:31 | daily | renovate-config · renovate | live |
@@ -69,21 +72,26 @@ Every scheduled workflow gets its own slot inside 13:00–16:00 UTC (runbook §3
| 13:47 | daily | pipdock · ci-integration (nightly) | proposed |
| 13:49 | daily | free-games-itchio-list · refresh | live |
| 13:53 | Thu | HashTool · qodana | live |
| 13:57 | Tue | mutevault · security (workflow lint + ops caller in one workflow) | live |
| 13:59 | daily | softharbor · vt-recheck | live |
| 14:07 | Sun | .github · weekly-digest | live |
| 14:09 | Fri | mutevault · qodana | live |
| 14:11 | Fri | CommandForge · security (workflow lint + ops caller in one workflow) | live |
| 14:13 | Wed | poli0981-dev · security | live |
| 14:17 | Mon | captureimg · docs (external links) | proposed |
| 14:19 | Thu | pipdock · security (ops caller, D4) | proposed |
| 14:21 | Sat | mutepeek · fuzz (added with fuzz.yml in 0.1) | reserved |
| 14:23 | Sat | OmniDeck · security | proposed |
| 14:27 | Mon | WardSweep · dependency audit | proposed |
| 14:29 | daily | tilepier · e2e | proposed |
| 14:31 | Thu | AppLedger · security | proposed |
| 14:33 | Tue | RepoLens · security | proposed |
| 14:33 | Tue | RepoLens · security | live |
| 14:37 | Mon | ticktune · audit | live |
| 14:39 | Sat | reelpilot · security (workflow lint + ops caller in one workflow) | live |
| 14:41 | Fri | frameledger · security | proposed |
| 14:43 | Mon | softharbor · link-check | live |
| 14:47 | daily | youtube-auto-post · notify (YA1) | proposed |
| 14:51 | Sun | mutepeek · security (workflow lint + ops caller in one workflow) | live |
| 14:53 | Tue | pipdock · ci-integration (weekly fixtures) | proposed |
| 14:59 | Sun | bookmarkmagic · security | proposed |
| 15:01 | Wed | free-games-itchio-list · security | live |
@@ -91,10 +99,13 @@ Every scheduled workflow gets its own slot inside 13:00–16:00 UTC (runbook §3
| 15:07 | Thu | tilepier · security | proposed |
| 15:11 | Sat | captureimg · security | proposed |
| 15:13 | Mon | ticktune · qodana | live |
| 15:23 | Fri | MarkLens · security | proposed |
| 15:17 | Sat | mutevault · fuzz (added with its fuzz workflow) | reserved |
| 15:21 | Thu | reelpilot · qodana | live |
| 15:23 | Fri | MarkLens · security (workflow lint + ops caller in one workflow) | live |
| 15:29 | Wed | ticktune · security | live |
| 15:33 | Sun | QuoteAtlas · security | proposed |
| 15:37 | Tue | softharbor · security | live |
| 15:39 | Wed | mutepeek · qodana | live |
| 15:41 | Mon | bookmarkmagic · qodana | proposed |
| 15:47 | Thu | youtube-auto-post · security | proposed |
| 15:49 | Tue | free-steam-games-list · security | live |
@@ -120,14 +131,14 @@ D1 is the maintainer's. D2–D16 were decided by the agent on the maintainer's i
| D12 | Code that **writes** to a repo at runtime through a GitHub App or token (poli0981-dev admin, free-steam-games-list and free-games-itchio-list Workers) | **The Gitea API with a token of the bot user `poli0981-bot`**, a collaborator with write access on exactly the repos it writes (`poli0981-dev`, `content`, `free-steam-games-list`, `free-games-itchio-list`), token scope `write:repository`, stored as a Worker secret. Several files in one commit: `POST /repos/{owner}/{repo}/contents` with each file's current `sha`, which is the optimistic lock that replaces `createCommitOnBranch`'s `expectedHeadOid` (**VERIFY** that a stale `sha` is refused with 409/422; the Workers' retry loops depend on it). A push by this user is a real user's push, so it starts workflows (ingest jobs) as the GitHub App's did. Commits are unsigned unless Gitea's server-side signing is set up; nothing requires it |
| D13 | Code that **reads** repo data at runtime (raw files, commits, releases, activity) | **Gitea without a token**: raw files at `https://git.poli0981.dev/poli0981/<repo>/raw/branch/main/<path>` (or `GET /repos/{owner}/{repo}/raw/{path}?ref=main`), and the REST API for the rest. The repos are public; the Workers keep their caches, so each new file version is fetched once per data centre |
| D14 | Public bug-report endpoints that opened GitHub issues (poli0981-dev, RepoLens) | **Issues on the GitLab mirror** through `POST /api/v4/projects/:id/issues`. The token is a project access token if the GitLab.com plan allows one, else a personal access token of a GitLab bot account with the Reporter role (scope `api`). Either expires within a year: note the date in the hand-off. When the call fails, the endpoint tells the reader to e-mail `code@` instead |
| D15 | Runner time: the two catalog pipelines need about four runner-hours a day, more than one job slot holds inside 13:00–16:00 next to the other repos' schedules | **A second runner registration on the PC with Docker labels only** (`ubuntu-latest`, `ubuntu-24.04`, `ubuntu-22.04`), capacity 1. Host-mode (`windows-latest`) jobs stay one at a time on the first runner; a long data job no longer blocks a Windows build. The data pipelines also run once a day with smaller time budgets (their guides). If the PC is off, the day's runs wait and catch up when it comes back (runbook §7 item 4) |
| D15 | Runner time: the two catalog pipelines need about four runner-hours a day, more than one job slot holds inside 13:00–16:00 next to the other repos' schedules | **A second runner registration on the PC with Docker labels only** (`ubuntu-latest`, `ubuntu-24.04`, `ubuntu-22.04`), capacity 3 by default (raise it with the RAM Docker gets), set up by `maintainer/add-runner.ps1`. Host-mode (`windows-latest`) jobs stay one at a time on the first runner; a long data job no longer blocks a Windows build. The data pipelines also run once a day with smaller time budgets (their guides). If the PC is off, the day's runs wait and catch up when it comes back (runbook §7 item 4) |
| D16 | Sites that bundle their data at build time (free-games-itchio-list): a data commit pushed with the job token starts no workflow, so no deploy | **The data workflow dispatches `deploy.yml`** after a successful commit (job token, `actions: write`). `deploy.yml` keeps `push` for code changes |
## Maintainer steps, once for all repos
1. Add your GPG public key to the Gitea account, so `https://git.poli0981.dev/poli0981.gpg` serves it (the pilot's tag check, OmniDeck's OD3).
2. Create the user `poli0981-bot` on Gitea (registration is off: Site Administration), add it as a Write collaborator on the four repos of D12, and create its token (`write:repository`). The token goes into each Worker as a secret during that repo's hand-off.
3. Register the second runner on the PC with Docker labels only (D15).
3. Register the second runner on the PC with Docker labels only (D15): `maintainer/add-runner.ps1 -DryRun`, then `-SplitExistingRunner` so the first runner keeps the `windows` labels only.
4. The GitLab issue token of D14, with its expiry date written down.
5. In the Cloudflare dashboard, disconnect Workers Builds' GitHub integration of every project the migrated repos deploy (D3).
6. The announcement (runbook §7 item 5): one post on poli0981.dev and the Discord announcement.
+2 -2
View File
@@ -6,8 +6,8 @@
commits, with the release commit), tagged and released as **v2.3.0**: Velopack feed and packages on
`releases.poli0981.dev/commandforge/`, `2.3.0/SHA256SUMS` and a CycloneDX SBOM next to them, a Gitea release with the
notes and links, announced through the ops `announce-release.yml` (pinned at ops v2026.11.4, `c133a00`). #3 corrected
two docs details the release showed. Renovate's onboarding PR #1 was closed: #2 adds `renovate.json`. What the move
found:
two docs details the release showed; #4 moved the ops pins to v2026.11.5, whose notifier names CommandForge a Velopack
app. Renovate's onboarding PR #1 was closed: #2 adds `renovate.json`. What the move found:
- **`vpk … s3` works against R2 as the runbook guessed** (vpk 1.2.161): `VPK_BUCKET`, `VPK_PREFIX=commandforge/`,
`VPK_ENDPOINT=https://<account>.r2.cloudflarestorage.com` and the keys, no region, default checksums. vpk reads every
+2 -2
View File
@@ -9,8 +9,8 @@ dispatched Release workflow. Renovate's onboarding PR #1 was closed (#2 adds `re
- **The runner's Ubuntu images have no ICU.** Every .NET process died at start-up ("Couldn't find a valid ICU
package"). Jobs that run the tests or the app install `libicu-dev`; jobs that only restore, build or run tools set
`DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1`. The ops `security.yml` NuGetAudit job had the same problem on its default
`ubuntu-latest` (fixed in this repo, effective from the next ops tag); HashTool calls it with
`dotnet-runs-on: windows-latest`.
`ubuntu-latest`; fixed in ops v2026.11.5, which HashTool pins since #3 (its NuGetAudit job runs on the default
`ubuntu-latest` again).
- **Avalonia 12.2's XAML compiler names generated types and methods with U+0001.** Microsoft.CodeCoverage's Cobertura
writer cannot put that into XML: all tests passed, then the test host crashed (exit -532462766). A plain
`dotnet test` does not show it; CI's `--coverage` does. `eng/coverage.config` limits coverage to HashTool.Core, the
+50
View File
@@ -2,6 +2,56 @@
> Written 2026-11-23 against `main` @ `9923c4c`. Profile: React/Vite web app + API Worker on Cloudflare (`jsonprism.poli0981.dev`) + Tauri 2 desktop (no updater) + Android APK (runbook §5.2, §5.3). Maintenance mode. Shared decisions: [README](README.md).
**Done 2026-11-27.** The migration, the dependency refresh and the release commit merged together as Gitea #2
(`aab4b89`, 7 commits); the CI `deploy` job put the site live and **v2.3.0** went to R2 (Windows, Linux, Android; no
macOS, D9). Renovate's onboarding PR (#1) was closed: #2 adds `renovate.json` with this repo's rules. What the move
found:
- **Gitea's `main` matched `github/main`** (`9923c4c`, the 2.2.1 release): nothing to restore. Until #2 merged, the
GitHub-era `maintenance-triage.yml` still ran from `main` on `pull_request_target` (owner PRs: skipped).
- **The runner did not come up at logon**: the scheduled task "Gitea Runner" started before Docker Desktop and the
daemon exited with "Docker Engine socket not found and docker_host config was invalid" (07:08 local); queued jobs
of every repo waited until `Start-ScheduledTask 'Gitea Runner'` once Docker was up (the first retry, a few seconds
later, still failed). With capacity 1, #2's first checks waited ~30 min behind free-games-itchio-list's ingest and a
RepoLens PR.
- **SSH push refused, HTTPS works**: `ssh://git@git.poli0981.dev:2222/…` answers "Permission denied (publickey)"
from the agent's shell on the PC, while `https://git.poli0981.dev/…` pushes through Git Credential Manager (one
transient "Failed to authenticate user" on a branch delete, fine on retry). The session pushed by URL and left the
`origin` remote as it was.
- **Two Discord secrets were not carried over**: the repo had `DISCORD_RELEASES_WEBHOOK` and `DISCORD_REPO_WEBHOOK`
but not `DISCORD_CI_WEBHOOK` or `DISCORD_RELEASE_PIPELINE_WEBHOOK` (youtube-generator has both).
`discord_notify.py` exits 1 without its webhook, so the release-pipeline notifier fails after every tag run until
they exist; `DISCORD_PING_ROLE_ID` is optional.
- **Renovate's onboarding preview** showed two proposals this repo cannot take: `ubuntu` 26.04 (it reads `runs-on:`
labels with the `github-runners` datasource, but the labels are the PC runner's) and JDK 25. `renovate.json`
disables `github-runners`, `node`/`java-jdk`, and the `gradle`/`gradle-wrapper` managers (the committed Tauri
Android project). The OSV alert it raised, kotlin-gradle-plugin 1.9.25 → 2.4.20 (CVE-2026-53914, moderate,
unsafe deserialization of the Kotlin build cache), waits for Tauri's template with the reason in `renovate.json`;
the release job never shares or restores a build cache.
- **Security on the first run**: Opengrep, osv-scanner and cargo-deny passed after the refresh (`url` 2.5.9,
`cookie` 0.18.3 taken; the six Tauri-stack advisories nobody fixes yet in `src-tauri/osv-scanner.toml`, as
youtube-generator). gitleaks found one non-secret, the Web Analytics beacon token in `src/lib/analytics.ts`, in
`.gitleaksignore`. `npm audit`: 0 — typescript-eslint 8.74 moved to minimatch 11, which closed the last GitHub-era
alert (GHSA-g3hv-75wg-m249).
- **Release dry run from the branch** (web route `POST /{owner}/{repo}/actions/run?workflow=release.yml`,
`ref=refs/heads/chore/gitea-migration`, as youtube-generator): verify, Windows (~6 min on the host), Linux
(`ubuntu-22.04`, ~9 min) and Android (~7 min, SDK + NDK 27.2 installed in the job) all green on the first try.
Unlike youtube-generator, this repo's committed `gen/android` `BuildTask.kt` runs the **npm** Tauri CLI, so no
`cargo install tauri-cli` is needed. The APK's signer certificate SHA-256 is `fef0029e…b645`; the keystore on the PC
(`E:\jsonprism-release.jks`) is PKCS12 with alias `jsonprism`, which `keytool` will not list without its password,
so the maintainer should confirm it matches the 2.2.1 APK's.
- **Production smoke as a reusable**: `production-smoke.yml` is `workflow_call` + `workflow_dispatch`, and `ci.yml`'s
`smoke` job calls it with `uses: ./.gitea/workflows/production-smoke.yml` after `deploy`, the pattern
free-games-itchio-list uses for its notifier. The first `deploy` (run 795) put `aab4b89` live; the same checks by
hand passed while the `smoke` job still queued behind Qodana.
- **The keystore alias is a secret, so the logs hide the app's name**: `ANDROID_KEY_ALIAS` is `jsonprism`, and the
runner masks secret values in the run's logs, so even the `assemble` job (which gets no secret) shows `***` for
"jsonprism" (`releases.poli0981.dev/***/2.3.0/…`). The files and notes are right; only the logs read oddly.
- **One runner, many queues**: the PR's Qodana Rust run (Docker Desktop, cold cache) would have held the `deploy` job
for ~25 minutes after the merge; it was cancelled, since the push to `main` runs the same scan.
- **GnuPG on the PC**: the first signed commit failed with "sending fd … to keyboxd: Input/output error" although the
signature was made; `gpgconf --kill keyboxd` fixed it.
## Decided (2026-11-23)
- D3: a deploy job with `wrangler deploy`, and `production-smoke.yml` runs after it. D9: no macOS bundles. D10: the Android SDK is installed in the job. D11: `pages-redirect.yml` and `announce-discussion.yml` go.
+55
View File
@@ -2,6 +2,61 @@
> Written 2026-11-23 against `main` @ `2d33b1c` (local clone `E:\marklens`, Gitea `poli0981/MarkLens`). Profile: Flutter desktop app (Windows installer via Inno Setup, Linux package), with an in-app update check. Docs 11 and 14 describe packaging and CI. Shared decisions: [README](README.md).
**Done 2026-11-27**, the first Flutter repo. The migration merged as Gitea #2 (9 commits) and #3 stacked on it (the
remote-badge fix, Flutter 3.50.1, maintenance mode and the release commit), both by fast-forward in the UI (every
commit stays signed); tagged and released as **v1.1.0**: the four artefacts and `SHA256SUMS` under
`releases.poli0981.dev/marklens/1.1.0/`, the update feed `marklens/latest.json` uploaded last, a Gitea release with the
notes and links, published (not a draft). Renovate's onboarding PR #1 was closed: #2 adds `renovate.json`. #4 ticked
the release checklist. What the move found:
- **Flutter has no setup action that fits host mode.** `subosito/flutter-action`'s steps are `shell: bash`, which on
the host-mode Windows runner can resolve to WSL's `bash.exe`. `tool/ci/install-flutter.{sh,ps1}` download the
pinned archive from `storage.googleapis.com`, check a SHA-256 pinned in `tool/ci/flutter.env` (copied from Google's
`releases_<os>.json`, not fetched beside the archive), and unpack it into `$RUNNER_TOOL_CACHE` (else
`%LOCALAPPDATA%\gitea-runner\toolcache`): once per version, never system-wide on the PC. A release passes
`--fresh`/`-Fresh` (job temp dir, no shared cache). The PC has `LongPathsEnabled=1`, which the SDK needs (its
deepest relative path is ~186 characters). Flutter runs as root in the Docker jobs with only a warning.
- **The Linux floor is a runner label again.** The GitHub release built the `.deb` and AppImage with `docker run -v
"$PWD:/src"` inside the job; from inside the runner's own container that mounts a host path, not the checkout.
`runs-on: ubuntu-22.04` *is* the build machine here (the runner's image), so the job installs
`tool/linux/Dockerfile`'s packages there and a repo test holds the label and the Dockerfile's `FROM` together. The
goldens, made in an `ubuntu:24.04` container, match byte for byte on the runner's `ubuntu-24.04` image.
- **Renovate would have moved the floor.** The onboarding PR listed "update dependency ubuntu to v26" (the
Dockerfiles' base images), and the `github-runners` datasource proposes newer `runs-on` labels. MarkLens's
`renovate.json` disables both for Ubuntu: 22.04 is its glibc floor, 24.04 its goldens' image. **Any repo that pins
an Ubuntu label on purpose (youtube-generator's `ubuntu-22.04` floor) wants the same rule**; a candidate for the
preset. Also local: `constraints.flutter` (the SDK Renovate's lockfile updates install), and holds on
`desktop_drop` < 0.9 (a `cross_file` wall) and `window_manager` < 0.6 (a nativeapi rewrite, held by decision).
**pub joined the preset's 3-day release-age rule** (renovate-config #7): pub.dev reports `published`.
- **The update feed (D8).** `tool/release/release_files.py` writes `latest.json` — `{app, version, tag, published,
page, files[{name, url, sha256, size}], sha256sums}` — and the release notes from CHANGELOG. The app reads
`version` and `page`, and opens `page` only on `git.poli0981.dev` / `releases.poli0981.dev` (the GitHub version
opened any `html_url`). The Gitea release is published, not a draft: the banner links to it, and a draft is a 404
for everyone else. So the tag is the release decision, and the person's checks moved before it (doc 15).
`latest.json` answers with `cf-cache-status: DYNAMIC`.
- **First CI run, two reds, neither in the code.** gitleaks (full history) flagged `sonar.projectKey=…` in the
deleted `sonar-project.properties` as `generic-api-key`; `.gitleaksignore` records that fingerprint, as softharbor's
does. The golden job died in `apt-get` on one failed DNS lookup of `archive.ubuntu.com` from the runner's Docker
network; every `apt-get` now runs with `-o Acquire::Retries=5`. osv-scanner reads `pubspec.lock` (green).
- **The tag run lost its Windows artifact** to `Failed to CreateArtifact … Request timeout` (all 5 attempts) after a
good build; nothing had been published, and "Re-run failed jobs" finished the chain with the Linux artifact kept.
- **Timings on the single runner**: a PR round ~25 min once it starts (`CI` + `Security`); the release rehearsal's
build jobs 6 min (Windows, host) and 4.7 min (Linux), assemble 30 s. A PR stacked on another was the cheaper
path: the lower PR's runs were cancelled and the upper one's CI covered both before both fast-forwarded.
- **Enabling Actions on 28.4.0** is Settings → Actions → General → "Enable Repository Actions" (not in the Advanced
settings list; `/settings/actions` 404s until it is on).
- **Branch protection on `main`** (D6): no push, no force push, administrators included; required checks
`CI / ci-ok (*)`, `Security / workflow-lint (*)`, `Reusable / Security / Secrets (gitleaks) (*)`,
`Reusable / Security / Dependencies (osv-scanner) (*)`. Default merge style: fast-forward only.
- **Installs of 1.0.0–1.0.2** ask `api.github.com/repos/poli0981/MarkLens/releases/latest`, now 404, silently by
design: README, SECURITY.md, the CHANGELOG and the release notes tell them to install 1.1.0 once by hand.
- **WinGet is paused**: winget-pkgs PRs come from a GitHub fork, and the pending 1.0.1 submission (#439835) points at
dead GitHub downloads. `tool/winget/` is unchanged.
- **Contacts**: CLAUDE.md said to leave `{{CONTACT_EMAIL}}` for the maintainer; this guide decided
`security@`/`code@poli0981.dev`, and the runbook wins for migration topics. Reported in #2; CLAUDE.md updated.
- **Not done**: no Discord announcement (MarkLens has no Discord webhooks; three secrets and one
`announce-release.yml` caller would add it); the listings (SoftHarbor, poli0981.dev) still link GitHub.
## Decided (2026-11-23)
- **D8 — the update check:** a `latest.json` (version + download URLs) at `releases.poli0981.dev/marklens/latest.json`, uploaded last by each release (a `*.json` name, so the cache is bypassed); `update_service.dart` reads it. Not the Gitea API: the app stays off the forge, like every other app. `legal/PRIVACY.md` names the new host: it is a privacy statement, not just a doc.
+51 -1
View File
@@ -2,7 +2,57 @@
> Written 2026-11-23 against `main` @ `ed91e72` (local clone `E:\repo`, Gitea `poli0981/repolens`). Profile: SvelteKit 3 on one Cloudflare Worker (`repolens.poli0981.dev`), a showcase of the maintainer's repositories read from the GitHub API, with a Cron Trigger (`*/10 * * * *`) that warms the cache. Maintenance mode since v1.5.0. Shared decisions: [README](README.md).
**The site has no data source.** Every repo it shows came from GitHub's GraphQL API with `GITHUB_TOKEN_READ`, a token of the suspended account; bug reports opened GitHub issues with `GITHUB_TOKEN_ISSUES`; the webhook was GitHub's. Restoring it is a website incident, which maintenance mode takes.
**Done 2026-11-26.** The migration merged as Gitea #2 (fast-forward to `35b5926`, 9 commits: CI, Renovate, RL1–RL4,
templates, docs), the CI `deploy` job put it live (version `475c73d8`, custom domain and the `*/10` cron applied),
and **v1.6.0** followed with the dependency refresh (Gitea #3, #4). The site reads Gitea again: 24 public repos, the
production smoke 7/7. Renovate's onboarding PR #1 was closed (#2 adds `renovate.json`). What the move found:
- **The repository went private on Gitea** (the owner's choice: `LICENSE` carries an internal relicensing note that
must not be public). Outside contributions arrive by e-mail. Renovate and the runner keep working (`renovate-bot`
is a collaborator). **Its GitLab push mirror** (added 2026-11-27, also where the confidential bug reports land) was
created **public**, which exposed the private source and that note; it was switched to private the same day. For a
private Gitea repo, check the mirror's visibility right after creating it.
- **Anonymous reads (D13) settled the VERIFY items:** `GET /repos/{o}/{r}/licenses` answers (the list and repo objects
carry `licenses` too, which can include `README`); `GET …/actions/runs` answers 401 without a token, so the build
badge reads the head commit's statuses (`GET …/commits/{sha}/status`, anonymous, one per job, latest per context,
`target_url` relative). `GET …/actions/tasks` is anonymous as well.
- **No ETag, no rate-limit headers** (`Cache-Control: max-age=0, private` on every answer). RepoLens keeps each
sub-resource with a validator instead: the repo's `updated_at` (any push moves it, Renovate's branches included)
or the head sha. A quiet list refresh is one request; a cold one 1 + 4 per repo.
- **No `pushed_at`:** the default branch's head commit time is the last push. Times carry the committer's offset
(`+07:00`): normalise to UTC before comparing ISO strings. Stars and forks are always 0 without registration (hidden),
and there are no deployments or language colours.
- **Webhook (RL3):** Gitea signs with `X-Gitea-Signature` (hex HMAC-SHA256, no prefix) and also sends GitHub-style
headers (read from `services/webhook/deliver.go`). The system webhook form (Site Administration → Integrations →
Webhooks → System Webhooks) names the events Create, Delete, Push, Repository, Release, **Statuses** and
**Workflow Run**. Gitea sends no ping, rename, transfer or visibility events.
- **Bug reports (RL2, D14):** `GITLAB_TOKEN_ISSUES` is optional on purpose: without it the endpoint answers 503 and the
dialog offers `code@` (no deploy waits on a GitLab token). The token set on 2026-11-26 has the **Guest** role: GitLab
files a Guest's confidential issue but silently drops its labels, so Reporter is the role to pick. It **expires
2027-11-26** (RepoLens docs/11 §H).
- **System webhook (live 2026-11-27, admin hook #1):** system hooks have no Test Delivery button, so the first real
events checked it (`npx wrangler tail repolens --format json --search webhook`): a push and two commit statuses of
free-games-itchio-list answered `202`, refreshed the list and the detail in ~2.5 s with 13 requests, and the burst's
later deliveries rode along.
- **e2e in the job container:** binding `wrangler dev` and Playwright to `127.0.0.1` (runbook §6) was enough; chromium
and webkit both ran. One PR's CI took ~10 minutes on the single runner (verify 55 s, e2e 2 min 44 s, Qodana
2 min 48 s).
- **Merging in the UI:** "Fast-forward only" keeps the signed commits; a UI merge commit is unsigned. Until #2 merged,
`main`'s GitHub-era `maintenance-triage.yml` still ran on the PR (`pull_request_target` reads the base branch).
- **Branch protection (D6):** no push, no force push; required `CI / verify (*)`, `CI / e2e (*)`,
`Security / npm-audit (*)`, `Reusable / Security / Secrets (gitleaks) (*)`,
`Reusable / Security / Dependencies (osv-scanner) (*)`.
- **adapter-cloudflare 9** builds through `@cloudflare/vite-plugin` and refuses a `main` in `wrangler.jsonc`: RepoLens's
`withScheduled` cron entry needs a redesign before it can move (left on 8.0.3). Other SvelteKit Workers with a
Cron Trigger will meet the same wall.
- **On the PC:** GPG signing failed with "sending fd … to keyboxd" until `gpgconf --kill keyboxd` of **Gpg4win** (git's
`gpg.program`), not Git Bash's `gpgconf`.
- **Done by the maintainer by 2026-11-27:** the GitLab project + `GITLAB_TOKEN_ISSUES`, the system webhook +
`GITEA_WEBHOOK_SECRET`, the dead `GITHUB_*` Worker secrets deleted. **Still open:** disconnecting Workers Builds,
Qodana Cloud's VCS URL, and every repo's description/website/topics on Gitea (all empty after the import; RepoLens
shows them once set).
**Before the move:** the site had no data source. Every repo it showed came from GitHub's GraphQL API with `GITHUB_TOKEN_READ`, a token of the suspended account; bug reports opened GitHub issues with `GITHUB_TOKEN_ISSUES`; the webhook was GitHub's. Restoring it is a website incident, which maintenance mode takes.
## Decided (2026-11-23)
+499
View File
@@ -0,0 +1,499 @@
#Requires -Version 7.0
<#
.SYNOPSIS
Dang ky them mot gitea-runner tren PC nay (mac dinh: runner chi chay Docker, cho cac nhan
ubuntu-*) va cho no tu chay khi dang nhap, sau khi Docker Desktop da san sang
(docs/migration/README.md, D15).
.DESCRIPTION
Script lam, theo thu tu:
1. Tim runner dang co (exe + config.yaml): qua tien trinh gitea-runner dang chay, neu khong
thi qua scheduled task -ExistingTaskName (chay exe truc tiep hoac qua script .ps1), hoac
lay tu -RunnerExe / -ExistingConfig. Khong tim duoc thi in ra nhung gi thay duoc.
2. Tao -Dir va viet config.yaml rieng cho runner moi: capacity, timeout, nhan, cache.dir va
host.workdir_parent rieng (hai runner khong dung chung DB cua cache server);
docker_host va network chep tu config cu neu co (cau hinh Docker Desktop dang chay duoc).
3. Dang ky runner voi Gitea. Token duoc hoi khi chay, khong luu o dau ca. Bo qua neu -Dir da
co .runner: chay lai script de doi capacity / nhan / gioi han container la an toan.
4. Viet run-runner.ps1 (doi 'docker info' thanh cong roi moi chay daemon, log ra runner.log,
daemon thoat thi 30 giay sau chay lai) va tao scheduled task -TaskName chay luc dang nhap.
5. Neu co -SplitExistingRunner: bo cac nhan docker (ubuntu-*) khoi config.yaml cua runner cu
(sao luu truoc), de runner cu chi nhan job windows-latest (host mode), roi khoi dong lai no.
Thu muc mac dinh nam trong %LOCALAPPDATA% (chi user nay doc duoc): .runner trong do chua token
cua runner.
Token dang ky: https://git.poli0981.dev/user/settings/actions/runners > Create new runner.
Dung dan token vao dong lenh (lich su shell giu lai): script se hoi.
Khoi dong lai mot runner se NGAT job dang chay tren no: script hoi truoc (bo qua bang -Yes).
Cap nhat gitea-runner.exe sau nay: dung CA HAI task truoc, vi hai runner dung chung mot exe.
Chay -DryRun truoc de xem se lam gi.
.EXAMPLE
.\add-runner.ps1 -DryRun
.\add-runner.ps1 -Capacity 3
.\add-runner.ps1 -Capacity 3 -SplitExistingRunner
.\add-runner.ps1 -Capacity 4 -ContainerOptions '--memory=8g --cpus=4' # chay lai: chi doi config + restart
#>
[CmdletBinding()]
param(
[string] $Instance = 'https://git.poli0981.dev',
[string] $Name = "$($env:COMPUTERNAME.ToLowerInvariant())-docker",
[string] $Dir = (Join-Path $env:LOCALAPPDATA 'gitea-runner-docker'),
[ValidateRange(1, 16)]
[int] $Capacity = 3,
[string[]] $Labels = @(),
[string] $ContainerOptions = '--memory=8g --cpus=4',
[string] $Timeout = '3h',
[string] $TaskName = 'Gitea Runner (Docker)',
[string] $ExistingTaskName = 'Gitea Runner',
[string] $RunnerExe = '',
[string] $ExistingConfig = '',
[switch] $SplitExistingRunner,
[switch] $NoTask,
[switch] $Yes,
[switch] $DryRun
)
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
# Nhan mac dinh, giong runbook section 1 (Runner labels). Chi dung khi -Labels rong va config cu
# khong co nhan docker nao de chep.
$DefaultLabels = @(
'ubuntu-latest:docker://docker.gitea.com/runner-images:ubuntu-latest',
'ubuntu-24.04:docker://docker.gitea.com/runner-images:ubuntu-24.04',
'ubuntu-22.04:docker://docker.gitea.com/runner-images:ubuntu-22.04'
)
$Utf8NoBom = [System.Text.UTF8Encoding]::new($false)
function Write-Step([string]$Msg) { Write-Host "`n==> $Msg" -ForegroundColor Green }
function Write-Info([string]$Msg) { Write-Host " $Msg" }
function Write-Warn([string]$Msg) { Write-Host "[!] $Msg" -ForegroundColor Yellow }
# Chuoi YAML trong nhay don: dau \ giu nguyen (duong dan Windows), dau ' viet thanh ''.
function ConvertTo-YamlString([string]$Value) { "'" + ($Value -replace "'", "''") + "'" }
function Write-TextFile([string]$Path, [string]$Text) {
if ($DryRun) { Write-Info "(dry run) se ghi $Path"; return }
[System.IO.File]::WriteAllText($Path, $Text, $Utf8NoBom)
}
function Confirm-Step([string]$Question) {
if ($Yes -or $DryRun) { return $true }
$answer = Read-Host "$Question (y/N)"
return ($answer -match '^(y|yes|c|co)$')
}
# Duong dan tuyet doi co that, hoac duong dan tuong doi tim trong cac thu muc goc; khong thay: $null.
function Resolve-RunnerPath([string]$Path, [string[]]$BaseDirs) {
if ([string]::IsNullOrWhiteSpace($Path)) { return $null }
$Path = [Environment]::ExpandEnvironmentVariables($Path.Trim().Trim('"').Trim("'"))
if ([System.IO.Path]::IsPathRooted($Path)) {
if (Test-Path -LiteralPath $Path) { return (Resolve-Path -LiteralPath $Path).Path }
return $null
}
foreach ($b in $BaseDirs) {
if ([string]::IsNullOrWhiteSpace($b)) { continue }
$c = Join-Path $b $Path
if (Test-Path -LiteralPath $c) { return (Resolve-Path -LiteralPath $c).Path }
}
return $null
}
# Gia tri cua -c / --config trong mot dong lenh gitea-runner.
function Get-ConfigArg([string]$Line) {
if ($Line -match '(?:^|\s)(?:-c|--config)(?:\s+|=)(?:"([^"]+)"|''([^'']+)''|(\S+))') {
foreach ($g in 1..3) { if ($Matches[$g]) { return $Matches[$g] } }
}
return $null
}
function Test-Contains([string]$Text, [string]$Part) {
if ([string]::IsNullOrEmpty($Text) -or [string]::IsNullOrEmpty($Part)) { return $false }
return $Text.IndexOf($Part, [System.StringComparison]::OrdinalIgnoreCase) -ge 0
}
# In ra task va cac tien trinh gitea-runner, khi khong tu tim duoc runner cu.
function Show-RunnerDiagnostics {
Write-Warn 'Script thay nhung thu sau (gui lai neu can sua script):'
$t = Get-ScheduledTask -TaskName $ExistingTaskName -ErrorAction SilentlyContinue | Select-Object -First 1
if ($t) {
foreach ($a in @($t.Actions)) { Write-Info "task '$ExistingTaskName': $($a.Execute) $($a.Arguments) (thu muc: $($a.WorkingDirectory))" }
} else { Write-Info "task '$ExistingTaskName': khong co" }
foreach ($p in @(Get-CimInstance Win32_Process -Filter "Name='gitea-runner.exe' OR Name='act_runner.exe'")) {
$parent = Get-CimInstance Win32_Process -Filter "ProcessId=$($p.ParentProcessId)" -ErrorAction SilentlyContinue
Write-Info "tien trinh $($p.ProcessId): $($p.CommandLine)"
if ($parent) { Write-Info " cha $($parent.ProcessId): $($parent.CommandLine)" }
}
}
# Tim exe va config cua runner dang co: truoc het qua tien trinh gitea-runner dang chay (khong
# phai runner moi), roi qua scheduled task -ExistingTaskName (chay exe truc tiep, hoac qua mot
# script .ps1 / lenh pwsh co goi gitea-runner).
function Get-ExistingRunner {
$exe = $null; $cfg = $null; $source = $null
$task = Get-ScheduledTask -TaskName $ExistingTaskName -ErrorAction SilentlyContinue | Select-Object -First 1
$procs = @(Get-CimInstance Win32_Process -Filter "Name='gitea-runner.exe' OR Name='act_runner.exe'" |
Where-Object { $_.ExecutablePath -and $_.CommandLine -match '\bdaemon\b' -and -not (Test-Contains $_.CommandLine $Dir) })
if ($procs.Count -gt 1) {
Write-Warn "Co $($procs.Count) tien trinh gitea-runner dang chay: lay tien trinh $($procs[0].ProcessId). Sai thi chi ro -RunnerExe / -ExistingConfig."
}
if ($procs.Count -ge 1) {
$p = $procs[0]
$exe = $p.ExecutablePath
$bases = @(Split-Path -Parent $exe)
$parent = Get-CimInstance Win32_Process -Filter "ProcessId=$($p.ParentProcessId)" -ErrorAction SilentlyContinue
if ($parent -and $parent.CommandLine -match '\s-f(?:ile)?\s+"?([^"]+?\.ps1)"?(?:\s|$)') {
$bases = @(Split-Path -Parent $Matches[1]) + $bases
}
$arg = Get-ConfigArg $p.CommandLine
if ($arg) { $cfg = Resolve-RunnerPath $arg $bases }
else {
$cfg = Resolve-RunnerPath 'config.yaml' $bases
if ($cfg) { Write-Warn "Dong lenh runner cu khong co -c: doan config la $cfg." }
}
$source = "tien trinh $($p.ProcessId)"
}
if (-not $exe -and $task) {
$act = @($task.Actions)[0]
if ($act) {
$execute = [Environment]::ExpandEnvironmentVariables("$($act.Execute)").Trim().Trim('"')
$argLine = [Environment]::ExpandEnvironmentVariables("$($act.Arguments)")
$wd = [Environment]::ExpandEnvironmentVariables("$($act.WorkingDirectory)").Trim().Trim('"')
$bases = @($wd)
$text = $argLine
if ($execute -match '(gitea-runner|act_runner)(\.exe)?$') {
$exe = Resolve-RunnerPath $execute $bases
} elseif ($argLine -match '(?:^|\s)-f(?:ile)?\s+"?([^"]+?\.ps1)"?(?:\s|$)') {
$scriptPath = Resolve-RunnerPath $Matches[1] $bases
if ($scriptPath) {
$text = Get-Content -LiteralPath $scriptPath -Raw
$bases = @((Split-Path -Parent $scriptPath), $wd)
}
}
if ($text -match '(?im)^\s*(?:Set-Location|Push-Location|cd)\s+(?:-(?:Literal)?Path\s+)?["'']?([A-Za-z]:\\[^"''\r\n]+?)["'']?\s*$') {
$bases = @($Matches[1]) + $bases
}
if (-not $exe -and $text) {
if ($text -match '(?i)([A-Za-z]:\\[^"''\r\n|&;]*?(?:gitea-runner|act_runner)\.exe)') { $exe = Resolve-RunnerPath $Matches[1] $bases }
elseif ($text -match '(?i)\b(gitea-runner|act_runner)(?:\.exe)?\b') { $exe = Resolve-RunnerPath "$($Matches[1]).exe" $bases }
}
if ($exe -and $text) {
$line = @($text -split "`r?`n" | Where-Object { $_ -match '(?i)(gitea-runner|act_runner)' -and $_ -match '\bdaemon\b' }) | Select-Object -First 1
if (-not $line) { $line = $text }
$arg = Get-ConfigArg $line
$bases = $bases + @(Split-Path -Parent $exe)
if ($arg) { $cfg = Resolve-RunnerPath $arg $bases } else { $cfg = Resolve-RunnerPath 'config.yaml' $bases }
}
$source = "task '$ExistingTaskName'"
}
}
if ($RunnerExe) { $exe = $RunnerExe; $source = '-RunnerExe' }
if ($ExistingConfig) { $cfg = $ExistingConfig }
[pscustomobject]@{ Task = $task; Exe = $exe; Config = $cfg; Source = $source }
}
# Gia tri vo huong dau tien cua mot khoa (vd. docker_host), du thut le bat ky.
function Read-YamlScalar([string[]]$Lines, [string]$Key) {
foreach ($l in $Lines) {
if ($l -match "^\s+$([regex]::Escape($Key)):\s*(.*?)\s*$") {
$v = $Matches[1] -replace '\s+#.*$', ''
if ($v -eq '' -or $v -like '#*') { return '' }
return $v.Trim().Trim('"').Trim("'")
}
}
return $null
}
# Cac muc trong runner.labels: chi so dong + gia tri.
function Get-ConfigLabels([string[]]$Lines) {
$out = [System.Collections.Generic.List[object]]::new()
$inRunner = $false; $inLabels = $false; $labelIndent = -1
for ($i = 0; $i -lt $Lines.Count; $i++) {
$l = $Lines[$i]
if ($l -match '^\s*(#.*)?$') { continue }
if ($l -match '^\S') {
$inRunner = ($l -match '^runner:\s*(#.*)?$'); $inLabels = $false; continue
}
if (-not $inRunner) { continue }
if ($l -match '^(\s+)labels:\s*(#.*)?$') { $inLabels = $true; $labelIndent = $Matches[1].Length; continue }
if (-not $inLabels) { continue }
if ($l -match '^\s*-\s*(.+?)\s*$') {
$v = $Matches[1] -replace '\s+#.*$', ''
$out.Add([pscustomobject]@{ Index = $i; Value = $v.Trim().Trim('"').Trim("'") })
continue
}
$indent = $l.Length - $l.TrimStart().Length
if ($indent -le $labelIndent) { $inLabels = $false }
}
$out.ToArray()
}
# Dung task va tien trinh runner cua no (theo duong dan config, hoac theo exe neu dong lenh
# khong co config, chi khi -AllowExeMatch), roi chay lai task.
function Restart-RunnerTask([string]$Task, [string]$ConfigPath, [string]$ExePath, [string]$NotLike, [switch]$AllowExeMatch) {
if ($DryRun) { Write-Info "(dry run) se khoi dong lai task '$Task'"; return }
if (-not (Get-ScheduledTask -TaskName $Task -ErrorAction SilentlyContinue)) {
Write-Warn "Khong co task '$Task': tu khoi dong lai runner do."
return
}
Stop-ScheduledTask -TaskName $Task -ErrorAction SilentlyContinue
$procs = @(Get-CimInstance Win32_Process -Filter "Name='gitea-runner.exe' OR Name='act_runner.exe'" |
Where-Object { $_.CommandLine })
$mine = @()
if ($ConfigPath) { $mine = @($procs | Where-Object { Test-Contains $_.CommandLine $ConfigPath }) }
if ($mine.Count -eq 0 -and $AllowExeMatch -and $ExePath -and $NotLike) {
$mine = @($procs | Where-Object { $_.ExecutablePath -eq $ExePath -and -not (Test-Contains $_.CommandLine $NotLike) })
}
foreach ($p in $mine) {
Write-Info "Dung tien trinh $($p.ProcessId)"
Stop-Process -Id $p.ProcessId -Force -ErrorAction SilentlyContinue
}
Start-Sleep -Seconds 2
Start-ScheduledTask -TaskName $Task
Write-Info "Da chay lai task '$Task'."
}
# ---------------------------------------------------------------------------------------------
Write-Step 'Runner dang co'
$Dir = [System.IO.Path]::GetFullPath($Dir)
$old = Get-ExistingRunner
$exe = $old.Exe
if (-not $exe -or -not (Test-Path -LiteralPath $exe)) {
Show-RunnerDiagnostics
throw "Khong tim thay gitea-runner.exe (qua tien trinh dang chay hoac task '$ExistingTaskName'). Chi ro bang -RunnerExe <duong dan> -ExistingConfig <config.yaml>."
}
$exe = (Resolve-Path -LiteralPath $exe).Path
Write-Info "tim qua: $($old.Source)"
Write-Info "exe: $exe"
Write-Info "config: $(if ($old.Config) { $old.Config } else { '(khong tim thay)' })"
try { & $exe --version } catch { Write-Warn "Khong doc duoc phien ban: $($_.Exception.Message)" }
if (-not (Get-Command docker -ErrorAction SilentlyContinue)) { Write-Warn 'Khong thay lenh docker trong PATH: runner moi can Docker Desktop.' }
if ($old.Config -and ([System.IO.Path]::GetFullPath((Split-Path -Parent $old.Config)) -eq $Dir)) {
throw "-Dir trung thu muc cua runner cu ($Dir). Chon thu muc khac."
}
$oldLines = @()
$oldItems = @()
if ($old.Config -and (Test-Path -LiteralPath $old.Config)) {
$oldLines = @(Get-Content -LiteralPath $old.Config)
$oldItems = @(Get-ConfigLabels $oldLines)
}
# Nhan cua runner moi: -Labels, neu khong thi nhan docker cua runner cu, neu khong thi mac dinh.
if ($Labels.Count -eq 0) {
$Labels = @($oldItems | Where-Object { $_.Value -match ':docker://' } | ForEach-Object { $_.Value })
if ($Labels.Count -gt 0) { Write-Info 'Nhan: chep cac nhan docker cua runner cu.' }
else { $Labels = $DefaultLabels; Write-Info 'Nhan: mac dinh (runbook section 1).' }
}
foreach ($l in $Labels) {
if ($l -notmatch '^[^:\s]+:(docker://\S+|host)$') { throw "Nhan khong hop le: '$l' (dang <nhan>:docker://<image> hoac <nhan>:host)." }
}
$dockerHost = if ($oldLines.Count) { Read-YamlScalar $oldLines 'docker_host' } else { $null }
$network = if ($oldLines.Count) { Read-YamlScalar $oldLines 'network' } else { $null }
if ($null -eq $dockerHost) { $dockerHost = '' }
if ($null -eq $network) { $network = '' }
# ---------------------------------------------------------------------------------------------
Write-Step "config.yaml cho '$Name' trong $Dir"
$cfgPath = Join-Path $Dir 'config.yaml'
$runnerFile = Join-Path $Dir '.runner'
$cacheDir = Join-Path $Dir 'cache'
$workDir = Join-Path $Dir 'work'
$labelLines = ($Labels | ForEach-Object { " - $(ConvertTo-YamlString $_)" }) -join "`n"
$config = @"
# Viet boi maintainer/add-runner.ps1 ($(Get-Date -Format 'yyyy-MM-dd')).
# Chay lai script de doi; sua tay thi khoi dong lai task '$TaskName'.
log:
level: info
runner:
file: $(ConvertTo-YamlString $runnerFile)
capacity: $Capacity
timeout: $Timeout
fetch_timeout: 5s
fetch_interval: 2s
labels:
$labelLines
cache:
enabled: true
dir: $(ConvertTo-YamlString $cacheDir)
host: ''
port: 0
container:
network: $(ConvertTo-YamlString $network)
privileged: false
options: $(ConvertTo-YamlString $ContainerOptions)
valid_volumes: []
docker_host: $(ConvertTo-YamlString $dockerHost)
force_pull: true
host:
workdir_parent: $(ConvertTo-YamlString $workDir)
"@
$config = $config -replace "`r`n", "`n"
Write-Host $config -ForegroundColor DarkGray
if (-not $DryRun) {
New-Item -ItemType Directory -Force -Path $Dir, $cacheDir, $workDir | Out-Null
}
Write-TextFile $cfgPath ($config + "`n")
# ---------------------------------------------------------------------------------------------
Write-Step 'Dang ky voi Gitea'
if (Test-Path -LiteralPath $runnerFile) {
Write-Info 'Da dang ky (.runner co san): bo qua. Nhan va capacity lay tu config.yaml khi daemon khoi dong.'
} elseif ($DryRun) {
Write-Info "(dry run) se chay: gitea-runner -c `"$cfgPath`" register --no-interactive --instance $Instance --name $Name --labels <nhan> --token <hoi khi chay>"
} else {
$secure = Read-Host -AsSecureString 'Token dang ky (Gitea > Settings > Actions > Runners > Create new runner)'
$token = [System.Net.NetworkCredential]::new('', $secure).Password
if ([string]::IsNullOrWhiteSpace($token)) { throw 'Token rong.' }
Push-Location $Dir
try {
& $exe -c $cfgPath register --no-interactive --instance $Instance --token $token --name $Name --labels ($Labels -join ',')
if ($LASTEXITCODE -ne 0) { throw "register that bai (exit $LASTEXITCODE)." }
} finally {
Pop-Location
$token = $null
}
if (-not (Test-Path -LiteralPath $runnerFile)) { throw "Dang ky xong nhung khong thay $runnerFile." }
Write-Info "Da dang ky '$Name'."
}
# ---------------------------------------------------------------------------------------------
Write-Step 'run-runner.ps1'
$wrapper = Join-Path $Dir 'run-runner.ps1'
$wrapperText = @'
# Viet boi maintainer/add-runner.ps1: doi Docker san sang, chay gitea-runner daemon, va chay lai
# 30 giay sau neu daemon thoat (Docker Desktop khoi dong lai, mat mang...). Dung han: dung task,
# roi dung tien trinh gitea-runner.exe co duong dan config nay trong dong lenh.
param(
[Parameter(Mandatory)] [string] $Exe,
[Parameter(Mandatory)] [string] $Config
)
$ErrorActionPreference = 'Continue'
$dir = Split-Path -Parent $Config
Set-Location -LiteralPath $dir
$log = Join-Path $dir 'runner.log'
while ($true) {
while ($true) {
$global:LASTEXITCODE = 1
try { & docker info *> $null } catch { }
if ($LASTEXITCODE -eq 0) { break }
Start-Sleep -Seconds 10
}
foreach ($f in @($log, "$log.out")) {
if (Test-Path -LiteralPath $f) { Move-Item -LiteralPath $f -Destination "$f.old" -Force }
}
Start-Process -FilePath $Exe -ArgumentList @('-c', "`"$Config`"", 'daemon') -WorkingDirectory $dir `
-NoNewWindow -Wait -RedirectStandardError $log -RedirectStandardOutput "$log.out"
Start-Sleep -Seconds 30
}
'@
Write-TextFile $wrapper (($wrapperText -replace "`r`n", "`n") + "`n")
# ---------------------------------------------------------------------------------------------
if ($NoTask) {
Write-Step 'Bo qua scheduled task (-NoTask)'
Write-Info "Chay tay: pwsh -File `"$wrapper`" -Exe `"$exe`" -Config `"$cfgPath`""
} else {
Write-Step "Scheduled task '$TaskName'"
$user = "$env:USERDOMAIN\$env:USERNAME"
$shell = (Get-Process -Id $PID).Path
if ($shell -like '*\Program Files\WindowsApps\*') {
# Ban PowerShell tu Microsoft Store: duong dan nay doi theo phien ban; dung alias on dinh.
$alias = Join-Path $env:LOCALAPPDATA 'Microsoft\WindowsApps\pwsh.exe'
if (Test-Path -LiteralPath $alias) { $shell = $alias }
else {
$cmd = Get-Command pwsh.exe -ErrorAction SilentlyContinue | Where-Object { $_.Source -notlike '*\Program Files\WindowsApps\*' } | Select-Object -First 1
if ($cmd) { $shell = $cmd.Source } else { Write-Warn "Task se goi $shell, duong dan nay doi khi PowerShell cap nhat." }
}
}
$argLine = "-NoProfile -NonInteractive -WindowStyle Hidden -ExecutionPolicy Bypass -File `"$wrapper`" -Exe `"$exe`" -Config `"$cfgPath`""
$existed = [bool](Get-ScheduledTask -TaskName $TaskName -ErrorAction SilentlyContinue)
if ($DryRun) {
Write-Info "(dry run) se tao task: $shell $argLine"
Write-Info "(dry run) trigger: dang nhap ($user); chay lai sau 1 phut khi loi; khong gioi han thoi gian"
} else {
$action = New-ScheduledTaskAction -Execute $shell -Argument $argLine -WorkingDirectory $Dir
$trigger = New-ScheduledTaskTrigger -AtLogOn -User $user
$settings = New-ScheduledTaskSettingsSet -ExecutionTimeLimit ([TimeSpan]::Zero) -RestartCount 999 `
-RestartInterval (New-TimeSpan -Minutes 1) -MultipleInstances IgnoreNew -StartWhenAvailable `
-AllowStartIfOnBatteries -DontStopIfGoingOnBatteries
$principal = New-ScheduledTaskPrincipal -UserId $user -LogonType Interactive -RunLevel Limited
try {
Register-ScheduledTask -TaskName $TaskName -Action $action -Trigger $trigger -Settings $settings `
-Principal $principal -Description "gitea-runner '$Name' ($Dir). Viet boi maintainer/add-runner.ps1." -Force | Out-Null
} catch {
throw "Khong tao duoc task: $($_.Exception.Message) Thu chay lai trong PowerShell 7 (Run as administrator)."
}
Write-Info "Da $(if ($existed) { 'cap nhat' } else { 'tao' }) task."
}
if ($existed) {
if (Confirm-Step "Khoi dong lai '$TaskName' de nhan config moi? Job dang chay tren runner nay se bi ngat") {
Restart-RunnerTask -Task $TaskName -ConfigPath $cfgPath
} else { Write-Warn "Chua khoi dong lai: config moi co hieu luc o lan chay sau cua '$TaskName'." }
} elseif (-not $DryRun) {
Start-ScheduledTask -TaskName $TaskName
Write-Info 'Da chay task. Log: runner.log trong thu muc runner.'
}
}
# ---------------------------------------------------------------------------------------------
if ($SplitExistingRunner -and $NoTask) {
Write-Warn 'Tach runner cu khi chua co task cho runner moi: job ubuntu-* se doi den khi ban tu chay runner moi.'
}
if ($SplitExistingRunner) {
Write-Step "Runner cu: chi giu nhan host (windows-latest)"
$dockerItems = @($oldItems | Where-Object { $_.Value -match ':docker://' })
$keepItems = @($oldItems | Where-Object { $_.Value -notmatch ':docker://' })
if (-not $old.Config -or $oldLines.Count -eq 0) {
Write-Warn 'Khong doc duoc config cua runner cu (-ExistingConfig). Khong sua gi.'
} elseif ($oldItems.Count -eq 0) {
Write-Warn "config cu khong liet ke runner.labels (runner dung nhan trong .runner). Them vao config do:"
Write-Info " labels:"
Write-Info " - 'windows-latest:host'"
Write-Info " - 'windows:host'"
Write-Info "roi khoi dong lai task '$ExistingTaskName'. Script khong tu sua."
} elseif ($dockerItems.Count -eq 0) {
Write-Info 'Runner cu da khong con nhan docker: khong can sua.'
} elseif ($keepItems.Count -eq 0) {
Write-Warn 'Bo nhan docker thi runner cu khong con nhan nao. Khong sua gi.'
} else {
Write-Info "Bo: $(($dockerItems | ForEach-Object { $_.Value }) -join ', ')"
Write-Info "Giu: $(($keepItems | ForEach-Object { $_.Value }) -join ', ')"
$drop = [System.Collections.Generic.HashSet[int]]::new()
foreach ($d in $dockerItems) { [void]$drop.Add($d.Index) }
$newLines = for ($i = 0; $i -lt $oldLines.Count; $i++) { if (-not $drop.Contains($i)) { $oldLines[$i] } }
$raw = [System.IO.File]::ReadAllText($old.Config)
$nl = if ($raw.Contains("`r`n")) { "`r`n" } else { "`n" }
$backup = "$($old.Config).bak-$(Get-Date -Format 'yyyyMMdd-HHmmss')"
if ($DryRun) {
Write-Info "(dry run) se sao luu thanh $backup va ghi lai $($old.Config)"
} else {
Copy-Item -LiteralPath $old.Config -Destination $backup
[System.IO.File]::WriteAllText($old.Config, (($newLines -join $nl) + $nl), $Utf8NoBom)
Write-Info "Sao luu: $backup"
}
if ($old.Task) {
if (Confirm-Step "Khoi dong lai '$ExistingTaskName'? Job dang chay tren runner cu se bi ngat") {
Restart-RunnerTask -Task $ExistingTaskName -ConfigPath $old.Config -ExePath $exe -NotLike $Dir -AllowExeMatch
} else { Write-Warn "Chua khoi dong lai '$ExistingTaskName': nhan moi co hieu luc o lan chay sau." }
} else {
Write-Warn 'Khong co task cua runner cu: tu khoi dong lai no.'
}
}
}
Write-Step 'Xong'
Write-Info "Kiem tra: $Instance/user/settings/actions/runners (runner '$Name' Idle, dung nhan)."
Write-Info "Log runner moi: $(Join-Path $Dir 'runner.log')"