initial commit

This commit is contained in:
TheOnlyMace
2026-05-17 13:26:14 +02:00
commit 75299b723d
176 changed files with 20327 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
<?php
namespace App\Providers;
use App\Services\Hosting\Plesk\PleskClient;
use App\Services\Hosting\Proxmox\ProxmoxClient;
use App\Services\Hosting\Provisioning\IpAddressAllocator;
use App\Services\Hosting\Proxmox\VmManagementService;
use App\Services\Hosting\Provisioning\ProvisioningService;
use App\Services\Hosting\Traefik\TraefikGenerator;
use Illuminate\Cache\RateLimiting\Limit;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\RateLimiter;
use Illuminate\Support\ServiceProvider;
class HostingServiceProvider extends ServiceProvider
{
public function register(): void
{
$this->app->singleton(ProxmoxClient::class);
$this->app->singleton(PleskClient::class);
$this->app->singleton(TraefikGenerator::class);
$this->app->singleton(IpAddressAllocator::class);
$this->app->singleton(ProvisioningService::class);
$this->app->singleton(VmManagementService::class);
}
public function boot(): void
{
RateLimiter::for('vm-power', function (Request $request) {
$limit = (int) config('hosting.vm_power.rate_limit_per_minute', 20);
return Limit::perMinute($limit)->by($request->user()?->id ?: $request->ip());
});
}
}