>>109711379
it worked :) that opencode nigger doesn't support socks5 so it used my host network without telling me leading to a "you run out of usage" bullshit banner. routing through another container worked. here is a slop script (this assumes you already have a proxy running)
#!/usr/bin/env bash
set -euo pipefail
# Configuration
IMAGE="ghcr.io/anomalyco/opencode"
GOST_IMAGE="gogost/gost:latest"
PROXY="socks5://192.168.1.10:1080"
WORKSPACE="${1:-$(pwd)}"
NETWORK="opencode-proxy-net"
GOST_NAME="opencode-gost"
GOST_PORT=8080
# Make sure the workspace exists
if [[ ! -d "$WORKSPACE" ]]; then
echo "Error: workspace does not exist: $WORKSPACE"
exit 1
fi
WORKSPACE="$(cd "$WORKSPACE" && pwd)"
# Cleanup on exit
cleanup() {
podman rm -f "$GOST_NAME" 2>/dev/null || true
podman network rm "$NETWORK" 2>/dev/null || true
}
trap cleanup EXIT
# Create network
podman network create "$NETWORK" 2>/dev/null || true
# Start gost: HTTP proxy forwards via SOCKS5
podman run -d --name "$GOST_NAME" \
--network "$NETWORK" \
--network-alias gost \
"$GOST_IMAGE" \
-L="http://:$GOST_PORT" \
-F="$PROXY"
echo "Starting OpenCode..."
echo "Workspace: $WORKSPACE"
echo "Proxy: $PROXY (via gost HTTP on port $GOST_PORT)"
exec podman run --rm -it \
--network "$NETWORK" \
-v "$WORKSPACE:/workspace" \
-w /workspace \
-e HTTP_PROXY="http://gost:$GOST_PORT" \
-e HTTPS_PROXY="http://gost:$GOST_PORT" \
-e NO_PROXY="localhost,127.0.0.1" \
"$IMAGE"