summaryrefslogtreecommitdiffstats
path: root/gitolite/entrypoint.sh
diff options
context:
space:
mode:
authorMalfurious <m@lfurio.us>2023-09-15 06:02:18 -0400
committerMalfurious <m@lfurio.us>2023-09-15 10:53:24 -0400
commit90858ead45f6702bdde31671246ad9c56fc7803e (patch)
tree4ce1cdbfd64ae494c26ced31a8e6a53bf836c944 /gitolite/entrypoint.sh
parentc3e4b42c98dd433bbc2f90beeae102a4993c17e5 (diff)
downloadsrcnode-90858ead45f6702bdde31671246ad9c56fc7803e.tar.gz
srcnode-90858ead45f6702bdde31671246ad9c56fc7803e.zip
gitolite: Refactor Dockerfile for debian base
Building from debian:latest will make for a smaller image, a faster build, and will make the image more accessible to a wider variety of platforms. The effort started by 19e7dc8932c is expanded upon such that the image cleanly bakes in all static config files into the image - ie. the entire hosting user's home directory, except for the repositories directory. This removal of config management from the gitolite-admin repo is part of the reason why it is being decoupled from this repo. The gitolite image will now never utilize a user pubkey during build. Instead, it can be invoked with an alternative entrypoint to interactively configure a new install. Signed-off-by: Malfurious <m@lfurio.us>
Diffstat (limited to '')
-rwxr-xr-xgitolite/entrypoint.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/gitolite/entrypoint.sh b/gitolite/entrypoint.sh
new file mode 100755
index 0000000..613a968
--- /dev/null
+++ b/gitolite/entrypoint.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# On startup of the gitolite container, force a receive of the gitolite-admin
+# files from the persistent volume, to cause the user's real pubkeys and config
+# files to take effect.
+main() {
+ sleep 5
+ ssh -o StrictHostKeyChecking=accept-new git@localhost info # cache hostkey
+ git clone --bare git@localhost:gitolite-admin.git /tmp/gladmin.git
+ git --git-dir=/tmp/gladmin.git push origin :master # remove rmt master
+ git --git-dir=/tmp/gladmin.git push origin master # replace rmt master
+}
+
+main &
+/usr/sbin/sshd -D