summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Bremner <bremner@debian.org>2020-12-25 19:12:52 -0400
committerDavid Bremner <bremner@debian.org>2020-12-25 19:12:52 -0400
commit145c85e054b506ae428984eafa3f4b3788ed875d (patch)
treea7181938c6b89bef341f288d8c0fee67d575b6d8
parentb0e9b9034cba9c34fe61a8335ff72e1966966c97 (diff)
parent4a01370abedf055ab073de70d5bbd583d611b0e2 (diff)
Merge tag 'upstream/3.6.12' into debian
merged from upstream tag v3.6.12
-rw-r--r--.__rc1
-rw-r--r--CHANGELOG13
-rwxr-xr-xcontrib/triggers/file_mirror16
-rwxr-xr-xinstall13
-rwxr-xr-xsrc/VREF/MAX_NEWBIN_SIZE2
-rwxr-xr-xsrc/commands/1plus12
-rwxr-xr-xsrc/commands/config19
-rwxr-xr-xsrc/commands/mirror63
-rwxr-xr-xsrc/commands/newbranch41
-rw-r--r--src/lib/Gitolite/Common.pm2
-rw-r--r--src/lib/Gitolite/Conf/Load.pm9
-rw-r--r--src/lib/Gitolite/Conf/Sugar.pm1
-rw-r--r--src/lib/Gitolite/Triggers/Alias.pm4
-rw-r--r--src/lib/Gitolite/Triggers/Mirroring.pm84
-rw-r--r--src/lib/Gitolite/Triggers/RepoUmask.pm4
-rw-r--r--src/lib/Gitolite/Triggers/TProxy.pm2
-rwxr-xr-xsrc/triggers/repo-specific-hooks18
-rw-r--r--t/README108
-rwxr-xr-xt/fedora-root-smart-http-test-setup95
-rwxr-xr-xt/git-config.t1
-rwxr-xr-xt/manjaro-root-smart-http-test-setup114
-rwxr-xr-xt/mirror-test8
-rwxr-xr-xt/mirror-test-setup.sh34
-rwxr-xr-xt/smart-http2
24 files changed, 529 insertions, 127 deletions
diff --git a/.__rc b/.__rc
new file mode 100644
index 0000000..488087b
--- /dev/null
+++ b/.__rc
@@ -0,0 +1 @@
+glp rm -rf /tmp/gitolite.git; umask 022; git clone --bare . /tmp/gitolite.git
diff --git a/CHANGELOG b/CHANGELOG
index 9cb5ffb..3bde762 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,16 @@
+2020-08-04 v3.6.12 mirroring terminoligy changes
+
+ install script can now modify #! lines when using a custom
+ perl executable
+
+ 'config' user command allows for config values with spaces
+ in them
+
+ finally added notes in "t/README" on testing http mode and
+ mirroring, with pre-build helpers for Fedora and Manjaro
+
+ ...plus various bug fixes
+
2019-01-08 v3.6.11 fix security issue in 'rsync' (bundle helper); see commit
5df2b81 for more
diff --git a/contrib/triggers/file_mirror b/contrib/triggers/file_mirror
index e3d083b..755ce86 100755
--- a/contrib/triggers/file_mirror
+++ b/contrib/triggers/file_mirror
@@ -22,16 +22,16 @@ exit 0 if $trigger eq 'POST_GIT' and $op ne 'W';
chdir("$rc{GL_REPO_BASE}/$repo.git") or _die "chdir failed: $!\n";
-my %config = config( $repo, "gitolite-options\\.mirror\\.extslave" );
-for my $slave ( values %config ) {
- _do($slave);
+my %config = config( $repo, "gitolite-options\\.mirror\\.extcopy" );
+for my $copy ( values %config ) {
+ _do($copy);
- # processing one slave is sufficient for restoring!
+ # processing one copy is sufficient for restoring!
last if $trigger eq 'POST_CREATE';
}
# in shell, that would be something like:
-# gitolite git-config -r $repo gitolite-options\\.mirror\\.extslave | cut -f3 | while read slave
+# gitolite git-config -r $repo gitolite-options\\.mirror\\.extcopy | cut -f3 | while read copy
# do
# ...
@@ -94,7 +94,7 @@ DESIGN NOTES
------------
This is really just a combination of "upstream" (see src/triggers/upstream)
-and mirroring (gitolite mirroring does allow a slave to be non-gitolite, as
+and mirroring (gitolite mirroring does allow a copy to be non-gitolite, as
long as the ssh stuff is done the same way).
The main difference is that gitolite mirroring expects peers to all talk ssh,
@@ -127,8 +127,8 @@ SETUP
4. Do something like this in your gitolite.conf file:
repo @all
- option mirror.extslave-1 = file:///tmp/he1/%GL_REPO.git
- option mirror.extslave-2 = file:///tmp/he2/%GL_REPO.git
+ option mirror.extcopy-1 = file:///tmp/he1/%GL_REPO.git
+ option mirror.extcopy-2 = file:///tmp/he2/%GL_REPO.git
As you can see, since this is just for demo/test, we're using a couple of
temp directories to serve as our "remotes" using the file:// protocol.
diff --git a/install b/install
index abafdd5..fa6fc26 100755
--- a/install
+++ b/install
@@ -7,6 +7,7 @@ use warnings;
use Getopt::Long;
use FindBin;
+use Config;
# meant to be run from the root of the gitolite tree, one level above 'src'
BEGIN { $ENV{GL_BINDIR} = $FindBin::RealBin . "/src"; }
@@ -34,6 +35,12 @@ Usage (from gitolite clone directory):
Please provide a full path, not a relative path.
+ <perl-executable> ./install -to <dir>
+ to copy the entire 'src' directory to <dir>, but will replace
+ all of the shebangs with the path to <perl-executable>. This
+ is a way to force gitolite to use some perl that is not
+ installed at /usr/bin/perl.
+
Simplest use, if $HOME/bin exists and is in $PATH, is:
git clone https://github.com/sitaramc/gitolite
@@ -76,6 +83,12 @@ if ($to) {
_mkdir($to);
system("cp -RpP * $to");
_print( "$to/VERSION", $version );
+
+ # Replace shebangs if necessary.
+ my $thisperl = $Config{perlpath};
+ if ($thisperl ne '/usr/bin/perl') {
+ system("cd $to; grep -r -l /usr/bin/perl | xargs perl -pi -e 's(^#!/usr/bin/perl)(#!$thisperl)'");
+ }
} elsif ($ln) {
ln_sf( $ENV{GL_BINDIR}, "gitolite", $ln );
_print( "VERSION", $version );
diff --git a/src/VREF/MAX_NEWBIN_SIZE b/src/VREF/MAX_NEWBIN_SIZE
index 84a9efa..99d51d3 100755
--- a/src/VREF/MAX_NEWBIN_SIZE
+++ b/src/VREF/MAX_NEWBIN_SIZE
@@ -21,6 +21,8 @@ die "not meant to be run manually" unless $ARGV[7];
my ( $newsha, $oldtree, $newtree, $refex, $max ) = @ARGV[ 2, 3, 4, 6, 7 ];
+exit 0 if $newsha eq '0000000000000000000000000000000000000000';
+
# / (.*) +\| Bin 0 -> (\d+) bytes/
chomp( my $author_email = `git log --format=%ae -1 $newsha` );
diff --git a/src/commands/1plus1 b/src/commands/1plus1
index 897d235..1d94006 100755
--- a/src/commands/1plus1
+++ b/src/commands/1plus1
@@ -5,7 +5,7 @@ use warnings;
# import LOCK_*
use Fcntl qw(:flock);
-my $lockbase = shift; # suggested: $GL_REPO_BASE/$GL_REPO.git/.gl-mirror-push-lock.$SLAVE_NAME
+my $lockbase = shift; # suggested: $GL_REPO_BASE/$GL_REPO.git/.gl-mirror-push-lock.$COPY_NAME
my @cmd_plus_args = @ARGV; # the actual 'gitolite mirror ...' command
@ARGV = ();
diff --git a/src/commands/config b/src/commands/config
index 7851c11..214158b 100755
--- a/src/commands/config
+++ b/src/commands/config
@@ -63,8 +63,8 @@ usage() if not @ARGV or $ARGV[0] eq '-h';
my $repo = shift;
-my ($op, $key, $val) = @ARGV;
-usage() unless $op and exists $nargs{$op} and @ARGV == $nargs{$op};
+my $op = shift;
+usage() unless $op and exists $nargs{$op};
# ----------------------------------------------------------------------
# authorisation checks
@@ -81,15 +81,30 @@ die "sorry, you are not authorised\n" unless
# key validity checks
unless ($op eq '--list') {
+ my $key = shift;
+
+ my $val = '';
+ $val = join(" ", @ARGV) if @ARGV;
+ # values with spaces embedded get flattened by sshd when it passes
+ # SSH_ORIGINAL_COMMAND to gitolite. In this specific instance, we will
+ # pretend we know what the user meant, and join up the last 1+ args into
+ # one space-separated arg.
+
my $user_configs = option( $repo, 'user-configs' );
# this is a space separated list of allowed config keys
my @validkeys = split( ' ', ( $user_configs || '' ) );
my @matched = grep { $key =~ /^$_$/i } @validkeys;
_die "config '$key' not allowed\n" if ( @matched < 1 );
+
+ @ARGV = ($key);
+ push @ARGV, $val if $val;
}
# ----------------------------------------------------------------------
# go!
+unshift @ARGV, $op;
+usage() unless @ARGV == $nargs{$op};
+
_chdir("$rc{GL_REPO_BASE}/$repo.git");
_system( "git", "config", @ARGV );
diff --git a/src/commands/mirror b/src/commands/mirror
index 3a74a42..b22ec2a 100755
--- a/src/commands/mirror
+++ b/src/commands/mirror
@@ -15,32 +15,32 @@ use Gitolite::Common;
use Gitolite::Conf::Load;
=for usage
-Usage 1: gitolite mirror push <slave> <repo>
- gitolite mirror status <slave> <repo>
+Usage 1: gitolite mirror push <copy> <repo>
+ gitolite mirror status <copy> <repo>
gitolite mirror status all <repo>
gitolite mirror status all all
-Usage 2: ssh git@master-server mirror push <slave> <repo>
- ssh git@master-server mirror status <slave> <repo>
+Usage 2: ssh git@master-server mirror push <copy> <repo>
+ ssh git@master-server mirror status <copy> <repo>
-Forces a push of one repo to one slave.
+Forces a push of one repo to one copy.
-Usage 1 is directly on the master server. Nothing is checked; if the slave
-accepts it, the push happens, even if the slave is not in any slaves
+Usage 1 is directly on the master server. Nothing is checked; if the copy
+accepts it, the push happens, even if the copy is not in any copies
option. This is how you do delayed or lagged pushes to servers that do not
need real-time updates or have bandwidth/connectivity issues.
Usage 2 can be initiated by *any* user who has *any* gitolite access to the
-master server, but it checks that the slave is in one of the slaves options
+master server, but it checks that the copy is in one of the copies options
before doing the push.
MIRROR STATUS: The usage examples above show what can be done. The 'status
-all <repo>' usage checks the status of all the slaves defined for the given
+all <repo>' usage checks the status of all the copies defined for the given
repo. The 'status all all' usage is special, in that it only prints a list of
repos that have *some* error, instead of dumping all the error info itself.
SERVER LIST: 'gitolite mirror list master <reponame>' and 'gitolite mirror
-list slaves <reponame>' will show you the name of the master server, and list
-the slave servers, for the repo. They only work on the server command line
+list copies <reponame>' will show you the name of the master server, and list
+the copy servers, for the repo. They only work on the server command line
(any server), but not remotely (from a normal user).
=cut
@@ -49,12 +49,13 @@ usage() if not @ARGV or $ARGV[0] eq '-h';
_die "HOSTNAME not set" if not $rc{HOSTNAME};
my ( $cmd, $host, $repo ) = @ARGV;
+$host = 'copies' if $host eq 'slaves';
$repo =~ s/\.git$//;
usage() if not $repo;
if ( $cmd eq 'push' ) {
- valid_slave( $host, $repo ) if exists $ENV{GL_USER};
- # will die if host not in slaves for repo
+ valid_copy( $host, $repo ) if exists $ENV{GL_USER};
+ # will die if host not in copies for repo
trace( 1, "TID=$tid host=$host repo=$repo", "gitolite mirror push started" );
_chdir( $rc{GL_REPO_BASE} );
@@ -80,15 +81,15 @@ if ( $cmd eq 'push' ) {
trace( 1, "mirror: $_" );
}
}
- # save the mirror push status for this slave if the word 'fatal' is found,
+ # save the mirror push status for this copy if the word 'fatal' is found,
# else remove the status file. We don't store "success" output messages;
# you can always get those from the log files if you really need them.
if ( $glss =~ /fatal/i ) {
my $glss_prefix = Gitolite::Common::gen_ts() . "\t$ENV{GL_TID}\t";
$glss =~ s/^/$glss_prefix/gm;
- _print("gl-slave-$host.status", $glss);
+ _print("gl-copy-$host.status", $glss);
} else {
- unlink "gl-slave-$host.status";
+ unlink "gl-copy-$host.status";
}
exit $errors;
@@ -101,20 +102,20 @@ if ( $cmd eq 'push' ) {
_chdir( $rc{GL_REPO_BASE} );
my $phy_repos = list_phy_repos(1);
for my $repo ( @{$phy_repos} ) {
- my @x = glob("$rc{GL_REPO_BASE}/$repo.git/gl-slave-*.status");
+ my @x = glob("$rc{GL_REPO_BASE}/$repo.git/gl-copy-*.status");
print "$repo\n" if @x;
}
exit 0;
}
- valid_slave( $host, $repo ) if exists $ENV{GL_USER};
- # will die if host not in slaves for repo
+ valid_copy( $host, $repo ) if exists $ENV{GL_USER};
+ # will die if host not in copies for repo
_chdir( $rc{GL_REPO_BASE} );
_chdir("$repo.git");
$host = '*' if $host eq 'all';
- map { print_status($repo, $_) } sort glob("gl-slave-$host.status");
+ map { print_status($repo, $_) } sort glob("gl-copy-$host.status");
} else {
# strictly speaking, we could allow some of the possible commands remotely
# also, at least for admins. However, these commands are mainly intended
@@ -126,18 +127,18 @@ if ( $cmd eq 'push' ) {
# ----------------------------------------------------------------------
-sub valid_slave {
+sub valid_copy {
my ( $host, $repo ) = @_;
_die "invalid repo '$repo'" unless $repo =~ $REPONAME_PATT;
- my %list = repo_slaves($repo);
- _die "'$host' not a valid slave for '$repo'" unless $list{$host};
+ my %list = repo_copies($repo);
+ _die "'$host' not a valid copy for '$repo'" unless $list{$host};
}
-sub repo_slaves {
+sub repo_copies {
my $repo = shift;
- my $ref = git_config( $repo, "^gitolite-options\\.mirror\\.slaves.*" );
+ my $ref = git_config( $repo, "^gitolite-options\\.mirror\\.copies.*" );
my %list = map { $_ => 1 } map { split } values %$ref;
return %list;
@@ -157,9 +158,9 @@ sub print_status {
my $repo = shift;
my $file = shift;
return unless -f $file;
- my $slave = $1 if $file =~ /^gl-slave-(.+)\.status$/;
+ my $copy = $1 if $file =~ /^gl-copy-(.+)\.status$/;
print "----------\n";
- print "WARNING: previous mirror push of repo '$repo' to host '$slave' failed, status is:\n";
+ print "WARNING: previous mirror push of repo '$repo' to host '$copy' failed, status is:\n";
print slurp($file);
print "----------\n";
}
@@ -167,17 +168,17 @@ sub print_status {
# ----------------------------------------------------------------------
# server side commands. Very little error checking.
# gitolite mirror list master <repo>
-# gitolite mirror list slaves <repo>
+# gitolite mirror list copies <repo>
sub server_side_commands {
if ( $cmd eq 'list' ) {
if ( $host eq 'master' ) {
say repo_master($repo);
- } elsif ( $host eq 'slaves' ) {
- my %list = repo_slaves($repo);
+ } elsif ( $host eq 'copies' ) {
+ my %list = repo_copies($repo);
say join( " ", sort keys %list );
} else {
- _die "gitolite mirror list master|slaves <reponame>";
+ _die "gitolite mirror list master|copies <reponame>";
}
} else {
_die "invalid command";
diff --git a/src/commands/newbranch b/src/commands/newbranch
new file mode 100755
index 0000000..6dff545
--- /dev/null
+++ b/src/commands/newbranch
@@ -0,0 +1,41 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+
+use lib $ENV{GL_LIBDIR};
+use Gitolite::Easy;
+
+=for usage
+Usage: ssh git@host newbranch <repo name> <new branch name> <based-on ref name>
+
+Create a new branch and set it to existing branch or tag. You should have
+write access to that branch.
+
+NOTE: runs "git branch arg-2 arg-3" in repo given by arg-1, which means you
+should NOT prefix arguments with "refs/heads/" or "refs/tags/".
+
+----
+
+This is for people who have restrictions on what files they can "touch". When
+you fork a branch and change a file, even if you changed only the files you're
+allowed to, gitolite thinks you changed *all* the files in the repo because
+the "old SHA" is basically empty.
+
+This helps get around that by first creating the new branch, so that you can
+then push to it.
+
+To enable this command, add it to the rc file as a 'command'.
+
+TODO: handle deletes also (less commonly encountered and left as an "exercise
+for the reader" for now!)
+=cut
+
+usage() if not @ARGV or @ARGV < 3 or $ARGV[0] eq '-h';
+
+my $repo = shift;
+my $newbr = shift;
+my $oldref = shift;
+
+_die "you are not authorized" unless can_write($repo, "W", "refs/heads/$newbr");
+
+Gitolite::Common::_system("git", "branch", $newbr, $oldref);
diff --git a/src/lib/Gitolite/Common.pm b/src/lib/Gitolite/Common.pm
index af9c875..b06f967 100644
--- a/src/lib/Gitolite/Common.pm
+++ b/src/lib/Gitolite/Common.pm
@@ -361,7 +361,7 @@ sub ssh_fingerprint_file {
my $in = shift;
-f $in or die "file not found: $in\n";
my $fh;
- open( $fh, "ssh-keygen -l -f $in |" ) or die "could not fork: $!\n";
+ open( $fh, "ssh-keygen -l -f $in 2>&1 |" ) or die "could not fork: $!\n";
my $output = <$fh>;
chomp $output;
# dbg("fp = $fp");
diff --git a/src/lib/Gitolite/Conf/Load.pm b/src/lib/Gitolite/Conf/Load.pm
index d377bca..7dea259 100644
--- a/src/lib/Gitolite/Conf/Load.pm
+++ b/src/lib/Gitolite/Conf/Load.pm
@@ -396,9 +396,12 @@ sub memberships {
push @ret, @{ $groups{$base} } if exists $groups{$base};
push @ret, @{ $groups{$base2} } if $base2 and exists $groups{$base2};
- for my $i ( keys %{ $patterns{groups} } ) {
- if ( $base =~ /^$i$/ or $base2 and ( $base2 =~ /^$i$/ ) ) {
- push @ret, @{ $groups{$i} };
+ if ($type eq 'repo') {
+ # regexes can only be used for repos, not for users
+ for my $i ( keys %{ $patterns{groups} } ) {
+ if ( $base =~ /^$i$/ or $base2 and ( $base2 =~ /^$i$/ ) ) {
+ push @ret, @{ $groups{$i} };
+ }
}
}
diff --git a/src/lib/Gitolite/Conf/Sugar.pm b/src/lib/Gitolite/Conf/Sugar.pm
index b054065..5c743d3 100644
--- a/src/lib/Gitolite/Conf/Sugar.pm
+++ b/src/lib/Gitolite/Conf/Sugar.pm
@@ -105,6 +105,7 @@ sub option {
# -> config gitolite-options.foo = bar
for my $line (@$lines) {
+ $line =~ s/option mirror\.slaves/option mirror.copies/;
if ( $line =~ /^option (\S+) = (\S.*)/ ) {
push @ret, "config gitolite-options.$1 = $2";
} else {
diff --git a/src/lib/Gitolite/Triggers/Alias.pm b/src/lib/Gitolite/Triggers/Alias.pm
index 1fa24bb..adaceb5 100644
--- a/src/lib/Gitolite/Triggers/Alias.pm
+++ b/src/lib/Gitolite/Triggers/Alias.pm
@@ -73,11 +73,11 @@ Notes:
test it and make it work please let me know.
* funnily enough, this even works with mirroring! That is, a master can
- push a repo "foo" to a slave per its configuration, while the slave thinks
+ push a repo "foo" to a copy per its configuration, while the copy thinks
it is getting repo "bar" from the master per its configuration.
Just make sure to put the Alias::input line *before* the Mirroring::input
- line in the rc file on the slave.
+ line in the rc file on the copy.
However, it will probably not work with redirected pushes unless you setup
the opposite alias ("bar" -> "foo") on master.
diff --git a/src/lib/Gitolite/Triggers/Mirroring.pm b/src/lib/Gitolite/Triggers/Mirroring.pm
index c9dabce..07b7f96 100644
--- a/src/lib/Gitolite/Triggers/Mirroring.pm
+++ b/src/lib/Gitolite/Triggers/Mirroring.pm
@@ -9,7 +9,7 @@ use warnings;
my $hn = $rc{HOSTNAME};
-my ( $mode, $master, %slaves, %trusted_slaves );
+my ( $mode, $master, %copies, %trusted_copies );
# ----------------------------------------------------------------------
@@ -51,7 +51,7 @@ sub input {
$rc{REDIRECTED_PUSH} = 1;
trace( 3, "redirected_push for user $1" );
} else {
- # master -> slave push, no access checks needed
+ # master -> copy push, no access checks needed
$ENV{GL_BYPASS_ACCESS_CHECKS} = 1;
}
}
@@ -72,32 +72,32 @@ sub pre_git {
# now you know the repo, get its mirroring details
details($repo);
- # print mirror status if at least one slave status file is present
- print_status( $repo ) if not $rc{HUSH_MIRROR_STATUS} and $mode ne 'local' and glob("$rc{GL_REPO_BASE}/$repo.git/gl-slave-*.status");
+ # print mirror status if at least one copy status file is present
+ print_status( $repo ) if not $rc{HUSH_MIRROR_STATUS} and $mode ne 'local' and glob("$rc{GL_REPO_BASE}/$repo.git/gl-copy-*.status");
# we don't deal with any reads. Note that for pre-git this check must
# happen *after* getting details, to give mode() a chance to die on "known
# unknown" repos (repos that are in the config, but mirror settings
- # exclude this host from both the master and slave lists)
+ # exclude this host from both the master and copy lists)
return if $aa eq 'R';
trace( 1, "mirror", "pre_git", $repo, "user=$user", "sender=$sender", "mode=$mode", ( $rc{REDIRECTED_PUSH} ? ("redirected") : () ) );
# ------------------------------------------------------------------
- # case 1: we're master or slave, normal user pushing to us
+ # case 1: we're master or copy, normal user pushing to us
if ( $user and not $rc{REDIRECTED_PUSH} ) {
trace( 3, "case 1, user push" );
return if $mode eq 'local' or $mode eq 'master';
- if ( $trusted_slaves{$hn} ) {
+ if ( $trusted_copies{$hn} ) {
trace( 1, "redirect to $master" );
exec( "ssh", $master, "USER=$user", "SOC=$ENV{SSH_ORIGINAL_COMMAND}" );
} else {
- _die "$hn: pushing '$repo' to slave '$hn' not allowed";
+ _die "$hn: pushing '$repo' to copy '$hn' not allowed";
}
}
# ------------------------------------------------------------------
- # case 2: we're slave, master pushing to us
+ # case 2: we're copy, master pushing to us
if ( $sender and not $rc{REDIRECTED_PUSH} ) {
trace( 3, "case 2, master push" );
_die "$hn: '$repo' is local" if $mode eq 'local';
@@ -107,13 +107,13 @@ sub pre_git {
}
# ------------------------------------------------------------------
- # case 3: we're master, slave sending a redirected push to us
+ # case 3: we're master, copy sending a redirected push to us
if ( $sender and $rc{REDIRECTED_PUSH} ) {
- trace( 3, "case 2, slave redirect" );
+ trace( 3, "case 2, copy redirect" );
_die "$hn: '$repo' is local" if $mode eq 'local';
- _die "$hn: '$repo' is not native" if $mode eq 'slave';
- _die "$hn: '$sender' is not a valid slave for '$repo'" if not $slaves{$sender};
- _die "$hn: redirection not allowed from '$sender'" if not $trusted_slaves{$sender};
+ _die "$hn: '$repo' is not native" if $mode eq 'copy';
+ _die "$hn: '$sender' is not a valid copy for '$repo'" if not $copies{$sender};
+ _die "$hn: redirection not allowed from '$sender'" if not $trusted_copies{$sender};
return;
}
@@ -142,20 +142,20 @@ sub post_git {
trace( 1, "mirror", "post_git", $repo, "user=$user", "sender=$sender", "mode=$mode", ( $rc{REDIRECTED_PUSH} ? ("redirected") : () ) );
# ------------------------------------------------------------------
- # case 1: we're master or slave, normal user pushing to us
+ # case 1: we're master or copy, normal user pushing to us
if ( $user and not $rc{REDIRECTED_PUSH} ) {
trace( 3, "case 1, user push" );
return if $mode eq 'local';
- # slave was eliminated earlier anyway, so that leaves 'master'
+ # copy was eliminated earlier anyway, so that leaves 'master'
- # find all slaves and push to each of them
- push_to_slaves($repo);
+ # find all copies and push to each of them
+ push_to_copies($repo);
return;
}
# ------------------------------------------------------------------
- # case 2: we're slave, master pushing to us
+ # case 2: we're copy, master pushing to us
if ( $sender and not $rc{REDIRECTED_PUSH} ) {
trace( 3, "case 2, master push" );
# nothing to do
@@ -163,12 +163,12 @@ sub post_git {
}
# ------------------------------------------------------------------
- # case 3: we're master, slave sending a redirected push to us
+ # case 3: we're master, copy sending a redirected push to us
if ( $sender and $rc{REDIRECTED_PUSH} ) {
- trace( 3, "case 2, slave redirect" );
+ trace( 3, "case 2, copy redirect" );
- # find all slaves and push to each of them
- push_to_slaves($repo);
+ # find all copies and push to each of them
+ push_to_copies($repo);
return;
}
@@ -182,39 +182,39 @@ sub post_git {
return if $lastrepo eq $repo;
$master = master($repo);
- %slaves = slaves($repo);
+ %copies = copies($repo);
$mode = mode($repo);
- %trusted_slaves = trusted_slaves($repo);
- trace( 3, $master, $mode, join( ",", sort keys %slaves ), join( ",", sort keys %trusted_slaves ) );
+ %trusted_copies = trusted_copies($repo);
+ trace( 3, $master, $mode, join( ",", sort keys %copies ), join( ",", sort keys %trusted_copies ) );
}
sub master {
return option( +shift, 'mirror.master' );
}
- sub slaves {
+ sub copies {
my $repo = shift;
- my $ref = git_config( $repo, "^gitolite-options\\.mirror\\.slaves.*" );
+ my $ref = git_config( $repo, "^gitolite-options\\.mirror\\.copies.*" );
my %out = map { $_ => 'async' } map { split } values %$ref;
- $ref = git_config( $repo, "^gitolite-options\\.mirror\\.slaves\\.sync.*" );
+ $ref = git_config( $repo, "^gitolite-options\\.mirror\\.copies\\.sync.*" );
map { $out{$_} = 'sync' } map { split } values %$ref;
- $ref = git_config( $repo, "^gitolite-options\\.mirror\\.slaves\\.nosync.*" );
+ $ref = git_config( $repo, "^gitolite-options\\.mirror\\.copies\\.nosync.*" );
map { $out{$_} = 'nosync' } map { split } values %$ref;
return %out;
}
- sub trusted_slaves {
+ sub trusted_copies {
my $ref = git_config( +shift, "^gitolite-options\\.mirror\\.redirectOK.*" );
- # the list of trusted slaves (where we accept redirected pushes from)
+ # the list of trusted copies (where we accept redirected pushes from)
# is either explicitly given...
my @out = map { split } values %$ref;
my %out = map { $_ => 1 } @out;
- # ...or it's all the slaves mentioned if the list is just a "all"
- %out = %slaves if ( @out == 1 and $out[0] eq 'all' );
+ # ...or it's all the copies mentioned if the list is just a "all"
+ %out = %copies if ( @out == 1 and $out[0] eq 'all' );
return %out;
}
@@ -222,24 +222,24 @@ sub post_git {
my $repo = shift;
return 'local' if not $hn;
return 'master' if $master eq $hn;
- return 'slave' if $slaves{$hn};
- return 'local' if not $master and not %slaves;
+ return 'copy' if $copies{$hn};
+ return 'local' if not $master and not %copies;
_die "$hn: '$repo' is mirrored but not here";
}
}
-sub push_to_slaves {
+sub push_to_copies {
my $repo = shift;
my $u = $ENV{GL_USER};
delete $ENV{GL_USER}; # why? see src/commands/mirror
my $lb = "$ENV{GL_REPO_BASE}/$repo.git/.gl-mirror-lock";
- for my $s ( sort keys %slaves ) {
- trace( 1, "push_to_slaves: skipping self" ), next if $s eq $hn;
- system("gitolite 1plus1 $lb.$s gitolite mirror push $s $repo </dev/null >/dev/null 2>&1 &") if $slaves{$s} eq 'async';
- system("gitolite 1plus1 $lb.$s gitolite mirror push $s $repo </dev/null >/dev/null 2>&1") if $slaves{$s} eq 'sync';
- _warn "manual mirror push pending for '$s'" if $slaves{$s} eq 'nosync';
+ for my $s ( sort keys %copies ) {
+ trace( 1, "push_to_copies skipping self" ), next if $s eq $hn;
+ system("gitolite 1plus1 $lb.$s gitolite mirror push $s $repo </dev/null >/dev/null 2>&1 &") if $copies{$s} eq 'async';
+ system("gitolite 1plus1 $lb.$s gitolite mirror push $s $repo </dev/null >/dev/null 2>&1") if $copies{$s} eq 'sync';
+ _warn "manual mirror push pending for '$s'" if $copies{$s} eq 'nosync';
}
$ENV{GL_USER} = $u;
diff --git a/src/lib/Gitolite/Triggers/RepoUmask.pm b/src/lib/Gitolite/Triggers/RepoUmask.pm
index 109cb31..276cd01 100644
--- a/src/lib/Gitolite/Triggers/RepoUmask.pm
+++ b/src/lib/Gitolite/Triggers/RepoUmask.pm
@@ -23,6 +23,10 @@ use warnings;
option umask = 0027
+ * Anytime you add or change the value, if there are existing repos that
+ would be affected, you will need to do a manual "chmod" adjustment,
+ because umask only affects newly created files.
+
=cut
# sadly option/config values are not available at pre_create time for normal
diff --git a/src/lib/Gitolite/Triggers/TProxy.pm b/src/lib/Gitolite/Triggers/TProxy.pm
index a2820ec..9c42918 100644
--- a/src/lib/Gitolite/Triggers/TProxy.pm
+++ b/src/lib/Gitolite/Triggers/TProxy.pm
@@ -49,7 +49,7 @@ package Gitolite::Triggers::TProxy;
# corresponding pub keys would already be set ok so step 2 in the
# upstream server setup (above) will not be needed.
# 2. needless to say, **don't** declare the repos you want to be
-# transparently proxied in the gitolite.conf for the slave.
+# transparently proxied in the gitolite.conf for the copy.
use Gitolite::Rc;
use Gitolite::Common;
diff --git a/src/triggers/repo-specific-hooks b/src/triggers/repo-specific-hooks
index 7c16f2f..4044cc9 100755
--- a/src/triggers/repo-specific-hooks
+++ b/src/triggers/repo-specific-hooks
@@ -42,19 +42,17 @@ while (<>) {
my @codes = split /\s+/, $codes;
- # check for disallowed hook types only if @codes is non-empty
- if (@codes) {
- # this is a special case
- if ( $repo eq 'gitolite-admin' and $hook eq 'post-update' ) {
- _warn "repo-specific-hooks: ignoring attempts to set post-update hook for the admin repo";
- next;
- }
-
- unless ( $hook =~ /^(pre-receive|post-receive|post-update|pre-auto-gc)$/ ) {
+ # bail on disallowed hook types (but warn only if @codes is non-empty)
+ if ( $repo eq 'gitolite-admin' and $hook eq 'post-update' ) {
+ _warn "repo-specific-hooks: ignoring attempts to set post-update hook for the admin repo" if @codes;
+ next;
+ }
+ unless ( $hook =~ /^(pre-receive|post-receive|post-update|pre-auto-gc)$/ ) {
+ if (@codes) {
_warn "repo-specific-hooks: '$hook' is not allowed, ignoring";
_warn " (only pre-receive, post-receive, post-update, and pre-auto-gc are allowed)";
- next;
}
+ next;
}
push @{ $repo_hooks{$repo}{$hook} }, @codes;
diff --git a/t/README b/t/README
index 4ecdfb7..4dc1594 100644
--- a/t/README
+++ b/t/README
@@ -1,7 +1,26 @@
+# instructions for running the tests
-============================================
-WARNING: THE TEST SUITE DELETES STUFF FIRST!
-============================================
+# Pre-requisites
+
+Install the following packages:
+
+* Manjaro (and probably Arch):
+
+ pacman -S perl-json perl-json-xs apache
+
+* Fedora (and probably CentOS):
+
+ dnf install -y perl-Test-Harness perl-JSON perl-JSON-XS httpd httpd-tools
+
+* others:
+
+ (TBD)
+
+# RUNNING THE MAIN TEST SUITE
+
+ ======================================
+ WARNING: THE TEST SUITE DELETES STUFF!
+ ======================================
Please run the tests ONLY on a userid where it's ok to LOSE DATA.
@@ -12,3 +31,86 @@ On such a userid, clone gitolite then run this command in the clone:
http://gitolite.com/gitolite/testing.html has more details. Alternatively,
http://gitolite.com/gitolite/req.html#trying will help you try out gitolite if
you want to play with gitolite safely.
+
+# RUNNING THE HTTP AND MIRROR TESTS
+
+ ======================================
+ WARNING: THE TEST SUITE DELETES STUFF!
+ ======================================
+
+The http and mirror tests require a lot more preparation, including commands
+and/or scripts to be run as root, so they're not invoked when you simply run
+"prove" as above.
+
+## Manjaro
+
+1. Create 3 users: sam, frodo, and gollum (`useradd -m`).
+
+2. Assuming you're running the tests using a local user called `g3`, run
+ `visudo` and add the following line:
+
+ g3 ALL = (sam,frodo,gollum) NOPASSWD: ALL
+
+ Test this by running this command from within `g3` and making sure you get
+ the correct results:
+
+ sudo -u sam -i pwd
+ # should print /home/sam
+ # similarly make sure frodo and gollum also give correct results
+
+ The mirror test will not run if this does not work. That does not mean
+ *mirroring* will not work; only the test suite depends on this feature.
+
+3. Manjaro does not, by default, add $HOME/bin to $PATH, so you will need the
+ following on at least sam, frodo, and gollum:
+
+ # copy-paste this into a root terminal
+ for u in frodo sam gollum; do
+ grep '$HOME/bin' /home/$u/.bash_profile || echo 'export PATH="$HOME/bin:$PATH"' >> /home/$u/.bash_profile
+ done
+
+ Again, test this by running:
+
+ sudo -u sam -i echo '$PATH'
+
+ and making sure the output starts with `/home/sam/bin:` (and similarly for
+ frodo and gollum).
+
+4. Take a look inside `t/manjaro-root-smart-http-test-setup` to make sure
+ everything looks sane (because you have to run it as root!!), then run it
+ as root.
+
+5. Now you are ready to run the last two tests:
+
+ GITOLITE_TEST=y prove t/smart-http
+ GITOLITE_TEST=y prove t/mirror-test
+
+## Fedora
+
+1. Create 3 users: sam, frodo, and gollum (`useradd`).
+
+2. Assuming you're running the tests using a local user called `g3`, run
+ `visudo` and add the following line:
+
+ g3 ALL = (sam,frodo,gollum) NOPASSWD: ALL
+
+ Test this by running this command from within `g3` and making sure you get
+ the correct results:
+
+ sudo -u sam -i pwd
+ # should print /home/sam
+ # similarly make sure frodo and gollum also give correct results
+
+ The mirror test will not run if this does not work. That does not mean
+ *mirroring* will not work; only the test suite depends on this feature.
+
+3. Take a look inside `t/fedora-root-smart-http-test-setup` to make sure
+ everything looks sane (because you have to run it as root!!), then run it
+ as root.
+
+4. Now you are ready to run the last two tests:
+
+ prove t/smart-http
+ prove t/mirror-test
+
+vim: ft=markdown
diff --git a/t/fedora-root-smart-http-test-setup b/t/fedora-root-smart-http-test-setup
new file mode 100755
index 0000000..869d13d
--- /dev/null
+++ b/t/fedora-root-smart-http-test-setup
@@ -0,0 +1,95 @@
+#!/bin/bash
+
+# gitolite http mode TESTING setup for Fedora
+# - Probably works for CentOS also; if someone tests it let me know
+# - Use the comments to create a version for your distro if needed
+
+# CAUTION: This script needs to be run as root, so you best eyeball it at
+# least once to make sure you know what changes it is making.
+
+# WARNING: clobbers /usr/share/httpd/gitolite-home, and also creates 7 http
+# users with trivial passwords FOR TESTING.
+
+# HOWEVER: if you remove some of that, especially the part that creates test
+# users, this *should* work as a quick "setup gitolite http mode" script.
+
+# CAUTION: This script assumes the httpd.conf file is pretty much the default
+# "as shipped" version. If you fiddled with it, this script *may* break.
+# It's on you to determine if that is the case and manually simulate the
+# actions of this script. It's not that hard, and anyway it's just once (for
+# a given server) so it's not too bad.
+
+# ----------------------------------------------------------------------
+
+cd ~apache
+# should be /usr/share/httpd; you may want to check just to be safe
+export GITOLITE_HTTP_HOME=$PWD/gitolite-home
+
+[[ -d gitolite-home ]] && {
+ [[ $GITOLITE_TEST != y ]] && {
+ echo "If you're OK with clobbering $GITOLITE_HTTP_HOME, please rerun with
+environment variable GITOLITE_TEST set to 'y'."
+ exit 1;
+ }
+}
+
+rm -rf gitolite-home
+mkdir gitolite-home
+
+# setup apache conf for gitolite
+cd /etc/httpd/conf.d
+[[ -f gitolite.conf ]] || {
+ cat > gitolite.conf <<-EOF
+ SetEnv GIT_PROJECT_ROOT $GITOLITE_HTTP_HOME/repositories
+ ScriptAlias /git/ $GITOLITE_HTTP_HOME/gitolite-source/src/gitolite-shell/
+ ScriptAlias /gitmob/ $GITOLITE_HTTP_HOME/gitolite-source/src/gitolite-shell/
+ SetEnv GITOLITE_HTTP_HOME $GITOLITE_HTTP_HOME
+ SetEnv GIT_HTTP_EXPORT_ALL
+
+ <Location /git>
+ AuthType Basic
+ AuthName "Private Git Access"
+ Require valid-user
+ AuthUserFile $GITOLITE_HTTP_HOME/gitolite-http-authuserfile
+ </Location>
+ EOF
+}
+
+# get the gitolite sources
+cd $GITOLITE_HTTP_HOME
+
+if [[ -d /tmp/gitolite.git ]]; then
+ git clone /tmp/gitolite.git gitolite-source
+ # I do this because I have to test stuff *before* it gets to github, so I
+ # can't simply clone what's on github. Instead, I use a local
+ # world-readable bare repo cloned from my dev environment.
+else
+ git clone 'https://github.com/sitaramc/gitolite' gitolite-source
+fi
+
+# make the bin directory, and add it to PATH
+cd gitolite-source
+mkdir $GITOLITE_HTTP_HOME/bin
+./install -ln $GITOLITE_HTTP_HOME/bin
+export PATH=$PATH:$GITOLITE_HTTP_HOME/bin
+
+# come back to base, then run setup. Notice that you have to point HOME to
+# the right place, even if it is just for this command
+cd $GITOLITE_HTTP_HOME
+HOME=$GITOLITE_HTTP_HOME gitolite setup -a admin
+
+# insert some essential lines at the beginning of the rc file
+echo '$ENV{PATH} .= ":$ENV{GITOLITE_HTTP_HOME}/bin";' > 1
+echo >> 1
+cat .gitolite.rc >> 1
+\mv 1 .gitolite.rc
+
+# create users "admin" and "u1" thru "u6" for testing
+htpasswd -bc $GITOLITE_HTTP_HOME/gitolite-http-authuserfile admin admin
+seq 6 | xargs -I % htpasswd -b $GITOLITE_HTTP_HOME/gitolite-http-authuserfile u% u%
+
+# fix up ownership
+chown -R apache:apache $GITOLITE_HTTP_HOME
+
+# restart httpd to make it pick up all the new stuff
+systemctl restart httpd
diff --git a/t/git-config.t b/t/git-config.t
index 86a3a7b..fb5097e 100755
--- a/t/git-config.t
+++ b/t/git-config.t
@@ -137,7 +137,6 @@ try "
$t = join("\n", sort (lines()));
cmp $t, 'bar.git/config: bare = true
-bar.git/config:[foo]
foo.git/config: bar = f1
foo.git/config: bare = true
foo.git/config:[foo]
diff --git a/t/manjaro-root-smart-http-test-setup b/t/manjaro-root-smart-http-test-setup
new file mode 100755
index 0000000..f254b55
--- /dev/null
+++ b/t/manjaro-root-smart-http-test-setup
@@ -0,0 +1,114 @@
+#!/bin/bash
+
+# gitolite http mode TESTING setup for Manjaro
+# - Probably works for Arch also; if someone tests it let me know
+# - Use the comments to create a version for your distro if needed
+
+# CAUTION: This script needs to be run as root, so you best eyeball it at
+# least once to make sure you know what changes it is making.
+
+# WARNING: clobbers /srv/http/gitolite-home, and also creates 7 http
+# users with trivial passwords FOR TESTING.
+
+# HOWEVER: if you remove some of that, especially the part that creates test
+# users, this *should* work as a quick "setup gitolite http mode" script.
+
+# CAUTION: This script assumes the httpd.conf file is pretty much the default
+# "as shipped" version. If you fiddled with it, this script *may* break.
+# It's on you to determine if that is the case and manually simulate the
+# actions of this script. It's not that hard, and anyway it's just once (for
+# a given server) so it's not too bad.
+
+# ----------------------------------------------------------------------
+# BEGIN APACHE CONF CHANGES
+
+# Unlike Fedora, Manjaro's default httpd.conf does not contain a wildcard
+# include for stuff in conf.d; they're all explicitly included, so we need to
+# include gitolite.conf.
+cd /etc/httpd/conf
+grep ^Include.*gitolite.conf httpd.conf ||
+ printf "\n%s\n%s\n" '# gitolite http mode' 'Include conf/extra/gitolite.conf' >> httpd.conf
+
+# Again, unlike Fedora, Manjaro's default conf does not come with cgi enabled.
+# In fact, the directive is both commented out *and* inside an "IF" block for
+# some other module. Since I don't plan to be an expert on apache, I will
+# punt by including the required LoadModule line before the first LoadModule
+# line that is not in an "if" block (i.e., not indented).
+grep '^LoadModule cgi_module modules/mod_cgi.so' httpd.conf ||
+ perl -i -pE 'say "LoadModule cgi_module modules/mod_cgi.so" if /^LoadModule/ and not $flag++' httpd.conf
+
+# END APACHE CONF CHANGES
+# ----------------------------------------------------------------------
+
+cd ~http
+# should be /srv/http; you may want to check just to be safe
+export GITOLITE_HTTP_HOME=$PWD/gitolite-home
+
+[[ -d gitolite-home ]] && {
+ [[ $GITOLITE_TEST != y ]] && {
+ echo "If you're OK with clobbering $GITOLITE_HTTP_HOME, please rerun with
+environment variable GITOLITE_TEST set to 'y'."
+ exit 1;
+ }
+}
+
+rm -rf gitolite-home
+mkdir gitolite-home
+
+# setup apache conf for gitolite
+cd /etc/httpd/conf/extra
+[[ -f gitolite.conf ]] || {
+ cat > gitolite.conf <<-EOF
+ SetEnv GIT_PROJECT_ROOT $GITOLITE_HTTP_HOME/repositories
+ ScriptAlias /git/ $GITOLITE_HTTP_HOME/gitolite-source/src/gitolite-shell/
+ ScriptAlias /gitmob/ $GITOLITE_HTTP_HOME/gitolite-source/src/gitolite-shell/
+ SetEnv GITOLITE_HTTP_HOME $GITOLITE_HTTP_HOME
+ SetEnv GIT_HTTP_EXPORT_ALL
+
+ <Location /git>
+ AuthType Basic
+ AuthName "Private Git Access"
+ Require valid-user
+ AuthUserFile $GITOLITE_HTTP_HOME/gitolite-http-authuserfile
+ </Location>
+ EOF
+}
+
+# get the gitolite sources
+cd $GITOLITE_HTTP_HOME
+
+if [[ -d /tmp/gitolite.git ]]; then
+ git clone /tmp/gitolite.git gitolite-source
+ # I do this because I have to test stuff *before* it gets to github, so I
+ # can't simply clone what's on github. Instead, I use a local
+ # world-readable bare repo cloned from my dev environment.
+else
+ git clone 'https://github.com/sitaramc/gitolite' gitolite-source
+fi
+
+# make the bin directory, and add it to PATH
+cd gitolite-source
+mkdir $GITOLITE_HTTP_HOME/bin
+./install -ln $GITOLITE_HTTP_HOME/bin
+export PATH=$PATH:$GITOLITE_HTTP_HOME/bin
+
+# come back to base, then run setup. Notice that you have to point HOME to
+# the right place, even if it is just for this command
+cd $GITOLITE_HTTP_HOME
+HOME=$GITOLITE_HTTP_HOME gitolite setup -a admin
+
+# insert some essential lines at the beginning of the rc file
+echo '$ENV{PATH} .= ":$ENV{GITOLITE_HTTP_HOME}/bin";' > 1
+echo >> 1
+cat .gitolite.rc >> 1
+\mv 1 .gitolite.rc
+
+# create users "admin" and "u1" thru "u6" for testing
+htpasswd -bc $GITOLITE_HTTP_HOME/gitolite-http-authuserfile admin admin
+seq 6 | xargs -I % htpasswd -b $GITOLITE_HTTP_HOME/gitolite-http-authuserfile u% u%
+
+# fix up ownership
+chown -R http:http $GITOLITE_HTTP_HOME
+
+# restart httpd to make it pick up all the new stuff
+systemctl restart httpd
diff --git a/t/mirror-test b/t/mirror-test
index e0c4e36..3ace59b 100755
--- a/t/mirror-test
+++ b/t/mirror-test
@@ -147,7 +147,7 @@ try "
git push; !ok
!/To localhost:gitolite-admin/
!/master -> master/
- /gollum: pushing 'gitolite-admin' to slave 'gollum' not allowed/
+ /gollum: pushing 'gitolite-admin' to copy 'gollum' not allowed/
git rev-parse HEAD
";
@@ -290,7 +290,7 @@ try "
cd fr1
empty
git push
- /frodo: pushing 'r1' to slave 'frodo' not allowed/
+ /frodo: pushing 'r1' to copy 'frodo' not allowed/
cd ..
git clone sam\@localhost:r1 sr1; ok
cd sr1
@@ -335,7 +335,7 @@ try "
cd fr1
tc b
git push
- /frodo: pushing 'r1' to slave 'frodo' not allowed/
+ /frodo: pushing 'r1' to copy 'frodo' not allowed/
cd ..
git clone frodo\@localhost:r2 fr2; ok
cd fr2
@@ -441,5 +441,5 @@ try "
cd nvsfrodo
empty
git push origin master; !ok
- /FATAL: frodo: 'sam' is not a valid slave for 'nvsfrodo'/
+ /FATAL: frodo: 'sam' is not a valid copy for 'nvsfrodo'/
";
diff --git a/t/mirror-test-setup.sh b/t/mirror-test-setup.sh
index b35364c..32bc462 100755
--- a/t/mirror-test-setup.sh
+++ b/t/mirror-test-setup.sh
@@ -66,7 +66,7 @@ ssh $mainhost@localhost info
lines="
repo gitolite-admin
option mirror.master = frodo
- option mirror.slaves-1 = sam gollum
+ option mirror.copies-1 = sam gollum
option mirror.redirectOK = sam
repo r1
@@ -74,14 +74,14 @@ repo r1
RW = u2
R = u3
option mirror.master = sam
- option mirror.slaves-1 = frodo
+ option mirror.copies-1 = frodo
repo r2
RW+ = u2
RW = u3
R = u4
option mirror.master = sam
- option mirror.slaves-1 = frodo gollum
+ option mirror.copies-1 = frodo gollum
option mirror.redirectOK = all
include \"%HOSTNAME.conf\"
@@ -106,7 +106,7 @@ done
# goes on frodo
lines="
-# local to frodo but sam thinks frodo is a slave
+# local to frodo but sam thinks frodo is a copy
repo lfrodo
RW = u1
@@ -114,13 +114,13 @@ RW = u1
repo mboth
RW = u1
option mirror.master = frodo
-option mirror.slaves = sam
+option mirror.copies = sam
# frodo thinks someone else is the master but sam thinks he is
repo mnotsam
RW = u1
option mirror.master = merry
-option mirror.slaves = frodo
+option mirror.copies = frodo
# local to frodo but sam thinks frodo is a master and redirect is OK
repo lfrodo2
@@ -130,14 +130,14 @@ RW = u1
repo nnfrodo
RW = u1
option mirror.master = gollum
-option mirror.slaves = frodo
+option mirror.copies = frodo
option mirror.redirectOK = all
-# sam is not a valid slave to send stuff to frodo
+# sam is not a valid copy to send stuff to frodo
repo nvsfrodo
RW = u1
option mirror.master = frodo
-option mirror.slaves = gollum
+option mirror.copies = gollum
option mirror.redirectOK = all
"
@@ -145,43 +145,43 @@ echo "$lines" | sudo -u frodo -i sh -c "cat >> .gitolite/conf/frodo.conf"
# goes on sam
lines="
-# local to frodo but sam thinks frodo is a slave
+# local to frodo but sam thinks frodo is a copy
repo lfrodo
RW = u1
option mirror.master = sam
-option mirror.slaves = frodo
+option mirror.copies = frodo
# both think they're master
repo mboth
RW = u1
option mirror.master = sam
-option mirror.slaves = frodo
+option mirror.copies = frodo
# frodo thinks someone else is the master but sam thinks he is
repo mnotsam
RW = u1
option mirror.master = sam
-option mirror.slaves = frodo
+option mirror.copies = frodo
# local to frodo but sam thinks frodo is a master and redirect is OK
repo lfrodo2
RW = u1
option mirror.master = frodo
-option mirror.slaves = sam
+option mirror.copies = sam
option mirror.redirectOK = all
# non-native to frodo but sam thinks frodo is master
repo nnfrodo
RW = u1
option mirror.master = frodo
-option mirror.slaves = sam
+option mirror.copies = sam
option mirror.redirectOK = all
-# sam is not a valid slave to send stuff to frodo
+# sam is not a valid copy to send stuff to frodo
repo nvsfrodo
RW = u1
option mirror.master = frodo
-option mirror.slaves = sam
+option mirror.copies = sam
option mirror.redirectOK = all
"
diff --git a/t/smart-http b/t/smart-http
index 9ae6d5b..3ac910b 100755
--- a/t/smart-http
+++ b/t/smart-http
@@ -62,7 +62,7 @@ tsh "
/1 file.*changed/
git push
ok
- /Initialized.*usr.share.httpd.gitolite-home.repositories.t2.git/
+ /Initialized.*gitolite-home.repositories.t2.git/
/To http:..localhost.git.gitolite-admin.git/
/master -. master/
## various ls-remotes