mirror of
https://github.com/PhyreApps/PhyrePanel.git
synced 2024-11-25 09:00:27 +00:00
update
This commit is contained in:
parent
ee90204394
commit
42f850fef0
4 changed files with 21 additions and 23 deletions
Binary file not shown.
|
@ -1,9 +0,0 @@
|
|||
-----BEGIN PUBLIC KEY-----
|
||||
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArRmu5WOZsz50RBvtUU05
|
||||
wZ66jQrAjmJ4t9Kj2+iaynX5OY05d9dH9v+JF9x6dCo+D6dSJLcAyA4/Cosq3TW/
|
||||
rDVSY9eIUsuxr4OlmguFLfHa9vML9Ot1f/z/4uxXhUuG1w15TkqhIvxbHdMes0mH
|
||||
5nA54uHVki5RSQrN08ebawBkxRbp/gG7qvMPxNhBdyTwZ6T7TUJSDWqZYzS6XcjR
|
||||
F1qzOhucAo1lqT7B2XBGYdsEHngZNTVlc4VAdj2ZajOSJdEYsOoxXGV20JFS22lr
|
||||
I1a4Sp6jm9stBuagttfsI5c2kTplfpMbGEDsj+jeNwY7rFfghy4d0G1xZQKarcBO
|
||||
iQIDAQAB
|
||||
-----END PUBLIC KEY-----
|
|
@ -0,0 +1,9 @@
|
|||
sudo certbot certonly \
|
||||
--non-interactive \
|
||||
--agree-tos \
|
||||
--manual \
|
||||
--preferred-challenges=http \
|
||||
-d {{$domain}} \
|
||||
--email {{$email}} \
|
||||
--manual-auth-hook /usr/local/phyre/web/Modules/LetsEncrypt/shell/hooks/pre/http-authenticator.sh \
|
||||
--force-renewal
|
|
@ -37,9 +37,18 @@ Route::post('letsencrypt/secure', function () {
|
|||
return response()->json(['error' => 'Domain already secured'], 400);
|
||||
}
|
||||
|
||||
$findHostingSubscription = \App\Models\HostingSubscription::where('id', $findDomain->hosting_subscription_id)->first();
|
||||
if (! $findHostingSubscription) {
|
||||
return response()->json(['error' => 'Domain not hosted'], 400);
|
||||
}
|
||||
|
||||
$generalSettings = Settings::general();
|
||||
|
||||
$acmeConfigYaml = view('letsencrypt::actions.acme-config-yaml', [
|
||||
$sslCertificateFilePath = '/etc/letsencrypt/live/'.$findDomain->domain.'/cert.pem';
|
||||
$sslCertificateKeyFilePath = '/etc/letsencrypt/live/'.$findDomain->domain.'/privkey.pem';
|
||||
$sslCertificateChainFilePath = '/etc/letsencrypt/live/'.$findDomain->domain.'/fullchain.pem';
|
||||
|
||||
$certbotHttpSecureCommand = view('letsencrypt::actions.certbot-http-secure-command', [
|
||||
'domain' => $findDomain->domain,
|
||||
'domainRoot' => $findDomain->domain_root,
|
||||
'domainPublic' => $findDomain->domain_public,
|
||||
|
@ -49,26 +58,15 @@ Route::post('letsencrypt/secure', function () {
|
|||
'organization' => $generalSettings['organization_name'],
|
||||
])->render();
|
||||
|
||||
file_put_contents($findDomain->domain_root.'/acme-config.yaml', $acmeConfigYaml);
|
||||
|
||||
$amePHPPharFile = base_path().'/Modules/LetsEncrypt/Actions/acmephp.phar';
|
||||
|
||||
$phyrePHP = ApiClient::getPhyrePHP();
|
||||
|
||||
$command = $phyrePHP.' '.$amePHPPharFile.' run '.$findDomain->domain_root.'/acme-config.yaml';
|
||||
|
||||
$execSSL = shell_exec($command);
|
||||
$exec = shell_exec($certbotHttpSecureCommand);
|
||||
|
||||
$validateCertificates = [];
|
||||
$sslCertificateFilePath = '/root/.acmephp/master/certs/'.$findDomain->domain.'/public/cert.pem';
|
||||
$sslCertificateKeyFilePath = '/root/.acmephp/master/certs/'.$findDomain->domain.'/private/key.private.pem';
|
||||
$sslCertificateChainFilePath = '/root/.acmephp/master/certs/'.$findDomain->domain.'/public/fullchain.pem';
|
||||
|
||||
if (! file_exists($sslCertificateFilePath)
|
||||
|| ! file_exists($sslCertificateKeyFilePath)
|
||||
|| ! file_exists($sslCertificateChainFilePath)) {
|
||||
// Cant get all certificates
|
||||
return;
|
||||
return response()->json(['error' => 'Cant get all certificates'], 400);
|
||||
}
|
||||
|
||||
$sslCertificateFileContent = file_get_contents($sslCertificateFilePath);
|
||||
|
|
Loading…
Reference in a new issue