diff options
| author | Elizabeth Hunt <me@liz.coffee> | 2025-12-05 21:43:18 -0800 |
|---|---|---|
| committer | Elizabeth Hunt <me@liz.coffee> | 2025-12-05 22:19:52 -0800 |
| commit | 8667f8615da479a8e9c4e8d5bb5987632d75bfaf (patch) | |
| tree | e3b4bdb4ebe4f0010c90dd43970822bbe8f8d4a6 /entrypoint.sh | |
| parent | 4cde5dedcf35f2d5850ce0479f25d29bac74daf7 (diff) | |
| download | wwwgit-8667f8615da479a8e9c4e8d5bb5987632d75bfaf.tar.gz wwwgit-8667f8615da479a8e9c4e8d5bb5987632d75bfaf.zip | |
Add ssh server
Diffstat (limited to 'entrypoint.sh')
| -rwxr-xr-x | entrypoint.sh | 32 |
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" & |
