Deployment
Keep mirrors in sync, speed up history with commit graphs, bound resources, and put a cache in front.
codeview is a single process with no database and no state of its own. Everything it shows comes from running git against the repositories on disk, so running it well comes down to keeping those repositories current and bounding the git work a request can trigger.
Repository maintenance
codeview never fetches. Keep the repositories in sync with whatever mirrors them, such as gickup on a timer, a soft-serve mirror, or a cron job running git remote update.
Optionally write a commit graph after each sync. It speeds up history and blame on large repositories.
git --git-dir=/srv/git/cli.git commit-graph write --reachable --changed-pathsLimits
Every uncached request runs git. Rate limit and cap concurrent requests in the reverse proxy, and bound the container.
docker run -d -p 8080:8080 --cpus 1 --memory 768m --pids-limit 256 \
-v /srv/git:/repos:ro \
ghcr.io/toaweme/codeviewWarning
There is no auth. A public instance should serve in the default public mode, and an all mode instance belongs behind a VPN, a LAN, or an auth proxy.
Caching
API responses are private, no-cache with an ETag, so browsers revalidate and get a 304 until a ref moves. Hashed UI assets are cached for a year. A CDN in front needs no cache rules.