From 139e4b608b351613198df4c56702da67f292509d Mon Sep 17 00:00:00 2001 From: svemagie <869694+svemagie@users.noreply.github.com> Date: Tue, 31 Mar 2026 12:59:22 +0200 Subject: [PATCH] docs: update CLAUDE.md for Gitea migration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Sharp restore path corrected to src/build/Release/ (0.33.x) - GITEA_URL / GITEA_ORG added to deploy env var reference - Document store-github → Gitea config (trailing slash gotcha, GH_CONTENT_TOKEN alias) - Document custom gitea_runner rc service and Micropub dispatch patch - Document Gitea sidebar widget and changelog migration Co-Authored-By: Claude Sonnet 4.6 --- CLAUDE.md | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 74f4db8..2476d96 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -117,7 +117,7 @@ There is no prebuilt `sharp` binary for FreeBSD. The CI step builds from source - **Cache location:** `/usr/local/git/.cache/sharp-freebsd/sharp-freebsd-x64-{VERSION}.node` - **Build:** `npm install node-addon-api node-gyp && npm install sharp --build-from-source` (requires `libvips` — installed via `pkg install vips` in the gitea jail) -- **Restore:** copies cached binary into `node_modules/sharp/build/Release/` — skips ~3 min compile +- **Restore:** copies cached binary into `node_modules/sharp/src/build/Release/` — skips ~3 min compile (Sharp 0.33.x loads from `../src/build/Release/`, **not** `../build/Release/`) ### Rsync deploy user @@ -134,6 +134,16 @@ The runner shell is POSIX sh (not bash/tcsh). Watch for GNU-only constructs: - `giersig.eu/indiekit-blog` — this repo (Eleventy + content). Local dir: `indiekit-blog` - `giersig.eu/indiekit-server` — IndieKit server (Micropub, AP, etc.). Local dir: `indiekit-server` +### IndieKit store-github → Gitea + +`store-github` is configured to write posts to Gitea instead of GitHub. Key points: + +- **`GITEA_BASE_URL`** must end with a trailing slash: `http://10.100.0.90:3000/api/v1/` + Without it, `new URL(apiPath, baseUrl)` strips the `v1` segment → 404 on all writes. +- **`GH_CONTENT_TOKEN`** must be set in `.env` (the Gitea PAT) — `start.sh` rejects startup if neither `GH_CONTENT_TOKEN` nor `GITHUB_TOKEN` is present. +- **`GITEA_CONTENT_USER`** = `giersig.eu` (the org, not a personal username) +- **`GITEA_CONTENT_REPO`** = `indiekit-blog` + ### Pushing workflow changes The server runs tcsh which mangles long `echo`/`printf` commands. Use a Python heredoc from the server to push via Gitea API: @@ -186,11 +196,13 @@ GITHUB_USERNAME svemagie BLUESKY_HANDLE svemagie ``` -The following are set directly in `.github/workflows/deploy.yml` (not secrets) because they are internal network addresses only reachable from the CI runner: +The following are set directly in `.github/workflows/deploy.yml` (not secrets) because they are internal network addresses or stable infrastructure values: ``` INDIEKIT_URL http://10.100.0.20:3000 # node jail — IndieKit API, Funkwhale proxy, etc. FUNKWHALE_INSTANCE http://10.100.0.40:5000 # Funkwhale jail +GITEA_URL https://gitea.giersig.eu # used by _data/githubActivity.js, githubRepos.js, widget JS +GITEA_ORG giersig.eu # Gitea org that owns the repos ``` --- @@ -210,4 +222,8 @@ FUNKWHALE_INSTANCE http://10.100.0.40:5000 # Funkwhale jail - **Soft-delete filtering** — posts with `deleted: true` excluded from all collections - **Content-warning support** — collapsible content on post pages, hidden content on listings - **Upstream drift check script** — `scripts/check-upstream-widget-drift.mjs` -- **Self-hosted Gitea CI** — replaced GitHub Actions; `act_runner` on FreeBSD, sharp built from source with persistent binary cache, rsync via `deploy` user, syndication webhook via internal jail URL +- **Self-hosted Gitea CI** — replaced GitHub Actions; `act_runner` on FreeBSD (custom `gitea_runner` rc service, `su - git` + `nohup`), sharp built from source with persistent binary cache (`src/build/Release/`), rsync via `deploy` user, syndication webhook via internal jail URL +- **Gitea content store** — `@indiekit/store-github` pointed at `http://10.100.0.90:3000/api/v1/` (trailing slash required for `new URL()` resolution); `GH_CONTENT_TOKEN` in `.env` satisfies `start.sh` preflight; `GITEA_CONTENT_USER=giersig.eu`, `GITEA_BASE_URL` in IndieKit `.env` +- **Micropub → Gitea dispatch** — `patch-micropub-gitea-dispatch.mjs` fires `workflow_dispatch` after each Micropub create/update (Gitea Contents API commits do not trigger `on: push`) +- **Gitea sidebar widget** — `github-repos.njk` renamed to "Gitea"; runtime JS fetches commits/repos/PRs directly from `gitea.giersig.eu` API; build-time data via `_data/githubActivity.js` + `_data/githubRepos.js` (both use Gitea org API). Widget configured via `site.gitea.{url,org,repos}` in `_data/site.js` +- **Changelog → Gitea** — `/changelog` page fetches commits directly from Gitea API (both repos), with client-side commit categorisation (feat/fix/docs/chore/refactor); no longer depends on IndieKit's GitHub proxy endpoint