3x-ui: add expiry days and start-after-first-use for clients
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+4
-4
@@ -264,7 +264,6 @@ class XuiClient:
|
||||
raise XuiApiError(f"Inbound #{inbound_id} — не VLESS (protocol={proto})")
|
||||
|
||||
uuid = await self.get_new_uuid()
|
||||
# Auto vision flow for Reality TCP if caller left flow empty
|
||||
if not flow:
|
||||
try:
|
||||
stream = inbound.get("streamSettings") or {}
|
||||
@@ -285,7 +284,7 @@ class XuiClient:
|
||||
"enable": True,
|
||||
"flow": flow,
|
||||
"totalGB": total_gb,
|
||||
"expiryTime": expiry_time,
|
||||
"expiryTime": int(expiry_time),
|
||||
"limitIp": limit_ip,
|
||||
"tgId": 0,
|
||||
"subId": _random_sub_id(),
|
||||
@@ -300,6 +299,7 @@ class XuiClient:
|
||||
"inbound_id": inbound_id,
|
||||
"uuid": uuid,
|
||||
"flow": flow,
|
||||
"expiryTime": int(expiry_time),
|
||||
"details": details,
|
||||
"links": links,
|
||||
}
|
||||
@@ -329,7 +329,7 @@ class XuiClient:
|
||||
"allowedIPs": ["0.0.0.0/0", "::/0"],
|
||||
"keepAlive": 0,
|
||||
"totalGB": total_gb,
|
||||
"expiryTime": expiry_time,
|
||||
"expiryTime": int(expiry_time),
|
||||
"limitIp": limit_ip,
|
||||
"tgId": 0,
|
||||
"subId": _random_sub_id(),
|
||||
@@ -337,13 +337,13 @@ class XuiClient:
|
||||
}
|
||||
await self.add_client_raw(client, [inbound_id])
|
||||
details = await self.get_client(email)
|
||||
# WG has no vless:// link — expose keys for conf building
|
||||
return {
|
||||
"protocol": "wireguard",
|
||||
"email": email,
|
||||
"inbound_id": inbound_id,
|
||||
"privateKey": keys["privateKey"],
|
||||
"publicKey": keys["publicKey"],
|
||||
"expiryTime": int(expiry_time),
|
||||
"details": details,
|
||||
"inbound": {
|
||||
"id": inbound.get("id"),
|
||||
|
||||
Reference in New Issue
Block a user