feat: implement CDN Purge Artisan command and UI dashboard control

This commit is contained in:
dyzulk
2026-01-07 11:06:33 +07:00
parent 2393be46f6
commit 0e67f8d273
4 changed files with 73 additions and 0 deletions

View File

@@ -942,4 +942,27 @@ class OpenSslService
return false;
}
}
/**
* Purge everything under the 'ca/' directory on the CDN.
*/
public function purgeAllCaFromCdn()
{
$disk = Storage::disk('r2-public');
if ($disk->exists('ca')) {
$disk->deleteDirectory('ca');
}
// Reset local database sync status
CaCertificate::query()->update([
'last_synced_at' => null,
'cert_path' => null,
'der_path' => null,
'bat_path' => null,
'mac_path' => null,
'linux_path' => null,
]);
return true;
}
}