mirror of
https://github.com/coollabsio/coolify.git
synced 2026-03-11 08:55:47 +00:00
Compare commits
29 commits
046792c1b9
...
74ff84c7fe
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
74ff84c7fe | ||
|
|
872e300cf9 | ||
|
|
470cc15e62 | ||
|
|
6bcae50e49 | ||
|
|
db55c8160a | ||
|
|
60dfadf036 | ||
|
|
27e2680d70 | ||
|
|
65d61a4af3 | ||
|
|
b5151815c1 | ||
|
|
184fbb98f3 | ||
|
|
a5367408d0 | ||
|
|
574f849778 | ||
|
|
19d1662fac | ||
|
|
e3daba0b1d | ||
|
|
7bee8a5668 | ||
|
|
4615cfd007 | ||
|
|
31caef990d | ||
|
|
380a34c7d6 | ||
|
|
cc96403cbe | ||
|
|
040658c142 | ||
|
|
34c5eb9e10 | ||
|
|
30c1d9bbd0 | ||
|
|
8cc10ab10a | ||
|
|
ffb1371094 | ||
|
|
83fcc09c77 | ||
|
|
969d21f081 | ||
|
|
fa785572c5 | ||
|
|
062ad02e15 | ||
|
|
830762f0ac |
53 changed files with 501 additions and 37 deletions
|
|
@ -51,9 +51,11 @@ class StartDatabaseProxy
|
|||
}
|
||||
|
||||
$configuration_dir = database_proxy_dir($database->uuid);
|
||||
$host_configuration_dir = $configuration_dir;
|
||||
if (isDev()) {
|
||||
$configuration_dir = '/var/lib/docker/volumes/coolify_dev_coolify_data/_data/databases/'.$database->uuid.'/proxy';
|
||||
$host_configuration_dir = '/var/lib/docker/volumes/coolify_dev_coolify_data/_data/databases/'.$database->uuid.'/proxy';
|
||||
}
|
||||
$timeoutConfig = $this->buildProxyTimeoutConfig($database->public_port_timeout);
|
||||
$nginxconf = <<<EOF
|
||||
user nginx;
|
||||
worker_processes auto;
|
||||
|
|
@ -67,6 +69,7 @@ class StartDatabaseProxy
|
|||
server {
|
||||
listen $database->public_port;
|
||||
proxy_pass $containerName:$internalPort;
|
||||
$timeoutConfig
|
||||
}
|
||||
}
|
||||
EOF;
|
||||
|
|
@ -85,7 +88,7 @@ class StartDatabaseProxy
|
|||
'volumes' => [
|
||||
[
|
||||
'type' => 'bind',
|
||||
'source' => "$configuration_dir/nginx.conf",
|
||||
'source' => "$host_configuration_dir/nginx.conf",
|
||||
'target' => '/etc/nginx/nginx.conf',
|
||||
],
|
||||
],
|
||||
|
|
@ -160,4 +163,13 @@ class StartDatabaseProxy
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
private function buildProxyTimeoutConfig(?int $timeout): string
|
||||
{
|
||||
if ($timeout === null || $timeout < 1) {
|
||||
$timeout = 3600;
|
||||
}
|
||||
|
||||
return "proxy_timeout {$timeout}s;";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -805,9 +805,15 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue
|
|||
);
|
||||
|
||||
$this->write_deployment_configurations();
|
||||
$this->execute_remote_command(
|
||||
[executeInDocker($this->deployment_uuid, "cd {$this->basedir} && {$start_command}"), 'hidden' => true],
|
||||
);
|
||||
if ($this->preserveRepository) {
|
||||
$this->execute_remote_command(
|
||||
['command' => "cd {$server_workdir} && {$start_command}", 'hidden' => true],
|
||||
);
|
||||
} else {
|
||||
$this->execute_remote_command(
|
||||
[executeInDocker($this->deployment_uuid, "cd {$this->basedir} && {$start_command}"), 'hidden' => true],
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$command = "{$this->coolify_variables} docker compose";
|
||||
if ($this->preserveRepository) {
|
||||
|
|
|
|||
|
|
@ -6,12 +6,13 @@ use App\Events\ProxyStatusChangedUI;
|
|||
use App\Models\Server;
|
||||
use App\Notifications\Server\TraefikVersionOutdated;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldBeEncrypted;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class CheckTraefikVersionForServerJob implements ShouldQueue
|
||||
class CheckTraefikVersionForServerJob implements ShouldBeEncrypted, ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
|
|
|
|||
|
|
@ -5,12 +5,13 @@ namespace App\Jobs;
|
|||
use App\Enums\ProxyTypes;
|
||||
use App\Models\Server;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldBeEncrypted;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class CheckTraefikVersionJob implements ShouldQueue
|
||||
class CheckTraefikVersionJob implements ShouldBeEncrypted, ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
|
|
|
|||
|
|
@ -666,7 +666,21 @@ class DatabaseBackupJob implements ShouldBeEncrypted, ShouldQueue
|
|||
$escapedSecret = escapeshellarg($secret);
|
||||
|
||||
$commands[] = "docker exec backup-of-{$this->backup_log_uuid} mc alias set temporary {$escapedEndpoint} {$escapedKey} {$escapedSecret}";
|
||||
$commands[] = "docker exec backup-of-{$this->backup_log_uuid} mc cp $this->backup_location temporary/$bucket{$this->backup_dir}/";
|
||||
|
||||
// Build S3 path with optional prefix
|
||||
$s3Path = $bucket;
|
||||
if (filled($this->s3->path)) {
|
||||
// Strip leading/trailing slashes to avoid double slashes in path
|
||||
$pathPrefix = trim($this->s3->path, '/');
|
||||
$s3Path .= '/'.$pathPrefix;
|
||||
}
|
||||
$s3Path .= $this->backup_dir.'/';
|
||||
|
||||
// Escape the paths to prevent command injection
|
||||
$escapedBackupLocation = escapeshellarg($this->backup_location);
|
||||
$escapedS3Path = escapeshellarg("temporary/{$s3Path}");
|
||||
|
||||
$commands[] = "docker exec backup-of-{$this->backup_log_uuid} mc cp {$escapedBackupLocation} {$escapedS3Path}";
|
||||
instant_remote_process($commands, $this->server, true, false, null, disableMultiplexing: true);
|
||||
|
||||
$this->s3_uploaded = true;
|
||||
|
|
|
|||
|
|
@ -7,13 +7,14 @@ use App\Models\SslCertificate;
|
|||
use App\Models\Team;
|
||||
use App\Notifications\SslExpirationNotification;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldBeEncrypted;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class RegenerateSslCertJob implements ShouldQueue
|
||||
class RegenerateSslCertJob implements ShouldBeEncrypted, ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
|
|
|
|||
|
|
@ -4,16 +4,27 @@ namespace App\Jobs;
|
|||
|
||||
use App\Notifications\Dto\SlackMessage;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldBeEncrypted;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
|
||||
class SendMessageToSlackJob implements ShouldQueue
|
||||
class SendMessageToSlackJob implements ShouldBeEncrypted, ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
/**
|
||||
* The number of times the job may be attempted.
|
||||
*/
|
||||
public $tries = 5;
|
||||
|
||||
/**
|
||||
* The number of seconds to wait before retrying the job.
|
||||
*/
|
||||
public $backoff = 10;
|
||||
|
||||
public function __construct(
|
||||
private SlackMessage $message,
|
||||
private string $webhookUrl
|
||||
|
|
|
|||
|
|
@ -22,6 +22,11 @@ class SendMessageToTelegramJob implements ShouldBeEncrypted, ShouldQueue
|
|||
*/
|
||||
public $tries = 5;
|
||||
|
||||
/**
|
||||
* The number of seconds to wait before retrying the job.
|
||||
*/
|
||||
public $backoff = 10;
|
||||
|
||||
/**
|
||||
* The maximum number of unhandled exceptions to allow before failing.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ use App\Models\Server;
|
|||
use App\Models\Team;
|
||||
use Cron\CronExpression;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldBeEncrypted;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
|
|
@ -15,7 +16,7 @@ use Illuminate\Support\Carbon;
|
|||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class ServerManagerJob implements ShouldQueue
|
||||
class ServerManagerJob implements ShouldBeEncrypted, ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
|
|
|
|||
|
|
@ -4,11 +4,12 @@ namespace App\Jobs;
|
|||
|
||||
use App\Models\Subscription;
|
||||
use App\Models\Team;
|
||||
use Illuminate\Contracts\Queue\ShouldBeEncrypted;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Queue\Queueable;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class StripeProcessJob implements ShouldQueue
|
||||
class StripeProcessJob implements ShouldBeEncrypted, ShouldQueue
|
||||
{
|
||||
use Queueable;
|
||||
|
||||
|
|
|
|||
|
|
@ -4,12 +4,13 @@ namespace App\Jobs;
|
|||
|
||||
use App\Models\Subscription;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldBeEncrypted;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class SyncStripeSubscriptionsJob implements ShouldQueue
|
||||
class SyncStripeSubscriptionsJob implements ShouldBeEncrypted, ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
|
|
|
|||
|
|
@ -8,13 +8,14 @@ use App\Events\ServerReachabilityChanged;
|
|||
use App\Events\ServerValidated;
|
||||
use App\Models\Server;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldBeEncrypted;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class ValidateAndInstallServerJob implements ShouldQueue
|
||||
class ValidateAndInstallServerJob implements ShouldBeEncrypted, ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
|
|
|
|||
|
|
@ -4,12 +4,13 @@ namespace App\Jobs;
|
|||
|
||||
use App\Models\Subscription;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldBeEncrypted;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class VerifyStripeSubscriptionStatusJob implements ShouldQueue
|
||||
class VerifyStripeSubscriptionStatusJob implements ShouldBeEncrypted, ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
|
|
|
|||
|
|
@ -51,9 +51,7 @@ class Configuration extends Component
|
|||
$this->environment = $environment;
|
||||
$this->application = $application;
|
||||
|
||||
if ($this->application->deploymentType() === 'deploy_key' && $this->currentRoute === 'project.application.preview-deployments') {
|
||||
return redirect()->route('project.application.configuration', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'application_uuid' => $application->uuid]);
|
||||
}
|
||||
|
||||
|
||||
if ($this->application->build_pack === 'dockercompose' && $this->currentRoute === 'project.application.healthcheck') {
|
||||
return redirect()->route('project.application.configuration', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'application_uuid' => $application->uuid]);
|
||||
|
|
|
|||
|
|
@ -36,6 +36,8 @@ class General extends Component
|
|||
|
||||
public ?int $publicPort = null;
|
||||
|
||||
public ?int $publicPortTimeout = 3600;
|
||||
|
||||
public ?string $customDockerRunOptions = null;
|
||||
|
||||
public ?string $dbUrl = null;
|
||||
|
|
@ -80,6 +82,7 @@ class General extends Component
|
|||
'portsMappings' => 'nullable|string',
|
||||
'isPublic' => 'nullable|boolean',
|
||||
'publicPort' => 'nullable|integer',
|
||||
'publicPortTimeout' => 'nullable|integer|min:1',
|
||||
'customDockerRunOptions' => 'nullable|string',
|
||||
'dbUrl' => 'nullable|string',
|
||||
'dbUrlPublic' => 'nullable|string',
|
||||
|
|
@ -99,6 +102,8 @@ class General extends Component
|
|||
'image.required' => 'The Docker Image field is required.',
|
||||
'image.string' => 'The Docker Image must be a string.',
|
||||
'publicPort.integer' => 'The Public Port must be an integer.',
|
||||
'publicPortTimeout.integer' => 'The Public Port Timeout must be an integer.',
|
||||
'publicPortTimeout.min' => 'The Public Port Timeout must be at least 1.',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
|
@ -115,6 +120,7 @@ class General extends Component
|
|||
$this->database->ports_mappings = $this->portsMappings;
|
||||
$this->database->is_public = $this->isPublic;
|
||||
$this->database->public_port = $this->publicPort;
|
||||
$this->database->public_port_timeout = $this->publicPortTimeout;
|
||||
$this->database->custom_docker_run_options = $this->customDockerRunOptions;
|
||||
$this->database->is_log_drain_enabled = $this->isLogDrainEnabled;
|
||||
$this->database->save();
|
||||
|
|
@ -130,6 +136,7 @@ class General extends Component
|
|||
$this->portsMappings = $this->database->ports_mappings;
|
||||
$this->isPublic = $this->database->is_public;
|
||||
$this->publicPort = $this->database->public_port;
|
||||
$this->publicPortTimeout = $this->database->public_port_timeout;
|
||||
$this->customDockerRunOptions = $this->database->custom_docker_run_options;
|
||||
$this->isLogDrainEnabled = $this->database->is_log_drain_enabled;
|
||||
$this->dbUrl = $this->database->internal_db_url;
|
||||
|
|
|
|||
|
|
@ -36,6 +36,8 @@ class General extends Component
|
|||
|
||||
public ?int $publicPort = null;
|
||||
|
||||
public ?int $publicPortTimeout = 3600;
|
||||
|
||||
public ?string $customDockerRunOptions = null;
|
||||
|
||||
public ?string $dbUrl = null;
|
||||
|
|
@ -91,6 +93,7 @@ class General extends Component
|
|||
'portsMappings' => 'nullable|string',
|
||||
'isPublic' => 'nullable|boolean',
|
||||
'publicPort' => 'nullable|integer',
|
||||
'publicPortTimeout' => 'nullable|integer|min:1',
|
||||
'customDockerRunOptions' => 'nullable|string',
|
||||
'dbUrl' => 'nullable|string',
|
||||
'dbUrlPublic' => 'nullable|string',
|
||||
|
|
@ -109,6 +112,8 @@ class General extends Component
|
|||
'image.required' => 'The Docker Image field is required.',
|
||||
'image.string' => 'The Docker Image must be a string.',
|
||||
'publicPort.integer' => 'The Public Port must be an integer.',
|
||||
'publicPortTimeout.integer' => 'The Public Port Timeout must be an integer.',
|
||||
'publicPortTimeout.min' => 'The Public Port Timeout must be at least 1.',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
|
@ -124,6 +129,7 @@ class General extends Component
|
|||
$this->database->ports_mappings = $this->portsMappings;
|
||||
$this->database->is_public = $this->isPublic;
|
||||
$this->database->public_port = $this->publicPort;
|
||||
$this->database->public_port_timeout = $this->publicPortTimeout;
|
||||
$this->database->custom_docker_run_options = $this->customDockerRunOptions;
|
||||
$this->database->is_log_drain_enabled = $this->isLogDrainEnabled;
|
||||
$this->database->enable_ssl = $this->enable_ssl;
|
||||
|
|
@ -139,6 +145,7 @@ class General extends Component
|
|||
$this->portsMappings = $this->database->ports_mappings;
|
||||
$this->isPublic = $this->database->is_public;
|
||||
$this->publicPort = $this->database->public_port;
|
||||
$this->publicPortTimeout = $this->database->public_port_timeout;
|
||||
$this->customDockerRunOptions = $this->database->custom_docker_run_options;
|
||||
$this->isLogDrainEnabled = $this->database->is_log_drain_enabled;
|
||||
$this->enable_ssl = $this->database->enable_ssl;
|
||||
|
|
|
|||
|
|
@ -401,20 +401,24 @@ EOD;
|
|||
}
|
||||
}
|
||||
|
||||
public function runImport()
|
||||
public function runImport(string $password = ''): bool|string
|
||||
{
|
||||
if (! verifyPasswordConfirmation($password, $this)) {
|
||||
return 'The provided password is incorrect.';
|
||||
}
|
||||
|
||||
$this->authorize('update', $this->resource);
|
||||
|
||||
if ($this->filename === '') {
|
||||
$this->dispatch('error', 'Please select a file to import.');
|
||||
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (! $this->server) {
|
||||
$this->dispatch('error', 'Server not found. Please refresh the page.');
|
||||
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
try {
|
||||
|
|
@ -434,7 +438,7 @@ EOD;
|
|||
if (! $this->validateServerPath($this->customLocation)) {
|
||||
$this->dispatch('error', 'Invalid file path. Path must be absolute and contain only safe characters.');
|
||||
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
$tmpPath = '/tmp/restore_'.$this->resourceUuid;
|
||||
$escapedCustomLocation = escapeshellarg($this->customLocation);
|
||||
|
|
@ -442,7 +446,7 @@ EOD;
|
|||
} else {
|
||||
$this->dispatch('error', 'The file does not exist or has been deleted.');
|
||||
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Copy the restore command to a script file
|
||||
|
|
@ -474,11 +478,15 @@ EOD;
|
|||
$this->dispatch('databaserestore');
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
return handleError($e, $this);
|
||||
handleError($e, $this);
|
||||
|
||||
return true;
|
||||
} finally {
|
||||
$this->filename = null;
|
||||
$this->importCommands = [];
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function loadAvailableS3Storages()
|
||||
|
|
@ -577,26 +585,30 @@ EOD;
|
|||
}
|
||||
}
|
||||
|
||||
public function restoreFromS3()
|
||||
public function restoreFromS3(string $password = ''): bool|string
|
||||
{
|
||||
if (! verifyPasswordConfirmation($password, $this)) {
|
||||
return 'The provided password is incorrect.';
|
||||
}
|
||||
|
||||
$this->authorize('update', $this->resource);
|
||||
|
||||
if (! $this->s3StorageId || blank($this->s3Path)) {
|
||||
$this->dispatch('error', 'Please select S3 storage and provide a path first.');
|
||||
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (is_null($this->s3FileSize)) {
|
||||
$this->dispatch('error', 'Please check the file first by clicking "Check File".');
|
||||
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (! $this->server) {
|
||||
$this->dispatch('error', 'Server not found. Please refresh the page.');
|
||||
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
try {
|
||||
|
|
@ -613,7 +625,7 @@ EOD;
|
|||
if (! $this->validateBucketName($bucket)) {
|
||||
$this->dispatch('error', 'Invalid S3 bucket name. Bucket name must contain only alphanumerics, dots, dashes, and underscores.');
|
||||
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Clean the S3 path
|
||||
|
|
@ -623,7 +635,7 @@ EOD;
|
|||
if (! $this->validateS3Path($cleanPath)) {
|
||||
$this->dispatch('error', 'Invalid S3 path. Path must contain only safe characters (alphanumerics, dots, dashes, underscores, slashes).');
|
||||
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Get helper image
|
||||
|
|
@ -711,9 +723,12 @@ EOD;
|
|||
$this->dispatch('info', 'Restoring database from S3. Progress will be shown in the activity monitor...');
|
||||
} catch (\Throwable $e) {
|
||||
$this->importRunning = false;
|
||||
handleError($e, $this);
|
||||
|
||||
return handleError($e, $this);
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function buildRestoreCommand(string $tmpPath): string
|
||||
|
|
|
|||
|
|
@ -38,6 +38,8 @@ class General extends Component
|
|||
|
||||
public ?int $publicPort = null;
|
||||
|
||||
public ?int $publicPortTimeout = 3600;
|
||||
|
||||
public ?string $customDockerRunOptions = null;
|
||||
|
||||
public ?string $dbUrl = null;
|
||||
|
|
@ -94,6 +96,7 @@ class General extends Component
|
|||
'portsMappings' => 'nullable|string',
|
||||
'isPublic' => 'nullable|boolean',
|
||||
'publicPort' => 'nullable|integer',
|
||||
'publicPortTimeout' => 'nullable|integer|min:1',
|
||||
'customDockerRunOptions' => 'nullable|string',
|
||||
'dbUrl' => 'nullable|string',
|
||||
'dbUrlPublic' => 'nullable|string',
|
||||
|
|
@ -114,6 +117,8 @@ class General extends Component
|
|||
'image.required' => 'The Docker Image field is required.',
|
||||
'image.string' => 'The Docker Image must be a string.',
|
||||
'publicPort.integer' => 'The Public Port must be an integer.',
|
||||
'publicPortTimeout.integer' => 'The Public Port Timeout must be an integer.',
|
||||
'publicPortTimeout.min' => 'The Public Port Timeout must be at least 1.',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
|
@ -130,6 +135,7 @@ class General extends Component
|
|||
$this->database->ports_mappings = $this->portsMappings;
|
||||
$this->database->is_public = $this->isPublic;
|
||||
$this->database->public_port = $this->publicPort;
|
||||
$this->database->public_port_timeout = $this->publicPortTimeout;
|
||||
$this->database->custom_docker_run_options = $this->customDockerRunOptions;
|
||||
$this->database->is_log_drain_enabled = $this->isLogDrainEnabled;
|
||||
$this->database->enable_ssl = $this->enable_ssl;
|
||||
|
|
@ -146,6 +152,7 @@ class General extends Component
|
|||
$this->portsMappings = $this->database->ports_mappings;
|
||||
$this->isPublic = $this->database->is_public;
|
||||
$this->publicPort = $this->database->public_port;
|
||||
$this->publicPortTimeout = $this->database->public_port_timeout;
|
||||
$this->customDockerRunOptions = $this->database->custom_docker_run_options;
|
||||
$this->isLogDrainEnabled = $this->database->is_log_drain_enabled;
|
||||
$this->enable_ssl = $this->database->enable_ssl;
|
||||
|
|
|
|||
|
|
@ -44,6 +44,8 @@ class General extends Component
|
|||
|
||||
public ?int $publicPort = null;
|
||||
|
||||
public ?int $publicPortTimeout = 3600;
|
||||
|
||||
public bool $isLogDrainEnabled = false;
|
||||
|
||||
public ?string $customDockerRunOptions = null;
|
||||
|
|
@ -79,6 +81,7 @@ class General extends Component
|
|||
'portsMappings' => 'nullable',
|
||||
'isPublic' => 'nullable|boolean',
|
||||
'publicPort' => 'nullable|integer',
|
||||
'publicPortTimeout' => 'nullable|integer|min:1',
|
||||
'isLogDrainEnabled' => 'nullable|boolean',
|
||||
'customDockerRunOptions' => 'nullable',
|
||||
'enableSsl' => 'boolean',
|
||||
|
|
@ -97,6 +100,8 @@ class General extends Component
|
|||
'mariadbDatabase.required' => 'The MariaDB Database field is required.',
|
||||
'image.required' => 'The Docker Image field is required.',
|
||||
'publicPort.integer' => 'The Public Port must be an integer.',
|
||||
'publicPortTimeout.integer' => 'The Public Port Timeout must be an integer.',
|
||||
'publicPortTimeout.min' => 'The Public Port Timeout must be at least 1.',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
|
@ -113,6 +118,7 @@ class General extends Component
|
|||
'portsMappings' => 'Port Mapping',
|
||||
'isPublic' => 'Is Public',
|
||||
'publicPort' => 'Public Port',
|
||||
'publicPortTimeout' => 'Public Port Timeout',
|
||||
'customDockerRunOptions' => 'Custom Docker Options',
|
||||
'enableSsl' => 'Enable SSL',
|
||||
];
|
||||
|
|
@ -154,6 +160,7 @@ class General extends Component
|
|||
$this->database->ports_mappings = $this->portsMappings;
|
||||
$this->database->is_public = $this->isPublic;
|
||||
$this->database->public_port = $this->publicPort;
|
||||
$this->database->public_port_timeout = $this->publicPortTimeout;
|
||||
$this->database->is_log_drain_enabled = $this->isLogDrainEnabled;
|
||||
$this->database->custom_docker_run_options = $this->customDockerRunOptions;
|
||||
$this->database->enable_ssl = $this->enableSsl;
|
||||
|
|
@ -173,6 +180,7 @@ class General extends Component
|
|||
$this->portsMappings = $this->database->ports_mappings;
|
||||
$this->isPublic = $this->database->is_public;
|
||||
$this->publicPort = $this->database->public_port;
|
||||
$this->publicPortTimeout = $this->database->public_port_timeout;
|
||||
$this->isLogDrainEnabled = $this->database->is_log_drain_enabled;
|
||||
$this->customDockerRunOptions = $this->database->custom_docker_run_options;
|
||||
$this->enableSsl = $this->database->enable_ssl;
|
||||
|
|
|
|||
|
|
@ -42,6 +42,8 @@ class General extends Component
|
|||
|
||||
public ?int $publicPort = null;
|
||||
|
||||
public ?int $publicPortTimeout = 3600;
|
||||
|
||||
public bool $isLogDrainEnabled = false;
|
||||
|
||||
public ?string $customDockerRunOptions = null;
|
||||
|
|
@ -78,6 +80,7 @@ class General extends Component
|
|||
'portsMappings' => 'nullable',
|
||||
'isPublic' => 'nullable|boolean',
|
||||
'publicPort' => 'nullable|integer',
|
||||
'publicPortTimeout' => 'nullable|integer|min:1',
|
||||
'isLogDrainEnabled' => 'nullable|boolean',
|
||||
'customDockerRunOptions' => 'nullable',
|
||||
'enableSsl' => 'boolean',
|
||||
|
|
@ -96,6 +99,8 @@ class General extends Component
|
|||
'mongoInitdbDatabase.required' => 'The MongoDB Database field is required.',
|
||||
'image.required' => 'The Docker Image field is required.',
|
||||
'publicPort.integer' => 'The Public Port must be an integer.',
|
||||
'publicPortTimeout.integer' => 'The Public Port Timeout must be an integer.',
|
||||
'publicPortTimeout.min' => 'The Public Port Timeout must be at least 1.',
|
||||
'sslMode.in' => 'The SSL Mode must be one of: allow, prefer, require, verify-full.',
|
||||
]
|
||||
);
|
||||
|
|
@ -112,6 +117,7 @@ class General extends Component
|
|||
'portsMappings' => 'Port Mapping',
|
||||
'isPublic' => 'Is Public',
|
||||
'publicPort' => 'Public Port',
|
||||
'publicPortTimeout' => 'Public Port Timeout',
|
||||
'customDockerRunOptions' => 'Custom Docker Run Options',
|
||||
'enableSsl' => 'Enable SSL',
|
||||
'sslMode' => 'SSL Mode',
|
||||
|
|
@ -153,6 +159,7 @@ class General extends Component
|
|||
$this->database->ports_mappings = $this->portsMappings;
|
||||
$this->database->is_public = $this->isPublic;
|
||||
$this->database->public_port = $this->publicPort;
|
||||
$this->database->public_port_timeout = $this->publicPortTimeout;
|
||||
$this->database->is_log_drain_enabled = $this->isLogDrainEnabled;
|
||||
$this->database->custom_docker_run_options = $this->customDockerRunOptions;
|
||||
$this->database->enable_ssl = $this->enableSsl;
|
||||
|
|
@ -172,6 +179,7 @@ class General extends Component
|
|||
$this->portsMappings = $this->database->ports_mappings;
|
||||
$this->isPublic = $this->database->is_public;
|
||||
$this->publicPort = $this->database->public_port;
|
||||
$this->publicPortTimeout = $this->database->public_port_timeout;
|
||||
$this->isLogDrainEnabled = $this->database->is_log_drain_enabled;
|
||||
$this->customDockerRunOptions = $this->database->custom_docker_run_options;
|
||||
$this->enableSsl = $this->database->enable_ssl;
|
||||
|
|
|
|||
|
|
@ -44,6 +44,8 @@ class General extends Component
|
|||
|
||||
public ?int $publicPort = null;
|
||||
|
||||
public ?int $publicPortTimeout = 3600;
|
||||
|
||||
public bool $isLogDrainEnabled = false;
|
||||
|
||||
public ?string $customDockerRunOptions = null;
|
||||
|
|
@ -81,6 +83,7 @@ class General extends Component
|
|||
'portsMappings' => 'nullable',
|
||||
'isPublic' => 'nullable|boolean',
|
||||
'publicPort' => 'nullable|integer',
|
||||
'publicPortTimeout' => 'nullable|integer|min:1',
|
||||
'isLogDrainEnabled' => 'nullable|boolean',
|
||||
'customDockerRunOptions' => 'nullable',
|
||||
'enableSsl' => 'boolean',
|
||||
|
|
@ -100,6 +103,8 @@ class General extends Component
|
|||
'mysqlDatabase.required' => 'The MySQL Database field is required.',
|
||||
'image.required' => 'The Docker Image field is required.',
|
||||
'publicPort.integer' => 'The Public Port must be an integer.',
|
||||
'publicPortTimeout.integer' => 'The Public Port Timeout must be an integer.',
|
||||
'publicPortTimeout.min' => 'The Public Port Timeout must be at least 1.',
|
||||
'sslMode.in' => 'The SSL Mode must be one of: PREFERRED, REQUIRED, VERIFY_CA, VERIFY_IDENTITY.',
|
||||
]
|
||||
);
|
||||
|
|
@ -117,6 +122,7 @@ class General extends Component
|
|||
'portsMappings' => 'Port Mapping',
|
||||
'isPublic' => 'Is Public',
|
||||
'publicPort' => 'Public Port',
|
||||
'publicPortTimeout' => 'Public Port Timeout',
|
||||
'customDockerRunOptions' => 'Custom Docker Run Options',
|
||||
'enableSsl' => 'Enable SSL',
|
||||
'sslMode' => 'SSL Mode',
|
||||
|
|
@ -159,6 +165,7 @@ class General extends Component
|
|||
$this->database->ports_mappings = $this->portsMappings;
|
||||
$this->database->is_public = $this->isPublic;
|
||||
$this->database->public_port = $this->publicPort;
|
||||
$this->database->public_port_timeout = $this->publicPortTimeout;
|
||||
$this->database->is_log_drain_enabled = $this->isLogDrainEnabled;
|
||||
$this->database->custom_docker_run_options = $this->customDockerRunOptions;
|
||||
$this->database->enable_ssl = $this->enableSsl;
|
||||
|
|
@ -179,6 +186,7 @@ class General extends Component
|
|||
$this->portsMappings = $this->database->ports_mappings;
|
||||
$this->isPublic = $this->database->is_public;
|
||||
$this->publicPort = $this->database->public_port;
|
||||
$this->publicPortTimeout = $this->database->public_port_timeout;
|
||||
$this->isLogDrainEnabled = $this->database->is_log_drain_enabled;
|
||||
$this->customDockerRunOptions = $this->database->custom_docker_run_options;
|
||||
$this->enableSsl = $this->database->enable_ssl;
|
||||
|
|
|
|||
|
|
@ -48,6 +48,8 @@ class General extends Component
|
|||
|
||||
public ?int $publicPort = null;
|
||||
|
||||
public ?int $publicPortTimeout = 3600;
|
||||
|
||||
public bool $isLogDrainEnabled = false;
|
||||
|
||||
public ?string $customDockerRunOptions = null;
|
||||
|
|
@ -93,6 +95,7 @@ class General extends Component
|
|||
'portsMappings' => 'nullable',
|
||||
'isPublic' => 'nullable|boolean',
|
||||
'publicPort' => 'nullable|integer',
|
||||
'publicPortTimeout' => 'nullable|integer|min:1',
|
||||
'isLogDrainEnabled' => 'nullable|boolean',
|
||||
'customDockerRunOptions' => 'nullable',
|
||||
'enableSsl' => 'boolean',
|
||||
|
|
@ -111,6 +114,8 @@ class General extends Component
|
|||
'postgresDb.required' => 'The Postgres Database field is required.',
|
||||
'image.required' => 'The Docker Image field is required.',
|
||||
'publicPort.integer' => 'The Public Port must be an integer.',
|
||||
'publicPortTimeout.integer' => 'The Public Port Timeout must be an integer.',
|
||||
'publicPortTimeout.min' => 'The Public Port Timeout must be at least 1.',
|
||||
'sslMode.in' => 'The SSL Mode must be one of: allow, prefer, require, verify-ca, verify-full.',
|
||||
]
|
||||
);
|
||||
|
|
@ -130,6 +135,7 @@ class General extends Component
|
|||
'portsMappings' => 'Port Mapping',
|
||||
'isPublic' => 'Is Public',
|
||||
'publicPort' => 'Public Port',
|
||||
'publicPortTimeout' => 'Public Port Timeout',
|
||||
'customDockerRunOptions' => 'Custom Docker Run Options',
|
||||
'enableSsl' => 'Enable SSL',
|
||||
'sslMode' => 'SSL Mode',
|
||||
|
|
@ -174,6 +180,7 @@ class General extends Component
|
|||
$this->database->ports_mappings = $this->portsMappings;
|
||||
$this->database->is_public = $this->isPublic;
|
||||
$this->database->public_port = $this->publicPort;
|
||||
$this->database->public_port_timeout = $this->publicPortTimeout;
|
||||
$this->database->is_log_drain_enabled = $this->isLogDrainEnabled;
|
||||
$this->database->custom_docker_run_options = $this->customDockerRunOptions;
|
||||
$this->database->enable_ssl = $this->enableSsl;
|
||||
|
|
@ -196,6 +203,7 @@ class General extends Component
|
|||
$this->portsMappings = $this->database->ports_mappings;
|
||||
$this->isPublic = $this->database->is_public;
|
||||
$this->publicPort = $this->database->public_port;
|
||||
$this->publicPortTimeout = $this->database->public_port_timeout;
|
||||
$this->isLogDrainEnabled = $this->database->is_log_drain_enabled;
|
||||
$this->customDockerRunOptions = $this->database->custom_docker_run_options;
|
||||
$this->enableSsl = $this->database->enable_ssl;
|
||||
|
|
|
|||
|
|
@ -36,6 +36,8 @@ class General extends Component
|
|||
|
||||
public ?int $publicPort = null;
|
||||
|
||||
public ?int $publicPortTimeout = 3600;
|
||||
|
||||
public bool $isLogDrainEnabled = false;
|
||||
|
||||
public ?string $customDockerRunOptions = null;
|
||||
|
|
@ -74,6 +76,7 @@ class General extends Component
|
|||
'portsMappings' => 'nullable',
|
||||
'isPublic' => 'nullable|boolean',
|
||||
'publicPort' => 'nullable|integer',
|
||||
'publicPortTimeout' => 'nullable|integer|min:1',
|
||||
'isLogDrainEnabled' => 'nullable|boolean',
|
||||
'customDockerRunOptions' => 'nullable',
|
||||
'redisUsername' => 'required',
|
||||
|
|
@ -90,6 +93,8 @@ class General extends Component
|
|||
'name.required' => 'The Name field is required.',
|
||||
'image.required' => 'The Docker Image field is required.',
|
||||
'publicPort.integer' => 'The Public Port must be an integer.',
|
||||
'publicPortTimeout.integer' => 'The Public Port Timeout must be an integer.',
|
||||
'publicPortTimeout.min' => 'The Public Port Timeout must be at least 1.',
|
||||
'redisUsername.required' => 'The Redis Username field is required.',
|
||||
'redisPassword.required' => 'The Redis Password field is required.',
|
||||
]
|
||||
|
|
@ -104,6 +109,7 @@ class General extends Component
|
|||
'portsMappings' => 'Port Mapping',
|
||||
'isPublic' => 'Is Public',
|
||||
'publicPort' => 'Public Port',
|
||||
'publicPortTimeout' => 'Public Port Timeout',
|
||||
'customDockerRunOptions' => 'Custom Docker Options',
|
||||
'redisUsername' => 'Redis Username',
|
||||
'redisPassword' => 'Redis Password',
|
||||
|
|
@ -143,6 +149,7 @@ class General extends Component
|
|||
$this->database->ports_mappings = $this->portsMappings;
|
||||
$this->database->is_public = $this->isPublic;
|
||||
$this->database->public_port = $this->publicPort;
|
||||
$this->database->public_port_timeout = $this->publicPortTimeout;
|
||||
$this->database->is_log_drain_enabled = $this->isLogDrainEnabled;
|
||||
$this->database->custom_docker_run_options = $this->customDockerRunOptions;
|
||||
$this->database->enable_ssl = $this->enableSsl;
|
||||
|
|
@ -158,6 +165,7 @@ class General extends Component
|
|||
$this->portsMappings = $this->database->ports_mappings;
|
||||
$this->isPublic = $this->database->is_public;
|
||||
$this->publicPort = $this->database->public_port;
|
||||
$this->publicPortTimeout = $this->database->public_port_timeout;
|
||||
$this->isLogDrainEnabled = $this->database->is_log_drain_enabled;
|
||||
$this->customDockerRunOptions = $this->database->custom_docker_run_options;
|
||||
$this->enableSsl = $this->database->enable_ssl;
|
||||
|
|
|
|||
|
|
@ -53,6 +53,8 @@ class Index extends Component
|
|||
|
||||
public ?int $publicPort = null;
|
||||
|
||||
public ?int $publicPortTimeout = 3600;
|
||||
|
||||
public bool $isPublic = false;
|
||||
|
||||
public bool $isLogDrainEnabled = false;
|
||||
|
|
@ -90,6 +92,7 @@ class Index extends Component
|
|||
'image' => 'required',
|
||||
'excludeFromStatus' => 'required|boolean',
|
||||
'publicPort' => 'nullable|integer',
|
||||
'publicPortTimeout' => 'nullable|integer|min:1',
|
||||
'isPublic' => 'required|boolean',
|
||||
'isLogDrainEnabled' => 'required|boolean',
|
||||
// Application-specific rules
|
||||
|
|
@ -158,6 +161,7 @@ class Index extends Component
|
|||
$this->serviceDatabase->image = $this->image;
|
||||
$this->serviceDatabase->exclude_from_status = $this->excludeFromStatus;
|
||||
$this->serviceDatabase->public_port = $this->publicPort;
|
||||
$this->serviceDatabase->public_port_timeout = $this->publicPortTimeout;
|
||||
$this->serviceDatabase->is_public = $this->isPublic;
|
||||
$this->serviceDatabase->is_log_drain_enabled = $this->isLogDrainEnabled;
|
||||
} else {
|
||||
|
|
@ -166,6 +170,7 @@ class Index extends Component
|
|||
$this->image = $this->serviceDatabase->image;
|
||||
$this->excludeFromStatus = $this->serviceDatabase->exclude_from_status ?? false;
|
||||
$this->publicPort = $this->serviceDatabase->public_port;
|
||||
$this->publicPortTimeout = $this->serviceDatabase->public_port_timeout;
|
||||
$this->isPublic = $this->serviceDatabase->is_public ?? false;
|
||||
$this->isLogDrainEnabled = $this->serviceDatabase->is_log_drain_enabled ?? false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,8 @@ class Form extends Component
|
|||
|
||||
public string $secret;
|
||||
|
||||
public ?string $path = null;
|
||||
|
||||
public ?bool $isUsable = null;
|
||||
|
||||
protected function rules(): array
|
||||
|
|
@ -42,6 +44,7 @@ class Form extends Component
|
|||
'secret' => 'required|max:255',
|
||||
'bucket' => 'required|max:255',
|
||||
'endpoint' => 'required|url|max:255',
|
||||
'path' => ['nullable', 'max:255', 'regex:/^[a-zA-Z0-9\/\-_\.]*$/', 'not_regex:/\.\./'],
|
||||
];
|
||||
}
|
||||
|
||||
|
|
@ -61,6 +64,9 @@ class Form extends Component
|
|||
'endpoint.required' => 'The Endpoint field is required.',
|
||||
'endpoint.url' => 'The Endpoint must be a valid URL.',
|
||||
'endpoint.max' => 'The Endpoint may not be greater than 255 characters.',
|
||||
'path.max' => 'The Path Prefix may not be greater than 255 characters.',
|
||||
'path.regex' => 'The Path Prefix may only contain letters, numbers, slashes (/), dashes (-), underscores (_), and dots (.).',
|
||||
'path.not_regex' => 'The Path Prefix may not contain directory traversal sequences (..).',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
|
@ -74,6 +80,7 @@ class Form extends Component
|
|||
'secret' => 'Secret',
|
||||
'bucket' => 'Bucket',
|
||||
'endpoint' => 'Endpoint',
|
||||
'path' => 'Path Prefix',
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
@ -92,6 +99,7 @@ class Form extends Component
|
|||
$this->storage->region = $this->region;
|
||||
$this->storage->key = $this->key;
|
||||
$this->storage->secret = $this->secret;
|
||||
$this->storage->path = $this->path;
|
||||
$this->storage->is_usable = $this->isUsable;
|
||||
} else {
|
||||
// Sync FROM model (on load/refresh)
|
||||
|
|
@ -102,6 +110,7 @@ class Form extends Component
|
|||
$this->region = $this->storage->region;
|
||||
$this->key = $this->storage->key;
|
||||
$this->secret = $this->storage->secret;
|
||||
$this->path = $this->storage->path;
|
||||
$this->isUsable = $this->storage->is_usable;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,7 +72,11 @@ class S3Storage extends BaseModel
|
|||
return null;
|
||||
}
|
||||
|
||||
return str($value)->trim()->start('/')->value();
|
||||
// Trim whitespace and normalize: add leading slash, remove trailing slash
|
||||
$path = str($value)->trim()->start('/')->rtrim('/')->value();
|
||||
|
||||
// Return null if only slashes remain after trimming
|
||||
return $path === '/' ? null : $path;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,10 @@ class ServiceDatabase extends BaseModel
|
|||
|
||||
protected $guarded = [];
|
||||
|
||||
protected $casts = [
|
||||
'public_port_timeout' => 'integer',
|
||||
];
|
||||
|
||||
protected static function booted()
|
||||
{
|
||||
static::deleting(function ($service) {
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ class StandaloneClickhouse extends BaseModel
|
|||
|
||||
protected $casts = [
|
||||
'clickhouse_password' => 'encrypted',
|
||||
'public_port_timeout' => 'integer',
|
||||
'restart_count' => 'integer',
|
||||
'last_restart_at' => 'datetime',
|
||||
'last_restart_type' => 'string',
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ class StandaloneDragonfly extends BaseModel
|
|||
|
||||
protected $casts = [
|
||||
'dragonfly_password' => 'encrypted',
|
||||
'public_port_timeout' => 'integer',
|
||||
'restart_count' => 'integer',
|
||||
'last_restart_at' => 'datetime',
|
||||
'last_restart_type' => 'string',
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ class StandaloneKeydb extends BaseModel
|
|||
|
||||
protected $casts = [
|
||||
'keydb_password' => 'encrypted',
|
||||
'public_port_timeout' => 'integer',
|
||||
'restart_count' => 'integer',
|
||||
'last_restart_at' => 'datetime',
|
||||
'last_restart_type' => 'string',
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ class StandaloneMariadb extends BaseModel
|
|||
|
||||
protected $casts = [
|
||||
'mariadb_password' => 'encrypted',
|
||||
'public_port_timeout' => 'integer',
|
||||
'restart_count' => 'integer',
|
||||
'last_restart_at' => 'datetime',
|
||||
'last_restart_type' => 'string',
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ class StandaloneMongodb extends BaseModel
|
|||
protected $appends = ['internal_db_url', 'external_db_url', 'database_type', 'server_status'];
|
||||
|
||||
protected $casts = [
|
||||
'public_port_timeout' => 'integer',
|
||||
'restart_count' => 'integer',
|
||||
'last_restart_at' => 'datetime',
|
||||
'last_restart_type' => 'string',
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ class StandaloneMysql extends BaseModel
|
|||
protected $casts = [
|
||||
'mysql_password' => 'encrypted',
|
||||
'mysql_root_password' => 'encrypted',
|
||||
'public_port_timeout' => 'integer',
|
||||
'restart_count' => 'integer',
|
||||
'last_restart_at' => 'datetime',
|
||||
'last_restart_type' => 'string',
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ class StandalonePostgresql extends BaseModel
|
|||
protected $casts = [
|
||||
'init_scripts' => 'array',
|
||||
'postgres_password' => 'encrypted',
|
||||
'public_port_timeout' => 'integer',
|
||||
'restart_count' => 'integer',
|
||||
'last_restart_at' => 'datetime',
|
||||
'last_restart_type' => 'string',
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ class StandaloneRedis extends BaseModel
|
|||
protected $appends = ['internal_db_url', 'external_db_url', 'database_type', 'server_status'];
|
||||
|
||||
protected $casts = [
|
||||
'public_port_timeout' => 'integer',
|
||||
'restart_count' => 'integer',
|
||||
'last_restart_at' => 'datetime',
|
||||
'last_restart_type' => 'string',
|
||||
|
|
|
|||
|
|
@ -209,6 +209,19 @@ function deleteBackupsS3(string|array|null $filenames, S3Storage $s3): void
|
|||
$filenames = [$filenames];
|
||||
}
|
||||
|
||||
// Apply path prefix if configured
|
||||
if (filled($s3->path)) {
|
||||
// Strip leading/trailing slashes to avoid double slashes in path
|
||||
$pathPrefix = trim($s3->path, '/');
|
||||
$filenames = array_map(function ($filename) use ($pathPrefix) {
|
||||
// The filename is the backup path (e.g., /data/coolify/backups/databases/...)
|
||||
// We need to prepend the path prefix to match the S3 key structure
|
||||
$cleanFilename = ltrim($filename, '/');
|
||||
|
||||
return $pathPrefix.'/'.$cleanFilename;
|
||||
}, $filenames);
|
||||
}
|
||||
|
||||
$disk = Storage::build([
|
||||
'driver' => 's3',
|
||||
'key' => $s3->key,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('s3_storages', function (Blueprint $table) {
|
||||
$table->string('path')->nullable()->after('endpoint');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('s3_storages', function (Blueprint $table) {
|
||||
$table->dropColumn('path');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
$tables = [
|
||||
'standalone_postgresqls',
|
||||
'standalone_mysqls',
|
||||
'standalone_mariadbs',
|
||||
'standalone_redis',
|
||||
'standalone_mongodbs',
|
||||
'standalone_clickhouses',
|
||||
'standalone_keydbs',
|
||||
'standalone_dragonflies',
|
||||
'service_databases',
|
||||
];
|
||||
|
||||
foreach ($tables as $table) {
|
||||
if (Schema::hasTable($table) && !Schema::hasColumn($table, 'public_port_timeout')) {
|
||||
Schema::table($table, function (Blueprint $table) {
|
||||
$table->integer('public_port_timeout')->nullable()->default(3600)->after('public_port');
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
$tables = [
|
||||
'standalone_postgresqls',
|
||||
'standalone_mysqls',
|
||||
'standalone_mariadbs',
|
||||
'standalone_redis',
|
||||
'standalone_mongodbs',
|
||||
'standalone_clickhouses',
|
||||
'standalone_keydbs',
|
||||
'standalone_dragonflies',
|
||||
'service_databases',
|
||||
];
|
||||
|
||||
foreach ($tables as $table) {
|
||||
if (Schema::hasTable($table) && Schema::hasColumn($table, 'public_port_timeout')) {
|
||||
Schema::table($table, function (Blueprint $table) {
|
||||
$table->dropColumn('public_port_timeout');
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
@ -46,7 +46,7 @@
|
|||
href="{{ route('project.application.scheduled-tasks.show', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'application_uuid' => $application->uuid]) }}"><span class="menu-item-label">Scheduled Tasks</span></a>
|
||||
<a class="sub-menu-item" {{ wireNavigate() }} wire:current.exact="menu-item-active"
|
||||
href="{{ route('project.application.webhooks', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'application_uuid' => $application->uuid]) }}"><span class="menu-item-label">Webhooks</span></a>
|
||||
@if ($application->deploymentType() !== 'deploy_key')
|
||||
@if ($application->git_based())
|
||||
<a class="sub-menu-item" {{ wireNavigate() }} wire:current.exact="menu-item-active"
|
||||
href="{{ route('project.application.preview-deployments', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'application_uuid' => $application->uuid]) }}"><span class="menu-item-label">Preview Deployments</span></a>
|
||||
@endif
|
||||
|
|
|
|||
|
|
@ -78,6 +78,8 @@
|
|||
</div>
|
||||
<x-forms.input placeholder="5432" disabled="{{ $isPublic }}" id="publicPort" label="Public Port"
|
||||
canGate="update" :canResource="$database" />
|
||||
<x-forms.input placeholder="3600" disabled="{{ $isPublic }}" id="publicPortTimeout"
|
||||
label="Proxy Timeout (seconds)" helper="Timeout for the public TCP proxy connection in seconds. Default: 3600 (1 hour)." canGate="update" :canResource="$database" />
|
||||
</div>
|
||||
</form>
|
||||
<h3 class="pt-4">Advanced</h3>
|
||||
|
|
|
|||
|
|
@ -115,6 +115,8 @@
|
|||
</div>
|
||||
<x-forms.input placeholder="5432" disabled="{{ $isPublic }}" id="publicPort" label="Public Port"
|
||||
canGate="update" :canResource="$database" />
|
||||
<x-forms.input placeholder="3600" disabled="{{ $isPublic }}" id="publicPortTimeout"
|
||||
label="Proxy Timeout (seconds)" helper="Timeout for the public TCP proxy connection in seconds. Default: 3600 (1 hour)." canGate="update" :canResource="$database" />
|
||||
</div>
|
||||
</form>
|
||||
<h3 class="pt-4">Advanced</h3>
|
||||
|
|
|
|||
|
|
@ -115,6 +115,8 @@
|
|||
</div>
|
||||
<x-forms.input placeholder="5432" disabled="{{ $isPublic }}" id="publicPort" label="Public Port"
|
||||
canGate="update" :canResource="$database" />
|
||||
<x-forms.input placeholder="3600" disabled="{{ $isPublic }}" id="publicPortTimeout"
|
||||
label="Proxy Timeout (seconds)" helper="Timeout for the public TCP proxy connection in seconds. Default: 3600 (1 hour)." canGate="update" :canResource="$database" />
|
||||
</div>
|
||||
<x-forms.textarea
|
||||
helper="<a target='_blank' class='underline dark:text-white' href='https://raw.githubusercontent.com/Snapchat/KeyDB/unstable/keydb.conf'>KeyDB Default Configuration</a>"
|
||||
|
|
|
|||
|
|
@ -139,6 +139,8 @@
|
|||
</div>
|
||||
<x-forms.input placeholder="5432" disabled="{{ $isPublic }}"
|
||||
id="publicPort" label="Public Port" canGate="update" :canResource="$database" />
|
||||
<x-forms.input placeholder="3600" disabled="{{ $isPublic }}" id="publicPortTimeout"
|
||||
label="Proxy Timeout (seconds)" helper="Timeout for the public TCP proxy connection in seconds. Default: 3600 (1 hour)." canGate="update" :canResource="$database" />
|
||||
</div>
|
||||
<x-forms.textarea label="Custom MariaDB Configuration" rows="10" id="mariadbConf"
|
||||
canGate="update" :canResource="$database" />
|
||||
|
|
|
|||
|
|
@ -153,6 +153,8 @@
|
|||
</div>
|
||||
<x-forms.input placeholder="5432" disabled="{{ $isPublic }}"
|
||||
id="publicPort" label="Public Port" canGate="update" :canResource="$database" />
|
||||
<x-forms.input placeholder="3600" disabled="{{ $isPublic }}" id="publicPortTimeout"
|
||||
label="Proxy Timeout (seconds)" helper="Timeout for the public TCP proxy connection in seconds. Default: 3600 (1 hour)." canGate="update" :canResource="$database" />
|
||||
</div>
|
||||
<x-forms.textarea label="Custom MongoDB Configuration" rows="10" id="mongoConf"
|
||||
canGate="update" :canResource="$database" />
|
||||
|
|
|
|||
|
|
@ -155,6 +155,8 @@
|
|||
</div>
|
||||
<x-forms.input placeholder="5432" disabled="{{ $isPublic }}"
|
||||
id="publicPort" label="Public Port" canGate="update" :canResource="$database" />
|
||||
<x-forms.input placeholder="3600" disabled="{{ $isPublic }}" id="publicPortTimeout"
|
||||
label="Proxy Timeout (seconds)" helper="Timeout for the public TCP proxy connection in seconds. Default: 3600 (1 hour)." canGate="update" :canResource="$database" />
|
||||
</div>
|
||||
<x-forms.textarea label="Custom Mysql Configuration" rows="10" id="mysqlConf" canGate="update" :canResource="$database" />
|
||||
<h3 class="pt-4">Advanced</h3>
|
||||
|
|
|
|||
|
|
@ -165,6 +165,8 @@
|
|||
</div>
|
||||
<x-forms.input placeholder="5432" disabled="{{ $isPublic }}" id="publicPort"
|
||||
label="Public Port" canGate="update" :canResource="$database" />
|
||||
<x-forms.input placeholder="3600" disabled="{{ $isPublic }}" id="publicPortTimeout"
|
||||
label="Proxy Timeout (seconds)" helper="Timeout for the public TCP proxy connection in seconds. Default: 3600 (1 hour)." canGate="update" :canResource="$database" />
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col gap-2">
|
||||
|
|
|
|||
|
|
@ -134,6 +134,8 @@
|
|||
</div>
|
||||
<x-forms.input placeholder="5432" disabled="{{ $isPublic }}"
|
||||
id="publicPort" label="Public Port" canGate="update" :canResource="$database" />
|
||||
<x-forms.input placeholder="3600" disabled="{{ $isPublic }}" id="publicPortTimeout"
|
||||
label="Proxy Timeout (seconds)" helper="Timeout for the public TCP proxy connection in seconds. Default: 3600 (1 hour)." canGate="update" :canResource="$database" />
|
||||
</div>
|
||||
<x-forms.textarea placeholder="# maxmemory 256mb
|
||||
# maxmemory-policy allkeys-lru
|
||||
|
|
|
|||
|
|
@ -40,6 +40,11 @@
|
|||
<x-forms.input canGate="update" :canResource="$storage" required label="Bucket" id="bucket" />
|
||||
<x-forms.input canGate="update" :canResource="$storage" required label="Region" id="region" />
|
||||
</div>
|
||||
<div class="flex gap-2">
|
||||
<x-forms.input canGate="update" :canResource="$storage" label="Path Prefix" id="path"
|
||||
placeholder="e.g., production or instance-1"
|
||||
helper="Optional prefix added before the standard backup path (/data/coolify/backups/...). Useful for separating multiple Coolify instances in a single bucket." />
|
||||
</div>
|
||||
<div class="flex gap-2">
|
||||
<x-forms.input canGate="update" :canResource="$storage" required type="password" label="Access Key"
|
||||
id="key" />
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@
|
|||
<div class="text-xs font-bold text-neutral-500 uppercase tracking-wide pb-1.5">Due now</div>
|
||||
<div class="flex justify-between gap-6 text-sm font-bold">
|
||||
<span class="dark:text-white">Prorated charge</span>
|
||||
<span class="dark:text-warning" x-text="fmt(preview.due_now)"></span>
|
||||
<span class="dark:text-warning" x-text="fmt(preview?.due_now)"></span>
|
||||
</div>
|
||||
<p class="text-xs text-neutral-500 pt-1">Charged immediately to your payment method.</p>
|
||||
</div>
|
||||
|
|
@ -147,8 +147,8 @@
|
|||
<div class="text-xs font-bold text-neutral-500 uppercase tracking-wide pb-1.5">Next billing cycle</div>
|
||||
<div class="space-y-1.5">
|
||||
<div class="flex justify-between gap-6 text-sm">
|
||||
<span class="text-neutral-500" x-text="preview.quantity + ' servers × ' + fmt(preview.unit_price)"></span>
|
||||
<span class="dark:text-white" x-text="fmt(preview.recurring_subtotal)"></span>
|
||||
<span class="text-neutral-500" x-text="preview?.quantity + ' servers × ' + fmt(preview?.unit_price)"></span>
|
||||
<span class="dark:text-white" x-text="fmt(preview?.recurring_subtotal)"></span>
|
||||
</div>
|
||||
<div class="flex justify-between gap-6 text-sm" x-show="preview?.tax_description" x-cloak>
|
||||
<span class="text-neutral-500" x-text="preview?.tax_description"></span>
|
||||
|
|
@ -156,7 +156,7 @@
|
|||
</div>
|
||||
<div class="flex justify-between gap-6 text-sm font-bold pt-1.5 border-t dark:border-coolgray-400 border-neutral-200">
|
||||
<span class="dark:text-white">Total / month</span>
|
||||
<span class="dark:text-white" x-text="fmt(preview.recurring_total)"></span>
|
||||
<span class="dark:text-white" x-text="fmt(preview?.recurring_total)"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -43,3 +43,15 @@ test('isNonTransientError detects port conflict patterns', function () {
|
|||
->and($method->invoke($action, 'network timeout'))->toBeFalse()
|
||||
->and($method->invoke($action, 'connection refused'))->toBeFalse();
|
||||
});
|
||||
|
||||
test('buildProxyTimeoutConfig normalizes invalid values to default', function (?int $input, string $expected) {
|
||||
$action = new StartDatabaseProxy;
|
||||
$method = new ReflectionMethod($action, 'buildProxyTimeoutConfig');
|
||||
|
||||
expect($method->invoke($action, $input))->toBe($expected);
|
||||
})->with([
|
||||
[null, 'proxy_timeout 3600s;'],
|
||||
[0, 'proxy_timeout 3600s;'],
|
||||
[-10, 'proxy_timeout 3600s;'],
|
||||
[120, 'proxy_timeout 120s;'],
|
||||
]);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,95 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Test to verify that docker-compose custom start commands use the correct
|
||||
* execution context based on the preserveRepository setting.
|
||||
*
|
||||
* When preserveRepository is enabled, the compose file and .env file are
|
||||
* written to the host at /data/coolify/applications/{uuid}/. The start
|
||||
* command must run on the host (not inside the helper container) so it
|
||||
* can access these files.
|
||||
*
|
||||
* When preserveRepository is disabled, the files are inside the helper
|
||||
* container at /artifacts/{uuid}/, so the command must run inside the
|
||||
* container via executeInDocker().
|
||||
*
|
||||
* @see https://github.com/coollabsio/coolify/issues/8417
|
||||
*/
|
||||
it('generates host command (not executeInDocker) when preserveRepository is true', function () {
|
||||
$deploymentUuid = 'test-deployment-uuid';
|
||||
$serverWorkdir = '/data/coolify/applications/app-uuid';
|
||||
$basedir = '/artifacts/test-deployment-uuid';
|
||||
$preserveRepository = true;
|
||||
|
||||
$startCommand = 'docker compose -f /data/coolify/applications/app-uuid/compose.yml --env-file /data/coolify/applications/app-uuid/.env --profile all up -d';
|
||||
|
||||
// Simulate the logic from ApplicationDeploymentJob::deploy_docker_compose_buildpack()
|
||||
if ($preserveRepository) {
|
||||
$command = "cd {$serverWorkdir} && {$startCommand}";
|
||||
} else {
|
||||
$command = executeInDocker($deploymentUuid, "cd {$basedir} && {$startCommand}");
|
||||
}
|
||||
|
||||
// When preserveRepository is true, the command should NOT be wrapped in executeInDocker
|
||||
expect($command)->not->toContain('docker exec');
|
||||
expect($command)->toStartWith("cd {$serverWorkdir}");
|
||||
expect($command)->toContain($startCommand);
|
||||
});
|
||||
|
||||
it('generates executeInDocker command when preserveRepository is false', function () {
|
||||
$deploymentUuid = 'test-deployment-uuid';
|
||||
$serverWorkdir = '/data/coolify/applications/app-uuid';
|
||||
$basedir = '/artifacts/test-deployment-uuid';
|
||||
$workdir = '/artifacts/test-deployment-uuid/backend';
|
||||
$preserveRepository = false;
|
||||
|
||||
$startCommand = 'docker compose -f /artifacts/test-deployment-uuid/backend/compose.yml --env-file /artifacts/test-deployment-uuid/backend/.env --profile all up -d';
|
||||
|
||||
// Simulate the logic from ApplicationDeploymentJob::deploy_docker_compose_buildpack()
|
||||
if ($preserveRepository) {
|
||||
$command = "cd {$serverWorkdir} && {$startCommand}";
|
||||
} else {
|
||||
$command = executeInDocker($deploymentUuid, "cd {$basedir} && {$startCommand}");
|
||||
}
|
||||
|
||||
// When preserveRepository is false, the command SHOULD be wrapped in executeInDocker
|
||||
expect($command)->toContain('docker exec');
|
||||
expect($command)->toContain($deploymentUuid);
|
||||
expect($command)->toContain("cd {$basedir}");
|
||||
});
|
||||
|
||||
it('uses host paths for env-file when preserveRepository is true', function () {
|
||||
$serverWorkdir = '/data/coolify/applications/app-uuid';
|
||||
$composeLocation = '/compose.yml';
|
||||
$preserveRepository = true;
|
||||
|
||||
$workdirPath = $preserveRepository ? $serverWorkdir : '/artifacts/deployment-uuid/backend';
|
||||
$startCommand = injectDockerComposeFlags(
|
||||
'docker compose --profile all up -d',
|
||||
"{$workdirPath}{$composeLocation}",
|
||||
"{$workdirPath}/.env"
|
||||
);
|
||||
|
||||
// Verify the injected paths point to the host filesystem
|
||||
expect($startCommand)->toContain("--env-file {$serverWorkdir}/.env");
|
||||
expect($startCommand)->toContain("-f {$serverWorkdir}{$composeLocation}");
|
||||
});
|
||||
|
||||
it('uses container paths for env-file when preserveRepository is false', function () {
|
||||
$workdir = '/artifacts/deployment-uuid/backend';
|
||||
$composeLocation = '/compose.yml';
|
||||
$preserveRepository = false;
|
||||
$serverWorkdir = '/data/coolify/applications/app-uuid';
|
||||
|
||||
$workdirPath = $preserveRepository ? $serverWorkdir : $workdir;
|
||||
$startCommand = injectDockerComposeFlags(
|
||||
'docker compose --profile all up -d',
|
||||
"{$workdirPath}{$composeLocation}",
|
||||
"{$workdirPath}/.env"
|
||||
);
|
||||
|
||||
// Verify the injected paths point to the container filesystem
|
||||
expect($startCommand)->toContain("--env-file {$workdir}/.env");
|
||||
expect($startCommand)->toContain("-f {$workdir}{$composeLocation}");
|
||||
expect($startCommand)->not->toContain('/data/coolify/applications/');
|
||||
});
|
||||
|
|
@ -51,3 +51,67 @@ test('S3Storage model is guarded correctly', function () {
|
|||
// The model should have $guarded = [] which means everything is fillable
|
||||
expect($s3Storage->getGuarded())->toBe([]);
|
||||
});
|
||||
|
||||
test('S3Storage path attribute normalizes path correctly', function () {
|
||||
$s3Storage = new S3Storage;
|
||||
|
||||
// Path should be normalized to start with /
|
||||
$s3Storage->path = 'backups/coolify';
|
||||
expect($s3Storage->path)->toBe('/backups/coolify');
|
||||
|
||||
// Path with leading slash should remain unchanged
|
||||
$s3Storage->path = '/backups/coolify';
|
||||
expect($s3Storage->path)->toBe('/backups/coolify');
|
||||
|
||||
// Empty path should return null
|
||||
$s3Storage->path = '';
|
||||
expect($s3Storage->path)->toBeNull();
|
||||
|
||||
// Null path should return null
|
||||
$s3Storage->path = null;
|
||||
expect($s3Storage->path)->toBeNull();
|
||||
|
||||
// Path with whitespace should be trimmed
|
||||
$s3Storage->path = ' backups/coolify ';
|
||||
expect($s3Storage->path)->toBe('/backups/coolify');
|
||||
});
|
||||
|
||||
test('S3Storage path attribute handles various path formats', function () {
|
||||
$s3Storage = new S3Storage;
|
||||
|
||||
// Simple path
|
||||
$s3Storage->path = 'instance-1';
|
||||
expect($s3Storage->path)->toBe('/instance-1');
|
||||
|
||||
// Nested path
|
||||
$s3Storage->path = 'production/backups/db';
|
||||
expect($s3Storage->path)->toBe('/production/backups/db');
|
||||
|
||||
// Path with special characters
|
||||
$s3Storage->path = 'my-instance_2024.backups';
|
||||
expect($s3Storage->path)->toBe('/my-instance_2024.backups');
|
||||
});
|
||||
|
||||
test('S3Storage path attribute handles edge cases', function () {
|
||||
$s3Storage = new S3Storage;
|
||||
|
||||
// Multiple consecutive slashes are preserved (validation should catch this)
|
||||
$s3Storage->path = 'path//to///backup';
|
||||
expect($s3Storage->path)->toBe('/path//to///backup');
|
||||
|
||||
// Path ending with slash - trailing slashes are now stripped
|
||||
$s3Storage->path = 'backups/coolify/';
|
||||
expect($s3Storage->path)->toBe('/backups/coolify');
|
||||
|
||||
// Only whitespace should return null
|
||||
$s3Storage->path = ' ';
|
||||
expect($s3Storage->path)->toBeNull();
|
||||
|
||||
// Path with dots (valid single dots)
|
||||
$s3Storage->path = 'path.with.dots';
|
||||
expect($s3Storage->path)->toBe('/path.with.dots');
|
||||
|
||||
// Only slashes should return null
|
||||
$s3Storage->path = '///';
|
||||
expect($s3Storage->path)->toBeNull();
|
||||
});
|
||||
|
|
|
|||
11
tests/Unit/ServiceIndexValidationTest.php
Normal file
11
tests/Unit/ServiceIndexValidationTest.php
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
|
||||
use App\Livewire\Project\Service\Index;
|
||||
|
||||
test('service database proxy timeout requires a minimum of one second', function () {
|
||||
$component = new Index;
|
||||
$rules = (fn (): array => $this->rules)->call($component);
|
||||
|
||||
expect($rules['publicPortTimeout'])
|
||||
->toContain('min:1');
|
||||
});
|
||||
Loading…
Reference in a new issue