release-verify: simplify SSH tunnel setup, remove gost config
ci-deploy / build-deploy-test (push) Successful in 1m14s
ci-deploy / build-deploy-test (push) Successful in 1m14s
This commit is contained in:
@@ -1,54 +0,0 @@
|
|||||||
services:
|
|
||||||
- name: http-8888
|
|
||||||
addr: "0.0.0.0:8888"
|
|
||||||
handler: { type: http, chain: chain-smart }
|
|
||||||
listener: { type: tcp }
|
|
||||||
|
|
||||||
- name: socks-1081
|
|
||||||
addr: "127.0.0.1:1081"
|
|
||||||
handler: { type: socks5, chain: chain-smart }
|
|
||||||
listener: { type: tcp }
|
|
||||||
|
|
||||||
chains:
|
|
||||||
- name: chain-smart
|
|
||||||
hops:
|
|
||||||
- name: tim-via-webzavod
|
|
||||||
addr: 127.0.0.1:1180
|
|
||||||
connector: { type: socks5 }
|
|
||||||
dialer: { type: tcp }
|
|
||||||
bypass: tim-whitelist
|
|
||||||
|
|
||||||
- name: default-socks
|
|
||||||
addr: 127.0.0.1:1080
|
|
||||||
connector: { type: socks5 }
|
|
||||||
dialer: { type: tcp }
|
|
||||||
bypass: tim-blacklist
|
|
||||||
|
|
||||||
bypasses:
|
|
||||||
- name: tim-whitelist
|
|
||||||
whitelist: true
|
|
||||||
matchers:
|
|
||||||
- ".webzavod.ru"
|
|
||||||
- ".devwebzavod.ru"
|
|
||||||
- ".aeroflot.ru"
|
|
||||||
- "webzavod.ru"
|
|
||||||
- "devwebzavod.ru"
|
|
||||||
- "aeroflot.ru"
|
|
||||||
- "46.235.186.67"
|
|
||||||
- "195.209.66.54"
|
|
||||||
- "195.209.82.146"
|
|
||||||
- "46.235.189.158"
|
|
||||||
|
|
||||||
- name: tim-blacklist
|
|
||||||
whitelist: false
|
|
||||||
matchers:
|
|
||||||
- ".webzavod.ru"
|
|
||||||
- ".devwebzavod.ru"
|
|
||||||
- ".aeroflot.ru"
|
|
||||||
- "webzavod.ru"
|
|
||||||
- "devwebzavod.ru"
|
|
||||||
- "aeroflot.ru"
|
|
||||||
- "46.235.186.67"
|
|
||||||
- "195.209.66.54"
|
|
||||||
- "195.209.82.146"
|
|
||||||
- "46.235.189.158"
|
|
||||||
@@ -32,54 +32,35 @@ jobs:
|
|||||||
# `Could not resolve host`.
|
# `Could not resolve host`.
|
||||||
run: echo "46.235.186.67 flights-ui.devwebzavod.ru" | sudo tee -a /etc/hosts
|
run: echo "46.235.186.67 flights-ui.devwebzavod.ru" | sudo tee -a /etc/hosts
|
||||||
|
|
||||||
- name: Set up gost proxy with TIM VPN routing
|
- name: Set up SSH tunnel to TIM VPN
|
||||||
# The customer URL (flights-ui.devwebzavod.ru) is only accessible
|
# The customer URL (flights-ui.devwebzavod.ru) is only accessible
|
||||||
# through the TIM VPN tunnel via webzavod (Ubuntu jump host).
|
# through the TIM VPN tunnel via webzavod (Ubuntu jump host).
|
||||||
# Set up gost with conditional routing: TIM domains → SSH SOCKS to webzavod.
|
# Use SSH dynamic port forwarding (-D) to create a SOCKS proxy.
|
||||||
env:
|
env:
|
||||||
SSH_PRIVATE_KEY: ${{ secrets.WEBZAVOD_SSH_KEY }}
|
SSH_PRIVATE_KEY: ${{ secrets.WEBZAVOD_SSH_KEY }}
|
||||||
run: |
|
run: |
|
||||||
# Install gost if not present
|
|
||||||
if ! command -v gost &> /dev/null; then
|
|
||||||
echo "Installing gost..."
|
|
||||||
curl -fsSL https://github.com/ginuerzh/gost/releases/download/v2.12.0/gost_2.12.0_linux_amd64.tar.gz | tar -xz -C /tmp
|
|
||||||
sudo mv /tmp/gost /usr/local/bin/
|
|
||||||
sudo chmod +x /usr/local/bin/gost
|
|
||||||
fi
|
|
||||||
echo "gost version: $(gost -V)"
|
|
||||||
|
|
||||||
# Set up SSH SOCKS tunnel to webzavod (TIM jump host)
|
# Set up SSH SOCKS tunnel to webzavod (TIM jump host)
|
||||||
# Use the SSH private key from secrets
|
|
||||||
echo "$SSH_PRIVATE_KEY" | base64 -d > /tmp/webzavod_key
|
echo "$SSH_PRIVATE_KEY" | base64 -d > /tmp/webzavod_key
|
||||||
chmod 600 /tmp/webzavod_key
|
chmod 600 /tmp/webzavod_key
|
||||||
ssh -Nf -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
|
ssh -Nf -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
|
||||||
|
-D 127.0.0.1:1080 \
|
||||||
-i /tmp/webzavod_key \
|
-i /tmp/webzavod_key \
|
||||||
-D 127.0.0.1:1180 gnezim@192.168.88.58
|
gnezim@192.168.88.58
|
||||||
echo "SSH SOCKS tunnel established on port 1180"
|
echo "SSH SOCKS tunnel established on port 1080"
|
||||||
|
|
||||||
# Copy gost config from repo
|
# Wait for SSH tunnel to be ready
|
||||||
cp .gitea/workflows/gost.yaml /tmp/gost.yaml
|
|
||||||
echo "gost config copied to /tmp/gost.yaml"
|
|
||||||
|
|
||||||
# Start gost with the config
|
|
||||||
gost -C /tmp/gost.yaml -L :8888 &
|
|
||||||
GOST_PID=$!
|
|
||||||
echo "gost started with PID $GOST_PID"
|
|
||||||
|
|
||||||
# Wait for gost to be ready
|
|
||||||
for i in {1..30}; do
|
for i in {1..30}; do
|
||||||
if curl -s -x http://127.0.0.1:8888 http://127.0.0.1:8888 > /dev/null 2>&1; then
|
if curl -s -x socks5h://127.0.0.1:1080 http://127.0.0.1:1080 > /dev/null 2>&1; then
|
||||||
echo "gost is ready"
|
echo "SSH tunnel is ready"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
|
|
||||||
# Export proxy environment variables
|
# Export proxy environment variables for curl
|
||||||
echo "HTTP_PROXY=http://127.0.0.1:8888" >> $GITHUB_ENV
|
echo "ALL_PROXY=socks5h://127.0.0.1:1080" >> $GITHUB_ENV
|
||||||
echo "ALL_PROXY=socks5h://127.0.0.1:1081" >> $GITHUB_ENV
|
|
||||||
echo "API_BASE_URL=https://flights.test.aeroflot.ru/api" >> $GITHUB_ENV
|
echo "API_BASE_URL=https://flights.test.aeroflot.ru/api" >> $GITHUB_ENV
|
||||||
echo "Exported HTTP_PROXY, ALL_PROXY, and API_BASE_URL"
|
echo "Exported ALL_PROXY and API_BASE_URL"
|
||||||
|
|
||||||
- name: Wait for customer URL
|
- name: Wait for customer URL
|
||||||
id: wait_customer
|
id: wait_customer
|
||||||
|
|||||||
Reference in New Issue
Block a user