mirror of
https://github.com/coollabsio/coolify.git
synced 2026-08-24 10:05:47 -05:00
Escape service application lifecycle command arguments for deploy, restart, stop, and log status checks. Validate API update payloads from JSON/form data before applying allowed fields, preserving explicit boolean and null values. Add coverage for service application API authorization, team isolation, validation, and command escaping.
25 lines
577 B
PHP
25 lines
577 B
PHP
<?php
|
|
|
|
namespace App\Actions\Service;
|
|
|
|
use App\Models\ServiceApplication;
|
|
use Lorisleiva\Actions\Concerns\AsAction;
|
|
|
|
class StopServiceApplication
|
|
{
|
|
use AsAction;
|
|
|
|
public string $jobQueue = 'high';
|
|
|
|
public function handle(ServiceApplication $serviceApplication): void
|
|
{
|
|
$service = $serviceApplication->service;
|
|
$server = $service->destination->server;
|
|
$containerName = escapeshellarg($serviceApplication->name.'-'.$service->uuid);
|
|
|
|
instant_remote_process([
|
|
"docker stop {$containerName}",
|
|
], $server);
|
|
}
|
|
}
|