Compare commits

..

21 Commits

Author SHA1 Message Date
mercury 1d9d992361 sslip.io -> nip.io 2024-10-14 00:00:25 +04:00
mercury e1f14d85e0 порядок правил маршрутизации для singbox 2024-10-13 23:58:02 +04:00
mercury dc65e65e20 fix create windows service box 2 2024-10-10 00:19:59 +04:00
mercury 486a2c5959 fix create windows service box 2024-10-09 21:03:15 +04:00
mercury 39643bf681 add html fake from settings menu 2024-10-06 23:19:05 +04:00
mercury 5f1fc6d912 override html mock 2024-10-06 21:04:13 +04:00
mercury 0538d04397 sing-box template: block rule first 2024-10-06 20:49:24 +04:00
mercury af9933676d karing import url 2024-09-30 17:13:32 +04:00
mercury 7bfebe8096 fix unset warp key 2024-09-30 09:58:48 +04:00
mercury ae61a38dbc on/off warp-svc 2024-09-29 16:10:16 +04:00
mercury e727f6552c create singbox archive improve 2024-09-29 13:48:26 +04:00
mercury cfd500d48a update version 2024-09-23 23:44:32 +04:00
mercury ff87ee1055 latest docker compose 2024-09-23 23:11:02 +04:00
mercury 3375293be5 fix update start 2024-09-22 21:05:48 +04:00
mercury 6e5f198e23 switch endpoint for wg/amnezia 2024-09-22 14:31:10 +04:00
mercury b10aaff459 fix domain for cdn 2024-09-22 01:06:02 +04:00
mercury 3271561418 update version 2024-09-19 13:44:35 +04:00
mercury 295ee6f2aa fix nginx.conf init 2024-09-19 12:11:05 +04:00
mercury 7ce7c56c1b domain for links -> cdn for xray 2024-09-19 12:02:51 +04:00
mercury dca34de723 fix config menu 2024-09-17 20:36:51 +04:00
mercury eb1ad21c88 domain for links 2024-09-17 20:15:34 +04:00
18 changed files with 364 additions and 90 deletions
+2 -1
View File
@@ -19,4 +19,5 @@ mirror/.env
update/*
!update/update.sh
override.env
override.env
override.html
+233 -52
View File
@@ -145,9 +145,15 @@ class Bot
case preg_match('~^/appOutbound$~', $this->input['callback'], $m):
$this->appOutbound();
break;
case preg_match('~^/offWarp$~', $this->input['callback'], $m):
$this->offWarp();
break;
case preg_match('~^/addSubdomain$~', $this->input['callback'], $m):
$this->addSubdomain();
break;
case preg_match('~^/addLinkDomain$~', $this->input['callback'], $m):
$this->addLinkDomain();
break;
case preg_match('~^/id$~', $this->input['message'], $m):
$this->send($this->input['chat'], $this->input['from'], $this->input['message_id']);
break;
@@ -340,6 +346,9 @@ class Bot
case preg_match('~^/switchTorrent (\d+)$~', $this->input['callback'], $m):
$this->switchTorrent($m[1]);
break;
case preg_match('~^/switchEndpoint (\d+)$~', $this->input['callback'], $m):
$this->switchEndpoint($m[1]);
break;
case preg_match('~^/switchAmnezia (-?\d+)$~', $this->input['callback'], $m):
$this->switchAmnezia($m[1]);
break;
@@ -473,8 +482,8 @@ class Bot
case preg_match('~^/proxy$~', $this->input['callback'], $m):
$this->proxy();
break;
case preg_match('~^/showpac$~', $this->input['callback'], $m):
$this->showpac();
case preg_match('~^/addOverrideHtml$~', $this->input['callback'], $m):
$this->addOverrideHtml();
break;
case preg_match('~^/export$~', $this->input['callback'], $m):
$this->exportManual();
@@ -800,6 +809,30 @@ class Bot
];
}
public function addOverrideHtml()
{
$r = $this->send(
$this->input['chat'],
"@{$this->input['username']} attach html",
$this->input['message_id'],
reply: 'attach html',
);
$_SESSION['reply'][$r['result']['message_id']] = [
'start_message' => $this->input['message_id'],
'start_callback' => $this->input['callback_id'],
'callback' => 'setOverrideHtml',
'args' => [],
];
}
public function setOverrideHtml()
{
$r = $this->request('getFile', ['file_id' => $this->input['file_id']]);
if (!empty($f = file_get_contents($this->file . $r['result']['file_path']))) {
file_put_contents('/app/webapp/override.html', $f);
}
}
public function restartOcserv($conf)
{
file_put_contents('/config/ocserv.conf', $conf);
@@ -1534,6 +1567,14 @@ class Bot
$this->menu('wg', $page);
}
public function switchEndpoint($page = 0)
{
$c = $this->getPacConf();
$c[$this->getInstanceWG(1) . 'endpoint'] = $c[$this->getInstanceWG(1) . 'endpoint'] ? 0 : 1;
$this->setPacConf($c);
$this->menu('wg', $page);
}
public function iptablesWG()
{
$c = $this->getPacConf();
@@ -1598,7 +1639,7 @@ class Bot
{
$conf = $this->getPacConf();
$ip = $this->ip;
$domain = $conf['domain'] ?: $ip;
$domain = $this->getDomain();
$scheme = empty($ssl = $this->nginxGetTypeCert()) ? 'http' : 'https';
$ss = $this->getSSConfig();
$port = !empty($ss['plugin']) ? (!empty($ssl) ? 443 : 80) : getenv('SSPORT');
@@ -1735,7 +1776,7 @@ class Bot
{
$c = $this->getPacConf();
if (empty($c['domain'])) {
$this->addDomain(str_replace('.', '-', $this->ip) . '.sslip.io', 1);
$this->addDomain(str_replace('.', '-', $this->ip) . '.nip.io', 1);
$this->setSSL('letsencrypt');
} else {
$this->menu();
@@ -2085,10 +2126,41 @@ class Bot
];
}
public function addLinkDomain()
{
$r = $this->send(
$this->input['chat'],
"@{$this->input['username']} enter domain for link",
$this->input['message_id'],
reply: 'enter domain for link',
);
$_SESSION['reply'][$r['result']['message_id']] = [
'start_message' => $this->input['message_id'],
'callback' => 'setLinkDomain',
'args' => [],
];
}
public function setLinkDomain($text)
{
$c = $this->getPacConf();
if (empty($text)) {
unset($c['linkdomain']);
} else {
$c['linkdomain'] = trim($text);
}
$this->setPacConf($c);
$this->xray();
}
public function setSubdomain($text)
{
$c = $this->getPacConf();
$c['subdomain'] = array_filter(explode(',', $text), fn($e) => !empty(trim($e)));
if (empty($text)) {
unset($c['subdomain']);
} else {
$c['subdomain'] = array_filter(explode(',', $text), fn($e) => !empty(trim($e)));
}
$this->setPacConf($c);
$this->menu('config');
}
@@ -2641,6 +2713,7 @@ DNS-over-HTTPS with IP:
$dns = $c[$this->getInstanceWG(1) . 'dns'];
$mtu = $c[$this->getInstanceWG(1) . 'mtu'] ?: $this->mtu;
$am = $c[$this->getInstanceWG(1) . 'amnezia'];
$end = $c[$this->getInstanceWG(1) . 'endpoint'];
$data = [
[
[
@@ -2672,6 +2745,12 @@ DNS-over-HTTPS with IP:
'callback_data' => "/defaultMTU $page",
],
],
[
[
'text' => $this->i18n('endpoint') . ': ' . ($end ? $this->ip : $this->getDomain()),
'callback_data' => "/switchEndpoint $page",
],
],
[
[
'text' => $this->i18n('add peer'),
@@ -3238,7 +3317,7 @@ DNS-over-HTTPS with IP:
$mpac = stat(__DIR__ . '/zapretlists/mpac');
$pac = stat(__DIR__ . '/zapretlists/pac');
$conf = $this->getPacConf();
$ip = $conf['domain'] ?: $this->ip;
$ip = $this->getDomain();
$hash = substr(md5($this->key), 0, 8);
$scheme = empty($this->nginxGetTypeCert()) ? 'http' : 'https';
$text = <<<text
@@ -3650,7 +3729,7 @@ DNS-over-HTTPS with IP:
{
$conf = $this->getPacConf();
$ip = $this->ip;
$domain = $conf['domain'] ?: $ip;
$domain = $this->getDomain();
$scheme = empty($ssl = $this->nginxGetTypeCert()) ? 'http' : 'https';
$ss = $this->getSSConfig();
$v2ray = !empty($ss['plugin']) ? 'ON' : 'OFF';
@@ -3830,7 +3909,7 @@ DNS-over-HTTPS with IP:
{
$c = $this->getXray();
$pac = $this->getPacConf();
$domain = $pac['domain'] ?: $this->ip;
$domain = $this->getDomain($pac['transport'] == 'Websocket');
$scheme = empty($this->nginxGetTypeCert()) ? 'http' : 'https';
$hash = substr(md5($this->key), 0, 8);
$si = "$scheme://{$domain}/pac/" . base64_encode(serialize([
@@ -3904,8 +3983,9 @@ DNS-over-HTTPS with IP:
public function naiveMenu()
{
$pac = $this->getPacConf();
$domain = $this->getDomain();
$text[] = "Menu -> NaiveProxy";
$text[] = "<code>https://{$pac['naive']['user']}:{$pac['naive']['pass']}@np.{$pac['domain']}</code>";
$text[] = "<code>https://{$pac['naive']['user']}:{$pac['naive']['pass']}@np.$domain</code>";
$data[] = [
[
'text' => $this->i18n('change login'),
@@ -3997,6 +4077,7 @@ DNS-over-HTTPS with IP:
public function ocMenu()
{
$pac = $this->getPacConf();
$domain = $this->getDomain();
$ocserv = file_get_contents('/config/ocserv.conf');
preg_match('~^camouflage_secret[^\n]+?"([^"]+)*"~sm', $ocserv, $m);
$cs = $m[1];
@@ -4005,7 +4086,7 @@ DNS-over-HTTPS with IP:
$pass = htmlspecialchars($pac['ocserv']);
$text[] = "Menu -> OpenConnect";
if (!empty($m[1])) {
$text[] = "<code>https://oc.{$pac['domain']}/?$cs</code>";
$text[] = "<code>https://oc.$domain/?$cs</code>";
}
$text[] = "password: <span class='tg-spoiler'>$pass</span>";
$data[] = [
@@ -4225,7 +4306,7 @@ DNS-over-HTTPS with IP:
public function templates($type)
{
$pac = $this->getPacConf();
$domain = $pac['domain'] ?: $this->ip;
$domain = $this->getDomain();
$hash = substr(md5($this->key), 0, 8);
$text[] = "Menu -> " . $this->i18n('xray') . " -> $type templates";
$templates = $pac["{$type}templates"];
@@ -4293,6 +4374,12 @@ DNS-over-HTTPS with IP:
$text[] = "fake domain: <code>$fake</code>";
}
$text[] = 'transport: ' . ($p['transport'] ?: 'Reality');
$data[] = [
[
'text' => $p['linkdomain'] ?: $this->i18n('cdn'),
'callback_data' => '/addLinkDomain',
],
];
$data[] = [
[
'text' => $this->i18n('Reality') . ' ' . ($p['transport'] != 'Websocket' ? $this->i18n('on') : $this->i18n('off')),
@@ -4450,33 +4537,67 @@ DNS-over-HTTPS with IP:
public function addWarpPlus($key)
{
$c = $this->getPacConf();
$c['warp'] = $key;
$c = $this->getPacConf();
if (!empty($key)) {
$c['warp'] = $key;
$this->send($this->input['chat'], 'Warp registration license: ' . $this->ssh("warp-cli --accept-tos registration license $key 2>&1", 'wp'));
} else {
unset($c['warp']);
}
$this->setPacConf($c);
$this->send($this->input['chat'], 'Warp registration license: ' . $this->ssh("warp-cli --accept-tos registration license $key", 'wp'));
sleep(1);
$this->warp();
}
public function warpStatus()
{
$st = $this->ssh('curl -m 1 -x socks5://127.0.0.1:40000 https://cloudflare.com/cdn-cgi/trace', 'wp');
preg_match('~warp=(\w+)~', $st, $m);
return $m[1];
if (!empty($this->ssh('pgrep warp-svc', 'wp'))) {
$st = $this->ssh('curl -m 1 -x socks5://127.0.0.1:40000 https://cloudflare.com/cdn-cgi/trace', 'wp');
preg_match('~warp=(\w+)~', $st, $m);
return $m[1];
}
return 'off';
}
public function offWarp()
{
$p = $this->getPacConf();
if (empty($p['warpoff'])) {
$this->ssh('pkill warp-svc', 'wp');
$p['warpoff'] = 1;
} else {
$this->ssh('warp-svc > /dev/null 2>&1 &', 'wp');
sleep(3);
$this->send($this->input['chat'], 'Registration: ' . $this->ssh('warp-cli --accept-tos registration new 2>&1', 'wp'));
if (!empty($p['warp'])) {
$this->send($this->input['chat'], 'License: ' . $this->ssh("warp-cli --accept-tos registration license {$p['warp']} 2>&1", 'wp'));
}
$this->send($this->input['chat'], 'Proxy mode: ' . $this->ssh('warp-cli --accept-tos mode proxy 2>&1', 'wp'));
$this->send($this->input['chat'], 'Connect: ' . $this->ssh('warp-cli --accept-tos connect 2>&1', 'wp'));
unset($p['warpoff']);
}
$this->setPacConf($p);
$this->warp();
}
public function warp()
{
$p = $this->getPacConf();
$text[] = "Menu -> " . $this->i18n('warp');
$text[] = "status: " . $this->warpStatus();
$text[] = "key: " . $this->getPacConf()['warp'];
$data[] = [
[
'text' => $this->i18n($p['warpoff'] ? 'off' : 'on'),
'callback_data' => "/offWarp",
],
];
$data[] = [
[
'text' => $this->i18n('set key'),
'callback_data' => "/warpPlus",
],
];
$data[] = [
[
'text' => $this->i18n('back'),
@@ -4548,7 +4669,7 @@ DNS-over-HTTPS with IP:
{
$c = $this->getXray()['inbounds'][0]['settings']['clients'][$i];
$pac = $this->getPacConf();
$domain = $pac['domain'] ?: $this->ip;
$domain = $this->getDomain($pac['transport'] == 'Websocket');
$scheme = empty($this->nginxGetTypeCert()) ? 'http' : 'https';
$hash = substr(md5($this->key), 0, 8);
@@ -4560,14 +4681,27 @@ DNS-over-HTTPS with IP:
$text[] = "<a href='$scheme://{$domain}/pac?h=$hash&t=si&r=si&s={$c['id']}#{$c['email']}'>sing-box</a>";
$text[] = "<a href='$scheme://{$domain}/pac?h=$hash&t=s&r=st&s={$c['id']}#{$c['email']}'>streisand</a>";
$text[] = "<a href='$scheme://{$domain}/pac?h=$hash&t=si&r=h&s={$c['id']}#{$c['email']}'>hiddify</a>";
$text[] = "<a href='$scheme://{$domain}/pac?h=$hash&t=si&r=k&s={$c['id']}#{$c['email']}'>karing</a>";
$si = "$scheme://{$domain}/pac/" . base64_encode(serialize([
'h' => $hash,
't' => 'si',
's' => $c['id'],
]));
$xr = "$scheme://{$domain}/pac/" . base64_encode(serialize([
'h' => $hash,
't' => 's',
's' => $c['id'],
]));
$text[] = "\nxray config: <pre><code>$xr</code></pre>";
$text[] = "sing-box config: <pre><code>$si</code></pre>";
$text[] = "\nv2ray config: <pre><code>$scheme://{$domain}/pac?h=$hash&t=s&s={$c['id']}</code></pre>";
$text[] = "sing-box config: <pre><code>$scheme://{$domain}/pac?h=$hash&t=si&s={$c['id']}</code></pre>";
$text[] = "sing-box windows: <a href='$scheme://{$domain}/pac?h=$hash&t=si&r=w&s={$c['id']}'>windows service</a>";
$data[] = [
[
'text' => 'v2ray',
'text' => 'xray',
'web_app' => ['url' => "https://{$domain}/pac?h=$hash&t=s&s={$c['id']}"],
],
[
@@ -4635,17 +4769,26 @@ DNS-over-HTTPS with IP:
);
}
public function getDomain($cdn = false)
{
$c = $this->getPacConf();
if ($cdn && $c['linkdomain']) {
return $c['linkdomain'];
}
return $c['domain'] ?: $this->ip;
}
public function v2raySubscription($key, $fs = 0)
{
$pac = $this->getPacConf();
$domain = $pac['domain'] ?: $this->ip;
$domain = $this->getDomain();
$xr = $this->getXray();
$flag = true;
foreach ($xr['inbounds'][0]['settings']['clients'] as $k => $v) {
if ($v['id'] == $key) {
if (!empty($fs)) {
return $this->userXr($k, 0, 1);
return $this->userXr($k);
}
if (empty($v['off'])) {
$flag = false;
@@ -4678,7 +4821,7 @@ DNS-over-HTTPS with IP:
{
$type = $_GET['t'] == 's' ? 'v2ray' : 'sing';
$pac = $this->getPacConf();
$domain = $pac['domain'] ?: $this->ip;
$domain = $_GET['cdn'] ?: ($_SERVER['SERVER_NAME'] ?: $this->getDomain($pac['transport'] == 'Websocket'));
$xr = $this->getXray();
$scheme = empty($this->nginxGetTypeCert()) ? 'http' : 'https';
$hash = substr(md5($this->key), 0, 8);
@@ -4720,20 +4863,19 @@ DNS-over-HTTPS with IP:
case 'v':
header("Location: v2rayng://install-config?url=$v2");
exit;
case 'k':
header("Location: karing://install-config?url=$si");
exit;
case 'h':
header("Location: hiddify://install-config/?url=$si");
exit;
case 'w':
$link = htmlspecialchars($si, ENT_XML1, 'UTF-8');
file_put_contents('/singbox/winsw3.xml', preg_replace('#~url~#', $link, file_get_contents('/singbox/winsw3.xml')));
$n = "singbox_$uid.zip";
copy('/singbox/singbox.zip', $n);
$zip = new ZipArchive();
$n = "singbox_$uid.zip";
$zip->open($n, ZipArchive::CREATE | ZipArchive::OVERWRITE);
foreach (scandir('/singbox') as $k => $v) {
if (!empty(!in_array($v, ['.', '..']))) {
$zip->addFile("/singbox/$v", $v);
}
}
$zip->open($n, ZipArchive::CREATE);
$zip->addFromString('winsw3.xml', preg_replace('#~url~#', $link, file_get_contents('/singbox/winsw3.xml')));
$zip->close();
header('Content-Disposition: attachment; filename="singbox.zip"');
echo file_get_contents($n);
@@ -4759,7 +4901,7 @@ DNS-over-HTTPS with IP:
switch ($_GET['t']) {
case 's':
$c['outbounds'][0]['settings']['vnext'][0]['address'] = $_GET['cdn'] ?: $domain;
$c['outbounds'][0]['settings']['vnext'][0]['address'] = $domain;
$c['outbounds'][0]['settings']['vnext'][0]['users'][0] = [
'id' => $uid,
'encryption' => 'none',
@@ -4773,7 +4915,7 @@ DNS-over-HTTPS with IP:
],
"tlsSettings" => [
"allowInsecure" => false,
"serverName" => $_GET['cdn'] ?: $domain,
"serverName" => $domain,
"fingerprint" => "chrome"
]
];
@@ -4811,7 +4953,7 @@ DNS-over-HTTPS with IP:
$c['dns']['servers'][0]['address'] = "https://$domain/dns-query/$uid";
}
$c['outbounds'][0]['server'] = $_GET['cdn'] ?: $domain;
$c['outbounds'][0]['server'] = $domain;
$c['outbounds'][0]['uuid'] = $uid;
if ($pac['transport'] == 'Websocket') {
unset($c['outbounds'][0]['tls']['reality']);
@@ -4820,7 +4962,7 @@ DNS-over-HTTPS with IP:
"type" => "ws",
"path" => "/ws"
];
$c['outbounds'][0]['tls']['server_name'] = $_GET['cdn'] ?: $domain;
$c['outbounds'][0]['tls']['server_name'] = $domain;
} else {
unset($c['outbounds'][0]["transport"]);
$c['outbounds'][0]['flow'] = 'xtls-rprx-vision';
@@ -4840,7 +4982,8 @@ DNS-over-HTTPS with IP:
$c['route']['rules'] = array_values($c['route']['rules']);
$c['route'] = $this->addRuleSet($c['route']);
$c['route'] = $this->addPackageRule($c['route']);
$c['route'] = $this->createRuleSet($c['route'], $uid);
$c['route'] = $this->addProcessRule($c['route']);
$c['route'] = $this->createRuleSet($c['route'], $uid, $domain);
$c['route'] = $this->clearEmptyRules($c['route']);
break;
}
@@ -4862,12 +5005,36 @@ DNS-over-HTTPS with IP:
public function addPackageRule($route)
{
$p = $this->getPacConf();
if (!empty($t = array_filter($p['packagelist'] ?: []))) {
$route['rules'][] = [
'package_name' => array_keys($t),
'outbound' => $p['app_outbound'] ? 'direct' : 'proxy',
];
foreach ($route['rules'] as $k => $v) {
if (array_key_exists('package_name', $v)) {
$p = $this->getPacConf();
if (!empty($t = array_filter($p['packagelist'] ?: []))) {
$route['rules'][$k] = [
'package_name' => array_keys($t),
'outbound' => $p['app_outbound'] ? 'direct' : 'proxy',
];
} else {
unset($route['rules'][$k]);
}
}
}
return $route;
}
public function addProcessRule($route)
{
foreach ($route['rules'] as $k => $v) {
if (array_key_exists('process_name', $v)) {
$p = $this->getPacConf();
if (!empty($t = array_filter($p['processlist'] ?: []))) {
$route['rules'][$k] = [
'process_name' => array_keys($t),
'outbound' => $p['process_outbound'] ? 'direct' : 'proxy',
];
} else {
unset($route['rules'][$k]);
}
}
}
return $route;
}
@@ -4897,10 +5064,9 @@ DNS-over-HTTPS with IP:
return $route;
}
public function createRuleSet($route, $uid)
public function createRuleSet($route, $uid, $domain)
{
$pac = $this->getPacConf();
$domain = $pac['domain'] ?: $this->ip;
$scheme = empty($this->nginxGetTypeCert()) ? 'http' : 'https';
$hash = substr(md5($this->key), 0, 8);
@@ -4943,12 +5109,12 @@ DNS-over-HTTPS with IP:
}
$ruleset[] = [
"tag" => $r['name'],
"url" => "$scheme://{$domain}/pac?" . http_build_query([
"url" => "$scheme://{$domain}/pac/" . base64_encode(serialize([
'h' => $hash,
't' => 'si',
's' => $uid,
'r' => $r['name'],
]),
])),
"update_interval" => $r['interval'],
"type" => "remote",
"format" => "binary",
@@ -5117,7 +5283,7 @@ DNS-over-HTTPS with IP:
{
$conf = $this->getPacConf();
$ip = $this->ip;
$domain = $conf['domain'] ?: $ip;
$domain = $this->getDomain();
$scheme = empty($ssl = $this->nginxGetTypeCert()) ? 'http' : 'https';
$text = "$scheme://$domain/adguard\nLogin: admin\nPass: <span class='tg-spoiler'>{$conf['adpswd']}</span>\n\n";
if ($ssl) {
@@ -5221,6 +5387,15 @@ DNS-over-HTTPS with IP:
return openssl_x509_parse($c)["validTo_time_t"] ?: false;
}
public function domainsCert()
{
$domains = openssl_x509_parse(openssl_x509_read(file_get_contents("/certs/cert_public")))['extensions']["subjectAltName"];
if (empty($domains)) {
return false;
}
return implode("\n", array_map(fn($e) => trim($e), explode(',', str_replace('DNS:', '', $domains))));
}
public function updatebot()
{
$b = exec('git -C / rev-parse --abbrev-ref HEAD');
@@ -5283,7 +5458,7 @@ DNS-over-HTTPS with IP:
}
$text[] = $conf['domain'] ? "Domains:\n{$conf['domain']}\nnp.{$conf['domain']} (for naiveproxy)\noc.{$conf['domain']} (for openconnect)" . ($conf['adguardkey'] ? "\n{$conf['adguardkey']}.{$conf['domain']} (for adguard DoT)" : '') . $custom : $this->i18n('domain explain');
$ssl = $this->expireCert();
$text[] = $conf['domain'] ? "\nSSL: " . ($ssl ? date('Y-m-d H:i:s', $this->expireCert()) : 'none') : '';
$text[] = $conf['domain'] ? "\nSSL: " . ($ssl ? date('Y-m-d H:i:s', $this->expireCert()) . "\n" . $this->domainsCert() : 'none') : '';
$data = [
[
@@ -5292,7 +5467,7 @@ DNS-over-HTTPS with IP:
'callback_data' => $conf['domain'] ? '/deldomain' : '/domain',
],
[
'text' => $this->i18n('subdomain'),
'text' => $this->i18n('+ subdomain'),
'callback_data' => '/addSubdomain',
],
],
@@ -5391,6 +5566,12 @@ DNS-over-HTTPS with IP:
'callback_data' => "/backup",
],
];
$data[] = [
[
'text' => $this->i18n('fake html'),
'callback_data' => "/addOverrideHtml",
],
];
$data[] = [
[
'text' => $this->i18n('logs'),
@@ -5790,7 +5971,7 @@ DNS-over-HTTPS with IP:
$conf[] = '';
$conf[] = $peer['# PublicKey'] ? '# [Peer]' : '[Peer]';
if (!empty($peer['Endpoint'])) {
$peer['Endpoint'] = ($pac['domain'] ? $pac['domain'] : $this->ip) . ":" . getenv($this->getInstanceWG(1) ? 'WG1PORT' : 'WGPORT');
$peer['Endpoint'] = ($this->getPacConf()[$this->getInstanceWG(1) . 'endpoint'] ? $this->ip : $this->getDomain()) . ":" . getenv($this->getInstanceWG(1) ? 'WG1PORT' : 'WGPORT');
}
foreach ($peer as $k => $v) {
$conf[] = "$k = $v";
+4
View File
@@ -337,4 +337,8 @@ $i = [
'en' => '🟢 have updates',
'ru' => '🟢 есть обновления',
],
'fake html' => [
'en' => 'fake html',
'ru' => 'фейк заглушка',
],
];
+25 -2
View File
@@ -31,7 +31,7 @@ http {
location / {
root /app;
index login.html;
index override.html login.html;
try_files $uri $uri/ =404;
}
location /adguard/ {
@@ -48,6 +48,7 @@ http {
}
location /pac {
access_log /logs/nginx_pac_access;
proxy_set_header Host $http_host;
proxy_pass http://php;
}
location /tlgrm {
@@ -75,6 +76,27 @@ http {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_read_timeout 5d;
}
#-ssl
# # The DoH server block
# location /dns-query {
# access_log /logs/nginx_doh_access;
# # Proxy HTTP/1.1, clear the connection header to enable Keep-Alive
# proxy_http_version 1.1;
# proxy_set_header Connection "";
# proxy_set_header Host $host;
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-Proto https;
# proxy_set_header X-Forwarded-For $remote_addr;
# proxy_set_header X-Forwarded-Host $remote_addr;
# # Enable Cache, and set the cache_key to include the request_body
# proxy_cache doh_cache;
# proxy_cache_key $scheme$proxy_host$uri$is_args$args$request_body;
# # proxy pass to the dohloop upstream
# proxy_pass https://ad/dns-query;
# }
#-ssl
location ~\.well-known {
access_log /logs/nginx_certbot_access;
root /certs/;
@@ -101,7 +123,7 @@ http {
# location / {
# root /app;
# index login.html;
# index override.html login.html;
# try_files $uri $uri/ =404;
# }
# location /adguard/ {
@@ -118,6 +140,7 @@ http {
# }
# location /pac {
# access_log /logs/nginx_pac_access;
# proxy_set_header Host $http_host;
# proxy_pass http://php;
# }
# location ~\.well-known {
+25 -2
View File
@@ -31,7 +31,7 @@ http {
location / {
root /app;
index login.html;
index override.html login.html;
try_files $uri $uri/ =404;
}
location /adguard/ {
@@ -48,6 +48,7 @@ http {
}
location /pac {
access_log /logs/nginx_pac_access;
proxy_set_header Host $http_host;
proxy_pass http://php;
}
location /tlgrm {
@@ -75,6 +76,27 @@ http {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_read_timeout 5d;
}
#-ssl
# # The DoH server block
# location /dns-query {
# access_log /logs/nginx_doh_access;
# # Proxy HTTP/1.1, clear the connection header to enable Keep-Alive
# proxy_http_version 1.1;
# proxy_set_header Connection "";
# proxy_set_header Host $host;
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-Proto https;
# proxy_set_header X-Forwarded-For $remote_addr;
# proxy_set_header X-Forwarded-Host $remote_addr;
# # Enable Cache, and set the cache_key to include the request_body
# proxy_cache doh_cache;
# proxy_cache_key $scheme$proxy_host$uri$is_args$args$request_body;
# # proxy pass to the dohloop upstream
# proxy_pass https://ad/dns-query;
# }
#-ssl
location ~\.well-known {
access_log /logs/nginx_certbot_access;
root /certs/;
@@ -101,7 +123,7 @@ http {
# location / {
# root /app;
# index login.html;
# index override.html login.html;
# try_files $uri $uri/ =404;
# }
# location /adguard/ {
@@ -118,6 +140,7 @@ http {
# }
# location /pac {
# access_log /logs/nginx_pac_access;
# proxy_set_header Host $http_host;
# proxy_pass http://php;
# }
# location ~\.well-known {
+24 -14
View File
@@ -110,6 +110,30 @@
"protocol": "dns",
"outbound": "dns-out"
},
{
"package_name": [
],
"outbound": "proxy"
},
{
"process_name": [
],
"outbound": "proxy"
},
{
"createruleset": [
{
"name": "block",
"interval": "15s",
"rules": [
{
"domain_suffix": "~block~"
}
]
}
],
"outbound": "block"
},
{
"createruleset": [
{
@@ -133,20 +157,6 @@
],
"outbound": "proxy"
},
{
"createruleset": [
{
"name": "block",
"interval": "15s",
"rules": [
{
"domain_suffix": "~block~"
}
]
}
],
"outbound": "block"
},
{
"outbound": "direct"
}
+5 -1
View File
@@ -16,7 +16,11 @@ echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]') \
$(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
apt update
apt install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
apt install -y docker-ce docker-ce-cli containerd.io
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
mkdir -p $DOCKER_CONFIG/cli-plugins
curl -SL https://github.com/docker/compose/releases/download/v2.29.6/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
git clone https://github.com/mercurykd/vpnbot.git
cd ./vpnbot
echo "<?php
+11 -7
View File
@@ -1,14 +1,18 @@
cat /ssh/key.pub > /root/.ssh/authorized_keys
ssh-keygen -A
exec /usr/sbin/sshd -D -e "$@" &
warp-svc > /dev/null &
sleep 3
warp-cli --accept-tos registration new
off=$(cat /config/pac.json | jq -r .warpoff)
key=$(cat /config/pac.json | jq -r .warp)
if [ ! -z "$key" ]
if [ "$off" == 'null' ]
then
warp-cli --accept-tos registration license $key
warp-svc > /dev/null &
sleep 3
warp-cli --accept-tos registration new
if [ ! -z "$key" ]
then
warp-cli --accept-tos registration license $key
fi
warp-cli --accept-tos mode proxy
warp-cli --accept-tos connect
fi
warp-cli --accept-tos mode proxy
warp-cli --accept-tos connect
socat TCP-LISTEN:4000,fork TCP:127.0.0.1:40000
-2
View File
@@ -1,2 +0,0 @@
winsw3.exe install
pause
-2
View File
@@ -1,2 +0,0 @@
winsw3.exe stop
winsw3.exe start
Binary file not shown.
-1
View File
@@ -1 +0,0 @@
winsw3.exe start
-2
View File
@@ -1,2 +0,0 @@
winsw3.exe status
pause
-1
View File
@@ -1 +0,0 @@
winsw3.exe stop
-2
View File
@@ -1,2 +0,0 @@
winsw3.exe uninstall
pause
+1 -1
View File
@@ -24,7 +24,7 @@ do
curl -H "Content-Type: application/json" -X POST https://api.telegram.org/bot$key/editMessageText -d "$(cat $pwd/update/curl | sed 's/"text":"~t~"/"text": "применяю обновления"/')"
git pull > ./update/message
curl -H "Content-Type: application/json" -X POST https://api.telegram.org/bot$key/editMessageText -d "$(cat $pwd/update/curl | sed 's/"text":"~t~"/"text": "запускаю бота"/')"
IP=$(curl https://ipinfo.io/ip) VER=$(git describe --tags) docker compose up -d --force-recreate
IP=$(curl ipinfo.io/ip) VER=$(git describe --tags) docker compose --env-file ./.env --env-file ./override.env up -d --force-recreate
bash $pwd/update/update.sh &
> $pwd/update/key
> $pwd/update/curl
+34
View File
@@ -1,3 +1,37 @@
13.10.2024 v1.67
- sslip.io -> nip.io
13.10.2024 v1.66
- singbox template: изменен порядок правил маршрутизации для package_name
10.10.2024 v1.65.1
- фикс создания архива windows service singbox 2
09.10.2024 v1.65
- фикс создания архива windows service singbox
06.10.2024 v1.64.1
- добавление html заглушки через меню
06.10.2024 v1.64
- возможность установить свою html-заглушку
06.10.2024 v1.63
- приоритет правила block над остальными в стандартном шаблоне sing-box
30.09.2024 v1.62
- импорт профиля xray в karing
30.09.2024 v1.61.1
- фикс удаления ключа варпа через ноль
29.09.2024 v1.61
- включение/отключение процесса warp
29.09.2024 v1.60
- ускорение сборки архива sing-box windows
23.09.2024 v1.59
- docker compose v2.29.6 (при установке бота)
22.09.2024 v1.58
- фикс запуска бота с правильными параметрами после обновления
22.09.2024 v1.57
- выбор типа endpoint для wireguard/amnezia
22.09.2024 v1.56.2
- фикс разных доменов при указании cdn для xray
19.09.2024 v1.56.1
- cdn для xray
17.09.2024 v1.55
- возможность подменить домен в ссылках на конфиги
16.09.2024 v1.54.2
- фикс нэйминга клиентов в adguardHome: замена на uuid
16.09.2024 v1.54.1