Compare commits
9 Commits
9a56dc778e
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 0ae7b13407 | |||
| a1996b1c9e | |||
| 051c0ac719 | |||
| b4cf4fc8ae | |||
| 251d99795b | |||
| cca76d4974 | |||
| a64b09de8e | |||
| de5f586bc7 | |||
| 3e2c431f49 |
+25
-20
@@ -6,38 +6,43 @@ on:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: linux
|
||||
container: python:3.13-alpine
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.13'
|
||||
- run: pip install pyyaml ruff pytest
|
||||
- run: apk add --no-cache git
|
||||
- run: |
|
||||
git clone --depth 1 \
|
||||
-c "http.extraHeader=Authorization: token ${{ github.token }}" \
|
||||
"${{ github.server_url }}/${{ github.repository }}.git" .
|
||||
- run: pip install --no-cache-dir -r requirements.txt ruff pytest
|
||||
- run: ruff check src/ tests/
|
||||
- run: PYTHONPATH=src pytest tests/ -v
|
||||
|
||||
secrets:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: linux
|
||||
container: ghcr.io/gitleaks/gitleaks:latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- run: |
|
||||
docker run --rm \
|
||||
-v "$PWD:/scan:ro" \
|
||||
ghcr.io/gitleaks/gitleaks:latest \
|
||||
detect --source /scan -v
|
||||
git clone \
|
||||
-c "http.extraHeader=Authorization: token ${{ github.token }}" \
|
||||
"${{ github.server_url }}/${{ github.repository }}.git" .
|
||||
- run: gitleaks detect --source . -v
|
||||
|
||||
build:
|
||||
needs: [test, secrets]
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: linux
|
||||
container: quay.io/podman/stable
|
||||
env:
|
||||
CONTAINER_HOST: unix:///var/run/docker.sock
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- run: dnf install -y git
|
||||
- run: |
|
||||
mkdir -p ~/.docker
|
||||
AUTH=$(printf '%s:%s' "$HARBOR_USER" "$HARBOR_PASS" | base64 -w0)
|
||||
printf '{"auths":{"harbor.mymx.me":{"auth":"%s"}}}\n' "$AUTH" > ~/.docker/config.json
|
||||
git clone --depth 1 \
|
||||
-c "http.extraHeader=Authorization: token ${{ github.token }}" \
|
||||
"${{ github.server_url }}/${{ github.repository }}.git" .
|
||||
- run: echo "$HARBOR_PASS" | podman --remote login -u "$HARBOR_USER" --password-stdin harbor.mymx.me
|
||||
env:
|
||||
HARBOR_USER: ${{ secrets.HARBOR_USER }}
|
||||
HARBOR_PASS: ${{ secrets.HARBOR_PASS }}
|
||||
- run: docker build --push -t harbor.mymx.me/s5p/s5p:latest -f Containerfile .
|
||||
- run: podman --remote build -t harbor.mymx.me/s5p/s5p:latest -f Containerfile .
|
||||
- run: podman --remote push harbor.mymx.me/s5p/s5p:latest
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
[allowlist]
|
||||
paths = [
|
||||
'''tests/''',
|
||||
'''docs/''',
|
||||
]
|
||||
+4
-3
@@ -1,10 +1,11 @@
|
||||
FROM python:3.13-alpine
|
||||
|
||||
RUN pip install --no-cache-dir --upgrade pip && \
|
||||
pip install --no-cache-dir pyyaml>=6.0
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir --upgrade pip && \
|
||||
pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
ENV PYTHONUNBUFFERED=1 \
|
||||
PYTHONDONTWRITEBYTECODE=1 \
|
||||
PYTHONPATH=/app/src
|
||||
|
||||
+10
-7
@@ -32,8 +32,8 @@ chain:
|
||||
# state_file: /data/pool-clean.json
|
||||
# refresh: 300
|
||||
# test_interval: 120
|
||||
# test_timeout: 8
|
||||
# max_fails: 3
|
||||
# test_timeout: 12
|
||||
# max_fails: 5
|
||||
# mitm: # MITM-capable proxies
|
||||
# sources:
|
||||
# - url: http://10.200.1.250:8081/proxies/all
|
||||
@@ -41,8 +41,8 @@ chain:
|
||||
# state_file: /data/pool-mitm.json
|
||||
# refresh: 300
|
||||
# test_interval: 120
|
||||
# test_timeout: 8
|
||||
# max_fails: 3
|
||||
# test_timeout: 12
|
||||
# max_fails: 5
|
||||
|
||||
# Single proxy pool (legacy, still supported -- becomes pool "default"):
|
||||
# proxy_pool:
|
||||
@@ -75,8 +75,11 @@ chain:
|
||||
# newnym_interval: 0 # periodic NEWNYM (seconds, 0 = manual only)
|
||||
|
||||
# Multi-Tor round-robin -- distribute traffic across multiple Tor nodes.
|
||||
# When present, the first hop in each listener's chain is replaced at
|
||||
# connection time by round-robin selection from this list.
|
||||
# When present, the first hop in each listener's chain is REPLACED at
|
||||
# connection time by round-robin selection from this list. The first hop
|
||||
# specified in each listener's chain acts as a fallback only; tor_nodes
|
||||
# takes precedence for both client traffic and pool health tests.
|
||||
# Connection pools are pre-warmed for every node listed here.
|
||||
# tor_nodes:
|
||||
# - socks5://10.200.1.1:9050
|
||||
# - socks5://10.200.1.254:9050
|
||||
@@ -110,7 +113,7 @@ chain:
|
||||
# - localhost # exact hostname
|
||||
# - .local # domain suffix
|
||||
# chain:
|
||||
# - socks5://127.0.0.1:9050
|
||||
# - socks5://127.0.0.1:9050 # first hop (overridden by tor_nodes)
|
||||
# - [pool:clean, pool:mitm] # random choice per connection
|
||||
# - [pool:clean, pool:mitm] # independent random choice
|
||||
#
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
pyyaml>=6.0
|
||||
@@ -208,6 +208,7 @@ async def _handle_client(
|
||||
else:
|
||||
effective_chain = list(listener.chain)
|
||||
fhp = first_hop_pool
|
||||
# tor_nodes round-robin overrides the listener's first hop
|
||||
if tor_rr and effective_chain:
|
||||
node = tor_rr.next()
|
||||
effective_chain[0] = node
|
||||
|
||||
Reference in New Issue
Block a user