aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitch Riedstra <mitch@riedstra.us>2020-09-14 20:07:18 -0400
committerMitch Riedstra <mitch@riedstra.us>2020-09-14 20:07:18 -0400
commitc0f5842a74acd5d88a04e3b1d37b368025895444 (patch)
treec1e1ceee35088802b6df6146ca5bb2fcb729b201
parent7c380585fd57d0dce35113075933199312b7c4ed (diff)
downloadalpine-cgit-c0f5842a74acd5d88a04e3b1d37b368025895444.tar.gz
alpine-cgit-c0f5842a74acd5d88a04e3b1d37b368025895444.tar.xz
Adjust permissions on each run. Also alter list command to pick up on all repos
-rwxr-xr-xentrypoint.sh10
-rwxr-xr-xhome/list.sh3
2 files changed, 4 insertions, 9 deletions
diff --git a/entrypoint.sh b/entrypoint.sh
index 1072ba6..16ec682 100755
--- a/entrypoint.sh
+++ b/entrypoint.sh
@@ -22,6 +22,7 @@ NGINX_WORKER_CONNECTIONS="${NGINX_WORKER_CONNECTIONS:-1024}"
printf "\033[0m"
+# This is only run once in the container's lifetime unless /setup is removed
setup() {
if [ -e /setup ] ; then return ; fi
if [ "$(find /var/git -type f | wc -l)" -eq 0 ] ; then
@@ -30,10 +31,7 @@ fi
addgroup -g "${CGIT_GID}" git
adduser -h /var/git --gecos "$FULL_NAME" -D -s "${CGIT_SHELL}" -u "${CGIT_UID}" -G git git
-
-chown -R git:git /var/git
passwd -u git
-
addgroup nginx git
if [ -n "$AUTHORIZED_KEYS" ] ; then
@@ -44,9 +42,6 @@ fi
touch /setup
}
-# exec runsvdir /var/service
-# /var/service/nginx/run &
-
run_nginx() {
cat > /etc/nginx/nginx.conf <<NGINX
worker_processes $NGINX_WORKER_PROCESSES;
@@ -128,7 +123,6 @@ umask 007
su git -c "fcgiwrap -f -c$CGIT_THREADS -s \"unix:$socket\" &"
}
-
run_sshd() {
if [ -d "$SSH_HOST_KEY_DIR" ] ; then
cp -v "$SSH_HOST_KEY_DIR"/* /etc/ssh/ || echo ""
@@ -163,8 +157,8 @@ while true ; do
done
}
-
setup
+chown -R git:git /var/git
run_nginx
run_cgit
run_sshd
diff --git a/home/list.sh b/home/list.sh
index c1cba62..b3b8bd9 100755
--- a/home/list.sh
+++ b/home/list.sh
@@ -1,9 +1,10 @@
#!/bin/sh
#shellcheck disable=SC2038
-find . -type d -name branches \
+find . -type f -name HEAD \
| xargs -n1 dirname \
| while read -r repo ; do
if ! [ "$(basename "$repo")" = ".git" ] ; then
echo "$repo";
fi
done
+