From 0ddb39a7290c6f008017841d140810d6f3578524 Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Sat, 30 Apr 2016 23:06:32 -0700 Subject: [PATCH] git-browser: switch back to master branch By making use of the new git-browser.conf 'doconfig' option and $check_path setting it's now possible to switch back to the git-browser.git master branch. Make it so. Signed-off-by: Kyle J. McKay --- git-browser.git | 2 +- gitweb/gitbrowser_config.perl | 19 +++++++++++++++++++ install.sh | 1 + 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 gitweb/gitbrowser_config.perl diff --git a/git-browser.git b/git-browser.git index 6322f16..234e98b 160000 --- a/git-browser.git +++ b/git-browser.git @@ -1 +1 @@ -Subproject commit 6322f16d8751a8c365ade0694bdeb2f59d2f4082 +Subproject commit 234e98b02793fc5b40b245240a62f6fa0a85f9c8 diff --git a/gitweb/gitbrowser_config.perl b/gitweb/gitbrowser_config.perl new file mode 100644 index 0000000..0f2b32e --- /dev/null +++ b/gitweb/gitbrowser_config.perl @@ -0,0 +1,19 @@ +## For the complete overview of available configuration options, +## see git-browser.git/git-browser.cgi file right after "package inner" line + +# If $check_path is set to a subroutine reference, it will be called +# by get_repo_path with two arguments, the name of the repo and its +# path which will be undef if it's not a known repo. If the function +# returns false, access to the repo will be denied. +# $check_path = sub { my ($name, $path) = @_; $name ~! /restricted/i; }; +our $check_path = sub { + my ($name, $path) = @_; + if (not defined $path and + $name =~ m!^/*_! || + $name =~ m!\.\.! || + !($name =~ m!\.git/*$!) || + $name =~ m!\.git/.*\.git/*$!i) { + return undef; + } + return 1; +}; diff --git a/install.sh b/install.sh index de65bb6..c342315 100755 --- a/install.sh +++ b/install.sh @@ -382,6 +382,7 @@ rm -f "$cfg_webroot"/git-browser/index.html cat >"$cfg_basedir/gitweb"/git-browser.conf.$$ <