chore(opencode-sandbox): add SSH config, git safe directory, and test setup
This commit is contained in:
@@ -1,6 +1,28 @@
|
||||
#!/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
|
||||
|
||||
Reference in New Issue
Block a user