AgeCommit message (Collapse)AuthorLines
Drop cached pages asked for with an escaped urlBryce Kwon-3/+7
README tells a visitor to write a plus in the query form as %2b, and cgit caches such a page under the raw query, but the hook compared that query with the url as it stands. A push to foo+bar.git left its pages under url=foo%2bbar.git/ and r=foo%2Bbar.git cached and stale until their ttl ran out. Decoding in sh would take more than the hook is worth, so a query with a % or a + now counts as stale, which costs another repository's page at most a refill.
Say to run the cache hook as the web serverBryce Kwon-4/+8
The header asked for write access for the pushing user, but MANUAL.txt keeps the cache root at mode 0700 for the web server and cgit writes its slots at 0600, so a pusher could at best drop every page rather than only its own.
Spell non-zero the way the tree doesBryce Kwon-1/+1
Point each hook at the other hooks hereBryce Kwon-1/+1
The cache hook named only the age-file hook, from before the commit-graph hook came.
Drop only the cache a push makes staleBryce Kwon-11/+104
The hook cleared every slot on a push to any repository. cgit writes the request a slot answers at its head, so the hook now reads it back and drops only the pushed repository's pages and the index. It finds the repository's url from scan-path or hooks.cgiturl, and with neither it clears everything as before.
Keep the cache hook's rm errors from pushersBryce Kwon-4/+4
Only the exit status was hidden, so a pusher without write access to the cache root saw a permission error per cached page, against what the hook's own comment promised.
Unify the docs, samples and extensionsBryce Kwon-19/+16
Clean up the whole treeBryce Kwon-2/+1
Trim the comments and dead code across the treeBryce Kwon-4/+3
Rename the inconsistent config keysBryce Kwon-1/+1
The old spellings are no longer read. enable-header and enable-plain-email take the opposite value of the noheader and noplainemail they replace.
Add a hook that clears cgit's cache on pushBryce Kwon-0/+38