fix(remnawave): move IPv6 cascade link to port 443 (150.241.64.209:443 v4, 2a12:...:443 v6)
This commit is contained in:
1 parent
a772e8d808
commit
58fd864432
2 files changed
+40
-6
No files matched your search
@@ -53,7 +53,7 @@
|
||||
"vnext": [
|
||||
{
|
||||
"address": "2a12:bec4:1bb0:2e80::2",
|
||||
"port": 1443,
|
||||
"port": 443,
|
||||
"users": [
|
||||
{
|
||||
"id": "__CASCADE_UUID__",
|
||||
|
||||
@@ -207,9 +207,22 @@ def ensure_cascade_credentials(
|
||||
de_obj = de_full.get("response") or de_full
|
||||
de_cfg = de_obj.get("config") or {}
|
||||
inbounds = de_cfg.get("inbounds") or []
|
||||
has_cascade_inb = any(i.get("tag") == "Cascade-RU-DE" for i in inbounds)
|
||||
has_cascade_inb = any(
|
||||
i.get("tag") == "Cascade-RU-DE" and i.get("port") == 443
|
||||
for i in inbounds
|
||||
)
|
||||
|
||||
if has_cascade_inb and ru_prof:
|
||||
ru_has_443 = 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
|
||||
|
||||
if has_cascade_inb and ru_has_443:
|
||||
return {}
|
||||
|
||||
_, users_resp = api.request("GET", "/users/")
|
||||
@@ -227,7 +240,7 @@ def ensure_cascade_credentials(
|
||||
cascade_inbound = {
|
||||
"tag": "Cascade-RU-DE",
|
||||
"listen": "2a12:bec4:1bb0:2e80::2",
|
||||
"port": 1443,
|
||||
"port": 443,
|
||||
"protocol": "vless",
|
||||
"settings": {
|
||||
"clients": [{"id": creds["uuid"], "flow": "xtls-rprx-vision"}],
|
||||
@@ -249,11 +262,32 @@ def ensure_cascade_credentials(
|
||||
},
|
||||
},
|
||||
}
|
||||
new_inbounds = [i for i in inbounds if i.get("tag") != "Cascade-RU-DE"]
|
||||
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.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")
|
||||
changes.append("updated profile DE-Yali with Cascade-RU-DE inbound on :443")
|
||||
if ru_prof and not ru_has_443:
|
||||
_, 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:
|
||||
vnext[0]["port"] = 443
|
||||
vnext[0]["users"][0]["id"] = creds["uuid"]
|
||||
rs = (ob.get("streamSettings") or {}).get("realitySettings") or {}
|
||||
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")
|
||||
return creds
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user