mirror of
https://github.com/PhyreApps/PhyrePanel.git
synced 2024-11-21 23:20:24 +00:00
update
This commit is contained in:
parent
145064f148
commit
adbbc0416f
2 changed files with 17 additions and 4 deletions
|
@ -52,14 +52,16 @@ class WildcardDomain extends BaseSettings
|
|||
$sslCertificateKeyFilePath = '/root/.acmephp/master/certs/*.'.$domain.'/private/key.private.pem';
|
||||
$sslCertificateChainFilePath = '/root/.acmephp/master/certs/*.'.$domain.'/public/fullchain.pem';
|
||||
|
||||
$sslCertificateFileContent = file_get_contents($sslCertificateFilePath);
|
||||
$sslCertificateKeyFileContent = file_get_contents($sslCertificateKeyFilePath);
|
||||
$sslCertificateChainFileContent = file_get_contents($sslCertificateChainFilePath);
|
||||
|
||||
|
||||
if (file_exists($sslCertificateFilePath)
|
||||
&& file_exists($sslCertificateKeyFilePath)
|
||||
&& file_exists($sslCertificateChainFilePath)) {
|
||||
|
||||
$sslCertificateFileContent = file_get_contents($sslCertificateFilePath);
|
||||
$sslCertificateKeyFileContent = file_get_contents($sslCertificateKeyFilePath);
|
||||
$sslCertificateChainFileContent = file_get_contents($sslCertificateChainFilePath);
|
||||
|
||||
|
||||
return [
|
||||
'sslFiles' => [
|
||||
'certificate' => $sslCertificateFilePath,
|
||||
|
|
|
@ -23,6 +23,17 @@ class DomainSslCertificate extends Model
|
|||
'renewed_date',
|
||||
'renewed_until_date',
|
||||
];
|
||||
public static function boot()
|
||||
{
|
||||
parent::boot();
|
||||
|
||||
static::deleting(function ($model) {
|
||||
|
||||
shell_exec('rm -rf '.'/root/.acmephp/master/certs/'.$model->domain);
|
||||
shell_exec('rm -rf '.'/etc/letsencrypt/live/'.$model->domain);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
public function getSSLFiles()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue