No description
  • Go Template 43.4%
  • CSS 28.9%
  • Python 27.7%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-09-22 20:27:11 +02:00
contrib-worker feat(heatmap,contributions,docker-config): Add a contribution generator for a better heatmap 2026-09-13 07:05:40 +02:00
custom feat(heatmap,contributions,docker-config): Add a contribution generator for a better heatmap 2026-09-13 07:05:40 +02:00
.env.example feat(heatmap,contributions,docker-config): Add a contribution generator for a better heatmap 2026-09-13 07:05:40 +02:00
.gitignore feat(init,css,fonts,base,custom,templates,project): Initial commit 2026-09-12 05:02:30 +02:00
compose.local.yml feat(heatmap,contributions,docker-config): Add a contribution generator for a better heatmap 2026-09-13 07:05:40 +02:00
compose.yml feat(github,import,code,compose): Add longer migration timeouts for big projets, removed old migration script, use my forgejo-sync instead 2026-09-14 06:18:03 +02:00
README.md feat(heatmap,contributions,docker-config): Add a contribution generator for a better heatmap 2026-09-13 07:05:40 +02:00

forgejo-tomplanche

Version-controlled customizations (theme, templates, compose files) for the Forgejo instance at git.tomplanche.com. No fork, no image build: everything under custom/ is mounted into the stock codeberg.org/forgejo/forgejo container over the data volume, using Forgejo's custom/ override mechanism.

Layout

compose.yml          # Pi / production
compose.local.yml    # Mac / development
custom/
  public/assets/     # theme CSS, logo
  templates/         # home.tmpl and base/footer_content.tmpl full overrides, custom/*.tmpl additive hooks
contrib-worker/       # real per-commit-date contribution heatmap, see below

Real contribution heatmap

Forgejo's own dashboard heatmap ("X contributions in the last 12 months") counts "Action" log entries, i.e. things that happened on this instance (push, create repo, ...), not actual git commit dates. Migrating a repo never backfills that log for its pre-existing history, so a repo migrated with years of commits contributes nothing but the single moment it was migrated, no matter how old or recent those commits really are.

contrib-worker is a small sidecar service (not a fork of Forgejo, a separate container in the same compose file) that walks every repo's actual commit history every INTERVAL seconds (default 60), counts commits whose resolved author matches the target account, the same way GitHub's contribution graph works, and writes the result to a cache file Forgejo serves as a static asset. custom/templates/custom/footer.tmpl then replaces the dashboard's native heatmap output with one built from that real data, since the native component (a Vue widget) only reads its data once at mount time and can't be fed new data by mutating its attributes afterward.

Linted and formatted with Ruff (uvx ruff format contrib-worker/generate_contributions.py, uvx ruff check contrib-worker/); see contrib-worker/pyproject.toml for the rule selection, E501 is deliberately off since the formatter doesn't rewrap docstrings/comments and this project writes those as unwrapped physical lines rather than hand-wrapped paragraphs.

Requires a CONTRIB_TOKEN env var (see .env.example), an API token scoped to read:repository,read:user:

docker compose exec -u git forgejo forgejo admin user generate-access-token \
  --username tom --token-name contrib-worker --scopes read:repository,read:user

Generate one against whichever instance you're actually running this on (local dev and the Pi need their own, a token from one won't work on the other), put it in .env (gitignored), then docker compose up -d.