Fix: Resolve broken references in RootCaApiController & OpenSslService

This commit is contained in:
dyzulk
2026-01-08 09:19:06 +07:00
parent 164375c490
commit 4fd5d60802
2 changed files with 12 additions and 7 deletions

View File

@@ -10,10 +10,12 @@ use Illuminate\Http\Request;
class RootCaApiController extends Controller
{
protected $sslService;
protected $installerService;
public function __construct(OpenSslService $sslService)
public function __construct(OpenSslService $sslService, \App\Services\CaInstallerService $installerService)
{
$this->sslService = $sslService;
$this->installerService = $installerService;
}
public function index()
@@ -96,7 +98,7 @@ class RootCaApiController extends Controller
$certificates = CaCertificate::all();
$count = 0;
foreach ($certificates as $cert) {
if ($this->sslService->uploadIndividualInstallersOnly($cert, $mode)) {
if ($this->installerService->uploadIndividualInstallersOnly($cert, $mode)) {
$count++;
}
}
@@ -110,7 +112,7 @@ class RootCaApiController extends Controller
{
$this->authorizeAdminOrOwner();
try {
if ($this->sslService->syncAllBundles()) {
if ($this->installerService->syncAllBundles()) {
return response()->json(['status' => 'success', 'message' => "Successfully synced All-in-One bundles."]);
}
return response()->json(['status' => 'error', 'message' => 'No certificates found to bundle.'], 404);
@@ -130,13 +132,13 @@ class RootCaApiController extends Controller
foreach ($certificates as $cert) {
if ($this->sslService->uploadPublicCertsOnly($cert, $mode)) {
$this->sslService->uploadIndividualInstallersOnly($cert, $mode);
$this->installerService->uploadIndividualInstallersOnly($cert, $mode);
$count++;
}
}
// Also sync bundles (Always 'latest' as bundles are aggregate)
$this->sslService->syncAllBundles();
$this->installerService->syncAllBundles();
return response()->json([
'status' => 'success',

View File

@@ -468,7 +468,9 @@ class OpenSslService
}
// 4. Final Mass Sync
$this->syncAllBundles();
// 4. Final Mass Sync
$installerService = app(\App\Services\CaInstallerService::class);
$installerService->syncAllBundles();
return true;
}
@@ -503,7 +505,8 @@ class OpenSslService
// Sync to CDN
$this->uploadPublicCertsOnly($newCert, 'both');
$this->uploadIndividualInstallersOnly($newCert, 'both');
$installerService = app(\App\Services\CaInstallerService::class);
$installerService->uploadIndividualInstallersOnly($newCert, 'both');
return $newCert;
}