docs: update CLAUDE.md for Gitea migration

- 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 <noreply@anthropic.com>
This commit is contained in:
svemagie
2026-03-31 12:59:22 +02:00
parent a6f87de59d
commit 139e4b608b
+19 -3
View File
@@ -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