git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Forbid access to /gitweb but authorize the sub projets

From
Dennis Kaarsemaker <dennis@kaarsemaker.net>
Date
Nov 9, 2016, 08:25 UTC
Message-ID
<1478679951.12904.1.camel@kaarsemaker.net>
In-Reply-To
<58207CAB.3060105@sagemcom.com>
On Mon, 2016-11-07 at 14:07 +0100, Alexandre Duplaix wrote:
Show 10 quoted lines
> Hello,
> 
> I have several projects under https://myserver/gitweb and I would like 
> to forbid the access to the root, so that the users can't list the 
> differents projects.
> 
> However, I need to let the access to the sub projects (ex: 
> https://myserver/gitweb/?p=project1;a=summary
> 
> How can I do please ?

My favourite way of doing this is abusing the fact that gitweb.conf is perl code that's loaded with do $filename.

This makes it easy to override such things. Try this in gitweb.conf for example:
sub no_index {
    die_error(403, "No access to the repository list");
}
$actions{project_list} = \&no_index;
$actions{project_index} = \&no_index;
$actions{opml} = \&no_index;
-- 
Dennis Kaarsemaker
http://www.kaarsemaker.net
Previous: Alexandre Duplaix
Message 2 of 2 in “Forbid access to /gitweb but authorize the sub projets”
  1. Alexandre DuplaixNov 7, 2016
  2. Dennis KaarsemakerNov 9, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.