From 7786ce2a332b0eba4b3ca7c57f906a32e8715da3 Mon Sep 17 00:00:00 2001 From: Bryan Bishop Date: Fri, 29 Oct 2010 19:46:24 -0500 Subject: Starting repo cleanup to make this not so awful --- pinyadmin/bin/addaccess | 2 ++ pinyadmin/bin/appendkeys | 5 +++++ pinyadmin/bin/createuser | 1 + pinyadmin/bin/lsaccess | 30 ++++++++++++++++++++++++++++++ pinyadmin/bin/lsrepo | 10 ++++++++++ pinyadmin/bin/newrepo | 2 ++ pinyadmin/bin/newuser | 2 ++ pinyadmin/bin/pinyconfig | 2 ++ pinyadmin/bin/pinyshell | 5 +++++ pinyadmin/bin/readkeys | 3 +++ pinyadmin/bin/rmaccess | 2 ++ pinyadmin/bin/rmrepo | 2 ++ pinyadmin/bin/writekeys | 5 +++++ 13 files changed, 71 insertions(+) create mode 100755 pinyadmin/bin/addaccess create mode 100755 pinyadmin/bin/appendkeys create mode 120000 pinyadmin/bin/createuser create mode 100755 pinyadmin/bin/lsaccess create mode 100755 pinyadmin/bin/lsrepo create mode 100755 pinyadmin/bin/newrepo create mode 100755 pinyadmin/bin/newuser create mode 100755 pinyadmin/bin/pinyconfig create mode 100755 pinyadmin/bin/pinyshell create mode 100755 pinyadmin/bin/readkeys create mode 100755 pinyadmin/bin/rmaccess create mode 100755 pinyadmin/bin/rmrepo create mode 100755 pinyadmin/bin/writekeys (limited to 'pinyadmin/bin') diff --git a/pinyadmin/bin/addaccess b/pinyadmin/bin/addaccess new file mode 100755 index 0000000..849119d --- /dev/null +++ b/pinyadmin/bin/addaccess @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/bin/sudo /usr/sbin/addaccess "$@" diff --git a/pinyadmin/bin/appendkeys b/pinyadmin/bin/appendkeys new file mode 100755 index 0000000..a4b7d98 --- /dev/null +++ b/pinyadmin/bin/appendkeys @@ -0,0 +1,5 @@ +#!/bin/sh + +/bin/mkdir -p ~/.ssh +/bin/echo Please input authorized keys to be appended. ctrl-d to finish, ctrl-c to abort current line. +/bin/cat >> ~/.ssh/authorized_keys diff --git a/pinyadmin/bin/createuser b/pinyadmin/bin/createuser new file mode 120000 index 0000000..e9d7937 --- /dev/null +++ b/pinyadmin/bin/createuser @@ -0,0 +1 @@ +newuser \ No newline at end of file diff --git a/pinyadmin/bin/lsaccess b/pinyadmin/bin/lsaccess new file mode 100755 index 0000000..ce41fc4 --- /dev/null +++ b/pinyadmin/bin/lsaccess @@ -0,0 +1,30 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use Piny; + +my $env = Piny::Environment->instance( ); + +my ( $reponame ) = @ARGV; + +if ( defined $reponame ) { + + my $repo = Piny::Repo->new( $reponame ); + + foreach my $user ( Piny::User->all_users( ) ) { + if ( $repo->has_access( $user ) ) { + print $user->name . "\n"; + }; + }; + +} else { + + foreach my $repo ( Piny::Repo->all_repos( ) ) { + if ( $repo->has_access( $env->user ) ) { + print $repo->name . "\n"; + }; + }; + +}; diff --git a/pinyadmin/bin/lsrepo b/pinyadmin/bin/lsrepo new file mode 100755 index 0000000..2d88eb5 --- /dev/null +++ b/pinyadmin/bin/lsrepo @@ -0,0 +1,10 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use Piny; + +foreach my $repo ( Piny::Repo->all_repos( ) ) { + print $repo->name . "\n"; +}; diff --git a/pinyadmin/bin/newrepo b/pinyadmin/bin/newrepo new file mode 100755 index 0000000..025e0cf --- /dev/null +++ b/pinyadmin/bin/newrepo @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/bin/sudo /usr/sbin/newrepo "$@" diff --git a/pinyadmin/bin/newuser b/pinyadmin/bin/newuser new file mode 100755 index 0000000..1f73ed6 --- /dev/null +++ b/pinyadmin/bin/newuser @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/bin/sudo /usr/sbin/newuser diff --git a/pinyadmin/bin/pinyconfig b/pinyadmin/bin/pinyconfig new file mode 100755 index 0000000..4e54f76 --- /dev/null +++ b/pinyadmin/bin/pinyconfig @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/bin/sudo /usr/sbin/pinyconfig "$@" diff --git a/pinyadmin/bin/pinyshell b/pinyadmin/bin/pinyshell new file mode 100755 index 0000000..0db88a8 --- /dev/null +++ b/pinyadmin/bin/pinyshell @@ -0,0 +1,5 @@ +#!/bin/sh +cd /srv/rbin +export PATH=/srv/rbin + +exec /bin/rbash "$@" diff --git a/pinyadmin/bin/readkeys b/pinyadmin/bin/readkeys new file mode 100755 index 0000000..745bd8d --- /dev/null +++ b/pinyadmin/bin/readkeys @@ -0,0 +1,3 @@ +#!/bin/sh + +/bin/cat ~/.ssh/authorized_keys diff --git a/pinyadmin/bin/rmaccess b/pinyadmin/bin/rmaccess new file mode 100755 index 0000000..665052c --- /dev/null +++ b/pinyadmin/bin/rmaccess @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/bin/sudo /usr/sbin/rmaccess "$@" diff --git a/pinyadmin/bin/rmrepo b/pinyadmin/bin/rmrepo new file mode 100755 index 0000000..e0e8085 --- /dev/null +++ b/pinyadmin/bin/rmrepo @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/bin/sudo /usr/sbin/rmrepo "$@" diff --git a/pinyadmin/bin/writekeys b/pinyadmin/bin/writekeys new file mode 100755 index 0000000..61a7760 --- /dev/null +++ b/pinyadmin/bin/writekeys @@ -0,0 +1,5 @@ +#!/bin/sh + +/bin/mkdir -p ~/.ssh +/bin/echo Please input all authorized keys. ctrl-d to finish, ctrl-c to abort. +/usr/bin/sponge ~/.ssh/authorized_keys -- cgit v1.2.3