Files
workspace/.opencode-sandbox/entrypoint.sh

25 lines
781 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 -p 222 git.processhub.work >> /tmp/known_hosts 2>/dev/null || true
# Configure SSH
export GIT_SSH_COMMAND="ssh -p 222 -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