Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4082dac97b | |||
| 7317d418de | |||
| b7a1f9bbd6 | |||
| fcc165b4be | |||
| a9d16eadce |
+19
-5
@@ -5,6 +5,7 @@ class Bot
|
||||
public $input;
|
||||
public $adguard;
|
||||
public $update;
|
||||
public $ip;
|
||||
|
||||
public function __construct($key, $i18n)
|
||||
{
|
||||
@@ -1451,7 +1452,7 @@ class Bot
|
||||
}
|
||||
}
|
||||
|
||||
public function addDomain($domain)
|
||||
public function addDomain($domain, $nomenu = false)
|
||||
{
|
||||
$domain = trim($domain);
|
||||
if (!empty($domain)) {
|
||||
@@ -1478,8 +1479,21 @@ class Bot
|
||||
file_put_contents('/config/nginx.conf', $nginx);
|
||||
}
|
||||
}
|
||||
sleep(3);
|
||||
$this->menu('config');
|
||||
if (empty($nomenu)) {
|
||||
sleep(3);
|
||||
$this->menu('config');
|
||||
}
|
||||
}
|
||||
|
||||
public function sslip()
|
||||
{
|
||||
$c = $this->getPacConf();
|
||||
if (empty($c['domain'])) {
|
||||
$this->addDomain(str_replace('.', '-', $this->ip) . '.sslip.io', 1);
|
||||
$this->setSSL('letsencrypt');
|
||||
} else {
|
||||
$this->menu();
|
||||
}
|
||||
}
|
||||
|
||||
public function comment($text, $tag)
|
||||
@@ -3091,7 +3105,7 @@ DNS-over-HTTPS with IP:
|
||||
[
|
||||
'text' => $this->i18n('donate'),
|
||||
'web_app' => [
|
||||
'url' => "https://yoomoney.ru/to/410011827900450",
|
||||
'url' => "https://www.donationalerts.com/r/mercurykd",
|
||||
]
|
||||
],
|
||||
],
|
||||
@@ -3507,7 +3521,7 @@ DNS-over-HTTPS with IP:
|
||||
$ip = $this->ip;
|
||||
$domain = $conf['domain'] ?: $ip;
|
||||
$scheme = empty($ssl = $this->nginxGetTypeCert()) ? 'http' : 'https';
|
||||
$text = $conf['adgbrowser'] ? "$scheme://$domain/adguard\nLogin: admin\nPass: <span class='tg-spoiler'>{$conf['adpswd']}</span>\n\n" : '';
|
||||
$text = "$scheme://$domain/adguard\nLogin: admin\nPass: <span class='tg-spoiler'>{$conf['adpswd']}</span>\n\n";
|
||||
if ($ssl) {
|
||||
$text .= "DNS over HTTPS:\n<code>$ip</code>\n<code>$scheme://$domain/dns-query" . ($conf['adguardkey'] ? "/{$conf['adguardkey']}" : '') . "</code>\n\n";
|
||||
$text .= "DNS over TLS:\n<code>tls://" . ($conf['adguardkey'] ? "{$conf['adguardkey']}." : '') . "$domain</code>";
|
||||
|
||||
+1
-1
@@ -35,4 +35,4 @@ if (!empty($c['admin'])) {
|
||||
}
|
||||
file_put_contents('/update/message', '');
|
||||
file_put_contents('/update/reload_message', '');
|
||||
$bot->menu();
|
||||
$bot->sslip();
|
||||
|
||||
@@ -2,7 +2,8 @@ b:
|
||||
docker compose build
|
||||
u: # запуск контейнеров
|
||||
bash ./update/update.sh &
|
||||
IP=$(shell curl https://ipinfo.io/ip) VER=$(shell git describe --tags) docker compose up -d --force-recreate
|
||||
touch ./override.env
|
||||
IP=$(shell curl https://ipinfo.io/ip) VER=$(shell git describe --tags) docker compose --env-file ./.env --env-file ./override.env up -d --force-recreate
|
||||
d: # остановка контейнеров
|
||||
-kill -9 $(shell cat ./update/update_pid) > /dev/null
|
||||
docker compose down --remove-orphans
|
||||
|
||||
@@ -6,7 +6,8 @@ After=docker.service
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
WorkingDirectory=path
|
||||
ExecStart=/bin/sh -c "IP=$(curl https://ipinfo.io/ip) VER=$(git describe --tags) docker compose up -d --force-recreate"
|
||||
ExecStartPre=/bin/sh -c "touch ./override.env"
|
||||
ExecStart=/bin/sh -c "IP=$(curl https://ipinfo.io/ip) VER=$(git describe --tags) docker compose --env-file ./.env --env-file ./override.env up -d --force-recreate"
|
||||
ExecStartPost=/bin/sh -c "bash ./update/update.sh &"
|
||||
ExecStop=/bin/sh -c "docker compose down --remove-orphans"
|
||||
ExecStopPost=/bin/sh -c "kill -9 $(cat ./update/update_pid) > /dev/null"
|
||||
|
||||
Reference in New Issue
Block a user