aboutsummaryrefslogtreecommitdiff
path: root/services/git-add-user
diff options
context:
space:
mode:
Diffstat (limited to 'services/git-add-user')
-rwxr-xr-xservices/git-add-user14
1 files changed, 14 insertions, 0 deletions
diff --git a/services/git-add-user b/services/git-add-user
new file mode 100755
index 0000000..2e500d2
--- /dev/null
+++ b/services/git-add-user
@@ -0,0 +1,14 @@
+#! /usr/bin/bash
+
+set -e
+
+script_dir="$(dirname "$0")"
+. "$script_dir/common.bash"
+
+ps_dir="$CRUPEST_PROJECT_DIR/$CRUPEST_DATA_DIR/git/private"
+ps_file="$ps_dir/user-info"
+echo "Password file at $ps_file"
+[[ -d "$ps_dir" ]] || mkdir -p "$ps_dir"
+[[ -f "$ps_file" ]] || touch "$ps_file"
+
+exec docker run -it --rm -v "$ps_file:/user-info" httpd htpasswd "/user-info" "$1"