Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 95c5b5b8fd | |||
| efbe20485a | |||
| 475eea1f47 | |||
| 02d9cdcccc | |||
| d633799f11 | |||
| ead66c3951 | |||
| bd7742d8b2 | |||
| ac593629a8 |
+81
-3
@@ -358,12 +358,18 @@ class Bot
|
||||
case preg_match('~^/changeCamouflage$~', $this->input['callback'], $m):
|
||||
$this->changeCamouflage();
|
||||
break;
|
||||
case preg_match('~^/changeOcDomain$~', $this->input['callback'], $m):
|
||||
$this->changeOcDomain();
|
||||
break;
|
||||
case preg_match('~^/changeOcPass$~', $this->input['callback'], $m):
|
||||
$this->changeOcPass();
|
||||
break;
|
||||
case preg_match('~^/changeNaiveUser$~', $this->input['callback'], $m):
|
||||
$this->changeNaiveUser();
|
||||
break;
|
||||
case preg_match('~^/changeNaiveSubdomain$~', $this->input['callback'], $m):
|
||||
$this->changeNaiveSubdomain();
|
||||
break;
|
||||
case preg_match('~^/changeNaivePass$~', $this->input['callback'], $m):
|
||||
$this->changeNaivePass();
|
||||
break;
|
||||
@@ -816,7 +822,7 @@ class Bot
|
||||
$this->input['chat'],
|
||||
"@{$this->input['username']} enter camouflage key",
|
||||
$this->input['message_id'],
|
||||
reply: 'enter password',
|
||||
reply: 'enter camouflage key',
|
||||
);
|
||||
$_SESSION['reply'][$r['result']['message_id']] = [
|
||||
'start_message' => $this->input['message_id'],
|
||||
@@ -826,6 +832,22 @@ class Bot
|
||||
];
|
||||
}
|
||||
|
||||
public function changeOcDomain()
|
||||
{
|
||||
$r = $this->send(
|
||||
$this->input['chat'],
|
||||
"@{$this->input['username']} enter subdomain",
|
||||
$this->input['message_id'],
|
||||
reply: 'enter subdomain',
|
||||
);
|
||||
$_SESSION['reply'][$r['result']['message_id']] = [
|
||||
'start_message' => $this->input['message_id'],
|
||||
'start_callback' => $this->input['callback_id'],
|
||||
'callback' => 'chOcSubdomain',
|
||||
'args' => [],
|
||||
];
|
||||
}
|
||||
|
||||
public function changeOcDns()
|
||||
{
|
||||
$r = $this->send(
|
||||
@@ -864,7 +886,7 @@ class Bot
|
||||
$this->input['chat'],
|
||||
"@{$this->input['username']} enter login",
|
||||
$this->input['message_id'],
|
||||
reply: 'enter password',
|
||||
reply: 'enter login',
|
||||
);
|
||||
$_SESSION['reply'][$r['result']['message_id']] = [
|
||||
'start_message' => $this->input['message_id'],
|
||||
@@ -874,6 +896,22 @@ class Bot
|
||||
];
|
||||
}
|
||||
|
||||
public function changeNaiveSubdomain()
|
||||
{
|
||||
$r = $this->send(
|
||||
$this->input['chat'],
|
||||
"@{$this->input['username']} enter subdomain",
|
||||
$this->input['message_id'],
|
||||
reply: 'enter subdomain',
|
||||
);
|
||||
$_SESSION['reply'][$r['result']['message_id']] = [
|
||||
'start_message' => $this->input['message_id'],
|
||||
'start_callback' => $this->input['callback_id'],
|
||||
'callback' => 'chNpSubdomain',
|
||||
'args' => [],
|
||||
];
|
||||
}
|
||||
|
||||
public function changeNaivePass()
|
||||
{
|
||||
$r = $this->send(
|
||||
@@ -987,6 +1025,34 @@ class Bot
|
||||
$this->menu('oc');
|
||||
}
|
||||
|
||||
public function chOcSubdomain($domain)
|
||||
{
|
||||
$pac = $this->getPacConf();
|
||||
if (empty($domain)) {
|
||||
unset($pac["oc_domain"]);
|
||||
} else {
|
||||
$pac["oc_domain"] = $domain;
|
||||
}
|
||||
$this->setPacConf($pac);
|
||||
$this->chocdomain($pac['domain']);
|
||||
$this->setUpstreamDomainOcserv($pac['domain']);
|
||||
$this->menu('oc');
|
||||
}
|
||||
|
||||
public function chNpSubdomain($domain)
|
||||
{
|
||||
$pac = $this->getPacConf();
|
||||
if (!empty($data)) {
|
||||
unset($pac['np_domain']);
|
||||
} else {
|
||||
$pac['np_domain'] = $domain;
|
||||
}
|
||||
$this->setPacConf($pac);
|
||||
$this->restartNaive();
|
||||
$this->setUpstreamDomainNaive($pac['domain']);
|
||||
$this->menu('naive');
|
||||
}
|
||||
|
||||
public function chnplogin($user)
|
||||
{
|
||||
$pac = $this->getPacConf();
|
||||
@@ -4823,6 +4889,12 @@ DNS-over-HTTPS with IP:
|
||||
$text[] = "Menu -> NaiveProxy";
|
||||
$np = $this->getHashSubdomain('np');
|
||||
$text[] = "<code>https://{$pac['naive']['user']}:{$pac['naive']['pass']}@$np.$domain</code>";
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n('change subdomain'),
|
||||
'callback_data' => "/changeNaiveSubdomain",
|
||||
],
|
||||
];
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n('change login'),
|
||||
@@ -4926,6 +4998,12 @@ DNS-over-HTTPS with IP:
|
||||
$text[] = "<code>https://$oc.$domain/?$cs</code>";
|
||||
}
|
||||
$text[] = "password: <span class='tg-spoiler'>$pass</span>";
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n('change subdomain'),
|
||||
'callback_data' => "/changeOcDomain",
|
||||
],
|
||||
];
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n('change secret'),
|
||||
@@ -6386,7 +6464,7 @@ DNS-over-HTTPS with IP:
|
||||
|
||||
public function getHashSubdomain($subdomain)
|
||||
{
|
||||
return substr(hash('sha256', "$subdomain{$this->key}"), 0, 8);
|
||||
return $this->getPacConf()["{$subdomain}_domain"] ?: substr(hash('sha256', "$subdomain{$this->key}"), 0, 8);
|
||||
}
|
||||
|
||||
public function addWg($page)
|
||||
|
||||
+2
-2
@@ -9,7 +9,7 @@
|
||||
"tag": "tun-in",
|
||||
"domain_strategy": "prefer_ipv4",
|
||||
"interface_name": "sing-tun",
|
||||
"inet4_address": "172.19.0.1\/30",
|
||||
"address": ["172.19.0.1\/30"],
|
||||
"mtu": 1400,
|
||||
"gso": true,
|
||||
"auto_route": true,
|
||||
@@ -192,4 +192,4 @@
|
||||
],
|
||||
"final": "direct"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
+11
-2
@@ -1,5 +1,14 @@
|
||||
#!/bin/bash
|
||||
pwd=`pwd`
|
||||
process_name="$pwd/update/update.sh"
|
||||
current_pid=$$
|
||||
pids=$(pgrep -f $process_name)
|
||||
for pid in $pids; do
|
||||
if [ $pid -ne $current_pid ]; then
|
||||
kill -9 $pid
|
||||
fi
|
||||
done
|
||||
|
||||
> $pwd/update/pipe
|
||||
echo "$$" > $pwd/update/update_pid
|
||||
|
||||
@@ -27,10 +36,10 @@ do
|
||||
git pull > ./update/message
|
||||
fi
|
||||
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": "launching the bot"/')"
|
||||
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
|
||||
IP=$(curl -s -t 1 2ip.io || curl -s -t 1 ipinfo.io/ip || curl -s -t 1 ifconfig.me) VER=$(git describe --tags) docker compose --env-file ./.env --env-file ./override.env up -d --force-recreate
|
||||
bash $pwd/update/update.sh &
|
||||
exit 0
|
||||
fi
|
||||
sleep 1
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
26.12.2024 v2.2
|
||||
- возможность менять поддомен для naive/openconnect
|
||||
26.12.2024 v2.1
|
||||
- обновление версии singbox и конфига под него
|
||||
22.12.2024 v2.0
|
||||
!!! версия не совместима с предыдущими, возможно прийдется накатывать руками. старые конфиги (кроме вг) не будут работать! перед обновлением:
|
||||
- включить все порты или удалить docker-compose.override.yml
|
||||
|
||||
Reference in New Issue
Block a user