summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/git-run15
-rwxr-xr-xsrc/init22
2 files changed, 24 insertions, 13 deletions
diff --git a/src/git-run b/src/git-run
index 0366e8f..7d70ef8 100755
--- a/src/git-run
+++ b/src/git-run
@@ -1,13 +1,18 @@
#!/usr/bin/env fish
-# load environment
+# load common environment
source (status dirname)/env
-# global variables
set gitCommand
set repoDir
set currentUser (whoami)
+###
+###
+### functions
+###
+###
+
function log --on-event log
echo "$(date -Is): $argv[1..2] user=$currentUser $argv[3..] ip=$SSH_CONNECTION" >> $_LOG
end
@@ -62,6 +67,12 @@ function verifyPermissions
end
end
+###
+###
+### main
+###
+###
+
# redirect stdout/stderr to file, no information to potential attacker
begin
parseCommand $argv; or exit $status
diff --git a/src/init b/src/init
index bc93c55..836cdb2 100755
--- a/src/init
+++ b/src/init
@@ -1,13 +1,13 @@
#!/usr/bin/env fish
-# load environment
+# load common environment
source (status dirname)/env
-#
-#
-# function definitions
-#
-#
+###
+###
+### functions
+###
+###
function fail
set_color red
@@ -110,11 +110,11 @@ function setupSSH
mkdir -p /var/ssh/etc/ssh/ && ssh-keygen -A -f /var/ssh
end
-#
-#
-# main
-#
-#
+###
+###
+### main
+###
+###
argparse 'g/git-uid=?' 'u/user=+' 'r/repo=+' 'h/help' 'v/version' -- $argv
or exit 1;