Files
github-readme-stats/fetcher
shayandClaude Opus 5.5 74a8146779 feat(deploy): log one access line per request to stdout
Each gunicorn service (edge, fetcher, generator) now writes a request line
("GET /x HTTP/1.1" 200 12ms) to stdout, which Pantheos ingests for request
logs and rps / 5xx / p95. /metrics and /health are left out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 10:50:32 -04:00
..

Fetcher Service

Owns every GitHub API interaction. Holds the PAT. Exposes cached payloads over an internal-only HTTP API protected by a shared secret.

Run locally

cd fetcher
pip install -r requirements.txt
FETCHER_INTERNAL_TOKEN=dev GITHUB_PAT=ghp_xxx python -m src.api

Cron (separate process):

FETCHER_INTERNAL_TOKEN=dev GITHUB_PAT=ghp_xxx python -m src.cron

Test

cd fetcher && pytest

Docker

docker build -t ghstats-fetcher .
docker run -e GITHUB_PAT=ghp_xxx -e FETCHER_INTERNAL_TOKEN=dev -p 5001:5001 -v $(pwd)/data:/app/data ghstats-fetcher
# cron: override CMD to ["python","-m","src.cron"]

Endpoints

Method Path Auth Description
GET /health none health check
GET /data/ X-Internal-Token return stored payload; auto-fetches on miss
POST /fetch X-Internal-Token force re-fetch (body: {username})
GET /avatar/ X-Internal-Token proxied avatar bytes

Env

See src/config.py.