diff --git a/opencode/compose.yaml b/opencode/compose.yaml index 8543f38..6f83734 100644 --- a/opencode/compose.yaml +++ b/opencode/compose.yaml @@ -9,16 +9,23 @@ services: command: - | ln -sfn /root/workspaces /workspaces + git config --global --add safe.directory '*' git config --global user.name "$$GIT_USER_NAME" git config --global user.email "$$GIT_USER_EMAIL" git config --global init.defaultBranch main git config --global credential.helper store GITEA_HOST=$$(echo "$$GITEA_URL" | sed -E 's|^https?://||; s|/+$$||') GITEA_PROTO=$$(echo "$$GITEA_URL" | grep -oE '^https?') - echo "$${GITEA_PROTO}://oauth2:$${GITEA_TOKEN}@$${GITEA_HOST}" > ~/.git-credentials - chmod 600 ~/.git-credentials + echo "$${GITEA_PROTO}://oauth2:$${GITEA_TOKEN}@$${GITEA_HOST}" > /root/.git-credentials + chmod 600 /root/.git-credentials exec opencode web --port 4096 --hostname 0.0.0.0 environment: + - HOME=/root/workspaces + - XDG_CONFIG_HOME=/root/.config + - XDG_DATA_HOME=/root/.local/share + - XDG_STATE_HOME=/root/.local/state + - XDG_CACHE_HOME=/root/.cache + - GIT_CONFIG_GLOBAL=/root/.gitconfig - OPENCODE_SERVER_PASSWORD=${OPENCODE_PASSWORD:?error_OPENCODE_PASSWORD_is_required} - OPENCODE_SERVER_USERNAME=${OPENCODE_USERNAME:-opencode} - GIT_USER_NAME=${GIT_USER_NAME:-OpenCode Agent}