From ed62c4ccf06c2c85d871a6334e3e0d82c6e4257a Mon Sep 17 00:00:00 2001 From: delusionalai Date: Sun, 15 Nov 2026 13:54:36 +0000 Subject: The host, built around the access control executable git-host is now the single home of the git repo configuration. The Dockerfile grew a build stage that installs git-authz from its own repository (the access-control / git-host-c project) via `make install`, so the image carries the executable, its example policy and the pre-receive hook symlink, all placed by the program's own installer rather than copied by hand. The server configuration is the git-authz-aware set that used to live beside the program: the entrypoint sets core.hooksPath and refuses to serve on a policy the hook cannot use, sshd carries PermitUserEnvironment and ForceCommand so a key's identity survives to the hook, create-repo prints the policy line to add, and git-host-key manages keys that name their user. cgitrc keeps the corrected ordering (repo-scoped settings above scan-path). --- git-http-backend.cgi | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'git-http-backend.cgi') diff --git a/git-http-backend.cgi b/git-http-backend.cgi index 960ebc0..c69758b 100644 --- a/git-http-backend.cgi +++ b/git-http-backend.cgi @@ -1,8 +1,12 @@ #!/bin/sh +# A .cgi-named door onto the stock backend, because mod_cgi dispatches by +# extension. No policy in here: writes are decided by the pre-receive hook. +# +# It must stay a plain exec. REMOTE_USER is the identity the hooks authorise +# from, and rewriting the environment here denies every push. set -eu -export GIT_PROJECT_ROOT="${GIT_PROJECT_ROOT:-/var/lib/git}" -export GIT_HTTP_EXPORT_ALL="${GIT_HTTP_EXPORT_ALL:-1}" -export HOME="${HOME:-/home/git}" +BACKEND="${GIT_HOST_HTTP_BACKEND:-/usr/libexec/git-core/git-http-backend}" +[ -x "$BACKEND" ] || { printf 'Status: 500 Internal Server Error\r\n\r\n' >&2; exit 1; } -exec /usr/libexec/git-core/git-http-backend +exec "$BACKEND" -- cgit v1.2.3