From 07cf7fedfe5c9f80b51124d9cbb479d6078a7e9b Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Mon, 26 Mar 2012 11:02:57 +0530 Subject: [PATCH] move triggers into their own subdir... ...otherwise 'gitolite help' was getting too confusing, mixing up stuff that users should not be running directly (even on the server) ---- implementation notes: those who are worried about the '../triggers/' in various parts of the code here, remember you can only do that from a command line on the server. Remote users can only use commands that have been explicitly listed in the COMMANDS hash in the rc file. This means they can't even access other commands in the same directory as, say, the 'info' command, so a '../' is definitely not going to work. --- src/Gitolite/Rc.pm | 2 +- src/commands/access | 2 +- src/{commands => triggers}/cpu-time | 0 src/{commands => triggers}/post-compile/ssh-authkeys | 0 src/{commands => triggers}/post-compile/update-git-configs | 0 .../post-compile/update-git-daemon-access-list | 0 .../post-compile/update-gitweb-access-list | 0 src/{commands => triggers}/renice | 0 t/all-yall.t | 4 ++-- t/ssh-authkeys.t | 2 +- t/ssh-basic.t | 2 +- 11 files changed, 6 insertions(+), 6 deletions(-) rename src/{commands => triggers}/cpu-time (100%) rename src/{commands => triggers}/post-compile/ssh-authkeys (100%) rename src/{commands => triggers}/post-compile/update-git-configs (100%) rename src/{commands => triggers}/post-compile/update-git-daemon-access-list (100%) rename src/{commands => triggers}/post-compile/update-gitweb-access-list (100%) rename src/{commands => triggers}/renice (100%) diff --git a/src/Gitolite/Rc.pm b/src/Gitolite/Rc.pm index bdd6755..b0752b0 100644 --- a/src/Gitolite/Rc.pm +++ b/src/Gitolite/Rc.pm @@ -171,7 +171,7 @@ sub trigger { for my $s ( @{ $rc{$rc_section} } ) { my ($pgm, @args) = split ' ', $s; - $pgm = "$ENV{GL_BINDIR}/commands/$pgm"; + $pgm = "$ENV{GL_BINDIR}/triggers/$pgm"; _warn("skipped command '$s'"), next if not -x $pgm; trace( 2, "command: $s" ); diff --git a/src/commands/access b/src/commands/access index 6da81c4..726a346 100755 --- a/src/commands/access +++ b/src/commands/access @@ -31,7 +31,7 @@ For each case where access is not denied, one line is printed like this: This is orders of magnitude faster than running the command multiple times; you'll notice if you have more than a hundred or so repos. -Advanced uses: see src/commands/post-compile/update-git-daemon-access-list for +Advanced uses: see src/triggers/post-compile/update-git-daemon-access-list for a good example. =cut diff --git a/src/commands/cpu-time b/src/triggers/cpu-time similarity index 100% rename from src/commands/cpu-time rename to src/triggers/cpu-time diff --git a/src/commands/post-compile/ssh-authkeys b/src/triggers/post-compile/ssh-authkeys similarity index 100% rename from src/commands/post-compile/ssh-authkeys rename to src/triggers/post-compile/ssh-authkeys diff --git a/src/commands/post-compile/update-git-configs b/src/triggers/post-compile/update-git-configs similarity index 100% rename from src/commands/post-compile/update-git-configs rename to src/triggers/post-compile/update-git-configs diff --git a/src/commands/post-compile/update-git-daemon-access-list b/src/triggers/post-compile/update-git-daemon-access-list similarity index 100% rename from src/commands/post-compile/update-git-daemon-access-list rename to src/triggers/post-compile/update-git-daemon-access-list diff --git a/src/commands/post-compile/update-gitweb-access-list b/src/triggers/post-compile/update-gitweb-access-list similarity index 100% rename from src/commands/post-compile/update-gitweb-access-list rename to src/triggers/post-compile/update-gitweb-access-list diff --git a/src/commands/renice b/src/triggers/renice similarity index 100% rename from src/commands/renice rename to src/triggers/renice diff --git a/t/all-yall.t b/t/all-yall.t index 947c753..5691cf2 100755 --- a/t/all-yall.t +++ b/t/all-yall.t @@ -60,8 +60,8 @@ try " "; try " - gitolite post-compile/update-git-daemon-access-list; ok - gitolite post-compile/update-gitweb-access-list; ok + gitolite ../triggers/post-compile/update-git-daemon-access-list; ok + gitolite ../triggers/post-compile/update-gitweb-access-list; ok cat $ENV{HOME}/projects.list; ok "; cmp 'bar.git diff --git a/t/ssh-authkeys.t b/t/ssh-authkeys.t index 98f2d79..d941922 100755 --- a/t/ssh-authkeys.t +++ b/t/ssh-authkeys.t @@ -17,7 +17,7 @@ my $kd = `gitolite query-rc -n GL_ADMIN_BASE` . "/keydir"; try "plan 49"; -my $pgm = "gitolite post-compile/ssh-authkeys"; +my $pgm = "gitolite ../triggers/post-compile/ssh-authkeys"; try " # prep diff --git a/t/ssh-basic.t b/t/ssh-basic.t index 14a1cf4..9051fa0 100755 --- a/t/ssh-basic.t +++ b/t/ssh-basic.t @@ -32,7 +32,7 @@ try " cp $bd/../t/keys/*.pub $ab/keydir; ok or die 6 "; -system("gitolite post-compile/ssh-authkeys"); +system("gitolite ../triggers/post-compile/ssh-authkeys"); # basic tests # ----------------------------------------------------------------------