feat: IPv6 outbound rotation via curl --interface

- Add IPv6SourcePool for round-robin IP rotation
- fetchViaCurl: Bun.spawn + curl -6 --interface for source binding
- Auto-fallback to regular fetch when IPv6 connection fails
- Response decompression via --compressed flag
- Docker + GHCR build/deploy workflows
- 8 routable IPv6 addresses on VPS
This commit is contained in:
MythEclipse
2026-06-19 19:07:46 +07:00
parent cb6191902e
commit 17338a7dca
13 changed files with 673 additions and 47 deletions
+57
View File
@@ -0,0 +1,57 @@
name: Build and Push to GHCR
on:
push:
branches: [master]
paths:
- 'src/**'
- 'Dockerfile'
- 'package.json'
- 'bun.lock*'
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest
type=sha,prefix=
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Trigger deployment
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.DEPLOY_TOKEN }}
event-type: deploy
client-payload: '{"image_tag": "${{ github.sha }}"}'
+47 -14
View File
@@ -1,21 +1,54 @@
name: Deploy
name: Deploy to VPS
on:
push:
branches: [master]
repository_dispatch:
types: [deploy]
workflow_dispatch:
env:
VPS_HOST: 45.127.35.244
VPS_USER: root
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- name: Setup SSH
uses: webfactory/ssh-agent@v0.9.0
with:
bun-version: latest
- run: bun install
- run: bun run build
- run: bun test
ssh-private-key: ${{ secrets.VPS_SSH_KEY }}
- name: Deploy to Cloudflare Workers
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
- name: Add VPS to known_hosts
run: |
mkdir -p ~/.ssh
ssh-keyscan -H ${{ env.VPS_HOST }} >> ~/.ssh/known_hosts
- name: Pull and restart container
run: |
ssh ${{ env.VPS_USER }}@${{ env.VPS_HOST }} << 'EOF'
set -e
echo "=== Logging in to GHCR ==="
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
echo "=== Pulling latest image ==="
docker pull ghcr.io/${{ github.repository }}:latest
echo "=== Stopping old container ==="
cd /opt/edge-proxy
docker compose down || true
echo "=== Starting new container ==="
docker compose up -d
echo "=== Waiting for health check ==="
sleep 5
curl -sf http://localhost:3000/health || echo "Health check failed"
echo "=== Deployment complete ==="
EOF
- name: Verify deployment
run: |
sleep 10
curl -sf https://proxy.asepharyana.my.id/health || echo "External health check failed"