X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=gitweb%2FINSTALL;h=18c9ce35e8fc6566663ad76dd04bd1aa70035c25;hb=6e13921b4f7adcc7316a76c0c4955b85b1589a65;hp=f7194dbef79f3b03cc3524469c4b504a195807b6;hpb=c636d0e2bcffdbd55c096944561d9ac470da600e;p=git.git diff --git a/gitweb/INSTALL b/gitweb/INSTALL index f7194dbef..18c9ce35e 100644 --- a/gitweb/INSTALL +++ b/gitweb/INSTALL @@ -144,6 +144,12 @@ Gitweb repositories Spaces in both project path and project owner have to be encoded as either '%20' or '+'. + Other characters that have to be url-encoded, i.e. replaced by '%' + followed by two-digit character number in octal, are: other whitespace + characters (because they are field separator in a record), plus sign '+' + (because it can be used as replacement for spaces), and percent sign '%' + (which is used for encoding / escaping). + You can generate the projects list index file using the project_index action (the 'TXT' link on projects list page) directly from gitweb. @@ -160,6 +166,27 @@ Gitweb repositories shows repositories only if this file exists in its object database (if directory has the magic file named $export_ok). +- Finally, it is possible to specify an arbitrary perl subroutine that + will be called for each project to determine if it can be exported. + The subroutine receives an absolute path to the project as its only + parameter. + + For example, if you use mod_perl to run the script, and have dumb + http protocol authentication configured for your repositories, you + can use the following hook to allow access only if the user is + authorized to read the files: + + $export_auth_hook = sub { + use Apache2::SubRequest (); + use Apache2::Const -compile => qw(HTTP_OK); + my $path = "$_[0]/HEAD"; + my $r = Apache2::RequestUtil->request; + my $sub = $r->lookup_file($path); + return $sub->filename eq $path + && $sub->status == Apache2::Const::HTTP_OK; + }; + + Generating projects list using gitweb ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~