aboutsummaryrefslogtreecommitdiff
path: root/cgitrc.5.txt
AgeCommit message (Collapse)Author
2026-08-01theming: include solarized.css theme addonv1.3.1+12Gravatar Saya Andy
The solarized.css includes adoption of Solarized Light/Dark themes for cgit, switching between light and dark variant depending on preferred color scheme. It is not used by default, but can be easily switched on with css directive.
2026-08-01logo: include svg variant for both favicon and logov1.3.1+11Gravatar Saya Andy
The reasoning behind using svg as primary defaults is simple – at close-up it is much neater, plus svg favicon is supported since 2015 in Firefox, 2020 in Chromium, 2025 in Safari. For old browsers ico is still kept as a fallback. The svg was auto-generated using a Python script and then simplified to a path, but kept close to an original.
2026-07-31licensing: add author preambles where changes were donev1.3.1+9Gravatar Saya Andy
Add a copyright for changes done by me, also note in README the nature of this repo
2026-07-30ui-ci: let a ci-filter decide whether the tab is shownGravatar Saya Andy
cgit cannot know whether the ref being viewed actually has a pipeline, so the "ci" tab is offered for every ref and only reveals a missing one once followed. Probing the ci system from cgit is not an option: the tab is part of the page header, so it would mean a blocking request for every page of every repository, cgit links no http client, and job pages are usually not readable anonymously. Add a ci filter instead, which receives the ref, whether it is a branch or a tag, and the expanded url, and answers with its exit status. This keeps credentials, timeouts and caching in a script, where they belong; filters/ci-jenkins.sh demonstrates all three against Jenkins' REST API. The verdict is memoized, so the filter runs once per request rather than once for the tab and again for the redirect, and it governs the page as well as the tab, so a hidden tab cannot be reached by typing the url. Signed-off-by: Saya Andy <saya.andy@posteo.com>
2026-07-30ui-ci: add a "ci" tab which redirects to an external ci systemGravatar Saya Andy
Add a "ci" page which redirects to an external ci system for the ref being viewed, along with a tab for it in the repository header. The target is a url template, configurable globally or per repository, with separate settings for branches and tags because pipelines for the two commonly live at different locations: on a Jenkins multibranch pipeline a branch is at job/<name>/job/<ref> while a tag is at job/<name>/view/tags/job/<ref>. $ref, $repo and $slug are substituted, $slug being the repository url with any ".git" suffix removed and slashes replaced by dashes, which is the shape job names usually take. An explicit repo.ci-url drops the branch and tag urls the repository would otherwise inherit from the global settings, as it could never take effect otherwise. The expansion is written to the Location header verbatim rather than through cgit_redirect(), which percent-encodes '?', '=' and '%' and would corrupt any url carrying a query string. An expansion containing CR or LF is refused so that it cannot smuggle in further headers. Signed-off-by: Saya Andy <saya.andy@posteo.com>
2026-02-24ui-log: allow link following to be disabled per-repoGravatar Jason A. Donenfeld
This exists for other CPU heavy operations like blame, but doesn't for the follow functionality. Add it for that. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2022-12-19config: add jsGravatar Andy Green
Just like the config allows setting css URL path, add a config for setting the js URL path Signed-off-by: Andy Green <andy@warmcat.com> Reviewed-by: John Keeping <john@keeping.me.uk> Signed-off-by: Christian Hesse <mail@eworm.de>
2022-12-19css: change to be a listGravatar Andy Green
Without changing the default behaviour of including /cgit.css if nothing declared, allow the "css" config to be given multiple times listing one or more alternative URL paths to be included in the document head area. Signed-off-by: Andy Green <andy@warmcat.com> Signed-off-by: Christian Hesse <mail@eworm.de>
2022-12-19cgitrc: handle value "0" for max-repo-countGravatar Christian Hesse
Setting max-repo-count to "0" makes cgit loop forever generating page links. Make this a special value to show all repositories. Signed-off-by: Christian Hesse <mail@eworm.de>
2022-12-19about: allow to give head from queryGravatar Christian Hesse
Reading the README from repository used to be limited to default branch or a branch given in configuration. Let's allow a branch from query if not specified explicitly. Signed-off-by: Christian Hesse <mail@eworm.de>
2020-03-12ui-snapshot: add support for zstd compressionGravatar Christian Hesse
This patch adds support for zstd [0] compressed snapshots (*.tar.zst). We enable multiple working threads (-T0), but keep default compression level. The latter can be influenced by environment variable. [0] https://www.zstd.net/ Signed-off-by: Christian Hesse <mail@eworm.de>
2020-02-26ui-snapshot: add support for lzip compressionGravatar Hanspeter Portner
This patch adds support for lzip [1] compressed snapshots (*.tar.lz) [1] https://www.nongnu.org/lzip/ Signed-off-by: Hanspeter Portner <dev@open-music-kontrollers.ch> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-06-25ui-tree: allow per repository override for enable-blameGravatar Christian Hesse
The blame operation can cause high cost in terms of CPU load for huge repositories. Let's add a per repository override for enable-blame. Signed-off-by: Christian Hesse <mail@eworm.de>
2018-07-05cgitrc.5: add local tar signature exampleGravatar Jason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-07-03cgitrc.5: document new signature notesGravatar Jason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-07-03extra-head-content: introduce another option for meta tagsGravatar Jason A. Donenfeld
This is to support things like go-import meta tags, which are on a per-repo basis. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-06-27manpage: fix sorting orderGravatar Andy Green
You maybe didn't know you had OCD until you saw an alpha sorted list that has stuff out of order in it. Signed-off-by: Andy Green <andy@warmcat.com> Reviewed-by: John Keeping <john@keeping.me.uk>
2018-06-27global: remove functionality we deprecated for cgit v1.0Gravatar Christian Hesse
The man page states these were deprecated for v1.0. We are past v1.1, so remove the functionality. Signed-off-by: Christian Hesse <mail@eworm.de> Reviewed-by: John Keeping <john@keeping.me.uk>
2018-06-27snapshot: support special value 'all' to enable all formatsGravatar Christian Hesse
Signed-off-by: Christian Hesse <mail@eworm.de> Reviewed-by: John Keeping <john@keeping.me.uk>
2018-06-27Add "snapshot-prefix" repo configurationGravatar John Keeping
Allow using a user-specified value for the prefix in snapshot files instead of the repository basename. For example, files downloaded from the linux-stable.git repository should be named linux-$VERSION and not linux-stable-$VERSION, which can be achieved by setting: repo.snapshot-prefix=linux Signed-off-by: John Keeping <john@keeping.me.uk> Reviewed-by: Christian Hesse <mail@eworm.de>
2017-10-03ui-blame: add blame UIGravatar Jeff Smith
Implement a page which provides the blame view of a specified file. This feature is controlled by a new config variable, "enable-blame", which is disabled by default. Signed-off-by: Jeff Smith <whydoubt@gmail.com> Reviewed-by: John Keeping <john@keeping.me.uk>
2016-07-06Fix spelling in man pageGravatar Peter Colberg
Signed-off-by: Peter Colberg <peter@colberg.org>
2016-03-08Renamed repo-specific configuration for enable-html-serving in cgitrc.5.txtGravatar Matt Comben
2016-02-22ui-shared: add homepage to tabsGravatar Jason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2016-01-14ui-plain: add enable-html-serving flagGravatar Jason A. Donenfeld
Unrestricts plain/ to contents likely to be executed by browser.
2015-08-12log: allow users to follow a fileGravatar John Keeping
Teach the "log" UI to behave in the same way as "git log --follow", when given a suitable instruction by the user. The default behaviour remains to show the log without following renames, but the follow behaviour can be activated by following a link in the page header. Follow is not the default because outputting merges in follow mode is tricky ("git log --follow" will not show merges). We also disable the graph in follow mode because the commit graph is not simplified so we end up with frequent gaps in the graph and many lines that do not connect with any commits we're actually showing. We also teach the "diff" and "commit" UIs to respect the follow flag on URLs, causing the single-file version of these UIs to detect renames. This feature is needed only for commits that rename the path we're interested in. For commits before the file has been renamed (i.e. that appear later in the log list) we change the file path in the links from the log to point to the old name; this means that links to commits always limit by the path known to that commit. If we didn't do this we would need to walk down the log diff'ing every commit whenever we want to show a commit. The drawback is that the "Log" link in the top bar of such a page links to the log limited by the old name, so it will only show pre-rename commits. I consider this a reasonable trade-off since the "Back" button still works and the log matches the path displayed in the top bar. Since following renames requires running diff on every commit we consider, I've added a knob to the configuration file to globally enable/disable this feature. Note that we may consider a large number of commits the revision walking machinery no longer performs any path limitation so we have to examine every commit until we find a page full of commits that affect the target path or something related to it. Suggested-by: René Neumann <necoro@necoro.eu> Signed-off-by: John Keeping <john@keeping.me.uk>
2015-01-29Add repo.hide and repo.ignoreGravatar Lukas Fleischer
These options can be used to hide a repository from the index or completely ignore a repository, respectively. They are particularly useful when used in combination with scan-path. Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
2014-12-23repolist: add owner-filterGravatar Chris Burroughs
This allows custom links to be used for repository owners by configuring a filter to be applied in the "Owner" column in the repository list.
2014-08-01cgitrc.5: we mean a cgi response, not requestGravatar Jason A. Donenfeld
2014-04-17remove trailing whitespaces from source filesGravatar Christian Hesse
2014-02-21Clean up cache documentation.Gravatar Jason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2014-02-21Skip cache slot when time-to-live is zeroGravatar Lukas Fleischer
If time-to-live is set to zero, we don't need to regenerate the cache slots on every request. Instead, just skip the caching process and immediately provide the dynamically generated version of the page. Setting time-to-live to zero is useful when you want to disable caching for certain pages. Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
2014-02-20Add a cache-snapshot-ttl configuration variableGravatar Lukas Fleischer
This can be used to specify the TTL for snapshots. Snapshots are usually static and do not ever change. On the other hand, tarball generation is CPU intensive. One use case of this setting (apart from increasing the lifetime of snapshot cache slots) is caching of snapshots while disabling the cache for static/dynamic HTML pages (by setting TTL to zero for everything except for snapshot requests). Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
2014-01-16auth: have cgit calculate login addressGravatar Jason A. Donenfeld
This way we're sure to use virtual root, or any other strangeness encountered. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2014-01-16authentication: use hidden form instead of refererGravatar Jason A. Donenfeld
This also gives us some CSRF protection. Note that we make use of the hmac to protect the redirect value. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2014-01-16auth: add basic authentication filter frameworkGravatar Jason A. Donenfeld
This leverages the new lua support. See filters/simple-authentication.lua for explaination of how this works. There is also additional documentation in cgitrc.5.txt. Though this is a cookie-based approach, cgit's caching mechanism is preserved for authenticated pages. Very plugable and extendable depending on user needs. The sample script uses an HMAC-SHA1 based cookie to store the currently logged in user, with an expiration date. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2014-01-14filter: allow returning exit code from filterGravatar Jason A. Donenfeld
Filters can now indicate a status back to cgit by means of the exit code for exec, or the return value from close for Lua. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2014-01-14cgitrc.5.txt: Fix documentation of the snapshot maskGravatar Lukas Fleischer
Mention that the snapshot setting only specifies the formats that links are generated for and not the set of formats that are accessible via HTTP. Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
2014-01-14filter: add page source to email filterGravatar Jason A. Donenfeld
Since the email filter is called from lots of places, the script might benefit from knowing the origin. That way it can modify its contents and/or size depending. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2014-01-14filter: add support for email filterGravatar Jason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2014-01-14filter: add lua supportGravatar Jason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2014-01-14filter: introduce "filter type" prefixGravatar John Keeping
This allows different filter implementations to be specified in the configuration file. Currently only "exec" is supported, but it may now be specified either with or without the "exec:" prefix. Signed-off-by: John Keeping <john@keeping.me.uk>
2014-01-08Add a suggestion to the manpageGravatar Přemysl Janouch
So that people wishing to use "enable-http-clone" don't have to find out the correct settings on their own. Signed-off-by: Přemysl Janouch <p.janouch@gmail.com>
2014-01-08Fix the example configurationGravatar Přemysl Janouch
"enable-git-clone" doesn't exist, replaced with "enable-http-clone". Signed-off-by: Přemysl Janouch <p.janouch@gmail.com>
2014-01-08Fix some spelling errorsGravatar Přemysl Janouch
Signed-off-by: Přemysl Janouch <p.janouch@gmail.com>
2013-08-16Fix silly spelling error.Gravatar Jason A. Donenfeld
2013-08-12add a note about generating agefile in hookGravatar Christian Hesse
2013-08-12cache: document negative ttls and add about ttlGravatar Jason A. Donenfeld
We've long supported negative ttls, for infinite cache, except the documentation incorrectly showed one of our defaults as being 5 and not -1. As well, with a negative ttl, we were actually making the HTTP expired header go backwards. This changes it to go ahead ten years instead. Further, we add an cache-about-ttl option to set a different ttl for about pages, which are now increasingly being filtered through markdown or just sent statically anyway. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2013-08-12use favicon by defaultGravatar Christian Hesse
2013-05-27cgitrc.5: improve example configGravatar Jason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>