diff options
| author | dev <dev@example> | 2026-11-15 13:54:31 +0000 |
|---|---|---|
| committer | dev <dev@example> | 2026-11-15 13:54:31 +0000 |
| commit | da06d4f56afa72ae832238f91358b9aeaeaf0da5 (patch) | |
| tree | 7ead0d915bf4e388dcc55d3b63b4fc0628ef895b /container/create-repo | |
| parent | 85b7fa7f8456c84f65a0d81b760c430098ae7fd8 (diff) | |
| download | access-control-da06d4f56afa72ae832238f91358b9aeaeaf0da5.tar.gz access-control-da06d4f56afa72ae832238f91358b9aeaeaf0da5.zip | |
The container image and all the server configuration (Dockerfile, entrypoint,
cgitrc, sshd, lighttpd, create-repo, git-host-key) move to the git-host project.
This repo is now just the program: cmd/, src/, test/, the Makefile that builds
git-authz and installs it, and the example policy - the same cmd/src/test/obj
layout the reference projects use.
The CI pipeline keeps the compile-and-test gate (strict, test, sanitizer,
install) and drops the container-build job, which belongs to git-host now.
Diffstat (limited to 'container/create-repo')
| -rwxr-xr-x | container/create-repo | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/container/create-repo b/container/create-repo deleted file mode 100755 index 5f80c92..0000000 --- a/container/create-repo +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -# Create a bare repository. Nothing is installed in it: every repository reaches -# the shared hook through core.hooksPath, so one made by hand is enforced the same. -# -# The policy is a read-only mount, so this only prints the line to add. - -set -eu - -GIT_REPO_ROOT="${GIT_REPO_ROOT:-/var/lib/git}" -GIT_USER="${GIT_USER:-git}" -GIT_GROUP="${GIT_GROUP:-git}" -DEFAULT_BRANCH="${GIT_HOST_DEFAULT_BRANCH:-main}" - -usage() { - cat >&2 <<USAGE -usage: create-repo <name> [description] - -Creates $GIT_REPO_ROOT/<name>.git - bare, owned by $GIT_USER, HEAD at -refs/heads/$DEFAULT_BRANCH - and prints the policy line to add. -USAGE - exit 64 -} - -[ "$#" -ge 1 ] || usage - -name="$1" -description="${2:-Unnamed repository}" - -case "${name}" in - */* | .* | *" "* | *".."* ) - printf 'invalid repository name: %s\n' "${name}" >&2 - exit 64 - ;; -esac - -case "${name}" in - *.git) repo_name="${name}" ;; - *) repo_name="${name}.git" ;; -esac - -repo_path="${GIT_REPO_ROOT}/${repo_name}" - -if [ -e "${repo_path}" ]; then - printf 'repository already exists: %s\n' "${repo_path}" >&2 - exit 1 -fi - -install -d -o "${GIT_USER}" -g "${GIT_GROUP}" "${repo_path}" -git init --bare -b "${DEFAULT_BRANCH}" "${repo_path}" >/dev/null -printf '%s\n' "${description}" >"${repo_path}/description" -chown -R "${GIT_USER}:${GIT_GROUP}" "${repo_path}" - -printf 'created %s\n' "${repo_path}" -printf 'policy line to add: <user> %s write refs/heads/*\n' "${name%.git}" -printf ' (edit the policy source and roll the ConfigMap; nothing here writes it)' |
