1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# ==============================================================================
# proxy-pilot Configuration Example
# ==============================================================================
# Copy this file to /etc/proxy-pilot/config.yaml on your server and edit it.
# IMPORTANT: Never commit your real config.yaml (with tokens) to Git!
# ==============================================================================
# ------------------------------------------------------------------------------
# 1. Proxy Core Settings (Xray / future: sing-box)
# ------------------------------------------------------------------------------
core:
kind: "xray" # Proxy core type
binary_path: "/var/lib/proxy-pilot/bin/xray"
config_path: "/usr/local/etc/xray/config.json"
service_name: "xray" # systemd service name
local_proxy: "socks5h://127.0.0.1:10808" # Fixed local proxy used for probes
# ------------------------------------------------------------------------------
# 2. Routing Mode (No TUN - Only Whitelisted Domains Use Proxy)
# ------------------------------------------------------------------------------
routing:
# ONLY matching domains/patterns use the proxy; everything else goes direct.
# Supports Xray prefixes:
# - "domain:example.com" -> matches example.com AND all subdomains (*.example.com)
# - "regexp:..." -> regular expression match
mode: "whitelist"
whitelist_domains:
- "domain:telegram.org"
- "domain:t.me"
- "domain:googleapis.com" # Gemini API
- "domain:youtube.com"
- "domain:docker.io" # All *.docker.io (registry-1, auth, etc.)
- "domain:docker.com" # All *.docker.com
- "domain:ghcr.io"
- "domain:gitlab.com" # GitLab & all *.gitlab.com (registry, etc.)
- "domain:pypi.org" # Python pip / uv
- "domain:pythonhosted.org"
# ------------------------------------------------------------------------------
# 3. Proxy Profiles (Failover Order: lower priority number = tried first)
# ------------------------------------------------------------------------------
profiles:
- name: "germany-1"
outbound_tag: "proxy-de-1"
priority: 1
- name: "finland-2"
outbound_tag: "proxy-fi-2"
priority: 2
# ------------------------------------------------------------------------------
# 3. Health Probe & Anti-Flapping Settings
# ------------------------------------------------------------------------------
probe:
interval_secs: 5 # Check active proxy every 5 seconds
timeout_secs: 4 # Max wait time per target request
failure_threshold: 3 # Consecutive failures before switching profile (~15s)
recovery_threshold: 2 # Consecutive successes before marking recovered
max_latency_ms: 2500 # Switch profile if response is slower than 2500ms
benchmark_interval_secs: 900 # Re-rank all profiles in background every 15m (0 = off)
auto_prune_after_hours: 24 # Remove profiles dead for 24h straight (0 = off)
# Optional direct (no-proxy) URL to verify host internet before auto-pruning
# (e.g. "https://www.aparat.com" on Iran servers, or any local reachable URL)
direct_check_url: "https://www.aparat.com"
targets:
- name: "gemini"
url: "https://generativelanguage.googleapis.com/"
expected_status:
blocked_status:
- name: "youtube"
url: "https://www.youtube.com/generate_204"
expected_status:
blocked_status:
- name: "telegram"
url: "https://api.telegram.org/"
expected_status:
blocked_status:
# ------------------------------------------------------------------------------
# 4. Alerting Channels (VPN-Independent)
# ------------------------------------------------------------------------------
notify:
cooldown_secs: 300 # Wait 5 minutes before repeating a critical alert
empty_profiles_reminder_secs: 300 # Remind every 5 minutes when 0 profiles are configured (0 disables)
bale:
enabled: true
# Tip: In production, set BALE_BOT_TOKEN env var instead of hardcoding here
bot_token: "REPLACE_WITH_BALE_BOT_TOKEN"
chat_id: "REPLACE_WITH_CHAT_ID"