| Commit message (Expand) | Author | Age | Files | Lines |
| ... | |
| * | git: update for git 2.0•••prefixcmp() and suffixcmp() have been remove, functionality is now
provided by starts_with() and ends_with(). Retrurn values have been
changed, so instead of just renaming we have to fix logic.
Everything else looks just fine.
| Christian Hesse | 2014-06-28 | 1 | -13/+13 |
| * | Add a cache-snapshot-ttl configuration variable•••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>
| Lukas Fleischer | 2014-02-20 | 1 | -0/+6 |
| * | cgit: add --version argument for printing info•••We need this to do runtime tests for make test.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
| Jason A. Donenfeld | 2014-01-20 | 1 | -0/+17 |
| * | cgit.c: free tmp variable•••Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
| Jason A. Donenfeld | 2014-01-17 | 1 | -0/+1 |
| * | Switch to exclusively using global ctx•••Drop the context parameter from the following functions (and all static
helpers used by them) and use the global context instead:
* cgit_print_http_headers()
* cgit_print_docstart()
* cgit_print_pageheader()
Remove context parameter from all commands
Drop the context parameter from the following functions (and all static
helpers used by them) and use the global context instead:
* cgit_get_cmd()
* All cgit command functions.
* cgit_clone_info()
* cgit_clone_objects()
* cgit_clone_head()
* cgit_print_plain()
* cgit_show_stats()
In initialization routines, use the global context variable instead of
passing a pointer around locally.
Remove callback data parameter for cache slots
This is no longer needed since the context is always read from the
global context variable.
Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
| Lukas Fleischer | 2014-01-17 | 1 | -161/+161 |
| * | auth: have cgit calculate login address•••This way we're sure to use virtual root, or any other strangeness
encountered.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
| Jason A. Donenfeld | 2014-01-16 | 1 | -1/+2 |
| * | authentication: use hidden form instead of referer•••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>
| Jason A. Donenfeld | 2014-01-16 | 1 | -14/+8 |
| * | auth: add basic authentication filter framework•••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>
| Jason A. Donenfeld | 2014-01-16 | 1 | -2/+94 |
| * | filter: add support for email filter•••Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
| Jason A. Donenfeld | 2014-01-14 | 1 | -0/+6 |
| * | filter: basic write hooking infrastructure•••Filters can now call hook_write and unhook_write if they want to
redirect writing to stdout to a different function. This saves us from
potential file descriptor pipes and other less efficient mechanisms.
We do this instead of replacing the call in html_raw because some places
stdlib's printf functions are used (ui-patch or within git itself),
which has its own internal buffering, which makes it difficult to
interlace our function calls. So, we dlsym libc's write and then
override it in the link stage.
While we're at it, we move considerations of argument count into the
generic new filter handler.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
| Jason A. Donenfeld | 2014-01-14 | 1 | -0/+2 |
| * | filter: allow for cleanup hook for filter types•••At some point, we're going to want to do lazy deallocation of filters.
For example, if we implement lua, we'll want to load the lua runtime
once for each filter, even if that filter is called many times.
Similarly, for persistent exec filters, we'll want to load it once,
despite many open_filter and close_filter calls, and only reap the child
process at the end of the cgit process. For this reason, we add here a
cleanup function that is called at the end of cgit's main().
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
| Jason A. Donenfeld | 2014-01-14 | 1 | -0/+1 |
| * | filter: add fprintf_filter function•••This stops the code in cgit.c::print_repo needing to inspect the
cgit_filter structure, meaning that we can abstract out different filter
types that will have different fields that need to be printed.
Signed-off-by: John Keeping <john@keeping.me.uk>
| John Keeping | 2014-01-14 | 1 | -3/+3 |
| * | filter: split filter functions into their own file•••A first step for more interesting things.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
| Jason A. Donenfeld | 2014-01-10 | 1 | -36/+6 |
| * | cgit.c: Fix comment on bit mask hack•••* Formatting and spelling fixes.
* A bit mask with the size of one byte only allows for storing 8 (not
255!) different flags.
Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
| Lukas Fleischer | 2014-01-10 | 1 | -8/+10 |
| * | cgit.c: Use "else" for mutually exclusive branches•••When parsing command line arguments, no pair of command line options can
ever match simultaneously. Use "else if" blocks to reflect this. This
change improves both readability and speed.
Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
| Lukas Fleischer | 2014-01-10 | 1 | -19/+10 |
| * | Replace most uses of strncmp() with prefixcmp()•••This is a preparation for replacing all prefix checks with either
strip_prefix() or starts_with() when Git 1.8.6 is released.
Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
| Lukas Fleischer | 2014-01-10 | 1 | -9/+9 |
| * | Update copyright information•••* Name "cgit Development Team" as copyright holder to avoid listing
every single developer.
* Update copyright ranges.
Signed-off-by: Lukas Fleischer <cgit@crytocrack.de>
| Lukas Fleischer | 2014-01-08 | 1 | -2/+1 |
| * | cache: id means static, even if head is specified too•••Pages like /commit?h=wip&id=8a335ce618ba77fbf05148d6f8be17bd48ba4340
were being marked as dynamic, because of h=wip, when it should be
static, because of id=.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
| Jason A. Donenfeld | 2013-08-12 | 1 | -3/+3 |
| * | cache: document negative ttls and add about ttl•••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>
| Jason A. Donenfeld | 2013-08-12 | 1 | -3/+12 |
| * | use favicon by default | Christian Hesse | 2013-08-12 | 1 | -0/+1 |
| * | readme: use string_list instead of space deliminations•••Now this is possible in cgitrc -
readme=:README.md
readme=:readme.md
readme=:README.mkd
readme=:readme.mkd
readme=:README.rst
readme=:readme.rst
readme=:README.html
readme=:readme.html
readme=:README.htm
readme=:readme.htm
readme=:README.txt
readme=:readme.txt
readme=:README
readme=:readme
readme=:INSTALL.txt
readme=:install.txt
readme=:INSTALL
readme=:install
Suggested-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
| Jason A. Donenfeld | 2013-05-26 | 1 | -23/+69 |
| * | readme: Accept multiple candidates and test them.•••The readme variable may now contain multiple space deliminated entries,
which per usual are either a filepath or a git ref filepath. If multiple
are specified, cgit will now select the first one in the list that
exists. This is to make it easier to specify multiple default readme
types in the main cgitrc file and have them automatically get applied to
each repo based on what exists.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
| Jason A. Donenfeld | 2013-05-25 | 1 | -0/+35 |
| * | ui-summary: Pass filename to about-filter•••This gives the about-filter API the same semantics as source-filter,
where the filter receives the filename so it can decide what to do next
with it.
While we're at it, plug a memory leak.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
| Jason A. Donenfeld | 2013-05-25 | 1 | -1/+1 |
| * | cgit.c: Do not reset HOME after unsetting it.•••The number of odd cases in which git will try to read config is far too
great to keep putting a bandaid over each one, so we'll just unset it.
If it turns out that scripts really liked to know about $HOME, we can
always reset it in the filter forks.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
| Jason A. Donenfeld | 2013-05-25 | 1 | -13/+0 |
| * | cgit.c: sync repo config printing with struct cgit_repo•••We've now added quite a few config keys for repositories, but we've
forgotten to update the printing of it for cache files. Synchronize the
two.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
| Jason A. Donenfeld | 2013-05-25 | 1 | -0/+14 |
| * | Add branch-sort and repo.branch-sort options.•••When set to "name", branches are sorted by name, which is the current
default. When set to "age", branches are sorted by the age of the
repository.
This feature was requested by Konstantin Ryabitsev for use on
kernel.org.
Proposed-by: Konstantin Ryabitsev <mricon@kernel.org>
| Jason A. Donenfeld | 2013-04-10 | 1 | -1/+13 |
| * | cgit.c: Do not restore unset environment variables•••getenv() returns a NULL pointer if the specified variable name cannot be
found in the environment. However, some setenv() implementations crash
if a NULL pointer is passed as second argument. Only restore variables
that are not NULL.
See commit d96d2c98ebc4c2d3765f5b35c4142e0e828a421b for a related patch.
Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
| Lukas Fleischer | 2013-04-10 | 1 | -2/+4 |
| * | Do not load user or system gitconfig and gitattributes•••While doing any kind of git loading, unset HOME variables and set
NOSYSTEM variables so that cgit does not load any settings that a user
may have set for his own /usr/bin/git usage.
This fixes a fatal error introduced with git 1.8, whereupon git would
fatally exit when failing to access particular files.
The result of this is that only repo-local configuration files are
accessed:
zx2c4@thinkpad ~/Projects/cgit $ HOME=/root QUERY_STRING="url=foo/log"
CGIT_CONFIG=tests/trash/cgitrc strace -e access ./cgit >/dev/null
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
access("repos/foo/.git/objects", X_OK) = 0
access("repos/foo/.git/refs", X_OK) = 0
access("repos/foo/.git/config", R_OK) = 0
access("repos/foo/.git/config", R_OK) = 0
access("repos/foo/.git/objects/b3/bafdbf0183f4897ef8b1319cb8c490ed54717e", F_OK) = 0
access("repos/foo/.git/objects/b3/bafdbf0183f4897ef8b1319cb8c490ed54717e", F_OK) = 0
access("repos/foo/.git/objects/b3/bafdbf0183f4897ef8b1319cb8c490ed54717e", F_OK) = 0
access("repos/foo/.git/objects/b3/bafdbf0183f4897ef8b1319cb8c490ed54717e", F_OK) = 0
+++ exited with 0 +++
Reported-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Tested-by: Jason A. Donenfeld <Jason@zx2c4.com>
Tested-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
| Jason A. Donenfeld | 2013-04-08 | 1 | -0/+24 |
| * | use struct strbuf instead of static buffers•••Use "struct strbuf" from Git to remove the limit on file path length.
Notes on scan-tree:
This is slightly involved since I decided to pass the strbuf into
add_repo() and modify if whenever a new file name is required, which
should avoid any extra allocations within that function. The pattern
there is to append the filename, use it and then reset the buffer to its
original length (retaining a trailing '/').
Notes on ui-snapshot:
Since write_archive modifies the argv array passed to it we
copy the argv_array values into a new array of char* and then free the
original argv_array structure and the new array without worrying about
what the values now look like.
Signed-off-by: John Keeping <john@keeping.me.uk>
| John Keeping | 2013-04-08 | 1 | -36/+36 |
| * | Convert cgit_print_error to a variadic function•••This removes many uses of "fmt" which uses a fixed size static pool of
fixed size buffers. Instead of relying on these, we now pass around
argument lists for as long as possible before using a strbuf to render
content of an arbitrary size.
Signed-off-by: John Keeping <john@keeping.me.uk>
| John Keeping | 2013-04-08 | 1 | -10/+8 |
| * | Fix out-of-bounds memory accesses with virtual_root=""•••The CGit configuration variable virtual_root is normalized so that it
does not have a trailing '/' character, but it is allowed to be empty
(the empty string and NULL have different meanings here) and there is
code that is insufficiently cautious when checking if it ends in a '/':
if (virtual_root[strlen(virtual_root) - 1] != '/')
Clearly this check is redundant, but rather than simply removing it we
get a slight efficiency improvement by switching the normalization so
that the virtual_root variable always ends in '/'. Do this with a new
"ensure_end" helper.
Signed-off-by: John Keeping <john@keeping.me.uk>
| John Keeping | 2013-04-08 | 1 | -8/+3 |
| * | Do not unnecessarily strdup() environment variables•••This reverts the memory duplication introduced in commit 60a2627, while
keeping everything else that has been cleaned up. The environment
variables are never modified, so we do not need to call xstrdupn() here.
Also, remove xstrdupn() which is no longer needed.
Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
| Lukas Fleischer | 2013-04-08 | 1 | -15/+10 |
| * | Maŕk cgit_environment members const•••These reflect the values of environment variables and should never be
changed. Add another xstrdup() when we assign environment variables to
strings that are potentially non-constant.
Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
| Lukas Fleischer | 2013-04-08 | 1 | -2/+2 |
| * | find_default_branch(): Free refmatch after usage•••Fixes following memory leak seen with "PATH_INFO=/cgit/refs/":
==13408== 7 bytes in 1 blocks are definitely lost in loss record 4 of 52
==13408== at 0x4C2C04B: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==13408== by 0x56F2DF1: strdup (in /usr/lib/libc-2.17.so)
==13408== by 0x46CA78: xstrdup (wrapper.c:35)
==13408== by 0x405840: find_current_ref (cgit.c:426)
==13408== by 0x44BE5A: do_one_ref (refs.c:527)
==13408== by 0x44D3E0: do_for_each_ref_in_dir (refs.c:553)
==13408== by 0x44D85A: do_for_each_ref (refs.c:1298)
==13408== by 0x405889: find_default_branch (cgit.c:438)
==13408== by 0x405AC4: prepare_repo_cmd (cgit.c:490)
==13408== by 0x405D97: process_request (cgit.c:557)
==13408== by 0x407490: cache_process (cache.c:322)
==13408== by 0x406C18: main (cgit.c:864)
Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
| Lukas Fleischer | 2013-03-04 | 1 | -0/+8 |
| * | Mark several functions/variables static•••Spotted by parsing the output of `gcc -Wmissing-prototypes [...]`.
Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
| Lukas Fleischer | 2013-03-04 | 1 | -13/+13 |
| * | cgit.c: Remove parameter from guess_defbranch()•••We use resolve_ref() since commit 8d7c2ec2, so this is no longer needed.
Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
| Lukas Fleischer | 2013-03-04 | 1 | -2/+2 |
| * | White space around control verbs.•••Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
| Jason A. Donenfeld | 2013-03-04 | 1 | -2/+2 |
| * | Fix several whitespace errors•••* Remove whitespace at the end of lines.
* Replace space indentation by tabs.
* Add whitespace before/after several operators ("+", "-", "*", ...)
* Add whitespace to assignments ("foo = bar;").
* Fix whitespace in parameter lists ("foobar(foo, bar, 42)").
Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
| Lukas Fleischer | 2013-03-04 | 1 | -9/+9 |
| * | Update git to v1.7.9.7•••resolve_ref() is renamed to resolve_ref_unsafe(). CGit's usage is safe.
Signed-off-by: John Keeping <john@keeping.me.uk>
| John Keeping | 2013-03-02 | 1 | -1/+1 |
| * | Make "owner" column on index page configurable•••This is not really needed for personal sites where all repos belong to
the same person. Since it is pretty useful for shared sites however, it
should be configurable.
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
| Florian Pritz | 2013-02-01 | 1 | -0/+3 |
| * | ui-log: Add "commit-sort" option for controlling commit ordering•••This makes it possible to use strict commit date ordering or strict
topological ordering by passing the corresponding flags to "git log".
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
| Tobias Bieniek | 2012-10-17 | 1 | -2/+12 |
| * | ui-repolist: Add "section-sort" flag to control section sorting.•••Flag which, when set to "1", will sort the sections on the repository
listing by name. Set this flag to "0" if the order in the cgitrc file
should be preserved. Default value: "1".
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
| Tobias Bieniek | 2012-10-17 | 1 | -0/+3 |
| * | scan-tree: Unify gitweb.* and cgit.* settings into one config option.•••After some back and forth with Jamie and René, it looks like the git
config semantics are going to be like this:
- gitweb.category maps to the cgit repo config key "section"
- gitweb.description maps to the cgit repo config key "desc"
- gitweb.owner maps to the cgit repo config key "owner"
- cgit.* maps to all cgit repo config keys
This option can be enabled with "enable-git-config=1", and replaces
all previous "enable-gitweb-*" config keys.
The order of operations is as follows:
- git config settings are applied in the order that they exist in
the git config file
- if the owner is not set from git config, get the owner using the
usual getpwuid call
- if the description is not set from git config, look inside the
static $path/description file
- if section-from-path=1, override whatever previous settings were
inside of git config using the section-from-path logic
- parse $path/cgitrc for local repo.* settings, that override all
previous settings
| Jason A. Donenfeld | 2012-10-17 | 1 | -7/+3 |
| * | ui-repolist: Rename section-sort to repository-sort.•••Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
| Jason A. Donenfeld | 2012-10-16 | 1 | -3/+3 |
| * | repo_config: do not let globals override repo settings•••This makes it possible to activate the enable_commit_graph,
enable_log_filecount, and enable_log_linecount for individual
repositories, even if the global setting is "0" (default).
The commit that introduced the broken behavior was e189344, and the
commit message of that makes it clear that this wasn't the intended
behavior.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
| Tobias Bieniek | 2012-10-16 | 1 | -3/+3 |
| * | Update copyright headers to have latest dates. | Jason A. Donenfeld | 2012-07-12 | 1 | -1/+1 |
| * | ui-repolist: Case insensitive sorting and age sort•••Add two options, one for doing the ordinary name sorts in a
case-insensitive manner, and another for choosing to sort repos in each
section by age instead of by name.
| Jason A. Donenfeld | 2012-07-12 | 1 | -0/+6 |
| * | scan-tree: Support gitweb.category.•••Use gitweb.category from git config to determine repo's section, if
option is enabled.
| Jason A. Donenfeld | 2012-07-12 | 1 | -0/+1 |
| * | scan-tree: Support gitweb.description.•••Use gitweb.description instead of description file to determine
description, if option is enabled.
| Jason A. Donenfeld | 2012-07-12 | 1 | -0/+3 |
| * | Merge branch 'fh/mimetypes' | Lars Hjemli | 2012-03-18 | 1 | -0/+2 |
| |\ |
|