removed - alterId

https://github.com/XTLS/Xray-core/pull/2199
9112cfd39c
This commit is contained in:
MHSanaei 2023-06-13 17:26:50 +03:30
parent b5657ab87d
commit ad9134bc1a
8 changed files with 3 additions and 19 deletions

View file

@ -76,7 +76,6 @@ type Client struct {
ID string `json:"id"` ID string `json:"id"`
Password string `json:"password"` Password string `json:"password"`
Flow string `json:"flow"` Flow string `json:"flow"`
AlterIds uint16 `json:"alterId"`
Email string `json:"email"` Email string `json:"email"`
LimitIP int `json:"limitIp"` LimitIP int `json:"limitIp"`
TotalGB int64 `json:"totalGB" form:"totalGB"` TotalGB int64 `json:"totalGB" form:"totalGB"`

View file

@ -236,7 +236,6 @@ func (s *SubService) genVmessLink(inbound *model.Inbound, email string) string {
} }
} }
obj["id"] = clients[clientIndex].ID obj["id"] = clients[clientIndex].ID
obj["aid"] = clients[clientIndex].AlterIds
if len(domains) > 0 { if len(domains) > 0 {
links := "" links := ""

View file

@ -1222,7 +1222,6 @@ class Inbound extends XrayCommonClass {
add: address, add: address,
port: this.port, port: this.port,
id: this.settings.vmesses[clientIndex].id, id: this.settings.vmesses[clientIndex].id,
aid: this.settings.vmesses[clientIndex].alterId,
net: this.stream.network, net: this.stream.network,
type: 'none', type: 'none',
tls: this.stream.security, tls: this.stream.security,
@ -1668,10 +1667,9 @@ Inbound.VmessSettings = class extends Inbound.Settings {
} }
}; };
Inbound.VmessSettings.Vmess = class extends XrayCommonClass { Inbound.VmessSettings.Vmess = class extends XrayCommonClass {
constructor(id=RandomUtil.randomUUID(), alterId=0, email=RandomUtil.randomLowerAndNum(8),limitIp=0, totalGB=0, expiryTime=0, enable=true, tgId='', subId=RandomUtil.randomLowerAndNum(16)) { constructor(id=RandomUtil.randomUUID(), email=RandomUtil.randomLowerAndNum(8),limitIp=0, totalGB=0, expiryTime=0, enable=true, tgId='', subId=RandomUtil.randomLowerAndNum(16)) {
super(); super();
this.id = id; this.id = id;
this.alterId = alterId;
this.email = email; this.email = email;
this.limitIp = limitIp; this.limitIp = limitIp;
this.totalGB = totalGB; this.totalGB = totalGB;
@ -1684,7 +1682,6 @@ Inbound.VmessSettings.Vmess = class extends XrayCommonClass {
static fromJson(json={}) { static fromJson(json={}) {
return new Inbound.VmessSettings.Vmess( return new Inbound.VmessSettings.Vmess(
json.id, json.id,
json.alterId,
json.email, json.email,
json.limitIp, json.limitIp,
json.totalGB, json.totalGB,

View file

@ -27,9 +27,6 @@
<a-input v-model.trim="client.password" style="width: 300px;"></a-input> <a-input v-model.trim="client.password" style="width: 300px;"></a-input>
</a-form-item> </a-form-item>
<br> <br>
<a-form-item label='{{ i18n "additional" }} ID' v-if="inbound.protocol === Protocols.VMESS">
<a-input-number v-model="client.alterId"></a-input-number>
</a-form-item>
<a-form-item label="ID" v-if="inbound.protocol === Protocols.VMESS || inbound.protocol === Protocols.VLESS"> <a-form-item label="ID" v-if="inbound.protocol === Protocols.VMESS || inbound.protocol === Protocols.VLESS">
<a-icon @click="client.id = RandomUtil.randomUUID()" type="sync"> </a-icon> <a-icon @click="client.id = RandomUtil.randomUUID()" type="sync"> </a-icon>
<a-input v-model.trim="client.id" style="width: 300px;"></a-input> <a-input v-model.trim="client.id" style="width: 300px;"></a-input>

View file

@ -15,10 +15,6 @@
<a-input v-model.trim="client.email" style="width: 200px;"></a-input> <a-input v-model.trim="client.email" style="width: 200px;"></a-input>
</a-form-item> </a-form-item>
<br> <br>
<a-form-item label='{{ i18n "additional" }} ID'>
<a-input-number v-model="client.alterId"></a-input-number>
</a-form-item>
<br>
<a-form-item label="ID"> <a-form-item label="ID">
<a-icon @click="client.id = RandomUtil.randomUUID()" type="sync"> </a-icon> <a-icon @click="client.id = RandomUtil.randomUUID()" type="sync"> </a-icon>
<a-input v-model.trim="client.id" style="width: 300px;"></a-input> <a-input v-model.trim="client.id" style="width: 300px;"></a-input>

View file

@ -396,7 +396,6 @@ func (s *InboundService) AddInboundClient(data *model.Inbound) (bool, error) {
err1 := s.xrayApi.AddUser(string(oldInbound.Protocol), oldInbound.Tag, map[string]interface{}{ err1 := s.xrayApi.AddUser(string(oldInbound.Protocol), oldInbound.Tag, map[string]interface{}{
"email": client.Email, "email": client.Email,
"id": client.ID, "id": client.ID,
"alterId": client.AlterIds,
"flow": client.Flow, "flow": client.Flow,
"password": client.Password, "password": client.Password,
}) })
@ -589,7 +588,6 @@ func (s *InboundService) UpdateInboundClient(data *model.Inbound, clientId strin
err1 := s.xrayApi.AddUser(string(oldInbound.Protocol), oldInbound.Tag, map[string]interface{}{ err1 := s.xrayApi.AddUser(string(oldInbound.Protocol), oldInbound.Tag, map[string]interface{}{
"email": clients[0].Email, "email": clients[0].Email,
"id": clients[0].ID, "id": clients[0].ID,
"alterId": clients[0].AlterIds,
"flow": clients[0].Flow, "flow": clients[0].Flow,
"password": clients[0].Password, "password": clients[0].Password,
}) })
@ -1169,7 +1167,6 @@ func (s *InboundService) ResetClientTraffic(id int, clientEmail string) (bool, e
err1 := s.xrayApi.AddUser(string(inbound.Protocol), inbound.Tag, map[string]interface{}{ err1 := s.xrayApi.AddUser(string(inbound.Protocol), inbound.Tag, map[string]interface{}{
"email": client.Email, "email": client.Email,
"id": client.ID, "id": client.ID,
"alterId": client.AlterIds,
"flow": client.Flow, "flow": client.Flow,
"password": client.Password, "password": client.Password,
}) })

View file

@ -116,7 +116,7 @@ func (s *XrayService) GetXrayConfig() (*xray.Config, error) {
} }
} }
for key := range c { for key := range c {
if key != "email" && key != "id" && key != "password" && key != "flow" && key != "alterId" { if key != "email" && key != "id" && key != "password" && key != "flow" {
delete(c, key) delete(c, key)
} }
if c["flow"] == "xtls-rprx-vision-udp443" { if c["flow"] == "xtls-rprx-vision-udp443" {

View file

@ -58,7 +58,6 @@ func (x *XrayAPI) AddUser(Protocol string, inboundTag string, user map[string]in
case "vmess": case "vmess":
account = serial.ToTypedMessage(&vmess.Account{ account = serial.ToTypedMessage(&vmess.Account{
Id: user["id"].(string), Id: user["id"].(string),
AlterId: uint32(user["alterId"].(uint16)),
}) })
case "vless": case "vless":
account = serial.ToTypedMessage(&vless.Account{ account = serial.ToTypedMessage(&vless.Account{