From e6fd29bfe889be243609235e42fcfb9660b91488 Mon Sep 17 00:00:00 2001 From: Matthias Lucas Jaros Date: Mon, 27 Oct 2025 17:41:35 +0100 Subject: Updated VERSION handling and added LICENSE file to docker image --- src/env | 1 + src/init | 14 ++++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/env b/src/env index 4d86362..6844369 100644 --- a/src/env +++ b/src/env @@ -6,3 +6,4 @@ set _GIT_VALIDATION_REGEX "^(git-(?:upload-pack|receive-pack|upload-archive)) '$ set _GIT_SUDO_GROUP gitsudo set _LOG /var/log/git-run set _PERMISSIONS r w +set _VERSION (cat (dirname (status --current-filename))/version) diff --git a/src/init b/src/init index b29bfee..85523d9 100755 --- a/src/init +++ b/src/init @@ -2,7 +2,6 @@ # load environment source (dirname (status --current-filename))/env -set VERSION (cat (dirname (status --current-filename))/version) # # @@ -108,7 +107,7 @@ end # # -argparse 'g/git-uid=?' 'u/user=+' 'r/repo=+' 'h/help' -- $argv +argparse 'g/git-uid=?' 'u/user=+' 'r/repo=+' 'h/help' 'v/version' -- $argv or exit 1; if set -q _flag_h @@ -118,11 +117,17 @@ if set -q _flag_h echo -e "\t -h, --help \t\t Display this page" echo -e "\t -g, --git-uid \t\t UID of the git user that is used also as ownership for all repos" echo -e "\t -u, --user \t\t User setting in form of :" - echo -e "\t -r, --repo \t\t Repo setting in form of :. You can add as many users as you want. Currently if a user is allowed he has all permissions read/write" + echo -e "\t -r, --repo \t\t Repo setting in form of ;:[;:;...]. You can add as many users as you want. If you do not specify a user for a repo, that user does not have access to it. If you specify a user without permission, the default fallback is read only." + echo -e "\t -v, --version \t\t Version" echo -e "" return end +if set -q _flag_v + echo -e "$_VERSION" + return +end + function showBanner echo echo ' @@ -134,7 +139,8 @@ function showBanner |___/ ' echo - echo Version $VERSION Copyright Matthias Jaros 2025 + echo Copyright Matthias Jaros 2025 + echo This software is licensed under GPLv3. See /usr/share/doc/git-server/LICENSE echo end -- cgit v1.3.1