AgeCommit message (Collapse)AuthorLines
Replace a readme's NUL bytes in one substitutionBryce Kwon-19/+3
Let the dispatch serve markdown without lpegBryce Kwon-5/+0
Without lpeg both renderers stay nil, and the handler lookup already falls back to plain text for a format it has no renderer for.
Render markdown and man pages through one functionBryce Kwon-28/+18
Everything that can raise already runs inside the parse and emit pcalls, so the outer one in filter_close could only ever have sent the page a second time. The size check moves to the dispatch with it.
Drop three needless forward declarationsBryce Kwon-9/+3
Drop fallbacks for a match that cannot failBryce Kwon-3/+3
A table capture of a pattern repeated zero or more times matches every string, the empty one included, so the inline grammars never return nil.
Drop the readme hooks that nothing readsBryce Kwon-14/+7
Nothing in assets/ or in README's list of hooks reads a fenced block's data-lang or the manpage class on a man page's wrapper, so the header now names the two wrappers the stylesheet does style.
Rewrap the max-ref-count commentBryce Kwon-2/+1
Spell customisation and uncoloured the British wayBryce Kwon-1/+2
Point each hook at the other hooks hereBryce Kwon-3/+6
The cache hook named only the age-file hook, from before the commit-graph hook came.
Drop config comments that restate their lineBryce Kwon-7/+2
Say each routing fact once in the server configsBryce Kwon-20/+16
Leave the filter prefixes to the filter preambleBryce Kwon-12/+7
The preamble above the filters explains lua: and exec:, and the repo.* filter entries already read "Value is a command."
Say minutes once in the cache ttl commentsBryce Kwon-12/+9
Drop the filter note from the cgitrc headerBryce Kwon-4/+0
The filter section names about-render.lua and the source-filter itself.
Name the guarded settings in one placeBryce Kwon-5/+4
Trim the header notes in the server configsBryce Kwon-23/+7
Each config listed every header cgit sends, where only its own nosniff and strict policy on raw bytes bear on the headers set there. The list also missed Vary, and the Apache one called Apache a proxy.
Say each css and js line holds one urlBryce Kwon-3/+3
Drop the snapshot format from the query commentBryce Kwon-1/+1
A snapshot's format comes from the suffix of its filename in the path, not from the query string.
Name every default asset link in the configsBryce Kwon-11/+11
The nginx sub-path recipe moved only the stylesheet and the logo, and left the script and the icon pointing at the domain root.
Say which versions enable-version-info namesBryce Kwon-4/+3
Only the footer carries the git version. The reason the versions stay out by default is left to MANUAL, which already gives it.
Document virtual-root's default of SCRIPT_NAMEBryce Kwon-2/+2
cgit falls back to SCRIPT_NAME followed by a slash when virtual-root is unset, so its links always take the path form and none take the ?url= form the docs described.
Move scan-path below the settings it inheritsBryce Kwon-4/+5
The quick start says to uncomment scan-path, and in its old place a scanned repository missed every setting below it, among them the filters, the snapshots and the enable flags.
Keep the age hook quiet when it cannot writeBryce Kwon-5/+7
Keep the commit-graph current in an example hookBryce Kwon-0/+34
cgit's log, blame and graph pages read commits from the commit-graph when a repository has one, and its changed path filters let a walk limited to one file skip the commits that never touched it. git gc writes a graph only now and then and starts those filters only when a write asks for them, so the hook writes a split layer with them after each push.
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.
Pin the server configs to the releases they suitBryce Kwon-1/+7
Each names the branch it was written for and the release current at its last review, nginx 1.30.6 stable, Apache httpd 2.4.69 and lighttpd 1.4.85, as the projects' own sites listed them on 2026-10-29.
Render the man pages that generators writeBryce Kwon-52/+188
DocBook, pod2man and hand written pages leaked roff onto the page: font escapes inside no fill blocks, comments, layout escapes such as \% and \c, the colours and half line moves around DocBook's links, and the requests and macro definitions their preambles open with. Those now draw nothing, the common named characters and strings render, .EX and pod2man's .Vb read as code, a .TP tag takes a line of its own and the alternating font macros switch fonts between their arguments. Anything rarer still falls back to its text.
Render more of the markdown seen in readmesBryce Kwon-19/+105
A line of equals signs or dashes under a paragraph now makes a heading of it, as on GitHub, instead of running into its text, and any other rule ends the paragraph. Four spaces or a tab start a code block, and an escaped pipe stays in its table cell. A link opening with two slashes or backslashes in any mix leads to another site, so it renders as text like the plain scheme relative one already did.
Keep a readme whole past a NUL byteBryce Kwon-2/+20
cgit takes filter output through a C string sink that stops at the first NUL, so a readme holding one lost everything after it. Each NUL now shows as U+FFFD, as a browser would show it.
Offer the versions as an optionBryce Kwon-0/+6
enable-version-info brings back the cgit and git versions that 3a00e19 took off the footer and the generator tag, for a site that wants them, and the version 2a6726a put on the signature of patches now follows it too. It stays off by default for the reason 3a00e19 gave.
Load the scripts with deferBryce Kwon-2/+3
A plain script in the head held up parsing until it had downloaded and run, though cgit.js only acts once the document is ready. Deferred scripts still run in the order given and before DOMContentLoaded, so a site script after cgit.js can still call window.cgit.
Say when a login fails, and line up the formBryce Kwon-16/+44
A wrong password sent the reader back to the same empty form, which looked no different from a crash. The redirect now carries a flag the form reads, the same for an unknown user as for a wrong password, and the form leaves the flag out of the way back it signs.
Colour css properties and pseudo-classesBryce Kwon-14/+17
Scintillua's css lexer tags them with names the map had no row for, so they came out as plain text.
Escape the same characters in the highlighterBryce Kwon-6/+39
A lexer may hand back the bytes of one separator, or the CR and LF of a line ending, in different tokens, so line endings become line feeds before lexing and the separators are escaped once the tokens are joined.
Read a negative ref count as no limitBryce Kwon-4/+6
summary-branches, summary-tags and max-ref-count already listed every ref at 0, but a negative value reached qsort as a count and crashed the summary and refs pages, and emptied the branch switcher.
Claim and test Lua 5.5 for every extensionBryce Kwon-13/+13
luaossl from release 20260910 and luaposix load under Lua 5.5, and cgit renders the same pages under it as under LuaJIT. Running the suites there already caught a write to a for loop's control variable, which 5.5 makes read-only.
Drop the highlighter's stale guard and dead branchBryce Kwon-11/+2
cgit runs as a CGI, so no interpreter outlives its request, and the lexers load once per process. The loop below already wrote nothing for an empty blob.
Find a script's lexer from its shebang lineBryce Kwon-3/+5
Scintillua's detect reads the first line as well as the name, and without it hooks, bin scripts and anything else lacking an extension stayed plain.
Ship the example tracker links commented outBryce Kwon-5/+8
An unedited copy sent every #123, Closes: and Bug: mark to bugs.example.com, a link that is wrong for every site.
Say that a protected repository stays on the indexBryce Kwon-0/+8
Name the auth cookie __Host- where it can beBryce Kwon-4/+20
Without the prefix any host under the same domain could set a cgitauth cookie of its own, signing a visitor in as someone else or out.
End a session when its account's hash changesBryce Kwon-58/+88
A session stayed good for its whole week after the password changed or the account went away, which is when ending it matters most.
Load auth libraries only when a request needs oneBryce Kwon-12/+20
Required at the top, a missing luaossl or luaposix failed every request to the site, public pages included, and each public page paid to load both.
Say which hash kinds each system's crypt checksBryce Kwon-4/+27
The one recipe given, SHA-512 from Debian's mkpasswd, cannot log anyone in on OpenBSD, whose crypt checks only bcrypt, or on macOS, and libxcrypt, which most Linux distributions use, recommends yescrypt instead.
Spend a missing account's login on a real hashBryce Kwon-21/+31
The fixed SHA-512 stand-in matched only the documented setup, so a site hashing with yescrypt, other rounds or bcrypt answered for missing and real names in different times, and on OpenBSD it failed at once.
Turn down passwords past 256 bytes uncheckedBryce Kwon-2/+10
SHA-crypt hashes the password in most of its rounds, so the 4 KB that cgit's POST limit lets through cost about fifteen ordinary logins per anonymous attempt.
Read the auth cookie in linear timeBryce Kwon-14/+42
Splitting the header with patterns that backtrack over spaces cost a quarter of a second per request at the 8 KB line most web servers allow, and a second at 16 KB, without any login. auth-file's trim had the same shape and now reads the cookie as well.
Offer avatars at twice the size to dense screensBryce Kwon-14/+22
The 13 pixel icon came out blurred on the high density screens most phones and laptops have.
Hash avatar addresses with SHA-256Bryce Kwon-6/+7
Gravatar's documentation now describes SHA-256 hashes on gravatar.com alone, and Libravatar has long accepted them beside MD5.
Mark avatar icons as decorativeBryce Kwon-8/+6
A screen reader announced the service's name before every author.