Net core: add single vless:// keys from BroV
- add_key accepts a vless:// link (uuid, host, port, Reality pbk checked; duplicates refused; the name from #fragment, made unique). Stored in keys/vless.txt (root, 600), served as the file provider vless-keys, which joins «ai-out» and «Авто» and the hide filter. The first key reloads the core (the provider appears), later ones only reload the provider. state reports vless-keys delays. - BroV: «Добавить подключение» takes vpn:// or vless://. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+13
-3
@@ -6,6 +6,7 @@ keys/*.vpnkey one vpn:// key per Amnezia connection (AmneziaWG 2/3); BroV
|
||||
src/saga.conf WireGuard client config -> only 192.168.8.0/24
|
||||
src/planet9.conf WireGuard client config -> only 192.168.68.0/24
|
||||
src/vless.sub 3x-ui subscription URL (all VLESS nodes)
|
||||
keys/vless.txt single vless:// links added in BroV (one per line, e.g. a client's server)
|
||||
tun.json {"on": bool}: traffic capture as the user left it (survives restarts)
|
||||
hidden.json connections removed in BroV: {"amnezia": [...], "vless": [...]} (proxy
|
||||
names). Hidden ones stay on disk and can be returned from the panel.
|
||||
@@ -195,6 +196,15 @@ def main():
|
||||
if hid["vless"]:
|
||||
# Hidden nodes stay in the subscription, the core just skips them.
|
||||
vless["exclude-filter"] = "^(?:" + "|".join(rx(n) for n in hid["vless"]) + ")$"
|
||||
# Single VLESS links added in BroV: a provider of their own (only when there are any —
|
||||
# mihomo refuses an empty provider file).
|
||||
extra_prov = {}
|
||||
vless_file = os.path.join(KEYS, "vless.txt")
|
||||
if os.path.exists(vless_file) and any(l.strip().startswith("vless://") for l in open(vless_file)):
|
||||
extra_prov["vless-keys"] = {"type": "file", "path": "./keys/vless.txt",
|
||||
"health-check": {"enable": True, "url": TEST_URL, "interval": 300}}
|
||||
if hid["vless"]:
|
||||
extra_prov["vless-keys"]["exclude-filter"] = vless["exclude-filter"]
|
||||
awg_prov = {"type": "file", "path": "./keys/amnezia.yaml",
|
||||
"health-check": {"enable": True, "url": TEST_URL, "interval": 300}}
|
||||
|
||||
@@ -212,7 +222,7 @@ def main():
|
||||
"nameserver": ["https://1.1.1.1/dns-query#exit", "https://8.8.8.8/dns-query#exit"],
|
||||
"direct-nameserver": ["77.88.8.8", "77.88.8.1"]},
|
||||
"proxies": proxies,
|
||||
"proxy-providers": {"amnezia-keys": awg_prov, "vless-cluster": vless},
|
||||
"proxy-providers": {"amnezia-keys": awg_prov, "vless-cluster": vless, **extra_prov},
|
||||
"proxy-groups": [
|
||||
# What traffic actually uses: the exit picked in BroV while it answers, "auto"
|
||||
# when it doesn't (a pinned connection that dies no longer takes the Mac offline).
|
||||
@@ -221,10 +231,10 @@ def main():
|
||||
{"name": "exit", "type": "fallback", "proxies": ["ai-out", "auto"],
|
||||
"url": TEST_URL, "interval": 30, "timeout": 4000, "max-failed-times": 3, "lazy": False},
|
||||
# What BroV's globe panel switches: "auto", the Amnezia group, or one VLESS node.
|
||||
{"name": "ai-out", "type": "select", "proxies": ["auto", "amnezia"], "use": ["vless-cluster"]},
|
||||
{"name": "ai-out", "type": "select", "proxies": ["auto", "amnezia"], "use": ["vless-cluster", *extra_prov]},
|
||||
# Fastest alive exit among every Amnezia connection and every VLESS node;
|
||||
# switches only when another one is 100+ ms faster.
|
||||
{"name": "auto", "type": "url-test", "use": ["amnezia-keys", "vless-cluster"],
|
||||
{"name": "auto", "type": "url-test", "use": ["amnezia-keys", "vless-cluster", *extra_prov],
|
||||
"url": TEST_URL, "interval": 60, "timeout": 4000, "max-failed-times": 3,
|
||||
"tolerance": 100, "lazy": False},
|
||||
# Amnezia: "amnezia-auto" (fastest connection) or one fixed connection.
|
||||
|
||||
Reference in New Issue
Block a user