Skip to content

Commit ef51106

Browse files
committed
Fix country code
1 parent db58970 commit ef51106

3 files changed

Lines changed: 6 additions & 163 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ dev/config-auth.toml
77
target
88
snapshots/*.bin
99
dev/data/*
10+
dev/xray-config.json

dev/xray-config.json

Lines changed: 0 additions & 160 deletions
Original file line numberDiff line numberDiff line change
@@ -1,160 +0,0 @@
1-
{
2-
"log": {
3-
"loglevel": "debug"
4-
},
5-
"inbounds": [
6-
{
7-
"tag": "VlessXhttpReality",
8-
"listen": "0.0.0.0",
9-
"port": 443,
10-
"protocol": "vless",
11-
"settings": {
12-
"clients": [],
13-
"decryption": "none"
14-
},
15-
"streamSettings": {
16-
"network": "xhttp",
17-
"security": "reality",
18-
"realitySettings": {
19-
"xver": 0,
20-
"target": "ya.ru:443",
21-
"serverNames": [
22-
"ya.ru"
23-
],
24-
"privateKey": "0EtqcOKG4wJsURvTfzSWRvH0dPeECVL1TXY21Ydx6Ho",
25-
"publicKey": "jgdqVgUnunocvov5MtuGKh9fVHCpSXIWega-VsHGXAE",
26-
"shortIds": [
27-
"0498897564df"
28-
]
29-
},
30-
"xhttpSettings": {
31-
"path": "/"
32-
}
33-
},
34-
"sniffing": {
35-
"enabled": true,
36-
"destOverride": [
37-
"http",
38-
"tls",
39-
"quic"
40-
]
41-
}
42-
},
43-
{
44-
"tag": "VlessGrpcReality",
45-
"listen": "0.0.0.0",
46-
"port": 8443,
47-
"protocol": "vless",
48-
"settings": {
49-
"clients": [],
50-
"decryption": "none"
51-
},
52-
"streamSettings": {
53-
"network": "grpc",
54-
"security": "reality",
55-
"realitySettings": {
56-
"xver": 0,
57-
"target": "ya.ru:443",
58-
"serverNames": [
59-
"ya.ru"
60-
],
61-
"privateKey": "0EtqcOKG4wJsURvTfzSWRvH0dPeECVL1TXY21AAAAAA",
62-
"publicKey": "jgdqVgUnunocvov5MtuGKh9fVHCpSXIWega-AAAAAAA",
63-
"shortIds": [
64-
"0498897564df"
65-
]
66-
},
67-
"grpcSettings": {
68-
"serviceName": "api.v1"
69-
}
70-
}
71-
},
72-
{
73-
"tag": "VlessTcpReality",
74-
"listen": "0.0.0.0",
75-
"port": 8444,
76-
"protocol": "vless",
77-
"settings": {
78-
"clients": [],
79-
"decryption": "none"
80-
},
81-
"streamSettings": {
82-
"network": "tcp",
83-
"security": "reality",
84-
"realitySettings": {
85-
"serverNames": [
86-
"cdn.discordapp.com",
87-
"discordapp.com"
88-
],
89-
"privateKey": "0EtqcOKG4wJsURvTfzSWRvH0dPeECVL1AAAAAAAA",
90-
"publicKey": "jgdqVgUnunocvov5MtuGKh9fVHCpSXIWega-AAAAAA",
91-
"shortIds": [
92-
"e5c4d84fb339fb92"
93-
],
94-
"target": "discordapp.com:443"
95-
}
96-
}
97-
}
98-
],
99-
"outbounds": [
100-
{
101-
"protocol": "freedom",
102-
"tag": "DIRECT"
103-
},
104-
{
105-
"protocol": "blackhole",
106-
"tag": "BLOCK"
107-
}
108-
],
109-
"routing": {
110-
"rules": [
111-
{
112-
"ip": [
113-
"geoip:private"
114-
],
115-
"outboundTag": "BLOCK",
116-
"type": "field"
117-
},
118-
{
119-
"domain": [
120-
"geosite:private"
121-
],
122-
"outboundTag": "BLOCK",
123-
"type": "field"
124-
},
125-
{
126-
"protocol": [
127-
"bittorrent"
128-
],
129-
"outboundTag": "BLOCK",
130-
"type": "field"
131-
}
132-
]
133-
},
134-
"api": {
135-
"listen": "127.0.0.1:23456",
136-
"services": [
137-
"HandlerService",
138-
"StatsService",
139-
"LoggerService",
140-
"ReflectionService"
141-
],
142-
"tag": "API"
143-
},
144-
"stats": {},
145-
"policy": {
146-
"levels": {
147-
"0": {
148-
"statsUserUplink": true,
149-
"statsUserDownlink": true,
150-
"statsUserOnline": true
151-
}
152-
},
153-
"system": {
154-
"statsInboundDownlink": false,
155-
"statsInboundUplink": false,
156-
"statsOutboundDownlink": true,
157-
"statsOutboundUplink": true
158-
}
159-
}
160-
}

src/bin/api/core/postgres/node.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ impl PgNode {
3737

3838
let node_query = "
3939
INSERT INTO nodes (
40-
id, uuid, env, hostname, address, status, created_at, modified_at, label, interface, cores, max_bandwidth_bps
40+
id, uuid, env, hostname, address, status, created_at, modified_at, label, interface, cores, max_bandwidth_bps, country
4141
)
4242
VALUES (
43-
$1, $2, $3, $4, $5, $6::node_status, $7, $8, $9, $10, $11, $12
43+
$1, $2, $3, $4, $5, $6::node_status, $7, $8, $9, $10, $11, $12, $13
4444
)
4545
ON CONFLICT (id) DO UPDATE SET
4646
uuid = EXCLUDED.uuid,
@@ -52,7 +52,8 @@ impl PgNode {
5252
label = EXCLUDED.label,
5353
interface = EXCLUDED.interface,
5454
cores = EXCLUDED.cores,
55-
max_bandwidth_bps = EXCLUDED.max_bandwidth_bps
55+
max_bandwidth_bps = EXCLUDED.max_bandwidth_bps,
56+
country = EXCLUDED.country
5657
";
5758

5859
tx.execute(
@@ -70,6 +71,7 @@ impl PgNode {
7071
&node.interface,
7172
&cores,
7273
&node.max_bandwidth_bps,
74+
&node.country,
7375
],
7476
)
7577
.await?;

0 commit comments

Comments
 (0)