Compare commits

..

29 Commits

Author SHA1 Message Date
mercury 1b93d41421 cyclical rebooting panel adguardhome fix 2025-04-07 00:22:50 +04:00
mercury e41c8e30a4 fix warp 2025-04-06 23:57:46 +04:00
mercury 260f988360 Merge branch 'dev' of github.com:mercurykd/vpnbot into dev 2025-04-05 00:38:54 +04:00
mercury ca4905220d np/oc the domain is preserved when transferring 2025-04-05 00:36:08 +04:00
Konstantin 08c5ff136e Merge pull request #38 from legiz-ru/dev
new variable ~dnspath~
2025-03-04 15:45:18 +04:00
legiz-ru 8709531717 new variable ~dnspath~
new variable ~dnspath~ for client templates (required for future release sing-box 1.12)
2025-03-04 12:41:23 +03:00
Konstantin 71f53c3575 Merge pull request #37 from legiz-ru/dev
update singbox 1.11.4 windows x64
2025-03-04 12:16:19 +04:00
legiz-ru 2607f1f264 update singbox 1.11.4 windows x64 2025-03-04 10:46:56 +03:00
mercury a94cab7dc1 fix ip limit user off 2025-03-02 18:41:18 +04:00
mercury 694d446402 update version 2025-02-22 18:56:42 +04:00
mercury 6074d40643 update version 2025-02-22 18:52:17 +04:00
mercury 4b1df94325 Revert "add clash mode selector for sing-box clients"
This reverts commit fb22744fa7.
2025-02-22 18:51:49 +04:00
mercury 232c75d5bf Merge branch 'dev' of github.com:mercurykd/vpnbot into dev 2025-02-22 18:50:32 +04:00
mercury 5e860a4896 fix addruleset for block outbound 2025-02-22 18:47:36 +04:00
Konstantin 5b05486b98 Merge pull request #35 from legiz-ru/dev
add clash mode selector for sing-box clients
2025-02-13 10:13:38 +04:00
legiz-ru fb22744fa7 add clash mode selector for sing-box clients 2025-02-13 08:11:20 +03:00
mercury af812b7c93 vless: stats collect improve 2025-02-12 13:29:08 +04:00
mercury 3302ca8871 vless stats: fix delete user 2025-02-12 12:50:39 +04:00
mercury 2c5eff03d5 vless stats: fix reset user stats 2025-02-12 00:25:23 +04:00
mercury a8a203041f vless stats: fix reset user stats 2025-02-11 22:48:47 +04:00
mercury a21c9b5fe9 update version 2025-02-11 00:14:07 +04:00
mercury 696779450f ip limit: count ip 2025-02-11 00:12:21 +04:00
mercury 7c5b3dfa3a xray: fix stats user 2025-02-10 23:58:17 +04:00
mercury 74404559f9 xray: stats to separate file 2025-02-10 23:33:38 +04:00
mercury 11e8fb468b singbox: return mixed-in port 2025-02-10 10:03:27 +04:00
mercury ca92ca703f update version 2025-02-08 15:52:49 +04:00
mercury f527888db8 vless: singbox 1.11 migrate 2025-02-08 15:51:44 +04:00
mercury 0e47a771cc Reapply "update singbox 1.11 windows x64"
This reverts commit 414a67c10d.
2025-02-08 15:51:20 +04:00
mercury ff10cbefc8 vless: fix reset stats 2025-02-07 22:44:55 +04:00
9 changed files with 141 additions and 96 deletions
+93 -55
View File
@@ -736,7 +736,7 @@ class Bot
"statsOutboundDownlink" => true "statsOutboundDownlink" => true
]; ];
if (empty($norestart)) { if (empty($norestart)) {
$c = $this->collectSession($c); $this->collectSession();
file_put_contents('/config/xray.json', json_encode($c, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)); file_put_contents('/config/xray.json', json_encode($c, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES));
$this->ssh('pkill xray', 'xr'); $this->ssh('pkill xray', 'xr');
$this->ssh('xray run -config /xray.json > /dev/null 2>&1 &', 'xr'); $this->ssh('xray run -config /xray.json > /dev/null 2>&1 &', 'xr');
@@ -745,24 +745,23 @@ class Bot
} }
} }
public function collectSession($c) { public function collectSession() {
$p = $this->getPacConf(); $p = $this->getXrayStats();
$p['vlessstat']['global'] = [ $p['global'] = [
'download' => $p['vlessstat']['global']['download'] + $p['vlessstat']['session']['download'], 'download' => $p['global']['download'] + $p['session']['download'],
'upload' => $p['vlessstat']['global']['upload'] + $p['vlessstat']['session']['upload'], 'upload' => $p['global']['upload'] + $p['session']['upload'],
]; ];
$p['vlessstat']['session'] = [ $p['session'] = [
'download' => 0, 'download' => 0,
'upload' => 0, 'upload' => 0,
]; ];
$this->setPacConf($p); foreach ($p['users'] as $k => $v) {
foreach ($c['inbounds'][0]['settings']['clients'] as $k => $v) { $p['users'][$k]['global']['download'] += $v['session']['download'];
$c['inbounds'][0]['settings']['clients'][$k]['global']['download'] += $v['session']['download']; $p['users'][$k]['session']['download'] = 0;
$c['inbounds'][0]['settings']['clients'][$k]['session']['download'] = 0; $p['users'][$k]['global']['upload'] += $v['session']['upload'];
$c['inbounds'][0]['settings']['clients'][$k]['global']['upload'] += $v['session']['upload']; $p['users'][$k]['session']['upload'] = 0;
$c['inbounds'][0]['settings']['clients'][$k]['session']['upload'] = 0;
} }
return $c; $this->setXrayStats($p);
} }
public function linkMtproto() public function linkMtproto()
@@ -994,7 +993,7 @@ class Bot
{ {
$r = $this->send( $r = $this->send(
$this->input['chat'], $this->input['chat'],
"@{$this->input['username']} enter pass", "@{$this->input['username']} enter password",
$this->input['message_id'], $this->input['message_id'],
reply: 'enter password', reply: 'enter password',
); );
@@ -1012,7 +1011,7 @@ class Bot
$this->input['chat'], $this->input['chat'],
"@{$this->input['username']} enter name", "@{$this->input['username']} enter name",
$this->input['message_id'], $this->input['message_id'],
reply: 'enter password', reply: 'enter name',
); );
$_SESSION['reply'][$r['result']['message_id']] = [ $_SESSION['reply'][$r['result']['message_id']] = [
'start_message' => $this->input['message_id'], 'start_message' => $this->input['message_id'],
@@ -1350,23 +1349,32 @@ class Bot
{ {
try { try {
$x = $this->getXray(); $x = $this->getXray();
$p = $this->getPacConf();
$td = json_decode($this->ssh('xray api stats --server=127.0.0.1:8080 -name "inbound>>>vless_tls>>>traffic>>>downlink" 2>&1', 'xr'), true)['stat']['value'] ?: 0; $td = json_decode($this->ssh('xray api stats --server=127.0.0.1:8080 -name "inbound>>>vless_tls>>>traffic>>>downlink" 2>&1', 'xr'), true)['stat']['value'] ?: 0;
$tu = json_decode($this->ssh('xray api stats --server=127.0.0.1:8080 -name "inbound>>>vless_tls>>>traffic>>>uplink" 2>&1', 'xr'), true)['stat']['value'] ?: 0; $tu = json_decode($this->ssh('xray api stats --server=127.0.0.1:8080 -name "inbound>>>vless_tls>>>traffic>>>uplink" 2>&1', 'xr'), true)['stat']['value'] ?: 0;
$p['vlessstat']['session']['download'] = $td; $p = $this->getXrayStats();
$p['vlessstat']['session']['upload'] = $tu; $p['session'] = [
$this->setPacConf($p); 'download' => $td,
'upload' => $tu,
];
if (!empty($users = $x['inbounds'][0]['settings']['clients'])) { if (!empty($users = $x['inbounds'][0]['settings']['clients'])) {
$tmp = [];
foreach ($users as $k => $v) { foreach ($users as $k => $v) {
$d = json_decode($this->ssh('xray api stats --server=127.0.0.1:8080 -name "user>>>' . $v['email'] . '>>>traffic>>>downlink" 2>&1', 'xr'), true)['stat']['value'] ?: 0; $d = json_decode($this->ssh('xray api stats --server=127.0.0.1:8080 -name "user>>>' . $v['email'] . '>>>traffic>>>downlink" 2>&1', 'xr'), true)['stat']['value'] ?: 0;
$u = json_decode($this->ssh('xray api stats --server=127.0.0.1:8080 -name "user>>>' . $v['email'] . '>>>traffic>>>uplink" 2>&1', 'xr'), true)['stat']['value'] ?: 0; $u = json_decode($this->ssh('xray api stats --server=127.0.0.1:8080 -name "user>>>' . $v['email'] . '>>>traffic>>>uplink" 2>&1', 'xr'), true)['stat']['value'] ?: 0;
$x['inbounds'][0]['settings']['clients'][$k]['session'] = [ $tmp[$k] = [
'download' => $d, 'session' => [
'upload' => $u, 'download' => $d,
'upload' => $u,
],
'global' => [
'download' => $p['users'][$k]['global']['download'],
'upload' => $p['users'][$k]['global']['upload'],
]
]; ];
} }
$this->restartXray($x, norestart: 1); $p['users'] = $tmp;
} }
$this->setXrayStats($p);
} catch (\Throwable $th) { } catch (\Throwable $th) {
} }
} }
@@ -1669,7 +1677,7 @@ class Bot
'ocu' => file_get_contents('/config/ocserv.passwd'), 'ocu' => file_get_contents('/config/ocserv.passwd'),
'ss' => $this->getSSConfig(), 'ss' => $this->getSSConfig(),
'sl' => $this->getSSLocalConfig(), 'sl' => $this->getSSLocalConfig(),
'xraystats' => $this->getXrayStats(),
]; ];
return json_encode($conf, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); return json_encode($conf, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
} }
@@ -1782,6 +1790,12 @@ class Bot
$this->adguardXrayClients(); $this->adguardXrayClients();
$this->setUpstreamDomain($json['pac']['transport'] != 'Reality' ? 't' : ($json['pac']['reality']['domain'] ?: $json['xray']['inbounds'][0]['streamSettings']['realitySettings']['serverNames'][0])); $this->setUpstreamDomain($json['pac']['transport'] != 'Reality' ? 't' : ($json['pac']['reality']['domain'] ?: $json['xray']['inbounds'][0]['streamSettings']['realitySettings']['serverNames'][0]));
} }
// xraystats
if (!empty($json['xraystats'])) {
$out[] = 'update xray stats';
$this->update($this->input['chat'], $this->input['message_id'], implode("\n", $out));
$this->setXrayStats($json['xraystats']);
}
// ocserv // ocserv
if (!empty($json['oc'])) { if (!empty($json['oc'])) {
$out[] = 'update ocserv'; $out[] = 'update ocserv';
@@ -2421,9 +2435,9 @@ class Bot
{ {
$r = $this->send( $r = $this->send(
$this->input['chat'], $this->input['chat'],
"@{$this->input['username']} enter seconds", "@{$this->input['username']} enter seconds and count ip",
$this->input['message_id'], $this->input['message_id'],
reply: 'enter seconds', reply: 'enter seconds:count_ip',
); );
$_SESSION['reply'][$r['result']['message_id']] = [ $_SESSION['reply'][$r['result']['message_id']] = [
'start_message' => $this->input['message_id'], 'start_message' => $this->input['message_id'],
@@ -4446,13 +4460,16 @@ DNS-over-HTTPS with IP:
$this->ipMenu(); $this->ipMenu();
} }
public function switchIpLimit(int $limit) public function switchIpLimit($limit)
{ {
$limit = explode(':', $limit);
$c = $this->getPacConf(); $c = $this->getPacConf();
if ($limit <= 0) { if ((int) $limit[0] <= 0) {
unset($c['ip_limit']); unset($c['ip_limit']);
unset($c['ip_count']);
} else { } else {
$c['ip_limit'] = $limit; $c['ip_limit'] = (int) $limit[0];
$c['ip_count'] = (int) $limit[1] ?: 1;
} }
$this->setPacConf($c); $this->setPacConf($c);
$this->xray(); $this->xray();
@@ -5295,10 +5312,13 @@ DNS-over-HTTPS with IP:
public function delxr($i) public function delxr($i)
{ {
$r = $this->getXray(); $r = $this->getXray();
$st = $this->getXrayStats();
foreach ($r['inbounds'][0]['settings']['clients'] as $k => $v) { foreach ($r['inbounds'][0]['settings']['clients'] as $k => $v) {
if ($i == $k) { if ($i == $k) {
unset($r['inbounds'][0]['settings']['clients'][$k]); unset($r['inbounds'][0]['settings']['clients'][$k]);
unset($st['users'][$k]);
$this->setXrayStats($st);
$this->restartXray($r); $this->restartXray($r);
$this->adguardXrayClients(); $this->adguardXrayClients();
break; break;
@@ -5393,23 +5413,28 @@ DNS-over-HTTPS with IP:
$this->userXr($i); $this->userXr($i);
} }
public function getXrayStats()
{
return json_decode(file_get_contents('/config/xray.stats'), true) ?: [];
}
public function setXrayStats($x)
{
file_put_contents('/config/xray.stats', json_encode($x));
}
public function resetXrUser($i) public function resetXrUser($i)
{ {
$c = $this->getXray(); $c = $this->getXrayStats();
$c['inbounds'][0]['settings']['clients'][$i]['global'] = [ unset($c['users'][$i]);
'download' => 0, $this->restartXray($this->getXray());
'upload' => 0,
];
$this->restartXray($c);
$this->userXr($i); $this->userXr($i);
} }
public function resetXrStats() public function resetXrStats()
{ {
$this->restartXray($this->getXray()); $this->restartXray($this->getXray());
$p = $this->getPacConf(); $this->setXrayStats([]);
unset($p['vlessstat']);
$this->setPacConf($p);
$this->xray(); $this->xray();
} }
@@ -5583,6 +5608,7 @@ DNS-over-HTTPS with IP:
<code>~block~</code> <code>~block~</code>
<code>~warp~</code> <code>~warp~</code>
<code>~dns~</code> <code>~dns~</code>
<code>~dnspath~</code>
<code>~uid~</code> <code>~uid~</code>
<code>~domain~</code> <code>~domain~</code>
<code>~directdomain~</code> <code>~directdomain~</code>
@@ -5713,8 +5739,9 @@ DNS-over-HTTPS with IP:
$text[] = "fake domain: <code>$fake</code>"; $text[] = "fake domain: <code>$fake</code>";
} }
$text[] = 'transport: ' . ($p['transport'] ?: 'Websocket'); $text[] = 'transport: ' . ($p['transport'] ?: 'Websocket');
$td = $this->getBytes($p['vlessstat']['global']['download'] + $p['vlessstat']['session']['download']); $st = $this->getXrayStats();
$tu = $this->getBytes($p['vlessstat']['global']['upload'] + $p['vlessstat']['session']['upload']); $td = $this->getBytes($st['global']['download'] + $st['session']['download']);
$tu = $this->getBytes($st['global']['upload'] + $st['session']['upload']);
$data[] = [ $data[] = [
[ [
'text' => $this->i18n('reset stats') . ": ↓$td$tu", 'text' => $this->i18n('reset stats') . ": ↓$td$tu",
@@ -5742,8 +5769,11 @@ DNS-over-HTTPS with IP:
'text' => $this->i18n('Websocket') . ' ' . ($p['transport'] != 'Reality' ? $this->i18n('on') : $this->i18n('off')), 'text' => $this->i18n('Websocket') . ' ' . ($p['transport'] != 'Reality' ? $this->i18n('on') : $this->i18n('off')),
'callback_data' => "/changeTransport 1", 'callback_data' => "/changeTransport 1",
], ],
];
$ip_count = $p['ip_count'] ?: 1;
$data[] = [
[ [
'text' => $this->i18n('ip limit') . ' ' . ($p['ip_limit'] ? ": {$p['ip_limit']} sec" : $this->i18n('off')), 'text' => $this->i18n('ip limit') . ' ' . ($p['ip_limit'] ? ": {$p['ip_limit']} sec & $ip_count" : $this->i18n('off')),
'callback_data' => "/setIpLimit", 'callback_data' => "/setIpLimit",
], ],
]; ];
@@ -5795,8 +5825,8 @@ DNS-over-HTTPS with IP:
$page = $page == -2 ? $all - 1 : $page; $page = $page == -2 ? $all - 1 : $page;
$clients = $page != -1 ? array_slice($clients, $page * $this->limit, $this->limit, true) : $clients; $clients = $page != -1 ? array_slice($clients, $page * $this->limit, $this->limit, true) : $clients;
foreach ($clients as $k => $v) { foreach ($clients as $k => $v) {
$download = $this->getBytes($v['global']['download'] + $v['session']['download']); $download = $this->getBytes($st['users'][$k]['global']['download'] + $st['users'][$k]['session']['download']);
$upload = $this->getBytes($v['global']['upload'] + $v['session']['upload']); $upload = $this->getBytes($st['users'][$k]['global']['upload'] + $st['users'][$k]['session']['upload']);
$time = $v['time'] ? $this->getTime($v['time']) : ''; $time = $v['time'] ? $this->getTime($v['time']) : '';
$data[] = [ $data[] = [
[ [
@@ -5986,13 +6016,13 @@ DNS-over-HTTPS with IP:
if (!empty($this->pool[$m['email']]['ip']) && $this->pool[$m['email']]['ip'] != $ip) { if (!empty($this->pool[$m['email']]['ip']) && $this->pool[$m['email']]['ip'] != $ip) {
$this->pool[$m['email']]['ips'][$ip] = time(); $this->pool[$m['email']]['ips'][$ip] = time();
} }
if (!empty($this->pool[$m['email']]['ips']) && count($this->pool[$m['email']]['ips']) > 1) { if (!empty($this->pool[$m['email']]['ips']) && count($this->pool[$m['email']]['ips']) > ($pac['ip_count'] ?: 1)) {
$xr = $this->getXray(); $xr = $this->getXray();
foreach ($xr['inbounds'][0]['settings']['clients'] as $k => $v) { foreach ($xr['inbounds'][0]['settings']['clients'] as $k => $v) {
if (empty($v['off']) && $v['email'] == $m['email']) { if (empty($v['off']) && $v['email'] == $m['email']) {
require __DIR__ . '/config.php'; require __DIR__ . '/config.php';
foreach ($c['admin'] as $k => $v) { foreach ($c['admin'] as $admin) {
$this->send($v, "vless: {$m['email']} is turned off (limit by one IP)"); $this->send($admin, "vless: {$m['email']} is turned off (limit by one IP)");
} }
unset($this->pool[$m['email']]); unset($this->pool[$m['email']]);
$this->switchXr($k, 1); $this->switchXr($k, 1);
@@ -6161,10 +6191,11 @@ DNS-over-HTTPS with IP:
$text[] = "sing-box config: <pre><code>$si</code></pre>"; $text[] = "sing-box config: <pre><code>$si</code></pre>";
$text[] = "mihomo config: <pre><code>$cl</code></pre>"; $text[] = "mihomo config: <pre><code>$cl</code></pre>";
$text[] = "sing-box windows: <a href='$scheme://{$domain}/pac$hash?t=si&r=w&s={$c['id']}'>windows service</a>"; $text[] = "sing-box windows: <a href='$scheme://{$domain}/pac$hash?t=si&r=w&s={$c['id']}'>windows service</a>";
$download = $this->getBytes($c['global']['download'] + $c['session']['download']); $st = $this->getXrayStats();
$upload = $this->getBytes($c['global']['upload'] + $c['session']['upload']); $download = $this->getBytes($st['users'][$i]['global']['download'] + $st['users'][$i]['session']['download']);
$data[] = [ $upload = $this->getBytes($st['users'][$i]['global']['upload'] + $st['users'][$i]['session']['upload']);
$data[] = [
[ [
'text' => $this->i18n('reset stats') . ": ↓$download$upload", 'text' => $this->i18n('reset stats') . ": ↓$download$upload",
'callback_data' => "/resetXrUser $i", 'callback_data' => "/resetXrUser $i",
@@ -6467,6 +6498,7 @@ DNS-over-HTTPS with IP:
'"~package~"' => json_encode(array_keys(array_filter($pac['packagelist'] ?: []))), '"~package~"' => json_encode(array_keys(array_filter($pac['packagelist'] ?: []))),
'"~subnet~"' => json_encode(array_keys(array_filter($pac['subnetlist'] ?: []))), '"~subnet~"' => json_encode(array_keys(array_filter($pac['subnetlist'] ?: []))),
'~dns~' => "https://$domain/dns-query$hash/$uid", '~dns~' => "https://$domain/dns-query$hash/$uid",
'~dnspath~' => "/dns-query$hash/$uid",
'~uid~' => $uid, '~uid~' => $uid,
'~domain~' => $domain, '~domain~' => $domain,
'~directdomain~' => $pac['domain'], '~directdomain~' => $pac['domain'],
@@ -6494,7 +6526,7 @@ DNS-over-HTTPS with IP:
$c['route'] = $this->createRuleSet($c['route'], $uid, $domain); $c['route'] = $this->createRuleSet($c['route'], $uid, $domain);
if (!empty($c['route']['rules'])) { if (!empty($c['route']['rules'])) {
foreach ($c['route']['rules'] as $k => $v) { foreach ($c['route']['rules'] as $k => $v) {
if (count($v) < 2) { if (count($v) == 1 && array_key_exists('outbound', $v)) {
unset($c['route']['rules'][$k]); unset($c['route']['rules'][$k]);
} }
} }
@@ -6624,7 +6656,7 @@ DNS-over-HTTPS with IP:
if (!empty($route['rules'])) { if (!empty($route['rules'])) {
foreach ($route['rules'] as $k => $v) { foreach ($route['rules'] as $k => $v) {
if (!empty($v['addruleset'])) { if (!empty($v['addruleset'])) {
$t[$v['outbound']] = $k; $t[$v['outbound'] ?: 'block'] = $k;
} }
} }
$p = $this->getPacConf(); $p = $this->getPacConf();
@@ -6825,7 +6857,13 @@ DNS-over-HTTPS with IP:
public function getHashSubdomain($subdomain) public function getHashSubdomain($subdomain)
{ {
return $this->getPacConf()["{$subdomain}_domain"] ?: substr(hash('sha256', "$subdomain{$this->key}"), 0, 8); $p = $this->getPacConf();
if (!empty($p["{$subdomain}_domain"])) {
return $p["{$subdomain}_domain"];
}
$p["{$subdomain}_domain"] = substr(hash('sha256', "$subdomain{$this->key}"), 0, 8);
$this->setPacConf($p);
return $p["{$subdomain}_domain"];
} }
public function addWg($page) public function addWg($page)
+1 -1
View File
@@ -38,7 +38,7 @@ switch (true) {
// adguard cookie // adguard cookie
case preg_match('~^' . preg_quote("/webapp$hash/check") . '~', $_SERVER['REQUEST_URI']) && $webapp: case preg_match('~^' . preg_quote("/webapp$hash/check") . '~', $_SERVER['REQUEST_URI']) && $webapp:
setcookie('c', substr(hash('sha256', $c['key']), 0, 8), 0, '/'); setcookie('c', $hash, 0, '/');
echo "/adguard$hash/"; echo "/adguard$hash/";
break; break;
+21 -21
View File
@@ -9,12 +9,12 @@
"tag": "tun-in", "tag": "tun-in",
"domain_strategy": "prefer_ipv4", "domain_strategy": "prefer_ipv4",
"interface_name": "sing-tun", "interface_name": "sing-tun",
"address": ["172.19.0.1\/30"], "address": [
"172.19.0.1\/30"
],
"mtu": 1400, "mtu": 1400,
"gso": true,
"auto_route": true, "auto_route": true,
"strict_route": true, "strict_route": true,
"sniff": true,
"endpoint_independent_nat": false, "endpoint_independent_nat": false,
"stack": "mixed", "stack": "mixed",
"platform": { "platform": {
@@ -27,14 +27,9 @@
}, },
{ {
"type": "mixed", "type": "mixed",
"tag": "mixed-in", "tag": "in",
"domain_strategy": "prefer_ipv4",
"listen": "127.0.0.1", "listen": "127.0.0.1",
"listen_port": 2080, "listen_port": 2080
"tcp_fast_open": true,
"sniff": true,
"sniff_override_destination": false,
"users": []
} }
], ],
"dns": { "dns": {
@@ -92,23 +87,28 @@
{ {
"type": "direct", "type": "direct",
"tag": "direct" "tag": "direct"
},
{
"type": "block",
"tag": "block"
},
{
"type": "dns",
"tag": "dns-out"
} }
], ],
"route": { "route": {
"auto_detect_interface": true, "auto_detect_interface": true,
"override_android_vpn": true, "override_android_vpn": true,
"rules": [ "rules": [
{
"action": "sniff"
},
{ {
"protocol": "dns", "protocol": "dns",
"outbound": "dns-out" "action": "hijack-dns"
},
{
"inbound": "in",
"action": "resolve",
"strategy": "prefer_ipv4"
},
{
"inbound": "in",
"action": "sniff",
"timeout": "1s"
}, },
{ {
"addruleset": true, "addruleset": true,
@@ -187,7 +187,7 @@
] ]
} }
], ],
"outbound": "block" "action": "reject"
}, },
{ {
"addruleset": true, "addruleset": true,
@@ -207,4 +207,4 @@
], ],
"final": "direct" "final": "direct"
} }
} }
+2 -2
View File
@@ -432,7 +432,7 @@ services:
ipv4_address: 10.10.0.12 ipv4_address: 10.10.0.12
logging: *default-logging logging: *default-logging
wp: wp:
image: mercurykd/vpnbot-wp:1.2 image: mercurykd/vpnbot-wp:1.3
build: build:
dockerfile: dockerfile/warp.dockerfile dockerfile: dockerfile/warp.dockerfile
args: args:
@@ -442,7 +442,7 @@ services:
devices: devices:
- /dev/net/tun:/dev/net/tun - /dev/net/tun:/dev/net/tun
volumes: volumes:
- ./config/.profile:/root/.ashrc:ro - ./config/.profile:/root/.bashrc:ro
- ./ssh:/ssh - ./ssh:/ssh
- ./config/sshd_config:/etc/ssh/sshd_config - ./config/sshd_config:/etc/ssh/sshd_config
- ./config:/config - ./config:/config
+3 -13
View File
@@ -1,16 +1,6 @@
FROM ubuntu:22.04 AS build FROM ubuntu:22.04
RUN apt update && apt install -y curl gpg lsb-release \ RUN apt update && apt install -y curl gpg socat jq lsb-release openssh-server \
&& curl -fsSL https://pkg.cloudflareclient.com/pubkey.gpg | gpg --yes --dearmor --output /usr/share/keyrings/cloudflare-warp-archive-keyring.gpg \ && curl -fsSL https://pkg.cloudflareclient.com/pubkey.gpg | gpg --yes --dearmor --output /usr/share/keyrings/cloudflare-warp-archive-keyring.gpg \
&& echo "deb [signed-by=/usr/share/keyrings/cloudflare-warp-archive-keyring.gpg] https://pkg.cloudflareclient.com/ $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/cloudflare-client.list \ && echo "deb [signed-by=/usr/share/keyrings/cloudflare-warp-archive-keyring.gpg] https://pkg.cloudflareclient.com/ $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/cloudflare-client.list \
&& apt update && apt install -y cloudflare-warp && apt update && apt install -y cloudflare-warp \
FROM alpine:3.17
ARG GLIBC_VERSION=2.34-r0
COPY --from=build /usr/bin/warp-cli /usr/bin/warp-svc /usr/local/bin/
RUN apk add --no-cache dbus-libs wget socat openssh-server jq curl \
&& mkdir /tmp/glibc-pkgs \
&& for PKG in glibc-$GLIBC_VERSION.apk glibc-bin-$GLIBC_VERSION.apk; do wget -q --directory-prefix /tmp/glibc-pkgs https://github.com/sgerrand/alpine-pkg-glibc/releases/download/$GLIBC_VERSION/$PKG; done \
&& apk add --no-cache --allow-untrusted --force-overwrite /tmp/glibc-pkgs/* \
&& rm -rf /tmp/glibc-pkgs \
&& /usr/glibc-compat/sbin/ldconfig /lib /usr/glibc-compat/lib \
&& mkdir /root/.ssh && mkdir /root/.ssh
+1 -1
View File
@@ -32,7 +32,7 @@ up: # консоль сервиса
ad: # консоль сервиса ad: # консоль сервиса
docker compose exec ad /bin/sh docker compose exec ad /bin/sh
wp: # консоль сервиса wp: # консоль сервиса
docker compose exec wp /bin/sh docker compose exec wp bash
proxy: # консоль сервиса proxy: # консоль сервиса
docker compose exec proxy /bin/sh docker compose exec proxy /bin/sh
tg: # консоль сервиса tg: # консоль сервиса
+4 -3
View File
@@ -1,9 +1,10 @@
cat /ssh/key.pub > /root/.ssh/authorized_keys cat /ssh/key.pub > /root/.ssh/authorized_keys
ssh-keygen -A echo 'HostKeyAlgorithms +ssh-rsa' >> /etc/ssh/sshd_config
exec /usr/sbin/sshd -D -e "$@" & echo 'PubkeyAcceptedKeyTypes +ssh-rsa' >> /etc/ssh/sshd_config
service ssh start
off=$(cat /config/pac.json | jq -r .warpoff) off=$(cat /config/pac.json | jq -r .warpoff)
key=$(cat /config/pac.json | jq -r .warp) key=$(cat /config/pac.json | jq -r .warp)
if [ "$off" == 'null' ] if [ "$off" = 'null' ]
then then
warp-svc > /dev/null & warp-svc > /dev/null &
sleep 3 sleep 3
Binary file not shown.
+16
View File
@@ -1,3 +1,19 @@
07.04.2025 v2.17
- фикс циклической перезагрузки панели adguardHome
07.04.2025 v2.16
- фикс warp
07.04.2025 v2.15
- миграция поддоменов np/oc вместе в с бэкапом
02.03.2025 v2.14
- vless ip limit: фикс выключения юзера
22.02.2025 v2.13
- vless: улучшение сбора статы
- vless: фикс добавления правил srs для block outbound
11.02.2025 v2.12
- vless: хранение статы в отдельном файле
- vless ip limit: возможность указать кол-во айпи
08.02.2025 v2.11
- vless: singbox 1.11
07.02.2025 v2.10 07.02.2025 v2.10
- vless: ip limit - vless: ip limit
- vless: общая стата - vless: общая стата