Re: about-filter flexibility

2013-05-25 Thread Jason A. Donenfeld
To those of you for whom C is easier than any human language, here's specifically what I have in mind: http://git.zx2c4.com/cgit/commit/?h=jd/auto-aboutid=82c6ed9a7bbc77f207f5e428a60bcbff005e587b Code-wise it's simple, but it could potentially be slightly disruptive.

CVE Request: cgit directory traversal

2013-05-25 Thread Jason A. Donenfeld
Hi Kurt, As mentioned in early messages to oss-sec, I've inherited maintainership of the cgit codebase and am gradually auditing it. Today I found a nasty directory traversal: http://somehost/?url=/somerepo/about/../../../../etc/passwd This should be pretty straightforward to categorize.

Re: [oss-security] CVE Request: cgit directory traversal

2013-05-27 Thread Jason A. Donenfeld
Hi Kurt, This issue has now been fixed with CGit v0.9.2: The announcement may be read here: http://lists.zx2c4.com/pipermail/cgit/2013-May/001394.html Jason ___ CGit mailing list CGit@lists.zx2c4.com http://lists.zx2c4.com/mailman/listinfo/cgit

Re: [oss-security] CVE Request: cgit directory traversal

2013-05-27 Thread Jason A. Donenfeld
On Mon, May 27, 2013 at 2:30 PM, Jan Lieskovsky jlies...@redhat.com wrote: Can you provide a patch that would apply against v0.9.1 version too? Or would this be just problem of master branch code? I could, but you'd be much better off just upgrading to v0.9.2.

Re: add favicon to cgit

2013-06-03 Thread Jason A. Donenfeld
On Wed, May 29, 2013 at 10:20 AM, Christian Hesse l...@eworm.de wrote: I was wondering why cgit does not ship a favicon by default. Could not find any discussions about that, so I hope I do not raise a discussion that has already been decided. Looks great! Thanks Christian. Merged into master.

Re: configfile.c:63:14: warning: array subscript is above array [-Warray-bounds]

2013-06-04 Thread Jason A. Donenfeld
Here is the function in question: static int read_config_line(FILE *f, char *line, const char **value, int bufsize) { int i = 0, isname = 0; *value = NULL; while (i bufsize - 1) { int c = next_char(f); if (!isname (c == '#' || c == ';'))

Re: [PATCH] Use strbuf for reading configuration files

2013-06-04 Thread Jason A. Donenfeld
Looks mostly okay. While you're at it, what about fixing the BUG mentioned at the bottom of cgitrc.5.txt? ___ CGit mailing list CGit@lists.zx2c4.com http://lists.zx2c4.com/mailman/listinfo/cgit

Re: section-from-path 1

2013-08-12 Thread Jason A. Donenfeld
The relevant code is here: if (ctx.cfg.section_from_path) { n = ctx.cfg.section_from_path; if (n 0) { slash = rel.buf; while (slash n (slash = strchr(slash, '/'))) n--;

Re: section-from-path 1

2013-08-12 Thread Jason A. Donenfeld
Caught up to mailing list posts. Thanks for the fix Lukas. Disregard prior message. ___ CGit mailing list CGit@lists.zx2c4.com http://lists.zx2c4.com/mailman/listinfo/cgit

Re: [PATCH 0/3] Download patch between arbitrary revisions

2013-08-14 Thread Jason A. Donenfeld
This will be reviewed as soon as I'm back home from vacation (which will be soon!), but for now, it's staging in: http://git.zx2c4.com/cgit/log/?h=lf/diffs If you also implement the git-format-patch improvements as discussed in the RFE, go ahead and base it on this branch.

Re: [PATCH] ui-patch.c: Fix formatting for merge commits

2013-08-22 Thread Jason A. Donenfeld
On Thu, Aug 22, 2013 at 2:48 PM, Lukas Fleischer c...@cryptocrack.de wrote: + rev.max_parents = 1; Good catch. This is what builtin/log.c does in get_patch_ids as well. Might be a good function to look at for comparison, in case you aren't already doing that.

Re: [PATCH/RFC 1/2] ui-diff: Use diff_tree_sha1() for raw diff formatting

2013-08-26 Thread Jason A. Donenfeld
On Tue, Aug 27, 2013 at 3:27 AM, Lukas Fleischer c...@cryptocrack.dewrote: + } else { + /* +* SHA-1 of an empty tree. We might be better off not +* hardcoding this. +*/ +

Merging -- Dec 6

2013-11-27 Thread Jason A. Donenfeld
Hi Folks, Merging of patches will resume on December 6th at 15h00 CEST. I will also be bringing Lukas Fleischer on board to help out with the review and merges, so that we can maintain a good pace of commits. Talk to you all next week. Jason ___ CGit

Welcome on board Lukas Fleischer

2014-01-08 Thread Jason A. Donenfeld
Hey folks, To speed things up with the merges and reviews of patches on this list, I've given Lukas Fleischer commit access. He's going to be helping me maintain the project. We'll each be merging and committing patches to jd/staging and lf/staging, and from there onto master. I'll be updating

Re: [PATCH] Fixed Arch Linux package link.

2014-01-08 Thread Jason A. Donenfeld
Much better. Updating the link to that. ___ CGit mailing list CGit@lists.zx2c4.com http://lists.zx2c4.com/mailman/listinfo/cgit

Re: RFE: author/committer/tagger links (enable cgit to show gravatar for author, committer and tagger)

2014-01-09 Thread Jason A. Donenfeld
this idea quite a bit. But the cost of forking indeed seems a bit high -- some listings have many many authors all at once. I'll investigate a little bit. -- Jason A. Donenfeld Deep Space Explorer fr: +33 6 51 90 82 66 us: +1 513 476 1200 www.jasondonenfeld.com

RFE: .so filters

2014-01-09 Thread Jason A. Donenfeld
Hey folks, I'm thinking about this filtering situation w.r.t. gravatar and potentially running multiple filters on one page. Something I've been considering is implementing a simple dlopen() mechanism for filters, if the filter filename starts with soname: or lib: or similar, so as to avoid the

Re: RFE: .so filters

2014-01-09 Thread Jason A. Donenfeld
On Fri, Jan 10, 2014 at 3:11 AM, Jason A. Donenfeld ja...@zx2c4.com wrote: Problems abound. This has race condition issues, where the parent process will SIGSTOP the child before the child can write its output. This could be fixed with a more complicated signaling protocol, but that's more

Re: RFE: .so filters

2014-01-10 Thread Jason A. Donenfeld
On Fri, Jan 10, 2014 at 10:06 AM, John Keeping j...@keeping.me.uk wrote: This seems drastically over complicated. So here's the situation. There's a lot of state that we're taking advantage of in using processes that terminate, that needs to be replicated: *a* Sending arguments to the

Re: [PATCH 1/4] Replace most uses of strncmp() with prefixcmp()

2014-01-10 Thread Jason A. Donenfeld
Looks good, merged. ___ CGit mailing list CGit@lists.zx2c4.com http://lists.zx2c4.com/mailman/listinfo/cgit

Re: [PATCH 1/2] cgit.c: Use else for mutually exclusive branches

2014-01-10 Thread Jason A. Donenfeld
Seems reasonable. Merged. ___ CGit mailing list CGit@lists.zx2c4.com http://lists.zx2c4.com/mailman/listinfo/cgit

Re: [PATCH] Disallow downloading disabled snapshot formats

2014-01-10 Thread Jason A. Donenfeld
On Fri, Jan 10, 2014 at 3:38 PM, Lukas Fleischer c...@cryptocrack.de wrote: We did only display enabled snapshot formats but we did not prevent from downloading disabled formats when requested. Fix this by adding an appropriate check. Previously:

sendfile patch revival?

2014-01-10 Thread Jason A. Donenfeld
Looking through the archives, I stumbled across this neglected patch: http://lists.zx2c4.com/pipermail/cgit/2012-June/000642.html Anybody want to investigate and brush this up for merging currently? ___ CGit mailing list CGit@lists.zx2c4.com

Re: RFE: .so filters

2014-01-10 Thread Jason A. Donenfeld
On Fri, Jan 10, 2014 at 6:20 PM, John Keeping j...@keeping.me.uk wrote: I was also wondering if supporting unix:/path/to/socket would be useful, then the filter would connect on a Unix socket, run and disconnect, on the assumption that the administrator has a daemon running to do the

Re: [PATCH 1/6] html: remove redundant htmlfd variable

2014-01-12 Thread Jason A. Donenfeld
I'm merging this, but, it strikes me the initial intent of this was a bit neat -- instead of dup2ing over stdout and restoring it with a dup'd original stdout, the htmlfd just had to be modified. I may end up reverting this change later, but for now I'll merge it.

Re: [PATCH 4/6] filter: add fprintf_filter function

2014-01-12 Thread Jason A. Donenfeld
What's the purpose of this? Why not just keep the original string that was passed to about-filter=... in the cmd variable as we have now? The thing that's variable from filter to filter is argv, the type (commit, about, etc), and the mechanism (lua, stdout, etc). But the variable aspects don't

Re: [PATCH 4/6] filter: add fprintf_filter function

2014-01-12 Thread Jason A. Donenfeld
On Sun, Jan 12, 2014 at 8:35 PM, John Keeping j...@keeping.me.uk wrote: I'm looking at splitting up the data so there is a filter object that contains function pointers to implementation functions and then some data that is specific to to given filter type. With that change, cmd moves to the

[PATCH] filter: allow for cleanup hook for filter types

2014-01-12 Thread Jason A. Donenfeld
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 ja...@zx2c4.com --- cgit.c | 1 + cgit.h | 2 ++ filter.c | 85

Re: [PATCH 2/3] ui-shared: URL-escape script_name

2014-01-12 Thread Jason A. Donenfeld
Are there any circumstances in which this could have prior lead to an XSS? ___ CGit mailing list CGit@lists.zx2c4.com http://lists.zx2c4.com/mailman/listinfo/cgit

[PATCH] filter: basic write hooking infrastructure

2014-01-12 Thread Jason A. Donenfeld
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. Signed-off-by: Jason A. Donenfeld ja...@zx2c4.com --- cgit.c | 2 ++ cgit.h | 1

Re: [PATCH 1/3] ui-refs: escape HTML chars in author and tagger names

2014-01-12 Thread Jason A. Donenfeld
Same question here -- XSS potential? ___ CGit mailing list CGit@lists.zx2c4.com http://lists.zx2c4.com/mailman/listinfo/cgit

[PATCH v2] filter: basic write hooking infrastructure

2014-01-12 Thread Jason A. Donenfeld
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. Signed-off-by: Jason A. Donenfeld ja...@zx2c4.com --- cgit.c | 2 ++ cgit.h | 1

[PATCH 03/12] filter: introduce filter type prefix

2014-01-12 Thread Jason A. Donenfeld
From: John Keeping j...@keeping.me.uk 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 j...@keeping.me.uk --- cgitrc.5.txt |

[PATCH 01/12] filter: add fprintf_filter function

2014-01-12 Thread Jason A. Donenfeld
From: John Keeping j...@keeping.me.uk 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 j...@keeping.me.uk ---

[PATCH 00/12] filter framework and lua integration: complete

2014-01-12 Thread Jason A. Donenfeld
, evidently. Jason A. Donenfeld (9): filter: allow for cleanup hook for filter types filter: basic write hooking infrastructure filter: add preliminary lua support filter: document lua filter type filter: lua error reporting filter: return on null filter from open and close filter: add

[PATCH 11/12] filter: add simple gravatar email filter

2014-01-12 Thread Jason A. Donenfeld
Signed-off-by: Jason A. Donenfeld ja...@zx2c4.com --- filters/email-gravatar.py | 30 ++ 1 file changed, 30 insertions(+) create mode 100755 filters/email-gravatar.py diff --git a/filters/email-gravatar.py b/filters/email-gravatar.py new file mode 100755 index

[PATCH 05/12] filter: basic write hooking infrastructure

2014-01-12 Thread Jason A. Donenfeld
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. Signed-off-by: Jason A. Donenfeld ja...@zx2c4.com --- cgit.c | 2 ++ cgit.h | 1

[PATCH 04/12] filter: allow for cleanup hook for filter types

2014-01-12 Thread Jason A. Donenfeld
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 ja...@zx2c4.com --- cgit.c | 1 + cgit.h | 2 ++ filter.c | 85

[PATCH 12/12] filter: add gravatar lua script

2014-01-12 Thread Jason A. Donenfeld
Signed-off-by: Jason A. Donenfeld ja...@zx2c4.com --- filters/email-gravatar.lua | 25 + filters/email-gravatar.py | 3 +++ 2 files changed, 28 insertions(+) create mode 100644 filters/email-gravatar.lua diff --git a/filters/email-gravatar.lua b/filters/email

Re: sendfile patch revival?

2014-01-12 Thread Jason A. Donenfeld
That would be much appreciated. Thanks Sebastian. Also, if there's anything else that you worked on that didn't get picked up, now would be a decent time to submit it for rereview. ___ CGit mailing list CGit@lists.zx2c4.com

[PATCH v2 1/9] filter: add fprintf_filter function

2014-01-13 Thread Jason A. Donenfeld
From: John Keeping j...@keeping.me.uk 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 j...@keeping.me.uk ---

[PATCH v2 0/9] filter framework and lua support: complete

2014-01-13 Thread Jason A. Donenfeld
. At least for now. Jason A. Donenfeld (6): filter: allow for cleanup hook for filter types filter: basic write hooking infrastructure filter: add lua support filter: return on null filter from open and close filter: add support for email filter filter: add gravatar scripts John

[PATCH v2 4/9] filter: allow for cleanup hook for filter types

2014-01-13 Thread Jason A. Donenfeld
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 ja...@zx2c4.com --- cgit.c | 1 + cgit.h | 2 ++ filter.c | 90

[PATCH v2 9/9] filter: add gravatar scripts

2014-01-13 Thread Jason A. Donenfeld
The lua one is hugely faster than the python one, but both are included for comparison. Signed-off-by: Jason A. Donenfeld ja...@zx2c4.com --- filters/email-gravatar.lua | 25 + filters/email-gravatar.py | 33 + 2 files changed, 58

[PATCH v2 2/9] filter: add interface layer

2014-01-13 Thread Jason A. Donenfeld
From: John Keeping j...@keeping.me.uk Change the existing cgit_{open,close,fprintf}_filter functions to delegate to filter-specific implementations accessed via function pointers on the cgit_filter object. We treat the exec filter type slightly specially here by putting its structure definition

[PATCH v2 8/9] filter: add support for email filter

2014-01-13 Thread Jason A. Donenfeld
Signed-off-by: Jason A. Donenfeld ja...@zx2c4.com --- cgit.c | 6 ++ cgit.h | 4 +++- cgitrc.5.txt | 18 ++ filter.c | 3 +++ shared.c | 1 + ui-commit.c | 4 ui-log.c | 2 ++ ui-refs.c| 9 - ui-tag.c | 2 ++ 9 files

[PATCH v2 7/9] filter: return on null filter from open and close

2014-01-13 Thread Jason A. Donenfeld
So that we don't have to include the if(filter) open_filter(filter) block everywhere, we introduce the guard in the function itself. This should simplify quite a bit of code. Signed-off-by: Jason A. Donenfeld ja...@zx2c4.com --- filter.c | 4 ui-commit.c | 18 ++ ui

[PATCH v2 6/9] filter: add lua support

2014-01-13 Thread Jason A. Donenfeld
Signed-off-by: Jason A. Donenfeld ja...@zx2c4.com --- cgit.mk | 22 ++- cgitrc.5.txt | 29 ++ filter.c | 186 +++ 3 files changed, 234 insertions(+), 3 deletions(-) diff --git a/cgit.mk b/cgit.mk index 9d6dea8

Re: [PATCH v2] filters: Improved syntax-highlighting.py

2014-01-13 Thread Jason A. Donenfeld
Thanks for all your hard work on this. Sorry for the extended back and forth. More comments, alas alas, below. On Mon, Jan 13, 2014 at 12:02 PM, Stefan Tatschner ste...@sevenbyte.org wrote: - Using inline CSS instead of this sys.stdout.print() hack. Please don't do this. Inline CSS makes for

lua vs luajit vs both

2014-01-13 Thread Jason A. Donenfeld
Hi, What reasons do we have for supporting lua at all? Why not just go with luajit? It's faster and just as widely supported. The motivation for not supporting vanilla lua is this luajit library: http://luajit.org/ext_ffi.html . This would be a nice way of being able to ship scripts without a big

Re: [PATCH v3 1/2] filters: Improved syntax-highlighting.py

2014-01-13 Thread Jason A. Donenfeld
Perfect! Applied. Thanks for going through all the revisions. ___ CGit mailing list CGit@lists.zx2c4.com http://lists.zx2c4.com/mailman/listinfo/cgit

Re: [PATCH v3 1/2] filters: Improved syntax-highlighting.py

2014-01-13 Thread Jason A. Donenfeld
On Mon, Jan 13, 2014 at 11:13 PM, Stefan Tatschner ste...@sevenbyte.org wrote: Why did you apply my patch with tabs instead of spaces? I was wondering because I adjusted the python script according to pep8 [1] and I'm sure the patchfile was with spaces. Maybe you have an automatic convert

Re: [PATCH v3 2/2] filters: Choose 'trac' theme in pygments

2014-01-13 Thread Jason A. Donenfeld
Personally, I think the trac colors are a bit ugly. I like pastie best. But this is just preference. Here's a comparison site: http://blog.favrik.com/2011/02/22/preview-all-pygments-styles-for-your-code-highlighting-needs/ If folks want to take some kind of vote, I'll go with majority opinion.

Re: cgit-lua: to jit or not to jit

2014-01-13 Thread Jason A. Donenfeld
On Tue, Jan 14, 2014 at 3:12 AM, Tim Hill drtimh...@gmail.com wrote: LuaJIT is currently compatible with Lua 5.1, not 5.2 or the upcoming 5.3, and my understanding is the LuaJIT project has now forked from mainstream Lua and will not be staying in sync with anything past 5.1, so I would

Re: cgit-lua: to jit or not to jit

2014-01-13 Thread Jason A. Donenfeld
On Tue, Jan 14, 2014 at 3:37 AM, Andrew Starks andrew.sta...@trms.com wrote: I don't have LuaJit installed and would not install it (and migrate everything I do over to it) just to use a library. By way of example, your library may as well have been written for Python, for as much good as it

Re: [PATCH 1/1] fix email-gravatar.lua for lua 5.2

2014-01-14 Thread Jason A. Donenfeld
Merged, thanks. What exactly is the reason for this change in Lua 5.2? ___ CGit mailing list CGit@lists.zx2c4.com http://lists.zx2c4.com/mailman/listinfo/cgit

Re: [PATCH 1/1] fix UTF-8 with email-gravatar.py

2014-01-14 Thread Jason A. Donenfeld
Ahhh Python... *sigh* Merged. Thanks for this. ___ CGit mailing list CGit@lists.zx2c4.com http://lists.zx2c4.com/mailman/listinfo/cgit

Re: [PATCH 1/1] fix html syntax in email-gravatar.*

2014-01-14 Thread Jason A. Donenfeld
Good catch with amp;. Merged. ___ CGit mailing list CGit@lists.zx2c4.com http://lists.zx2c4.com/mailman/listinfo/cgit

Re: [PATCH/RFC] tests/: Add t0111-filter.sh

2014-01-14 Thread Jason A. Donenfeld
Terrific! I was hoping something like this would come about. Looking forward to seeing the lua side of things. There's another change I'm going to be pushing later today that involves being able to do meaningful things with the cgit_filter_close() exit code. I'll then be using this to /maybe/

[PATCH] filter: refactor cgit_new_filter()

2014-01-14 Thread Jason A. Donenfeld
From: Lukas Fleischer c...@cryptocrack.de Use prefixcmp() as a preparation for using strip_prefix() later. Also, interpret the command as a file name if it contains a colon but none of the filter prefixes matches instead of bailing out and adding a special check for Windows. Signed-off-by: Lukas

Re: cgit-lua: to jit or not to jit

2014-01-14 Thread Jason A. Donenfeld
On Tue, Jan 14, 2014 at 4:51 AM, Andrew Starks andrew.sta...@trms.com wrote: I also just remembered this: https://github.com/jmckaskill/luaffi Which is a luajit compatible FFI extension for Lua 5.1 and Lua 5.2, but 5.2 is listed as beta. It might be worth a shot, if it lets you gain some of

Re: [PATCH 1/1] filter: fix lua function name

2014-01-14 Thread Jason A. Donenfeld
Wow you're quick. I pushed and then [improperly] rebased within a matter of 15 seconds. But I guess you caught this anyway. ___ CGit mailing list CGit@lists.zx2c4.com http://lists.zx2c4.com/mailman/listinfo/cgit

Re: [RESEND PATCH 1/1] enable cgit to show gravatar for author, committer and tagger

2014-01-14 Thread Jason A. Donenfeld
On Tue, Jan 14, 2014 at 6:22 PM, Christian Hesse l...@eworm.de wrote: Looks better, though not perfect. At least firefox still scales the image a bit. Can you investigate the whole px to pt situation, line-height, and the best way to manage this? ___

Re: [RESEND PATCH 1/1] enable cgit to show gravatar for author, committer and tagger

2014-01-14 Thread Jason A. Donenfeld
On Tue, Jan 14, 2014 at 6:35 PM, Christian Hesse l...@eworm.de wrote: Probably the only way to not have this is to use pixel only for images. Want a patch? I think I have it handled. Would you look at git.zx2c4.com/cgit/log/ and tell me if that looks better to you?

Re: [RESEND PATCH 1/1] enable cgit to show gravatar for author, committer and tagger

2014-01-14 Thread Jason A. Donenfeld
On Tue, Jan 14, 2014 at 6:58 PM, Christian Hesse l...@eworm.de wrote: Looks good to me. Though this may result in images that do not fit font size if dpi is a lot more or less than 96 as René pointed. Anybody want to try with a fancy retina iPad or the like?

Re: lua vs luajit vs both

2014-01-14 Thread Jason A. Donenfeld
On Tue, Jan 14, 2014 at 10:08 AM, John Keeping j...@keeping.me.uk wrote: It was more of a there doesn't seem much overhead to supporting both, since the API is the same. I think the Makefile should take an approach more like this though: ifdef NO_LUA CGIT_CFLAGS +=

Re: authentication support: work has begun!

2014-01-15 Thread Jason A. Donenfeld
On Wed, Jan 15, 2014 at 10:28 AM, Peter Wu lekenst...@gmail.com wrote: The script is vulnerable to header injection: $ curl -i http://git.zx2c4.com/login -H 'Referer: x%0d\nX: 1' \ -d 'username=1; path%3d/password=%0aY: 2' HTTP/1.1 302 Redirect Server: ZX2C4 Web Server Date: Wed, 15 Jan

Re: [PATCH 1/1] email-gravatar: fix html syntax issues

2014-01-15 Thread Jason A. Donenfeld
Jimminy cricket. Okay, merged. ___ CGit mailing list CGit@lists.zx2c4.com http://lists.zx2c4.com/mailman/listinfo/cgit

Re: [PATCH 3/3] t0111: Check all arguments

2014-01-15 Thread Jason A. Donenfeld
Squashed and merged this series. ___ CGit mailing list CGit@lists.zx2c4.com http://lists.zx2c4.com/mailman/listinfo/cgit

Re: authentication support: work has begun!

2014-01-15 Thread Jason A. Donenfeld
Username: jason Password: secretpassword ___ CGit mailing list CGit@lists.zx2c4.com http://lists.zx2c4.com/mailman/listinfo/cgit

[PATCH] auth: add basic authentication filter framework

2014-01-15 Thread Jason A. Donenfeld
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 ja...@zx2c4.com --- You can try this out at http://git.zx2c4.com/glouglou/log using the username jason and the password

Re: authentication support: work has begun!

2014-01-15 Thread Jason A. Donenfeld
On Wed, Jan 15, 2014 at 7:29 PM, Jason A. Donenfeld ja...@zx2c4.com wrote: On Wed, Jan 15, 2014 at 7:17 PM, Peter Wu lekenst...@gmail.com wrote: The current login page is cachable, you should add Cache-Control: private to prevent that. Excellent idea. I've added no-cache, no-store

Re: Policy on global variables

2014-01-15 Thread Jason A. Donenfeld
On Thu, Jan 16, 2014 at 1:59 AM, Eric Wong normalper...@yhbt.net wrote: This. I prefer we keep passing around the ctx variable to keep the code more flexible for future reuse. Of course, IIRC git itself has this limitation, too... Can anyone confirm or deny this? Is it a pointless endeavor

author/committer/tagger links -- kernel.org?

2014-01-15 Thread Jason A. Donenfeld
Hey Konstantin, On Thu, Jan 9, 2014 at 4:21 PM, Konstantin Ryabitsev mri...@kernel.org wrote: That's pretty nifty. That reminds me -- I'm working on a web-of-trust site for kernel.org and something I wouldn't mind having is a way to link from cgit to the web of trust for that person. E.g. an

Re: Policy on global variables

2014-01-16 Thread Jason A. Donenfeld
On Thu, Jan 16, 2014 at 11:47 AM, Eric Wong normalper...@yhbt.net wrote: Lars Hjemli hje...@gmail.com wrote: Supporting something like FCGI in cgit will require a fork(2) for each request, before invoking libgit.a functions, since these functions are not generally reentrant (they tend to use

TODO list for next release

2014-01-16 Thread Jason A. Donenfeld
Hi guys, We're getting close to release time. Here's what I'm hoping for between now and then: - Review lua - Review authentication filter - Write tests for authentication filter - Implement time invariant string compare function in lua for simple-authentication.lua - Potentially merge or reject

Time Invariant String Comparison

2014-01-16 Thread Jason A. Donenfeld
Hi guys, Over at cgit [1] we use Lua for our authentication framework [2]. One thing we're doing wrong is lines like these: if password == post[password] then Since an attacker can control the post params, this test is vulnerable to a timing attack, by which an attacker could determine

Re: Policy on global variables

2014-01-16 Thread Jason A. Donenfeld
On Thu, Jan 16, 2014 at 2:08 PM, John Keeping j...@keeping.me.uk wrote: I had a look at porting to libgit2 about a year ago and it mostly isn't too bad. IIRC the only problematic area is the graph output which we currently get from libgit.a but would have to do ourselves if we switch to

Re: owner links? (was: author/committer/tagger links -- kernel.org?)

2014-01-16 Thread Jason A. Donenfeld
On Thu, Jan 16, 2014 at 2:46 PM, Kyle J. McKay mack...@gmail.com wrote: And we use this hook: $owner_link_hook = sub { url_path($Girocco::Config::webadmurl). /projlist.cgi?name=.md5_hex($_[0]); }; Well, that wound up being totally trivial, and a logical thing to have by

[PATCH] repolist: make owner clickable to search

2014-01-16 Thread Jason A. Donenfeld
Signed-off-by: Jason A. Donenfeld ja...@zx2c4.com --- ** MAYBE THIS WON'T BE MERGED ** This is super simple and seems like a no brainer but... As an alternative to this, we could pretty easily pipe the owner through the email-filter, even though the owner name isn't associated with an email

Re: Policy on global variables

2014-01-16 Thread Jason A. Donenfeld
On Thu, Jan 16, 2014 at 11:20 PM, John Keeping j...@keeping.me.uk wrote: At once (as in in parallel), or without needing to fork for every request? I think that many requests serially in the same process is a much more likely scenario (that's what FastCGI does); in that case all we need to do

Re: [RFC] Moving the about tab to the left

2014-01-16 Thread Jason A. Donenfeld
There were no comments about this after I posted this seven months ago, so I'm going to merge this, pending no objections. On May 26, 2013 4:36 PM, Jason A. Donenfeld ja...@zx2c4.com wrote: Hello, I'm considering a cosmetic change that may be controversial. If the about tab is enabled

Re: [RFC] Moving the about tab to the left

2014-01-17 Thread Jason A. Donenfeld
Merged. ___ CGit mailing list CGit@lists.zx2c4.com http://lists.zx2c4.com/mailman/listinfo/cgit

Re: owner links? (was: author/committer/tagger links -- kernel.org?)

2014-01-17 Thread Jason A. Donenfeld
On Fri, Jan 17, 2014 at 7:58 AM, Kyle J. McKay mack...@gmail.com wrote: For example, this link [1] shows ALL refs in the repository, not just those under refs/heads and refs/tags. That's not just important for mirrored repositories, the Personal Mob Branches feature [2] also needs it to be

Re: [ANNOUNCE] CGIT v0.10 Released with Lua Scripting, Authentication Support, and more

2014-01-17 Thread Jason A. Donenfeld
On Fri, Jan 17, 2014 at 5:16 PM, Peter Wu lekenst...@gmail.com wrote: Congratulations on this release. I personally think this release is a bit too early though. Some features were only created a week ago (like LUA and auth). A RC release would be more appropriate, don't you think? If there

Re: The road to v0.10.1 or v0.11

2014-01-17 Thread Jason A. Donenfeld
On Fri, Jan 17, 2014 at 5:28 PM, John Keeping j...@keeping.me.uk wrote: I really can't see this being sensible without moving to libgit2. As long as we stick with libgit.a then we need to fork for each request so I'm not sure there's much benefit to supporting FastCGI without moving to

Re: The road to v0.10.1 or v0.11

2014-01-17 Thread Jason A. Donenfeld
On Fri, Jan 17, 2014 at 5:53 PM, John Keeping j...@keeping.me.uk wrote: But scan for repos is caught by the cache most of the time, and presumably even if we run persistently we still need to do that periodically (or use inotify); or do we just rely on the process being replaced when the set

Re: Missing dependency

2014-01-17 Thread Jason A. Donenfeld
On Fri, Jan 17, 2014 at 8:08 PM, Félix C. Morency felix.more...@gmail.com wrote: You should add pkg-config to the list of dependencies in the README. It is required if you want to build with Lua support. Also, it might be a good idea to check for pkg-config presence in the Makefile. Thanks for

Re: The road to v0.10.1 or v0.11

2014-01-17 Thread Jason A. Donenfeld
On Fri, Jan 17, 2014 at 8:29 PM, Konstantin Ryabitsev mri...@kernel.org wrote: The process that updates the repositories may not have permissions to send SIGUSR1 to the fcgid process -- either because they are running as different users or because there are SELinux policies preventing it.

Re: The road to v0.10.1 or v0.11

2014-01-17 Thread Jason A. Donenfeld
On Fri, Jan 17, 2014 at 8:32 PM, John Keeping j...@keeping.me.uk wrote: Presumably you are OK with this having the same latency as the existing cache mechanism. The simplest implementation will probably be to keep the existing cache valid? check and re-scan repositories as we currently do.

Re: [PATCH 2/4] cache: use sendfile() instead of a pair of read() + write()

2014-01-19 Thread Jason A. Donenfeld
Excellent, thanks Sebastian! I've merged this commit. Would you mind sending another commit where you implement this for the read() write() situation in authenticate_post() on http://git.zx2c4.com/cgit/tree/cgit.c#n624 ? Still bounding it to MAX_AUTHENTICATION_POST_BYTES, but not having to copy

Re: [PATCH 3/4] summary: Add tag head line in the dowload section

2014-01-19 Thread Jason A. Donenfeld
On Sat, Jan 18, 2014 at 9:24 PM, Sebastian Andrzej Siewior sebast...@breakpoint.cc wrote: If the downloads are disabled one gets only ugly commit sha1. With downloads enabled you see the file name with different extensions a few times. This patches changes it a little. Instead of printing the

Re: Description in repo not used if not using scan-path

2014-01-20 Thread Jason A. Donenfeld
It looks like we get description from gitweb.description, inside the git config: else if (!strcmp(key, gitweb.description)) config_fn(repo, desc, value); We alternatively get it from the description file: if (repo-desc == cgit_default_repo_desc || !repo-desc) {

Re: [PATCH] ui-refs.c: Simplify and inline cmp_age()

2014-02-04 Thread Jason A. Donenfeld
zx2c4@thinkpad ~ $ cat a.c static int cmp_age(int age1, int age2) { if (age1 != 0 age2 != 0) return age2 - age1; if (age1 == 0 age2 == 0) return 0; if (age1 == 0) return +1; return -1; } static int cmp_age2(int age1,

Re: [PATCH] gen-version.sh: check if git is available before trying to call it

2014-02-05 Thread Jason A. Donenfeld
On Sat, Feb 1, 2014 at 4:10 PM, Fabien C. t74jgwb88tli...@jetable.org wrote: Here is yet another version (+ patch file): if test $(git rev-parse --git-dir 2/dev/null) = '.git' then V=$(git describe --abbrev=4 HEAD 2/dev/null) fi Merged, thanks.

Re: [PATCH 1/2] Skip cache slot when time-to-live is zero

2014-02-06 Thread Jason A. Donenfeld
On Wed, Feb 5, 2014 at 10:46 AM, Lukas Fleischer c...@cryptocrack.dewrote: /* If the cache is disabled, just generate the content */ - if (size = 0) { + if (size = 0 || ttl == 0) { fn(); return 0; } Apparently we already special

Re: Intelligent caching

2014-02-06 Thread Jason A. Donenfeld
time. What do you think about that? Regards, Lukas ___ CGit mailing list CGit@lists.zx2c4.com http://lists.zx2c4.com/mailman/listinfo/cgit -- Jason A. Donenfeld Deep Space Explorer fr: +33 6 51 90 82 66 us: +1 513 476 1200 www.jasondonenfeld.com

Re: [PATCH 1/2] Skip cache slot when time-to-live is zero

2014-02-08 Thread Jason A. Donenfeld
On Feb 6, 2014 10:07 PM, Lukas Fleischer c...@cryptocrack.de wrote: This is different. -1 means never expire. 0 means always expire. Ahh perfect -- this is exactly the type of distinction I was looking for. Do we have this documented? ___ CGit

adopting kernel.org's css modifications?

2014-02-20 Thread Jason A. Donenfeld
Looks like kernel.org makes some changes. Do we want to adopt any of these? Some of them are pretty, like the even/odd background. Others I'm not sure what they do... --- cgit.css2014-02-20 20:07:39.0 +0100 +++ cgit-korg.css 2013-02-28 20:16:48.0 +0100 @@ -59,6 +59,7 @@

Re: Build failed in Jenkins: cgit - upstream - get-git - master #125 - master - 45315f8

2014-03-20 Thread Jason A. Donenfeld
Thanks for catching that. Your Jenkins is awesome. http://git.zx2c4.com/cgit/commit/?id=88b93113235452d47e7ce474689327c43e64b843 Using the kernel.org mirror instead now. ___ CGit mailing list CGit@lists.zx2c4.com

  1   2   3   4   5   >