From 82e51c0d9ce30733d2ec0cf1de66989208bd2481 Mon Sep 17 00:00:00 2001 From: mercury Date: Mon, 10 Nov 2025 00:14:04 +0400 Subject: [PATCH] empty password stoped openconnect and naive --- app/bot.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/bot.php b/app/bot.php index cb9e381..5b403c2 100644 --- a/app/bot.php +++ b/app/bot.php @@ -1124,7 +1124,10 @@ class Bot { file_put_contents('/config/ocserv.conf', $conf); $this->ssh('pkill ocserv', 'oc'); - $this->ssh('ocserv -c /etc/ocserv/ocserv.conf', 'oc'); + $pac = $this->getPacConf(); + if (!empty($pac['ocserv'])) { + $this->ssh('ocserv -c /etc/ocserv/ocserv.conf', 'oc'); + } } public function restartNaive() @@ -1134,7 +1137,9 @@ class Bot $c = file_get_contents('/config/Caddyfile'); $t = preg_replace('~^(\t+)?basic_auth[^\n]+~sm', '$1basic_auth ' . ($pac['naive']['user'] ?? '_') . ' ' . ($pac['naive']['pass'] ?? '__'), $c); file_put_contents('/config/Caddyfile', $t); - $this->ssh('caddy run -c /config/Caddyfile > /dev/null 2>&1 &', 'np', false); + if (!empty($pac['naive']['pass'])) { + $this->ssh('caddy run -c /config/Caddyfile > /dev/null 2>&1 &', 'np', false); + } } public function chocdns($dns)