25 lines
767 B
Bash
25 lines
767 B
Bash
#!/bin/bash
|
|
|
|
# Fix SSH directory permissions
|
|
chmod 700 /root/.ssh
|
|
chmod 600 /root/.ssh/id_ed25519
|
|
|
|
# Copy known_hosts to tmp if it's read-only (from host mount)
|
|
cp /root/.ssh/known_hosts /tmp/known_hosts 2>/dev/null || touch /tmp/known_hosts
|
|
chmod 600 /tmp/known_hosts
|
|
|
|
# Add Gitea to known_hosts
|
|
ssh-keyscan -H git.processhub.work >> /tmp/known_hosts 2>/dev/null || true
|
|
|
|
# Configure SSH
|
|
export GIT_SSH_COMMAND="ssh -i /root/.ssh/id_ed25519 -o UserKnownHostsFile=/tmp/known_hosts -o StrictHostKeyChecking=accept-new"
|
|
|
|
# Git config
|
|
git config --global user.email "gabriel.pereira@protonmail.com"
|
|
git config --global user.name "gabspereira"
|
|
git config --system --add safe.directory '*'
|
|
git config --global --add safe.directory /workspace
|
|
|
|
# Run opencode
|
|
exec opencode
|