fixes for first launch
This commit is contained in:
+37
-2
@@ -1760,10 +1760,14 @@ class Bot
|
|||||||
$this->adguardProtect();
|
$this->adguardProtect();
|
||||||
$u = $this->ssh("nginx -t 2>&1", 'ng');
|
$u = $this->ssh("nginx -t 2>&1", 'ng');
|
||||||
$out[] = $u;
|
$out[] = $u;
|
||||||
|
if (empty($nomenu)) {
|
||||||
$this->update($this->input['chat'], $this->input['message_id'], implode("\n", $out));
|
$this->update($this->input['chat'], $this->input['message_id'], implode("\n", $out));
|
||||||
|
}
|
||||||
if (preg_match('~test is successful~', $u)) {
|
if (preg_match('~test is successful~', $u)) {
|
||||||
$out[] = $this->ssh("nginx -s reload 2>&1", 'ng');
|
$out[] = $this->ssh("nginx -s reload 2>&1", 'ng');
|
||||||
|
if (empty($nomenu)) {
|
||||||
$this->update($this->input['chat'], $this->input['message_id'], implode("\n", $out));
|
$this->update($this->input['chat'], $this->input['message_id'], implode("\n", $out));
|
||||||
|
}
|
||||||
$this->setPacConf($conf);
|
$this->setPacConf($conf);
|
||||||
$this->chocdomain($domain);
|
$this->chocdomain($domain);
|
||||||
$this->setUpstreamDomainOcserv($domain);
|
$this->setUpstreamDomainOcserv($domain);
|
||||||
@@ -5734,13 +5738,44 @@ DNS-over-HTTPS with IP:
|
|||||||
$this->logs();
|
$this->logs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function selfUpdate()
|
||||||
|
{
|
||||||
|
require __DIR__ . '/config.php';
|
||||||
|
if (!empty($c['admin'])) {
|
||||||
|
$ip = getenv('IP');
|
||||||
|
$rm = explode(':', trim(file_get_contents('/update/reload_message')));
|
||||||
|
$m = file_get_contents('/update/message');
|
||||||
|
foreach ($c['admin'] as $k => $v) {
|
||||||
|
$r = $this->send($v, "start $ip");
|
||||||
|
$this->input['chat'] = $v;
|
||||||
|
$this->input['message_id'] = $r['result']['message_id'];
|
||||||
|
if (file_exists($this->update)) {
|
||||||
|
if (!empty($m)) {
|
||||||
|
$this->send($v, "<pre>$m</pre>", $v == $rm[0] ? $rm[1] : 0);
|
||||||
|
}
|
||||||
|
$r = $this->send($v, "import settings");
|
||||||
|
$this->input['chat'] = $v;
|
||||||
|
$this->input['message_id'] = $r['result']['message_id'];
|
||||||
|
$this->input['callback_id'] = $r['result']['message_id'];
|
||||||
|
if (empty($flag)) {
|
||||||
|
$this->importFile($this->update);
|
||||||
|
unlink($this->update);
|
||||||
|
$flag = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_put_contents('/update/message', '');
|
||||||
|
file_put_contents('/update/reload_message', '');
|
||||||
|
}
|
||||||
|
|
||||||
public function backup()
|
public function backup()
|
||||||
{
|
{
|
||||||
$r = $this->send(
|
$r = $this->send(
|
||||||
$this->input['chat'],
|
$this->input['chat'],
|
||||||
"@{$this->input['username']} enter like start / period",
|
"@{$this->input['username']} enter like: start / period",
|
||||||
$this->input['message_id'],
|
$this->input['message_id'],
|
||||||
reply: 'enter like now / 12:00',
|
reply: 'enter like: now / 12 hours',
|
||||||
);
|
);
|
||||||
$_SESSION['reply'][$r['result']['message_id']] = [
|
$_SESSION['reply'][$r['result']['message_id']] = [
|
||||||
'start_message' => $this->input['message_id'],
|
'start_message' => $this->input['message_id'],
|
||||||
|
|||||||
+1
-2
@@ -7,5 +7,4 @@ require __DIR__ . '/bot.php';
|
|||||||
require __DIR__ . '/config.php';
|
require __DIR__ . '/config.php';
|
||||||
require __DIR__ . '/i18n.php';
|
require __DIR__ . '/i18n.php';
|
||||||
|
|
||||||
$bot = new Bot($c['key'], $i);
|
(new Bot($c['key'], $i))->cron();
|
||||||
$bot->cron();
|
|
||||||
|
|||||||
+5
-4
@@ -10,8 +10,9 @@ if ($c['debug']) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$bot = new Bot($c['key'], $i);
|
$bot = new Bot($c['key'], $i);
|
||||||
$bot->adguardProtect();
|
|
||||||
$bot->adguardCheckPswd();
|
|
||||||
$bot->setcommands();
|
|
||||||
$bot->syncPortClients();
|
|
||||||
$bot->setwebhook();
|
$bot->setwebhook();
|
||||||
|
$bot->selfUpdate();
|
||||||
|
$bot->adguardCheckPswd();
|
||||||
|
$bot->adguardProtect();
|
||||||
|
$bot->syncPortClients();
|
||||||
|
$bot->setcommands();
|
||||||
|
|||||||
@@ -12,32 +12,6 @@ if ($c['debug']) {
|
|||||||
|
|
||||||
$bot = new Bot($c['key'], $i);
|
$bot = new Bot($c['key'], $i);
|
||||||
|
|
||||||
if (!empty($c['admin'])) {
|
|
||||||
$ip = getenv('IP');
|
|
||||||
$rm = explode(':', trim(file_get_contents('/update/reload_message')));
|
|
||||||
$m = file_get_contents('/update/message');
|
|
||||||
foreach ($c['admin'] as $k => $v) {
|
|
||||||
$r = $bot->send($v, "start $ip");
|
|
||||||
$bot->input['chat'] = $v;
|
|
||||||
$bot->input['message_id'] = $r['result']['message_id'];
|
|
||||||
if (file_exists($bot->update)) {
|
|
||||||
if (!empty($m)) {
|
|
||||||
$bot->send($v, "<pre>$m</pre>", $v == $rm[0] ? $rm[1] : 0);
|
|
||||||
}
|
|
||||||
$r = $bot->send($v, "import settings");
|
|
||||||
$bot->input['chat'] = $v;
|
|
||||||
$bot->input['message_id'] = $r['result']['message_id'];
|
|
||||||
$bot->input['callback_id'] = $r['result']['message_id'];
|
|
||||||
if (empty($flag)) {
|
|
||||||
$bot->importFile($bot->update);
|
|
||||||
unlink($bot->update);
|
|
||||||
$flag = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
file_put_contents('/update/message', '');
|
|
||||||
file_put_contents('/update/reload_message', '');
|
|
||||||
$bot->restartTG();
|
$bot->restartTG();
|
||||||
$bot->sslip();
|
$bot->sslip();
|
||||||
$bot->cleanDocker();
|
$bot->cleanDocker();
|
||||||
|
|||||||
+1
-99
@@ -1,99 +1 @@
|
|||||||
{
|
{}
|
||||||
"zapret": false,
|
|
||||||
"excludelist": {
|
|
||||||
"(?:v|w)ul(?:c|k)an": true,
|
|
||||||
"^\\d": true,
|
|
||||||
"^a\\w-": true,
|
|
||||||
"^admiral": true,
|
|
||||||
"^avtomaty": true,
|
|
||||||
"^azart": true,
|
|
||||||
"^azimob": true,
|
|
||||||
"^baltplay": true,
|
|
||||||
"a(?:s|z)ino": true,
|
|
||||||
"adrenalin": true,
|
|
||||||
"alco": true,
|
|
||||||
"bet": true,
|
|
||||||
"prostitut": true,
|
|
||||||
"zenit": true,
|
|
||||||
"zerkalo": true,
|
|
||||||
"777": true
|
|
||||||
},
|
|
||||||
"includelist": {},
|
|
||||||
"reverselist": {},
|
|
||||||
"subzoneslist": {
|
|
||||||
"3dn": false,
|
|
||||||
"3nx": true,
|
|
||||||
"akadns": true,
|
|
||||||
"appspot": true,
|
|
||||||
"azurewebsites": true,
|
|
||||||
"beget": true,
|
|
||||||
"berlogovo": true,
|
|
||||||
"biz": true,
|
|
||||||
"brightcove": true,
|
|
||||||
"cc": true,
|
|
||||||
"cloudfront": true,
|
|
||||||
"co": true,
|
|
||||||
"com": true,
|
|
||||||
"cu": true,
|
|
||||||
"ddns": true,
|
|
||||||
"deviantart": true,
|
|
||||||
"dn": true,
|
|
||||||
"dp": true,
|
|
||||||
"dyndns": true,
|
|
||||||
"edgecastcdn": true,
|
|
||||||
"edu": true,
|
|
||||||
"eu": true,
|
|
||||||
"fastly": true,
|
|
||||||
"force": true,
|
|
||||||
"github": true,
|
|
||||||
"google": true,
|
|
||||||
"googleusercontent": true,
|
|
||||||
"gov": true,
|
|
||||||
"herokuapp": true,
|
|
||||||
"hldns": true,
|
|
||||||
"ho": true,
|
|
||||||
"hopto": true,
|
|
||||||
"hwcdn": true,
|
|
||||||
"i": true,
|
|
||||||
"iboards": true,
|
|
||||||
"in": true,
|
|
||||||
"info": true,
|
|
||||||
"int": true,
|
|
||||||
"itch": true,
|
|
||||||
"keenetic": true,
|
|
||||||
"kiev": true,
|
|
||||||
"kirov": true,
|
|
||||||
"linode": true,
|
|
||||||
"livejournal": true,
|
|
||||||
"maryno": true,
|
|
||||||
"mil": true,
|
|
||||||
"msk": true,
|
|
||||||
"my1": true,
|
|
||||||
"mybb2": true,
|
|
||||||
"ne": true,
|
|
||||||
"net": true,
|
|
||||||
"netdna-ssl": true,
|
|
||||||
"nnov": true,
|
|
||||||
"notion": true,
|
|
||||||
"nov": true,
|
|
||||||
"od": true,
|
|
||||||
"org": true,
|
|
||||||
"pp": true,
|
|
||||||
"pximg": true,
|
|
||||||
"pythonanywhere": true,
|
|
||||||
"ru": true,
|
|
||||||
"scaleway": true,
|
|
||||||
"sl": true,
|
|
||||||
"sl-reverse": true,
|
|
||||||
"spb": true,
|
|
||||||
"tilda": true,
|
|
||||||
"trafficmanager": true,
|
|
||||||
"tut": true,
|
|
||||||
"u-stream": true,
|
|
||||||
"ucoz": true,
|
|
||||||
"v": true,
|
|
||||||
"vercel": true,
|
|
||||||
"wix": true,
|
|
||||||
"wixmp": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
+3
-2
@@ -33,7 +33,8 @@ services:
|
|||||||
- ./config/sshd_config:/etc/ssh/sshd_config
|
- ./config/sshd_config:/etc/ssh/sshd_config
|
||||||
- ./logs/:/logs/
|
- ./logs/:/logs/
|
||||||
ports:
|
ports:
|
||||||
- 443:443
|
- 443:443/tcp
|
||||||
|
- 443:443/udp
|
||||||
hostname: upstream
|
hostname: upstream
|
||||||
container_name: upstream-${VER}
|
container_name: upstream-${VER}
|
||||||
depends_on:
|
depends_on:
|
||||||
@@ -127,7 +128,7 @@ services:
|
|||||||
required: false
|
required: false
|
||||||
hostname: php
|
hostname: php
|
||||||
container_name: php-${VER}
|
container_name: php-${VER}
|
||||||
restart: unless-stopped
|
# restart: unless-stopped
|
||||||
stop_grace_period: 1s
|
stop_grace_period: 1s
|
||||||
command: ["/bin/sh", "/start_php.sh"]
|
command: ["/bin/sh", "/start_php.sh"]
|
||||||
working_dir: /app
|
working_dir: /app
|
||||||
|
|||||||
@@ -2,8 +2,12 @@ rm /ssh/key*
|
|||||||
ssh-keygen -m PEM -t rsa -f /ssh/key -N ''
|
ssh-keygen -m PEM -t rsa -f /ssh/key -N ''
|
||||||
openssl req -newkey rsa:2048 -sha256 -nodes -x509 -days 365 -keyout /certs/self_private -out /certs/self_public -subj "/C=NN/ST=N/L=N/O=N/CN=$IP"
|
openssl req -newkey rsa:2048 -sha256 -nodes -x509 -days 365 -keyout /certs/self_private -out /certs/self_public -subj "/C=NN/ST=N/L=N/O=N/CN=$IP"
|
||||||
php init.php
|
php init.php
|
||||||
|
if [[ -f "/start" && -f "/ssh/key.pub" && -s "/ssh/key.pub" ]]; then
|
||||||
php cron.php &
|
php cron.php &
|
||||||
unitd --log /logs/unit_error
|
unitd --log /logs/unit_error
|
||||||
curl -X PUT --data-binary @/config/unit.json --unix-socket /var/run/control.unit.sock http://localhost/config
|
curl -X PUT --data-binary @/config/unit.json --unix-socket /var/run/control.unit.sock http://localhost/config
|
||||||
pkill unitd
|
pkill unitd
|
||||||
unitd --no-daemon --control 0.0.0.0:8080 --log /logs/unit_error
|
unitd --no-daemon --control 0.0.0.0:8080 --log /logs/unit_error
|
||||||
|
else
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
21.10.2024 v1.71
|
||||||
|
- фикс установки nip.io при первом запуске
|
||||||
|
- фикс инициализации вебпанели adguardHome при первом запуске
|
||||||
14.10.2024 v1.70
|
14.10.2024 v1.70
|
||||||
- xray route: учет регистра в process_name, package_name
|
- xray route: учет регистра в process_name, package_name
|
||||||
14.10.2024 v1.69
|
14.10.2024 v1.69
|
||||||
|
|||||||
Reference in New Issue
Block a user