Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 11e34d8c4e | |||
| 3e3684eb34 | |||
| 7ee47db8e2 | |||
| b390fe7dd8 | |||
| fe0414cc59 |
+4
-2
@@ -1005,6 +1005,7 @@ class Bot
|
||||
'mtproto' => file_get_contents('/config/mtprotosecret'),
|
||||
'xray' => json_decode(file_get_contents('/config/xray.json'), true),
|
||||
'oc' => file_get_contents('/config/ocserv.conf'),
|
||||
'ocu' => file_get_contents('/config/ocserv.passwd'),
|
||||
|
||||
];
|
||||
return json_encode($conf, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
|
||||
@@ -1129,6 +1130,7 @@ class Bot
|
||||
if (!empty($json['oc'])) {
|
||||
$out[] = 'update ocserv';
|
||||
$this->update($this->input['chat'], $this->input['message_id'], implode("\n", $out));
|
||||
file_put_contents('/config/ocserv.passwd', $json['ocu']);
|
||||
$this->restartOcserv($json['oc']);
|
||||
}
|
||||
if (!empty($json['pac']['domain'])) {
|
||||
@@ -2230,7 +2232,7 @@ DNS-over-HTTPS with IP:
|
||||
if (!empty($v['# PublicKey'])) {
|
||||
$conf['peers'][$k]['online'] = 'off';
|
||||
} else {
|
||||
$conf['peers'][$k]['status'] = $this->getStatusPeer($v['PublicKey'], $status['peers']);
|
||||
$conf['peers'][$k]['status'] = $status ? $this->getStatusPeer($v['PublicKey'], $status['peers']) : 'error';
|
||||
$conf['peers'][$k]['online'] = preg_match('~^(\d+ seconds|[12] minute)~', $conf['peers'][$k]['status']['latest handshake']) ? 'online' : '';
|
||||
}
|
||||
}
|
||||
@@ -2585,7 +2587,7 @@ DNS-over-HTTPS with IP:
|
||||
if ($clients) {
|
||||
$name = $this->getName($clients[$client]['interface']);
|
||||
$conf = $this->createConfig($clients[$client]);
|
||||
if ($this->getInstanceWG(1)) {
|
||||
if ($this->getWGType() == 'awg') {
|
||||
$sl = $this->getAmneziaShortLink($clients[$client]);
|
||||
}
|
||||
return [
|
||||
|
||||
+1
-1
@@ -243,7 +243,7 @@ $i = [
|
||||
],
|
||||
'backup' => [
|
||||
'en' => 'auto backup',
|
||||
'ru' => 'бэкап',
|
||||
'ru' => 'автобэкап',
|
||||
],
|
||||
'logs' => [
|
||||
'en' => 'logs',
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
cp scripts/vpnbot.service /etc/systemd/system/vpnbot.service
|
||||
path=`pwd`
|
||||
sed "s|path|$path|g" "$path/scripts/vpnbot.service" > /etc/systemd/system/vpnbot.service
|
||||
systemctl daemon-reload
|
||||
systemctl enable vpnbot
|
||||
|
||||
@@ -3,10 +3,13 @@ Description=VPN: Docker Compose Application Service
|
||||
Requires=docker.service
|
||||
After=docker.service
|
||||
[Service]
|
||||
WorkingDirectory=/root/vpnbot
|
||||
ExecStart=/bin/sh -c "IP=$(curl https://ipinfo.io/ip) VER=$(git describe --tags) docker compose up -d --force-recreate && bash ./update/update.sh &"
|
||||
ExecStop=/bin/sh -c "kill -9 $(cat ./update/update_pid) > /dev/null && docker compose down --remove-orphans"
|
||||
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"
|
||||
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"
|
||||
TimeoutStartSec=0
|
||||
Restart=on-failure
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
Reference in New Issue
Block a user