29 lines
939 B
Bash
29 lines
939 B
Bash
#!/bin/bash
|
|
|
|
# Fix SSH directory and key permissions
|
|
chmod 700 /root/.ssh
|
|
chmod 600 /root/.ssh/id_ed25519
|
|
|
|
# Add Gitea server to known_hosts (suppress errors if network unavailable)
|
|
ssh-keyscan -H git.processhub.work >> /root/.ssh/known_hosts 2>/dev/null || true
|
|
|
|
# Allow outbound SSH to Gitea
|
|
GITEA_IP=$(getent hosts git.processhub.work | awk '{print $1}' | head -1)
|
|
if [ -n "$GITEA_IP" ]; then
|
|
iptables -A OUTPUT -p tcp --dport 22 -d "$GITEA_IP" -j ACCEPT 2>/dev/null || true
|
|
fi
|
|
|
|
# Configure SSH to use the correct key
|
|
export GIT_SSH_COMMAND="ssh -i /root/.ssh/id_ed25519 -o StrictHostKeyChecking=accept-new"
|
|
|
|
# Configure git user
|
|
git config --global user.email "gabriel.pereira@protonmail.com"
|
|
git config --global user.name "gabspereira"
|
|
|
|
# Configure git safe directory (system-wide + workspace specific)
|
|
git config --system --add safe.directory '*'
|
|
git config --global --add safe.directory /workspace
|
|
|
|
# Run opencode
|
|
exec opencode
|