Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 90084c37ff | |||
| b49f088256 | |||
| 09a0f77863 | |||
| 8c65f8e538 | |||
| 32e49088c2 | |||
| f666762dfa | |||
| a1778e6be8 | |||
| 4b61e38b6b | |||
| 270968e4ac | |||
| 3349e3b306 |
+56
-64
@@ -802,6 +802,14 @@ class Bot
|
||||
];
|
||||
}
|
||||
|
||||
public function ssPswdCheck()
|
||||
{
|
||||
$c = $this->getSSConfig();
|
||||
if (empty($c['password']) || ($c['password'] == 'test')) {
|
||||
$this->sspwdch(password_hash(time(), PASSWORD_DEFAULT), 1);
|
||||
}
|
||||
}
|
||||
|
||||
public function changeCamouflage()
|
||||
{
|
||||
$r = $this->send(
|
||||
@@ -1024,7 +1032,7 @@ class Bot
|
||||
$this->menu('oc');
|
||||
}
|
||||
|
||||
public function sspwdch($pass)
|
||||
public function sspwdch($pass, $nomenu = false)
|
||||
{
|
||||
$this->ssh('pkill sslocal', 'proxy');
|
||||
$this->ssh('pkill ssserver', 'ss');
|
||||
@@ -1035,7 +1043,11 @@ class Bot
|
||||
file_put_contents('/config/sslocal.json', json_encode($l, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES));
|
||||
$this->ssh('ssserver -v -d -c /config.json', 'ss');
|
||||
$this->ssh('sslocal -v -d -c /config.json', 'proxy');
|
||||
$this->menu('ss');
|
||||
|
||||
$this->sd($c, 1);
|
||||
if (!empty($nomenu)) {
|
||||
$this->menu('ss');
|
||||
}
|
||||
}
|
||||
|
||||
public function v2ray()
|
||||
@@ -2554,6 +2566,7 @@ DNS-over-HTTPS with IP:
|
||||
$this->stopAd();
|
||||
$c = yaml_parse_file($this->adguard);
|
||||
unset($c['dns']['upstream_dns'][$k]);
|
||||
$c['dns']['upstream_dns'] = array_values($c['dns']['upstream_dns']);
|
||||
yaml_emit_file($this->adguard, $c);
|
||||
$this->startAd();
|
||||
$this->menu('adguard');
|
||||
@@ -6138,10 +6151,9 @@ DNS-over-HTTPS with IP:
|
||||
}
|
||||
break;
|
||||
case 'cl':
|
||||
$c = $this->createClashRuleSet($c, $uid, $domain);
|
||||
$c = $this->addClashRuleSet($c);
|
||||
if (!empty($c['rules'])) {
|
||||
$c['rules'] = $this->clashRules($c['rules']);
|
||||
$c = $this->clashRules($c, $uid, $domain);
|
||||
if (count($c['rules']) == 1) {
|
||||
unset($c['rules']);
|
||||
}
|
||||
@@ -6159,59 +6171,6 @@ DNS-over-HTTPS with IP:
|
||||
echo json_encode($c);
|
||||
}
|
||||
|
||||
public function createClashRuleSet($c, $uid, $domain)
|
||||
{
|
||||
$scheme = empty($this->nginxGetTypeCert()) ? 'http' : 'https';
|
||||
$hash = substr(md5($this->key), 0, 8);
|
||||
if (!empty($c['rule-providers'])) {
|
||||
foreach ($c['rule-providers'] as $k => $v) {
|
||||
if (array_key_exists('list', $v)) {
|
||||
if (!empty($_GET['r']) && $k == $_GET['r']) {
|
||||
header("Content-Disposition: attachment; filename=$k.yaml");
|
||||
header('Content-Type: text/yaml');
|
||||
switch ($v['behavior']) {
|
||||
case 'domain':
|
||||
echo yaml_emit(['payload' => array_map(fn($e) => "+.$e", $v['list'])]);
|
||||
break;
|
||||
|
||||
default:
|
||||
echo yaml_emit(['payload' => array_map(fn($e) => "PROCESS-NAME,$e", $v['list'])]);
|
||||
break;
|
||||
}
|
||||
exit;
|
||||
}
|
||||
$c['rule-providers'][$k] = [
|
||||
'type' => 'http',
|
||||
'url' => "$scheme://{$domain}/pac/" . base64_encode(serialize([
|
||||
'h' => $hash,
|
||||
't' => 'cl',
|
||||
's' => $uid,
|
||||
'r' => $k,
|
||||
])),
|
||||
'interval' => $v['interval'],
|
||||
'behavior' => $v['behavior'],
|
||||
'format' => 'yaml',
|
||||
];
|
||||
switch ($v['action']) {
|
||||
case 'reject':
|
||||
case 'REJECT':
|
||||
array_unshift($c['rules'], [
|
||||
'RULE-SET', $k, strtoupper($v['action'])
|
||||
]);
|
||||
break;
|
||||
|
||||
default:
|
||||
array_splice($c['rules'], count($c['rules']) - 1, 0, [[
|
||||
'RULE-SET', $k, strtoupper($v['action'])
|
||||
]]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $c;
|
||||
}
|
||||
|
||||
public function addClashRuleSet($c)
|
||||
{
|
||||
$p = $this->getPacConf();
|
||||
@@ -6252,20 +6211,53 @@ DNS-over-HTTPS with IP:
|
||||
return $c;
|
||||
}
|
||||
|
||||
public function clashRules($rules)
|
||||
public function clashRules($c, $uid, $domain)
|
||||
{
|
||||
foreach ($rules as $v) {
|
||||
if (isset($v['list'])) {
|
||||
if (!empty($v['list'])) {
|
||||
foreach ($v['list'] as $j) {
|
||||
$tmp[] = "{$v['type']}, $j, {$v['action']}";
|
||||
$scheme = empty($this->nginxGetTypeCert()) ? 'http' : 'https';
|
||||
$hash = substr(md5($this->key), 0, 8);
|
||||
foreach ($c['rules'] as $v) {
|
||||
if (array_key_exists('list', $v)) {
|
||||
if ($v['type'] == 'RULE-SET') {
|
||||
if (!empty($_GET['r']) && $v['name'] == $_GET['r']) {
|
||||
header("Content-Disposition: attachment; filename={$v['name']}.yaml");
|
||||
header('Content-Type: text/yaml');
|
||||
switch ($v['behavior']) {
|
||||
case 'domain':
|
||||
echo yaml_emit(['payload' => array_map(fn($e) => "+.$e", $v['list'])]);
|
||||
break;
|
||||
|
||||
default:
|
||||
echo yaml_emit(['payload' => array_map(fn($e) => "PROCESS-NAME,$e", $v['list'])]);
|
||||
break;
|
||||
}
|
||||
exit;
|
||||
}
|
||||
$c['rule-providers'][$v['name']] = [
|
||||
'type' => 'http',
|
||||
'url' => "$scheme://{$domain}/pac/" . base64_encode(serialize([
|
||||
'h' => $hash,
|
||||
't' => 'cl',
|
||||
's' => $uid,
|
||||
'r' => $v['name'],
|
||||
])),
|
||||
'interval' => $v['interval'],
|
||||
'behavior' => $v['behavior'],
|
||||
'format' => 'yaml',
|
||||
];
|
||||
$tmp[] = "{$v['type']}, {$v['name']}, {$v['action']}";
|
||||
} else {
|
||||
if (!empty($v['list'])) {
|
||||
foreach ($v['list'] as $j) {
|
||||
$tmp[] = "{$v['type']}, $j, {$v['action']}";
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$tmp[] = implode(', ', $v);
|
||||
}
|
||||
}
|
||||
return $tmp;
|
||||
$c['rules'] = $tmp;
|
||||
return $c;
|
||||
}
|
||||
|
||||
public function replaceTags($subject, $tags)
|
||||
|
||||
@@ -13,6 +13,7 @@ if ($c['debug']) {
|
||||
$bot = new Bot($c['key'], $i);
|
||||
|
||||
$bot->selfUpdate();
|
||||
$bot->ssPswdCheck();
|
||||
$bot->restartTG();
|
||||
if (!empty($bot->selfupdate)) {
|
||||
$bot->offWarp();
|
||||
|
||||
+41
-32
@@ -91,39 +91,48 @@
|
||||
}
|
||||
],
|
||||
"add-rule-providers": true,
|
||||
"rule-providers": {
|
||||
"block": {
|
||||
"list": "~block~",
|
||||
"interval": 30,
|
||||
"action": "REJECT",
|
||||
"behavior": "domain"
|
||||
},
|
||||
"pac": {
|
||||
"list": "~pac~",
|
||||
"interval": 30,
|
||||
"action": "PROXY",
|
||||
"behavior": "domain"
|
||||
},
|
||||
"warp": {
|
||||
"list": "~warp~",
|
||||
"interval": 30,
|
||||
"action": "PROXY",
|
||||
"behavior": "domain"
|
||||
},
|
||||
"package": {
|
||||
"list": "~package~",
|
||||
"interval": 30,
|
||||
"action": "PROXY",
|
||||
"behavior": "classical"
|
||||
},
|
||||
"process": {
|
||||
"list": "~process~",
|
||||
"interval": 30,
|
||||
"action": "PROXY",
|
||||
"behavior": "classical"
|
||||
}
|
||||
},
|
||||
"rule-providers": {},
|
||||
"rules": [
|
||||
{
|
||||
"type": "RULE-SET",
|
||||
"list": "~block~",
|
||||
"action": "REJECT",
|
||||
"interval": 30,
|
||||
"behavior": "domain",
|
||||
"name": "block"
|
||||
},
|
||||
{
|
||||
"type": "RULE-SET",
|
||||
"list": "~process~",
|
||||
"action": "PROXY",
|
||||
"interval": 30,
|
||||
"behavior": "classical",
|
||||
"name": "process"
|
||||
},
|
||||
{
|
||||
"type": "RULE-SET",
|
||||
"list": "~package~",
|
||||
"action": "PROXY",
|
||||
"interval": 30,
|
||||
"behavior": "classical",
|
||||
"name": "package"
|
||||
},
|
||||
{
|
||||
"type": "RULE-SET",
|
||||
"list": "~warp~",
|
||||
"action": "PROXY",
|
||||
"interval": 30,
|
||||
"behavior": "domain",
|
||||
"name": "warp"
|
||||
},
|
||||
{
|
||||
"type": "RULE-SET",
|
||||
"list": "~pac~",
|
||||
"action": "PROXY",
|
||||
"interval": 30,
|
||||
"behavior": "domain",
|
||||
"name": "pac"
|
||||
},
|
||||
{
|
||||
"type": "MATCH",
|
||||
"action": "DIRECT"
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
"server_port": 8388,
|
||||
"local_address": "0.0.0.0",
|
||||
"local_port": 1080,
|
||||
"password": "test",
|
||||
"password": "",
|
||||
"timeout": 120,
|
||||
"method": "chacha20-ietf-poly1305",
|
||||
"no_delay": true,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"server": "0.0.0.0",
|
||||
"server_port": 8388,
|
||||
"password": "test",
|
||||
"password": "",
|
||||
"timeout": 120,
|
||||
"method": "chacha20-ietf-poly1305",
|
||||
"no_delay": true,
|
||||
|
||||
+1
-1
@@ -307,7 +307,7 @@ services:
|
||||
ipv4_address: 10.10.0.14
|
||||
logging: *default-logging
|
||||
ad:
|
||||
image: mercurykd/vpnbot-ad:1.2
|
||||
image: mercurykd/vpnbot-ad:1.3
|
||||
build:
|
||||
dockerfile: dockerfile/adguard.dockerfile
|
||||
args:
|
||||
|
||||
@@ -1,28 +1,37 @@
|
||||
telegram bot to manage servers (inside the bot)
|
||||
|
||||
<img src="https://github.com/mercurykd/vpnbot/assets/30900414/d5a81237-5215-41db-87e5-20734120cc9c" width="200">
|
||||
<img src="https://github.com/user-attachments/assets/ec5faa51-987c-461a-a973-d94c7edf7115" width="300">
|
||||
|
||||
### XTLS-Reality
|
||||
### VLESS (Reality OR Websocket)
|
||||
- change secret
|
||||
- qr/config
|
||||
- change fake domain
|
||||
- multiple users
|
||||
- subscriptions with routing
|
||||
- subscriptions with routing (xray, sing-box, mihomo)
|
||||
- routing templates per user
|
||||
- routing via rulesets (sing-box, mihomo)
|
||||
- steal from yourself
|
||||
<img src="https://github.com/mercurykd/vpnbot/assets/30900414/39bdf4e0-96a6-4257-b61e-30a14122e236" width="200">
|
||||
- add domains to warp
|
||||
|
||||
### Main menu VLESS:
|
||||
<img src="https://github.com/user-attachments/assets/80d2f671-fade-4819-a96a-efa253741ffd" width="300">
|
||||
|
||||
### User menu VLESS:
|
||||
<img src="https://github.com/user-attachments/assets/5c3c5b5e-1931-4e98-a472-d303bac61a4e" width="300">
|
||||
|
||||
### NaiveProxy
|
||||
- change login
|
||||
- change password
|
||||
<img src="https://github.com/mercurykd/vpnbot/assets/30900414/2127a4af-0436-452c-bfe2-c750dd5dbc06" width="200">
|
||||
<img src="https://github.com/mercurykd/vpnbot/assets/30900414/2127a4af-0436-452c-bfe2-c750dd5dbc06" width="300">
|
||||
|
||||
### OpenConnect
|
||||
- change secret
|
||||
- change password
|
||||
- change dns
|
||||
- add user
|
||||
<img src="https://github.com/mercurykd/vpnbot/assets/30900414/a4ffc04f-965a-439b-862b-210b98e1f87d" width="200">
|
||||
- add ip subnet
|
||||
- expose-iroutes (lan between users)
|
||||
<img src="https://github.com/user-attachments/assets/c3a8a78e-fe99-423c-a626-610b333a2a56" width="300">
|
||||
|
||||
### Wireguard / Amnezia
|
||||
- create
|
||||
@@ -31,31 +40,38 @@ telegram bot to manage servers (inside the bot)
|
||||
- timer
|
||||
- torrent blocking
|
||||
- qr/config
|
||||
- AmneziaVPN vpn:// link
|
||||
- statistics
|
||||
<img src="https://github.com/mercurykd/vpnbot/assets/30900414/51a79c93-8083-40ba-a14b-a6ef19f00531" width="200">
|
||||
<img src="https://github.com/mercurykd/vpnbot/assets/30900414/fd6ffd9f-bd75-479c-8dca-ea6c0b938b6c" width="200">
|
||||
<img src="https://github.com/mercurykd/vpnbot/assets/30900414/51a79c93-8083-40ba-a14b-a6ef19f00531" width="300">
|
||||
<img src="https://github.com/mercurykd/vpnbot/assets/30900414/fd6ffd9f-bd75-479c-8dca-ea6c0b938b6c" width="300">
|
||||
|
||||
### Shadowsocks + v2ray
|
||||
- change password
|
||||
- on/off v2ray
|
||||
- qr
|
||||
- short link
|
||||
<img src="https://github.com/mercurykd/vpnbot/assets/30900414/fbe39617-63ae-4536-8ab0-e4269ed8784a" width="200">
|
||||
<img src="https://github.com/mercurykd/vpnbot/assets/30900414/fbe39617-63ae-4536-8ab0-e4269ed8784a" width="300">
|
||||
|
||||
### AdguardHome
|
||||
- change password
|
||||
- change upstream dns
|
||||
- check dns
|
||||
<img src="https://github.com/mercurykd/vpnbot/assets/30900414/a7d4ba52-494b-429f-a3e2-08c68c8353c4" width="200">
|
||||
- check safesearch
|
||||
- add custom clientID for DNSoverTLS (DOT)
|
||||
- fill allowed clients (WG/AWG + OpenConnect + VLESS)
|
||||
- custom ID for each user VLESS
|
||||
<img src="https://github.com/user-attachments/assets/1dcdd9f9-f781-4ec2-8e32-01ce6095e0a3" width="300">
|
||||
|
||||
### PAC
|
||||
- the ability to create your own PAC available by url with the ability to substitute the final ip and port
|
||||
<img src="https://github.com/mercurykd/vpnbot/assets/30900414/5343e009-1b21-450f-918d-b811b98a0549" width="200">
|
||||
- Shadowsocks Android PAC
|
||||
- add [antifilter-community](https://community.antifilter.download/) or [ru-bundle](https://github.com/legiz-ru/sb-rule-sets/blob/main/ru-bundle.lst) domain lists
|
||||
<img src="https://github.com/user-attachments/assets/8d039dbb-6478-43a8-811a-4279e766c884" width="300">
|
||||
|
||||
### MTProto
|
||||
- change secret
|
||||
- qr/config
|
||||
<img src="https://github.com/mercurykd/vpnbot/assets/30900414/411696d8-172a-4dac-b6b7-4a6da3adfab2" width="200">
|
||||
<img src="https://github.com/user-attachments/assets/d37b2e1c-f991-4e1c-8060-1b547eea8fe2" width="300">
|
||||
|
||||
### Settings
|
||||
- add/change admin
|
||||
@@ -63,10 +79,12 @@ telegram bot to manage servers (inside the bot)
|
||||
- import/export all settings
|
||||
- domain binding
|
||||
- obtain ssl for domain
|
||||
<img src="https://github.com/mercurykd/vpnbot/assets/30900414/431ec09d-9c14-4c74-b8f6-e49c142132e8" width="200">
|
||||
- fake html for domain
|
||||
- ports block
|
||||
<img src="https://github.com/user-attachments/assets/82b78014-eaa2-4b4c-bc90-77f58d03d57c" width="300">
|
||||
|
||||
---
|
||||
environment: ubuntu 18.04/20.04/22.04, debian 11/12
|
||||
environment: ubuntu 22.04/24.04, debian 11/12
|
||||
|
||||
### Install:
|
||||
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
19.12.2024 v1.115
|
||||
- генерация устойчивого пароля shadowsocks, если он равен test или пуст
|
||||
19.12.2024 v1.114
|
||||
- убран дефолтный пароль у shadowsocks
|
||||
13.12.2024 v1.113
|
||||
- обновлен adguardHome
|
||||
- фикс краша adg при удалении dns-upstream из бота
|
||||
10.12.2024 v1.112
|
||||
- mihomo: встроенные списки теперь отдаются через rule-providers(т.е подгружаются ядром без обновления конфига)
|
||||
- обновлены ядра
|
||||
|
||||
Reference in New Issue
Block a user