summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Dockerfile6
-rwxr-xr-xsrc/git-run (renamed from src/run)2
-rwxr-xr-xsrc/init5
-rw-r--r--src/ssh.conf2
-rw-r--r--src/version1
5 files changed, 10 insertions, 6 deletions
diff --git a/Dockerfile b/Dockerfile
index c25e8c0..3b0f377 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -11,9 +11,11 @@ COPY src/sudo-git /etc/sudoers.d/
# copy scrips
COPY src/env /usr/local/bin/
COPY src/init /usr/local/bin/
-COPY src/run /usr/local/bin/
+COPY src/git-run /usr/local/bin/
RUN chmod 755 /usr/local/bin/env
RUN chmod 755 /usr/local/bin/init
-RUN chmod 755 /usr/local/bin/run
+RUN chmod 755 /usr/local/bin/git-run
+
+COPY src/version /usr/local/bin/
ENTRYPOINT ["/usr/local/bin/init"]
diff --git a/src/run b/src/git-run
index 51d912c..68d4989 100755
--- a/src/run
+++ b/src/git-run
@@ -38,7 +38,7 @@ begin
end
# info logging
- echo "$(date -Is): ALLOW user=$currentUser ip=$SSH_CONNECTION argv=$argv"
+ echo "$(date -Is): ALLOW ok user=$currentUser ip=$SSH_CONNECTION argv=$argv"
end &>>$_LOG
# execute parsed git command
diff --git a/src/init b/src/init
index 394335a..3686332 100755
--- a/src/init
+++ b/src/init
@@ -2,6 +2,7 @@
# load environment
source (dirname (status --current-filename))/env
+set VERSION (cat (dirname (status --current-filename))/version)
#
#
@@ -34,7 +35,7 @@ function createUser
# add user to sudo group
addgroup "$user" $_GIT_SUDO_GROUP
# unlock account to allow ssh logins
- passwd -u "$user"
+ passwd -u "$user" &>/dev/null
mkdir "$HOME/.ssh"
echo "$key" > "$HOME/.ssh/authorized_keys"
chown -R $user "$HOME"
@@ -124,7 +125,7 @@ function showBanner
|___/
'
echo
- echo Copyright Matthias Jaros 2025
+ echo Version $VERSION Copyright Matthias Jaros 2025
echo
end
diff --git a/src/ssh.conf b/src/ssh.conf
index 0de789c..407285d 100644
--- a/src/ssh.conf
+++ b/src/ssh.conf
@@ -18,7 +18,7 @@ SyslogFacility AUTH
LogLevel INFO
# Force run script that checks for permissions and runs sudo
-ForceCommand /usr/local/bin/run "$SSH_ORIGINAL_COMMAND"
+ForceCommand /usr/local/bin/git-run "$SSH_ORIGINAL_COMMAND"
# git user has access to EVERYTHING. no login should be possible
DenyUsers git
diff --git a/src/version b/src/version
new file mode 100644
index 0000000..9f8e9b6
--- /dev/null
+++ b/src/version
@@ -0,0 +1 @@
+1.0 \ No newline at end of file