git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Forbid access to /gitweb but authorize the sub projets
@ 2016-11-07 13:07 Alexandre Duplaix
  2016-11-09  8:25 ` Dennis Kaarsemaker
  0 siblings, 1 reply; 2+ messages in thread
From: Alexandre Duplaix @ 2016-11-07 13:07 UTC (permalink / raw
  To: git

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8"; format=flowed, Size: 1335 bytes --]

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 ?

Thank you in advance :)

" Ce courriel et les documents qui lui sont joints peuvent contenir des
informations confidentielles ou ayant un caractère privé. 
S'ils ne vous sont pas destinés nous vous signalons qu'il est strictement interdit de les
divulguer, de les reproduire ou d'en utiliser de quelque manière que ce
soit le contenu. Si ce message vous a été transmis par erreur, merci d'en
informer l'expéditeur et de supprimer immédiatement de votre système
informatique ce courriel ainsi que tous les documents qui y sont attachés"

                               ******

" This e-mail and any attached documents may contain confidential or
proprietary information. If you are not the intended recipient, you are
notified that any dissemination, copying of this e-mail and any attachments
thereto or use of their contents by any means whatsoever is strictly
prohibited. If you have received this e-mail in error, please advise the
sender immediately and delete this e-mail and all attached documents
from your computer system."
#


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Forbid access to /gitweb but authorize the sub projets
  2016-11-07 13:07 Forbid access to /gitweb but authorize the sub projets Alexandre Duplaix
@ 2016-11-09  8:25 ` Dennis Kaarsemaker
  0 siblings, 0 replies; 2+ messages in thread
From: Dennis Kaarsemaker @ 2016-11-09  8:25 UTC (permalink / raw
  To: Alexandre Duplaix, git

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-11-09  8:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-07 13:07 Forbid access to /gitweb but authorize the sub projets Alexandre Duplaix
2016-11-09  8:25 ` Dennis Kaarsemaker

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).