diff options
-rwxr-xr-x | src/cron/gitjoe.pl | 2 | ||||
-rwxr-xr-x | src/gitjoe/addsshkey.pl | 3 | ||||
-rwxr-xr-x | src/gitjoe/adduser.pl | 13 | ||||
-rwxr-xr-x | src/gitjoe/chdesc.pl | 3 | ||||
-rwxr-xr-x | src/gitjoe/chowner.pl | 3 | ||||
-rwxr-xr-x | src/gitjoe/chstate.pl | 3 | ||||
-rwxr-xr-x | src/gitjoe/newrepo.pl | 3 | ||||
-rwxr-xr-x | src/gitjoe/rmrepo.pl | 3 | ||||
-rwxr-xr-x | src/gitjoe/rmuser.pl | 8 | ||||
-rwxr-xr-x | src/other/git-ro-daemon.pl | 4 |
10 files changed, 19 insertions, 26 deletions
diff --git a/src/cron/gitjoe.pl b/src/cron/gitjoe.pl index f3b85a4..023c3cc 100755 --- a/src/cron/gitjoe.pl +++ b/src/cron/gitjoe.pl @@ -7,7 +7,7 @@ use File::Copy; use Capture::Tiny; use constant { - HOME_DIR => '/usr/home/', + HOME_DIR => '/usr/local/git/', TMP_DIR => '/tmp/gitjoe/', SITE_DIR => '/usr/local/www/gitjoe/' }; diff --git a/src/gitjoe/addsshkey.pl b/src/gitjoe/addsshkey.pl index 3340d64..431ce7d 100755 --- a/src/gitjoe/addsshkey.pl +++ b/src/gitjoe/addsshkey.pl @@ -3,6 +3,7 @@ use strict; use warnings; use Term::ANSIColor; +use constant HOME_DIR => '/usr/local/git/'; sub main { @@ -17,7 +18,7 @@ sub main my $usr = $ARGV[0]; my $sshkey = "no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty "; $sshkey = $sshkey . $ARGV[1]; - my $home_dir = '/usr/home/' . $usr . '/'; + my $home_dir = HOME_DIR . $usr . '/'; open(my $fh, '>>:encoding(UTF-8)', $home_dir . '.ssh/authorized_keys'); print $fh "$sshkey\n"; close($fh); diff --git a/src/gitjoe/adduser.pl b/src/gitjoe/adduser.pl index 23c7a56..4e0746d 100755 --- a/src/gitjoe/adduser.pl +++ b/src/gitjoe/adduser.pl @@ -3,10 +3,7 @@ use strict; use warnings; use Term::ANSIColor; -use constant { - DASH_PATH => '/usr/local/bin/dash', - ADDUSER_PATH => '/usr/sbin/adduser', -}; +use constant HOME_DIR => '/usr/local/git/'; sub main { @@ -21,11 +18,9 @@ sub main my $usr = $ARGV[0]; my $sshkey = "no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty "; $sshkey = $sshkey . $ARGV[1]; - my $home_dir = '/usr/home/' . $usr . '/'; + my $home_dir = HOME_DIR . $usr . '/'; system( - DASH_PATH, - '-c', - ADDUSER_PATH . " << EOF + "adduser << EOF " . $usr . " @@ -33,7 +28,7 @@ sub main git-shell - +" . HOME_DIR . $usr . " diff --git a/src/gitjoe/chdesc.pl b/src/gitjoe/chdesc.pl index e15ca4e..b0c25b7 100755 --- a/src/gitjoe/chdesc.pl +++ b/src/gitjoe/chdesc.pl @@ -3,6 +3,7 @@ use strict; use warnings; use Term::ANSIColor; +use constant HOME_DIR => '/usr/local/git/'; sub main { @@ -17,7 +18,7 @@ sub main my $usr = $ARGV[0]; my $repo = $ARGV[1]; my $desc = $ARGV[2]; - my $home_dir = '/usr/home/' . $usr . '/'; + my $home_dir = HOME_DIR . $usr . '/'; if (substr($repo, -4) ne '.git') { $repo = $repo . '.git'; } diff --git a/src/gitjoe/chowner.pl b/src/gitjoe/chowner.pl index 203e4ba..f3b1218 100755 --- a/src/gitjoe/chowner.pl +++ b/src/gitjoe/chowner.pl @@ -3,6 +3,7 @@ use strict; use warnings; use Term::ANSIColor; +use constant HOME_DIR => '/usr/local/git/'; sub main { @@ -17,7 +18,7 @@ sub main my $usr = $ARGV[0]; my $repo = $ARGV[1]; my $owner = $ARGV[2]; - my $home_dir = '/usr/home/' . $usr . '/'; + my $home_dir = HOME_DIR . $usr . '/'; if (substr($repo, -4) ne '.git') { $repo = $repo . '.git'; } diff --git a/src/gitjoe/chstate.pl b/src/gitjoe/chstate.pl index e05f024..25de239 100755 --- a/src/gitjoe/chstate.pl +++ b/src/gitjoe/chstate.pl @@ -3,6 +3,7 @@ use strict; use warnings; use Term::ANSIColor; +use constant HOME_DIR => '/usr/local/git/'; sub main { @@ -16,7 +17,7 @@ sub main } my $usr = $ARGV[0]; my $repo = $ARGV[1]; - my $home_dir = '/usr/home/' . $usr . '/'; + my $home_dir = HOME_DIR . $usr . '/'; if (substr($repo, -4) ne '.git') { $repo = $repo . '.git'; } diff --git a/src/gitjoe/newrepo.pl b/src/gitjoe/newrepo.pl index ea3c46d..dc8041b 100755 --- a/src/gitjoe/newrepo.pl +++ b/src/gitjoe/newrepo.pl @@ -4,6 +4,7 @@ use strict; use warnings; use Term::ANSIColor; use File::Find; +use constant HOME_DIR => '/usr/local/git/'; sub main { @@ -21,7 +22,7 @@ sub main if ($argc >= 3) { $desc = $ARGV[2]; } - my $home_dir = '/usr/home/' . $usr . '/'; + my $home_dir = HOME_DIR . $usr . '/'; if (substr($repo, -4) ne '.git') { $repo = $repo . '.git'; } diff --git a/src/gitjoe/rmrepo.pl b/src/gitjoe/rmrepo.pl index 9c82b14..b028bb4 100755 --- a/src/gitjoe/rmrepo.pl +++ b/src/gitjoe/rmrepo.pl @@ -3,6 +3,7 @@ use strict; use warnings; use Term::ANSIColor; +use constant HOME_DIR => '/usr/local/git/'; sub main { @@ -16,7 +17,7 @@ sub main } my $usr = $ARGV[0]; my $repo = $ARGV[1]; - my $home_dir = '/usr/home/' . $usr . '/'; + my $home_dir = HOME_DIR . $usr . '/'; if (substr($repo, -4) ne '.git') { $repo = $repo . '.git'; } diff --git a/src/gitjoe/rmuser.pl b/src/gitjoe/rmuser.pl index e88ddfa..9753950 100755 --- a/src/gitjoe/rmuser.pl +++ b/src/gitjoe/rmuser.pl @@ -3,10 +3,6 @@ use strict; use warnings; use Term::ANSIColor; -use constant { - DASH_PATH => '/usr/local/bin/dash', - RMUSER_PATH => '/usr/sbin/rmuser', -}; sub main { @@ -20,9 +16,7 @@ sub main } my $usr = $ARGV[0]; system( - DASH_PATH, - '-c', - RMUSER_PATH . " << EOF + "rmuser << EOF " . $usr . " y y diff --git a/src/other/git-ro-daemon.pl b/src/other/git-ro-daemon.pl index 93c5339..f237bbc 100755 --- a/src/other/git-ro-daemon.pl +++ b/src/other/git-ro-daemon.pl @@ -6,9 +6,7 @@ use Term::ANSIColor; sub main { system( - '/usr/local/bin/dash', - '-c', - '/usr/local/bin/git daemon --reuseaddr --base-path=/usr/home /usr/home &' + 'git daemon --reuseaddr --base-path=/usr/local/git /usr/local/git &' ); exit; } |