Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e41c8e30a4 | |||
| 260f988360 | |||
| ca4905220d | |||
| 08c5ff136e | |||
| 8709531717 | |||
| 71f53c3575 | |||
| 2607f1f264 | |||
| a94cab7dc1 | |||
| 694d446402 | |||
| 6074d40643 | |||
| 4b1df94325 | |||
| 232c75d5bf | |||
| 5e860a4896 | |||
| 5b05486b98 | |||
| fb22744fa7 | |||
| af812b7c93 | |||
| 3302ca8871 | |||
| 2c5eff03d5 | |||
| a8a203041f |
+38
-20
@@ -755,11 +755,11 @@ class Bot
|
||||
'download' => 0,
|
||||
'upload' => 0,
|
||||
];
|
||||
foreach ($p['clients'] as $k => $v) {
|
||||
$p['clients'][$k]['global']['download'] += $v['session']['download'];
|
||||
$p['clients'][$k]['session']['download'] = 0;
|
||||
$p['clients'][$k]['global']['upload'] += $v['session']['upload'];
|
||||
$p['clients'][$k]['session']['upload'] = 0;
|
||||
foreach ($p['users'] as $k => $v) {
|
||||
$p['users'][$k]['global']['download'] += $v['session']['download'];
|
||||
$p['users'][$k]['session']['download'] = 0;
|
||||
$p['users'][$k]['global']['upload'] += $v['session']['upload'];
|
||||
$p['users'][$k]['session']['upload'] = 0;
|
||||
}
|
||||
$this->setXrayStats($p);
|
||||
}
|
||||
@@ -993,7 +993,7 @@ class Bot
|
||||
{
|
||||
$r = $this->send(
|
||||
$this->input['chat'],
|
||||
"@{$this->input['username']} enter pass",
|
||||
"@{$this->input['username']} enter password",
|
||||
$this->input['message_id'],
|
||||
reply: 'enter password',
|
||||
);
|
||||
@@ -1011,7 +1011,7 @@ class Bot
|
||||
$this->input['chat'],
|
||||
"@{$this->input['username']} enter name",
|
||||
$this->input['message_id'],
|
||||
reply: 'enter password',
|
||||
reply: 'enter name',
|
||||
);
|
||||
$_SESSION['reply'][$r['result']['message_id']] = [
|
||||
'start_message' => $this->input['message_id'],
|
||||
@@ -1357,14 +1357,22 @@ class Bot
|
||||
'upload' => $tu,
|
||||
];
|
||||
if (!empty($users = $x['inbounds'][0]['settings']['clients'])) {
|
||||
$tmp = [];
|
||||
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;
|
||||
$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;
|
||||
$p['users'][$k]['session'] = [
|
||||
'download' => $d,
|
||||
'upload' => $u,
|
||||
$tmp[$k] = [
|
||||
'session' => [
|
||||
'download' => $d,
|
||||
'upload' => $u,
|
||||
],
|
||||
'global' => [
|
||||
'download' => $p['users'][$k]['global']['download'],
|
||||
'upload' => $p['users'][$k]['global']['upload'],
|
||||
]
|
||||
];
|
||||
}
|
||||
$p['users'] = $tmp;
|
||||
}
|
||||
$this->setXrayStats($p);
|
||||
} catch (\Throwable $th) {
|
||||
@@ -5304,10 +5312,13 @@ DNS-over-HTTPS with IP:
|
||||
|
||||
public function delxr($i)
|
||||
{
|
||||
$r = $this->getXray();
|
||||
$r = $this->getXray();
|
||||
$st = $this->getXrayStats();
|
||||
foreach ($r['inbounds'][0]['settings']['clients'] as $k => $v) {
|
||||
if ($i == $k) {
|
||||
unset($r['inbounds'][0]['settings']['clients'][$k]);
|
||||
unset($st['users'][$k]);
|
||||
$this->setXrayStats($st);
|
||||
$this->restartXray($r);
|
||||
$this->adguardXrayClients();
|
||||
break;
|
||||
@@ -5415,10 +5426,7 @@ DNS-over-HTTPS with IP:
|
||||
public function resetXrUser($i)
|
||||
{
|
||||
$c = $this->getXrayStats();
|
||||
$c['clients'][$i]['global'] = [
|
||||
'download' => 0,
|
||||
'upload' => 0,
|
||||
];
|
||||
unset($c['users'][$i]);
|
||||
$this->restartXray($this->getXray());
|
||||
$this->userXr($i);
|
||||
}
|
||||
@@ -5600,6 +5608,7 @@ DNS-over-HTTPS with IP:
|
||||
<code>~block~</code>
|
||||
<code>~warp~</code>
|
||||
<code>~dns~</code>
|
||||
<code>~dnspath~</code>
|
||||
<code>~uid~</code>
|
||||
<code>~domain~</code>
|
||||
<code>~directdomain~</code>
|
||||
@@ -5751,7 +5760,6 @@ DNS-over-HTTPS with IP:
|
||||
'callback_data' => '/addLinkDomain',
|
||||
],
|
||||
];
|
||||
$ip_count = $p['ip_count'] ?: 1;
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n('Reality') . ' ' . ($p['transport'] == 'Reality' ? $this->i18n('on') : $this->i18n('off')),
|
||||
@@ -5761,6 +5769,9 @@ DNS-over-HTTPS with IP:
|
||||
'text' => $this->i18n('Websocket') . ' ' . ($p['transport'] != 'Reality' ? $this->i18n('on') : $this->i18n('off')),
|
||||
'callback_data' => "/changeTransport 1",
|
||||
],
|
||||
];
|
||||
$ip_count = $p['ip_count'] ?: 1;
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n('ip limit') . ' ' . ($p['ip_limit'] ? ": {$p['ip_limit']} sec & $ip_count" : $this->i18n('off')),
|
||||
'callback_data' => "/setIpLimit",
|
||||
@@ -6010,8 +6021,8 @@ DNS-over-HTTPS with IP:
|
||||
foreach ($xr['inbounds'][0]['settings']['clients'] as $k => $v) {
|
||||
if (empty($v['off']) && $v['email'] == $m['email']) {
|
||||
require __DIR__ . '/config.php';
|
||||
foreach ($c['admin'] as $k => $v) {
|
||||
$this->send($v, "vless: {$m['email']} is turned off (limit by one IP)");
|
||||
foreach ($c['admin'] as $admin) {
|
||||
$this->send($admin, "vless: {$m['email']} is turned off (limit by one IP)");
|
||||
}
|
||||
unset($this->pool[$m['email']]);
|
||||
$this->switchXr($k, 1);
|
||||
@@ -6487,6 +6498,7 @@ DNS-over-HTTPS with IP:
|
||||
'"~package~"' => json_encode(array_keys(array_filter($pac['packagelist'] ?: []))),
|
||||
'"~subnet~"' => json_encode(array_keys(array_filter($pac['subnetlist'] ?: []))),
|
||||
'~dns~' => "https://$domain/dns-query$hash/$uid",
|
||||
'~dnspath~' => "/dns-query$hash/$uid",
|
||||
'~uid~' => $uid,
|
||||
'~domain~' => $domain,
|
||||
'~directdomain~' => $pac['domain'],
|
||||
@@ -6644,7 +6656,7 @@ DNS-over-HTTPS with IP:
|
||||
if (!empty($route['rules'])) {
|
||||
foreach ($route['rules'] as $k => $v) {
|
||||
if (!empty($v['addruleset'])) {
|
||||
$t[$v['outbound']] = $k;
|
||||
$t[$v['outbound'] ?: 'block'] = $k;
|
||||
}
|
||||
}
|
||||
$p = $this->getPacConf();
|
||||
@@ -6845,7 +6857,13 @@ DNS-over-HTTPS with IP:
|
||||
|
||||
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)
|
||||
|
||||
+2
-2
@@ -432,7 +432,7 @@ services:
|
||||
ipv4_address: 10.10.0.12
|
||||
logging: *default-logging
|
||||
wp:
|
||||
image: mercurykd/vpnbot-wp:1.2
|
||||
image: mercurykd/vpnbot-wp:1.3
|
||||
build:
|
||||
dockerfile: dockerfile/warp.dockerfile
|
||||
args:
|
||||
@@ -442,7 +442,7 @@ services:
|
||||
devices:
|
||||
- /dev/net/tun:/dev/net/tun
|
||||
volumes:
|
||||
- ./config/.profile:/root/.ashrc:ro
|
||||
- ./config/.profile:/root/.bashrc:ro
|
||||
- ./ssh:/ssh
|
||||
- ./config/sshd_config:/etc/ssh/sshd_config
|
||||
- ./config:/config
|
||||
|
||||
@@ -1,16 +1,6 @@
|
||||
FROM ubuntu:22.04 AS build
|
||||
RUN apt update && apt install -y curl gpg lsb-release \
|
||||
FROM ubuntu:22.04
|
||||
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 \
|
||||
&& 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
|
||||
|
||||
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 \
|
||||
&& apt update && apt install -y cloudflare-warp \
|
||||
&& mkdir /root/.ssh
|
||||
|
||||
@@ -32,7 +32,7 @@ up: # консоль сервиса
|
||||
ad: # консоль сервиса
|
||||
docker compose exec ad /bin/sh
|
||||
wp: # консоль сервиса
|
||||
docker compose exec wp /bin/sh
|
||||
docker compose exec wp bash
|
||||
proxy: # консоль сервиса
|
||||
docker compose exec proxy /bin/sh
|
||||
tg: # консоль сервиса
|
||||
|
||||
+4
-3
@@ -1,9 +1,10 @@
|
||||
cat /ssh/key.pub > /root/.ssh/authorized_keys
|
||||
ssh-keygen -A
|
||||
exec /usr/sbin/sshd -D -e "$@" &
|
||||
echo 'HostKeyAlgorithms +ssh-rsa' >> /etc/ssh/sshd_config
|
||||
echo 'PubkeyAcceptedKeyTypes +ssh-rsa' >> /etc/ssh/sshd_config
|
||||
service ssh start
|
||||
off=$(cat /config/pac.json | jq -r .warpoff)
|
||||
key=$(cat /config/pac.json | jq -r .warp)
|
||||
if [ "$off" == 'null' ]
|
||||
if [ "$off" = 'null' ]
|
||||
then
|
||||
warp-svc > /dev/null &
|
||||
sleep 3
|
||||
|
||||
Binary file not shown.
@@ -1,3 +1,8 @@
|
||||
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: возможность указать кол-во айпи
|
||||
|
||||
Reference in New Issue
Block a user