修复fnOS部署失败

This commit is contained in:
net909 2026-01-24 16:45:24 +08:00
parent 224c27d796
commit d1eaaec650
3 changed files with 4 additions and 6 deletions

View File

@ -880,9 +880,7 @@ class DeployHelper
sudo visudo<br/>
#在文件最后一行增加以下内容需要将username替换成自己的用户名<br/>
username ALL=(ALL) NOPASSWD: NOPASSWD: ALL<br/>
ctrl+x 保存退出<br/>
sudo mkdir -p /home/<用户名><br/>
sudo chown -R <用户名>: /home/<用户名><br/>',
ctrl+x 保存退出<br/>',
'tasknote' => '系统会根据关联SSL证书的域名自动更新对应证书',
'inputs' => [
'host' => [

View File

@ -52,7 +52,7 @@ class fnos implements DeployInterface
$this->exec($connection, '上传证书文件', "sudo tee ".$certPath." > /dev/null <<'EOF'\n".$fullchain."\nEOF");
$this->exec($connection, '上传私钥文件', "sudo tee ".$keyPath." > /dev/null <<'EOF'\n".$privatekey."\nEOF");
$this->exec($connection, '刷新目录权限', 'sudo chmod 0755 "'.$certDir.'" -R');
$this->exec($connection, '更新数据表', 'sudo -u postgres psql -d trim_connect -c "UPDATE cert SET valid_to='.$certInfo['validTo_time_t'].'000,valid_from='.$certInfo['validFrom_time_t'].'000,issued_by=\''.$certInfo['issuer']['CN'].'\',updated_time='.getMillisecond().' WHERE private_key=\''.$keyPath.'\'"');
$this->exec($connection, '更新数据表', 'cd /tmp && sudo -u postgres psql -d trim_connect -c "UPDATE cert SET valid_to='.$certInfo['validTo_time_t'].'000,valid_from='.$certInfo['validFrom_time_t'].'000,issued_by=\''.$certInfo['issuer']['CN'].'\',updated_time='.getMillisecond().' WHERE private_key=\''.$keyPath.'\'"');
$this->log('证书 '.$row['domain'].' 更新成功');
$success++;
}

View File

@ -160,7 +160,7 @@ class qingcloud implements DnsInterface
if ($Type == 'MX') {
$Value = intval($MX).' '.$Value;
} elseif ($Type == 'TXT') {
} elseif ($Type == 'TXT' && substr($Value, 0, 1) != '"') {
$Value = '"'.$Value.'"';
}
@ -184,7 +184,7 @@ class qingcloud implements DnsInterface
if ($Type == 'MX') {
$Value = intval($MX).' '.$Value;
} elseif ($Type == 'TXT') {
} elseif ($Type == 'TXT' && substr($Value, 0, 1) != '"') {
$Value = '"'.$Value.'"';
}