git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dennis Kaarsemaker <dennis@kaarsemaker.net>
To: Alexandre Duplaix <alexandre.duplaix-ext@sagemcom.com>,
	git@vger.kernel.org
Subject: Re: Forbid access to /gitweb but authorize the sub projets
Date: Wed, 09 Nov 2016 09:25:51 +0100	[thread overview]
Message-ID: <1478679951.12904.1.camel@kaarsemaker.net> (raw)
In-Reply-To: <58207CAB.3060105@sagemcom.com>

On Mon, 2016-11-07 at 14:07 +0100, Alexandre Duplaix wrote:
> 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

      reply	other threads:[~2016-11-09  8:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-07 13:07 Forbid access to /gitweb but authorize the sub projets Alexandre Duplaix
2016-11-09  8:25 ` Dennis Kaarsemaker [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1478679951.12904.1.camel@kaarsemaker.net \
    --to=dennis@kaarsemaker.net \
    --cc=alexandre.duplaix-ext@sagemcom.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).