feat(ger-nod-02,remnawave): move ger-nod-02 SelfSteal & Xray strictly to IPv6 (AAAA)
ansible-deploy / plan (push) Successful in 2s
ansible-lint / lint (push) Successful in 3s
ansible-deploy / deploy (core-net, ) (push) Successful in 18s
ansible-deploy / deploy (ger-nod-02, ) (push) Successful in 1m19s
ansible-deploy / deploy (rus-central, ) (push) Successful in 40s
ansible-deploy / plan (push) Successful in 2s
ansible-lint / lint (push) Successful in 3s
ansible-deploy / deploy (core-net, ) (push) Successful in 18s
ansible-deploy / deploy (ger-nod-02, ) (push) Successful in 1m19s
ansible-deploy / deploy (rus-central, ) (push) Successful in 40s
This commit is contained in:
1 parent
e03bd49077
commit
028deea531
7 files changed
+96
-35
No files matched your search
@@ -15,9 +15,8 @@ nodes:
|
||||
country_code: "DE"
|
||||
profile_name: "DE-Yali"
|
||||
profile_template: "profile-selfsteal-xhttp.json"
|
||||
inbound_tag: "Steal-Yali"
|
||||
extra_inbound_tags:
|
||||
- "Cascade-RU-DE"
|
||||
inbound_tag: "Cascade-RU-DE"
|
||||
create_host: false
|
||||
selfsteal_domain: "yali.gunis.top"
|
||||
xhttp_path: "/xhttp-yali"
|
||||
host_remark: "🇩🇪 ger-nod-02"
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
"network": "tcp",
|
||||
"security": "reality",
|
||||
"realitySettings": {
|
||||
"serverName": "www.cloudflare.com",
|
||||
"serverName": "yali.gunis.top",
|
||||
"fingerprint": "chrome",
|
||||
"publicKey": "__CASCADE_PUBLIC_KEY__",
|
||||
"shortId": "__CASCADE_SHORT_ID__"
|
||||
|
||||
@@ -208,21 +208,25 @@ def ensure_cascade_credentials(
|
||||
de_cfg = de_obj.get("config") or {}
|
||||
inbounds = de_cfg.get("inbounds") or []
|
||||
has_cascade_inb = any(
|
||||
i.get("tag") == "Cascade-RU-DE" and i.get("port") == 443
|
||||
i.get("tag") == "Cascade-RU-DE"
|
||||
and i.get("port") == 443
|
||||
and ((i.get("streamSettings") or {}).get("realitySettings") or {}).get("dest") == "/dev/shm/nginx.sock"
|
||||
for i in inbounds
|
||||
)
|
||||
has_steal_yali = any(i.get("tag") == "Steal-Yali" for i in inbounds)
|
||||
|
||||
ru_has_443 = False
|
||||
ru_ok = False
|
||||
if ru_prof:
|
||||
_, ru_full = api.request("GET", f"/config-profiles/{ru_prof['uuid']}")
|
||||
ru_cfg = (ru_full.get("response") or ru_full).get("config") or {}
|
||||
for ob in ru_cfg.get("outbounds") or []:
|
||||
if ob.get("tag") == "CASCADE-DE":
|
||||
vnext = (ob.get("settings") or {}).get("vnext") or []
|
||||
if vnext and vnext[0].get("port") == 443:
|
||||
ru_has_443 = True
|
||||
rs = (ob.get("streamSettings") or {}).get("realitySettings") or {}
|
||||
if vnext and vnext[0].get("port") == 443 and rs.get("serverName") == "yali.gunis.top":
|
||||
ru_ok = True
|
||||
|
||||
if has_cascade_inb and ru_has_443:
|
||||
if has_cascade_inb and not has_steal_yali and ru_ok:
|
||||
return {}
|
||||
|
||||
_, users_resp = api.request("GET", "/users/")
|
||||
@@ -254,27 +258,25 @@ def ensure_cascade_credentials(
|
||||
"network": "tcp",
|
||||
"security": "reality",
|
||||
"realitySettings": {
|
||||
"dest": "www.cloudflare.com:443",
|
||||
"dest": "/dev/shm/nginx.sock",
|
||||
"show": False,
|
||||
"xver": 1,
|
||||
"spiderX": "",
|
||||
"shortIds": [creds["short_id"]],
|
||||
"privateKey": creds["priv"],
|
||||
"serverNames": ["www.cloudflare.com"],
|
||||
"serverNames": ["yali.gunis.top"],
|
||||
},
|
||||
},
|
||||
}
|
||||
new_inbounds = []
|
||||
for i in inbounds:
|
||||
if i.get("tag") == "Cascade-RU-DE":
|
||||
continue
|
||||
if i.get("tag") == "Steal-Yali":
|
||||
i = dict(i)
|
||||
i["listen"] = "150.241.64.209"
|
||||
new_inbounds.append(i)
|
||||
new_inbounds = [
|
||||
i for i in inbounds
|
||||
if i.get("tag") not in ("Cascade-RU-DE", "Steal-Yali")
|
||||
]
|
||||
new_inbounds.append(cascade_inbound)
|
||||
de_cfg["inbounds"] = new_inbounds
|
||||
api.request("PATCH", "/config-profiles/", {"uuid": de_uuid, "config": de_cfg})
|
||||
changes.append("updated profile DE-Yali with Cascade-RU-DE inbound on :443")
|
||||
if ru_prof and not ru_has_443:
|
||||
changes.append("updated profile DE-Yali to IPv6-only SelfSteal Cascade-RU-DE")
|
||||
if ru_prof:
|
||||
_, ru_full = api.request("GET", f"/config-profiles/{ru_prof['uuid']}")
|
||||
ru_cfg = (ru_full.get("response") or ru_full).get("config") or {}
|
||||
for ob in ru_cfg.get("outbounds") or []:
|
||||
@@ -284,10 +286,11 @@ def ensure_cascade_credentials(
|
||||
vnext[0]["port"] = 443
|
||||
vnext[0]["users"][0]["id"] = creds["uuid"]
|
||||
rs = (ob.get("streamSettings") or {}).get("realitySettings") or {}
|
||||
rs["serverName"] = "yali.gunis.top"
|
||||
rs["publicKey"] = creds["pub"]
|
||||
rs["shortId"] = creds["short_id"]
|
||||
api.request("PATCH", "/config-profiles/", {"uuid": ru_prof["uuid"], "config": ru_cfg})
|
||||
changes.append("updated profile RU-Cascade to port 443")
|
||||
changes.append("updated profile RU-Cascade to SelfSteal yali.gunis.top")
|
||||
return creds
|
||||
|
||||
|
||||
@@ -426,6 +429,9 @@ def sync_node_and_host(
|
||||
api.request("PUT", "/nodes/", payload)
|
||||
changes.append(f"updated node {node_name} ({target_addr})")
|
||||
|
||||
if not node_cfg.get("create_host", True):
|
||||
return
|
||||
|
||||
selfsteal = node_cfg["selfsteal_domain"]
|
||||
_, hosts_resp = api.request("GET", "/hosts/")
|
||||
hosts = _extract_list(hosts_resp)
|
||||
@@ -506,7 +512,7 @@ def cleanup_removed_nodes_and_hosts(
|
||||
desired_nodes: list[dict[str, Any]],
|
||||
changes: list[str],
|
||||
) -> None:
|
||||
desired_domains = {n["selfsteal_domain"] for n in desired_nodes}
|
||||
desired_domains = {n["selfsteal_domain"] for n in desired_nodes if n.get("create_host", True)}
|
||||
desired_node_names = {n["name"] for n in desired_nodes}
|
||||
desired_profile_names = {n["profile_name"] for n in desired_nodes}
|
||||
|
||||
|
||||
Reference in new issue
Block a user