summaryrefslogtreecommitdiff
path: root/entrypoint.sh
diff options
context:
space:
mode:
Diffstat (limited to 'entrypoint.sh')
-rwxr-xr-xentrypoint.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/entrypoint.sh b/entrypoint.sh
index 5bdcede..58aea85 100755
--- a/entrypoint.sh
+++ b/entrypoint.sh
@@ -2,6 +2,38 @@
set -e
+# Set up git-shell-commands in the repositories directory (volume-safe)
+echo "Setting up git-shell-commands..."
+mkdir -p /var/lib/git/repositories/git-shell-commands
+cp -r /usr/local/share/git-shell-commands/* /var/lib/git/repositories/git-shell-commands/
+chmod +x /var/lib/git/repositories/git-shell-commands/*
+chown -R code:code /var/lib/git/repositories
+chmod 755 /var/lib/git/repositories
+
+# Verify setup
+echo "Git-shell commands installed:"
+ls -la /var/lib/git/repositories/git-shell-commands/
+
+# Set up SSH host keys (with volume support)
+echo "Setting up SSH host keys..."
+mkdir -p /etc/ssh/host_keys
+
+# Check if host keys are mounted from a volume, if not generate them
+if [ -f /etc/ssh/host_keys/ssh_host_rsa_key ]; then
+ echo "Using existing host keys from volume..."
+ cp /etc/ssh/host_keys/ssh_host_* /etc/ssh/
+else
+ echo "Generating new SSH host keys..."
+ ssh-keygen -A
+ # Copy generated keys to the persistent location if it's writable
+ if [ -w /etc/ssh/host_keys ]; then
+ cp /etc/ssh/ssh_host_* /etc/ssh/host_keys/ 2>/dev/null || true
+ fi
+fi
+
+echo "Starting SSH daemon..."
+/usr/sbin/sshd
+
echo "Starting fcgiwrap..."
su -l www-data -s /bin/bash -c "/usr/sbin/fcgiwrap -s unix:/run/sock/fcgiwrap.socket" &