summaryrefslogtreecommitdiffstats
path: root/container/entrypoint.sh
diff options
context:
space:
mode:
Diffstat (limited to 'container/entrypoint.sh')
-rwxr-xr-xcontainer/entrypoint.sh19
1 files changed, 9 insertions, 10 deletions
diff --git a/container/entrypoint.sh b/container/entrypoint.sh
index e82ae4f..df33b47 100755
--- a/container/entrypoint.sh
+++ b/container/entrypoint.sh
@@ -16,9 +16,9 @@ need_secret() { # <name> [mode] [owner-group]
chmod "$mode" "$SECRETS_DIR/$name"
}
-# Copy the secrets to /run and fix their modes. Mounted secrets arrive with
-# whatever mode the volume plugin chose, and sshd refuses keys that are too
-# loose while lighttpd must be able to read htpasswd as the git user.
+# Mounted secrets arrive with whatever mode the volume plugin chose. sshd refuses
+# keys that are too loose; lighttpd must read htpasswd as the git user.
+
mkdir -p "$SECRETS_DIR"
need_secret authorized_keys 0640 git
need_secret htpasswd 0640 git
@@ -28,15 +28,14 @@ need_secret ssh_host_rsa_key
need_secret ssh_host_rsa_key.pub 0644
chmod 0755 /run/git-host "$SECRETS_DIR"
-# One hook for every repository. This is the single most important line in the
-# container: without it a repository carries no policy and pushes go unchecked.
-# The policy file itself stays wherever it is mounted; it is never copied, so a
-# ConfigMap update takes effect on the next push with no restart.
+# The single most important line in the container: without it a repository carries
+# no policy and pushes go unchecked. The policy is never copied, so a ConfigMap
+# update takes effect on the next push.
+
git config --file /etc/gitconfig core.hooksPath "${GIT_HOST_HOOK_DIR:-/usr/local/share/git-host/hooks}"
-# Fail rather than serve a host that cannot enforce anything. A policy that
-# does not parse is only a warning inside validate: reads keep working and
-# pushes are denied, which is the correct direction for a mistake to fall in.
+# Do not serve a host that cannot enforce anything.
+
git-authz validate
/usr/sbin/sshd -D -e -f /etc/ssh/sshd_config &