AgeCommit message (Collapse)AuthorLines
Keep the version numbers off the pagesHEADmainBryce Kwon-14/+7
The generator meta, the footer and the patch signature named the exact cgit and git versions on every response, which only helps someone matching a site against an advisory. The shipped server configs already hide the server's own version for the same reason, and `cgit --version` still answers on the host.
Mark a page behind an auth filter privateBryce Kwon-14/+42
Only the login page carried a Cache-Control, so a page an auth filter had let a visitor see could be kept by a cache shared with the next visitor. The page also varies on the cookie that got them in.
Pin the advisory classes with tests and name an empty authorBryce Kwon-6/+120
Each class behind cgit's published advisories now has a check against the current code, from a newline in a file name to shell syntax handed to a filter. The feed also treated an ident with an empty name and an empty address as present and wrote an empty person, which Atom forbids.
End a request quietly when the client has goneBryce Kwon-4/+50
A write that failed with EPIPE on an uncached page died into an error page, which died again at exit when the page could not be sent either, and git logged a recursion warning on every dropped connection. A filter that exits early fails a write the same way, so the quiet exit is kept for writes that reach the client itself.
Send a charset only with a text typeBryce Kwon-15/+19
Archives, packs and the HEAD file went out as octet-stream or gzip with a UTF-8 charset on the end, since only the blob page cleared it. The headers now decide from the type itself, so the two places that cleared the charset by hand no longer need to.
Word the blob size and binary errors alikeBryce Kwon-11/+7
The four pages that refuse a blob over max-blob-size each said it in their own way, two of them in lower case, and the blame page ended its binary notice with a full stop no other error carries.
Leave a branch spelled like an option out of the switcherBryce Kwon-0/+11
Such a name is refused as a head before git could read it as an option, and the fallback branch already skips it, so the switcher offered a choice that led only to an error page.
Replace the stray bytes of text that is not UTF-8Bryce Kwon-43/+99
A commit whose encoding header names something iconv cannot convert, or whose text is labelled UTF-8 without being it, reached a page declared UTF-8 with its bytes untouched. The atom feed already replaced them, so its UTF-8 reader moves to shared.c and every ident, subject, message and tag text passes through it.
Walk a path on the blob page from any commit the id namesBryce Kwon-8/+29
With both an id and a path the blob page handed back the raw object the id named, so a commit id gave the commit text itself, while the plain page looked the path up in that commit's tree. A tag is peeled to its commit on the way, and the README example of a pinned commit now uses a form the request checks accept.
Keep the query string across the about redirectsBryce Kwon-12/+68
The hop to the trailing-slash form of the about page, and the hop back to the summary of a repository without a readme, were built from the path alone, so a request for the about page of another branch landed on the default one. The query goes into the Location line as the client sent it, with any byte a header cannot carry percent-encoded.
Withhold the alternates file on the dumb transportBryce Kwon-0/+21
It lists object directories by their path on the server, which a client fetching over http can neither use nor needs to learn. The http-alternates file written for such clients still goes out.
Limit rawdiff to the requested pathBryce Kwon-13/+35
The diff and patch pages honour the path in the url, which the parameter table documents for every page, but rawdiff never handed it to git and answered with the whole diff.
Send a clone file with its size in whole batchesBryce Kwon-4/+33
The dumb transport read a pack four kilobytes at a time through stdio and sent it without a length, so a client could not tell a cut-off transfer from a complete one.
Keep clone files and oversized responses out of the cacheBryce Kwon-15/+124
The dumb transport reads files that already sit on the disk, so a pack copied into a slot cost that disk twice and the request a second write of every byte. A snapshot took a slot whatever its size, so a visitor naming distinct refs and ids could fill the cache root with archives. `cache-max-slot-size`, 64 MB unless set, now serves a larger response from the lock file and drops it, along with any expired copy it would have replaced.
Keep the builder's home directory out of the binaryBryce Kwon-2/+11
Git's Makefile defaults `prefix` to `$HOME` and compiles it into `exec-cmd.o` as the fallback runtime prefix, so each build embedded the path of whoever ran it and no two builders could produce the same bytes. The release script also maps the build directory out of the debug info, which otherwise differs between checkouts.
Gate html serving behind trust-scan-configBryce Kwon-24/+67
`enable-html-serving` makes the plain page send a repository file as text/html on the site's own origin, with no nosniff and no policy, so a scanned repository could switch it on from its git config or cgitrc without `trust-scan-config` and run script against every visitor. The warning for a key read from git config also named a null repository, because `repo->path` was set only after that file had been read.
Keep the Lua-less build compilingBryce Kwon-2/+81
`cgit_abort_filters` unhooks the Lua write interposer under NO_LUA too, where neither the hook nor its state exists, so `make NO_LUA=1` and the default mode of `tools/release-build.sh` have not compiled since the die path learned to take stdout back from a filter. The suite now builds that variant into `build/nolua` and runs it, and a `lua:` filter in such a build is refused with a message naming the cause instead of an unknown filter type.
Rename enable-trailers to enable-commit-trailersBryce Kwon-52/+53
Add stable markup hooks for site themesBryce Kwon-174/+398
Release v2.8.0v2.8.0Bryce Kwon-3/+57
Align with spaces instead of tabsBryce Kwon-58/+62
Unify the docs, samples and extensionsBryce Kwon-472/+468
Test the hardening passBryce Kwon-30/+501
Harden the page renderersBryce Kwon-350/+658
Harden the request path, scan and error recoveryBryce Kwon-223/+564
Answer 404 for a repository whose path is missingBryce Kwon-8/+29
Link builds reproduciblyBryce Kwon-0/+4
Read the encoding header without its newlineBryce Kwon-1/+1
The newline made the charset name unknown to the converter, so a message in another charset was left unconverted.
Read every query parameterBryce Kwon-1/+3
A parameter without a value swallowed the parameter after it.
Log a cache slot that cannot be publishedBryce Kwon-2/+14
Fail cleanly when a filter cannot runBryce Kwon-5/+20
A filter program that could not be run answered with two responses, and a filter that exited without reading its input ended cgit with the page half written.
Name the tagged object under its full idBryce Kwon-47/+55
Keep the hash rows out of the column widthsBryce Kwon-8/+20
Gate scanned filters with `trust-scan-filters`Bryce Kwon-81/+99
Map trailer idents and print bare lines as writtenBryce Kwon-22/+57
Apply the mailmap at HEAD to every identBryce Kwon-8/+153
Add the link-trailers extensionBryce Kwon-0/+245
Split trailers out of the commit messageBryce Kwon-7/+315
Lay the tag table out like the commit tableBryce Kwon-32/+93
Release v2.7.1v2.7.1Bryce Kwon-1/+15
Settle the snapshot v-prefix from the tag listBryce Kwon-8/+69
`compose_snapshot_prefix` dropped the leading v of a tag only when just one of the names 1.2, v1.2 and V1.2 resolved as a tag, so that the shorter snapshot name could always be traced back to one tag. Those probes went through ref lookups, and on a case-insensitive filesystem a lookup for V1.2 finds the loose file of v1.2, so every freshly made tag counted as ambiguous and kept its v. Once git packed the refs the lookups became exact and the same tag quietly changed its snapshot names. The claimants on a stripped name are now counted over the tag list itself with exact string comparison, so the answer no longer depends on how a ref is stored or on the filesystem underneath. Two tags that really differ only by the letter's case still both keep it.
Release v2.7.0v2.7.0Bryce Kwon-11/+58
Clean up the whole treeBryce Kwon-1317/+762
Harden the lua filter failure pathsBryce Kwon-5/+31
Give the login inputs explicit field typesBryce Kwon-3/+4
Refresh the server configs and drop `unsafe-inline`Bryce Kwon-96/+87
The inline handlers and the auto-submitting selects are gone, so `script-src` no longer needs it, and t0004 now checks that the three configs pin the same policy.
Trim the comments and dead code across the treeBryce Kwon-942/+652
Remove the auto-submitting selectsBryce Kwon-37/+16
Remove the theme toggleBryce Kwon-163/+13
Extend the html validity checksBryce Kwon-1/+26