Skip to content

Commit b570ccd

Browse files
committed
format
1 parent 68efd4b commit b570ccd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+235
-210
lines changed

app/Actions/CoolifyTask/RunRemoteProcess.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
use App\Enums\ActivityTypes;
66
use App\Enums\ProcessStatus;
7+
use App\Helpers\SshMultiplexingHelper;
78
use App\Jobs\ApplicationDeploymentJob;
89
use App\Models\Server;
910
use Illuminate\Process\ProcessResult;
1011
use Illuminate\Support\Facades\DB;
1112
use Illuminate\Support\Facades\Process;
1213
use Spatie\Activitylog\Models\Activity;
13-
use App\Helpers\SshMultiplexingHelper;
1414

1515
class RunRemoteProcess
1616
{

app/Actions/Database/StartDragonfly.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function handle(StandaloneDragonfly $database)
2323
$startCommand = "dragonfly --requirepass {$this->database->dragonfly_password}";
2424

2525
$container_name = $this->database->uuid;
26-
$this->configuration_dir = database_configuration_dir() . '/' . $container_name;
26+
$this->configuration_dir = database_configuration_dir().'/'.$container_name;
2727

2828
$this->commands = [
2929
"echo 'Starting {$database->name}.'",
@@ -75,7 +75,7 @@ public function handle(StandaloneDragonfly $database)
7575
],
7676
],
7777
];
78-
if (!is_null($this->database->limits_cpuset)) {
78+
if (! is_null($this->database->limits_cpuset)) {
7979
data_set($docker_compose, "services.{$container_name}.cpuset", $this->database->limits_cpuset);
8080
}
8181
if ($this->database->destination->server->isLogDrainEnabled() && $this->database->isLogDrainEnabled()) {
@@ -118,10 +118,10 @@ private function generate_local_persistent_volumes()
118118
$local_persistent_volumes = [];
119119
foreach ($this->database->persistentStorages as $persistentStorage) {
120120
if ($persistentStorage->host_path !== '' && $persistentStorage->host_path !== null) {
121-
$local_persistent_volumes[] = $persistentStorage->host_path . ':' . $persistentStorage->mount_path;
121+
$local_persistent_volumes[] = $persistentStorage->host_path.':'.$persistentStorage->mount_path;
122122
} else {
123123
$volume_name = $persistentStorage->name;
124-
$local_persistent_volumes[] = $volume_name . ':' . $persistentStorage->mount_path;
124+
$local_persistent_volumes[] = $volume_name.':'.$persistentStorage->mount_path;
125125
}
126126
}
127127

@@ -152,7 +152,7 @@ private function generate_environment_variables()
152152
$environment_variables->push("$env->key=$env->real_value");
153153
}
154154

155-
if ($environment_variables->filter(fn($env) => str($env)->contains('REDIS_PASSWORD'))->isEmpty()) {
155+
if ($environment_variables->filter(fn ($env) => str($env)->contains('REDIS_PASSWORD'))->isEmpty()) {
156156
$environment_variables->push("REDIS_PASSWORD={$this->database->dragonfly_password}");
157157
}
158158

app/Actions/Database/StartKeydb.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function handle(StandaloneKeydb $database)
2424
$startCommand = "keydb-server --requirepass {$this->database->keydb_password} --appendonly yes";
2525

2626
$container_name = $this->database->uuid;
27-
$this->configuration_dir = database_configuration_dir() . '/' . $container_name;
27+
$this->configuration_dir = database_configuration_dir().'/'.$container_name;
2828

2929
$this->commands = [
3030
"echo 'Starting {$database->name}.'",
@@ -74,7 +74,7 @@ public function handle(StandaloneKeydb $database)
7474
],
7575
],
7676
];
77-
if (!is_null($this->database->limits_cpuset)) {
77+
if (! is_null($this->database->limits_cpuset)) {
7878
data_set($docker_compose, "services.{$container_name}.cpuset", $this->database->limits_cpuset);
7979
}
8080
if ($this->database->destination->server->isLogDrainEnabled() && $this->database->isLogDrainEnabled()) {
@@ -94,10 +94,10 @@ public function handle(StandaloneKeydb $database)
9494
if (count($volume_names) > 0) {
9595
$docker_compose['volumes'] = $volume_names;
9696
}
97-
if (!is_null($this->database->keydb_conf) || !empty($this->database->keydb_conf)) {
97+
if (! is_null($this->database->keydb_conf) || ! empty($this->database->keydb_conf)) {
9898
$docker_compose['services'][$container_name]['volumes'][] = [
9999
'type' => 'bind',
100-
'source' => $this->configuration_dir . '/keydb.conf',
100+
'source' => $this->configuration_dir.'/keydb.conf',
101101
'target' => '/etc/keydb/keydb.conf',
102102
'read_only' => true,
103103
];
@@ -125,10 +125,10 @@ private function generate_local_persistent_volumes()
125125
$local_persistent_volumes = [];
126126
foreach ($this->database->persistentStorages as $persistentStorage) {
127127
if ($persistentStorage->host_path !== '' && $persistentStorage->host_path !== null) {
128-
$local_persistent_volumes[] = $persistentStorage->host_path . ':' . $persistentStorage->mount_path;
128+
$local_persistent_volumes[] = $persistentStorage->host_path.':'.$persistentStorage->mount_path;
129129
} else {
130130
$volume_name = $persistentStorage->name;
131-
$local_persistent_volumes[] = $volume_name . ':' . $persistentStorage->mount_path;
131+
$local_persistent_volumes[] = $volume_name.':'.$persistentStorage->mount_path;
132132
}
133133
}
134134

@@ -159,7 +159,7 @@ private function generate_environment_variables()
159159
$environment_variables->push("$env->key=$env->real_value");
160160
}
161161

162-
if ($environment_variables->filter(fn($env) => str($env)->contains('REDIS_PASSWORD'))->isEmpty()) {
162+
if ($environment_variables->filter(fn ($env) => str($env)->contains('REDIS_PASSWORD'))->isEmpty()) {
163163
$environment_variables->push("REDIS_PASSWORD={$this->database->keydb_password}");
164164
}
165165

app/Actions/Database/StartMariadb.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function handle(StandaloneMariadb $database)
2121
$this->database = $database;
2222

2323
$container_name = $this->database->uuid;
24-
$this->configuration_dir = database_configuration_dir() . '/' . $container_name;
24+
$this->configuration_dir = database_configuration_dir().'/'.$container_name;
2525

2626
$this->commands = [
2727
"echo 'Starting {$database->name}.'",
@@ -69,7 +69,7 @@ public function handle(StandaloneMariadb $database)
6969
],
7070
],
7171
];
72-
if (!is_null($this->database->limits_cpuset)) {
72+
if (! is_null($this->database->limits_cpuset)) {
7373
data_set($docker_compose, "services.{$container_name}.cpuset", $this->database->limits_cpuset);
7474
}
7575
if ($this->database->destination->server->isLogDrainEnabled() && $this->database->isLogDrainEnabled()) {
@@ -89,10 +89,10 @@ public function handle(StandaloneMariadb $database)
8989
if (count($volume_names) > 0) {
9090
$docker_compose['volumes'] = $volume_names;
9191
}
92-
if (!is_null($this->database->mariadb_conf) || !empty($this->database->mariadb_conf)) {
92+
if (! is_null($this->database->mariadb_conf) || ! empty($this->database->mariadb_conf)) {
9393
$docker_compose['services'][$container_name]['volumes'][] = [
9494
'type' => 'bind',
95-
'source' => $this->configuration_dir . '/custom-config.cnf',
95+
'source' => $this->configuration_dir.'/custom-config.cnf',
9696
'target' => '/etc/mysql/conf.d/custom-config.cnf',
9797
'read_only' => true,
9898
];
@@ -120,10 +120,10 @@ private function generate_local_persistent_volumes()
120120
$local_persistent_volumes = [];
121121
foreach ($this->database->persistentStorages as $persistentStorage) {
122122
if ($persistentStorage->host_path !== '' && $persistentStorage->host_path !== null) {
123-
$local_persistent_volumes[] = $persistentStorage->host_path . ':' . $persistentStorage->mount_path;
123+
$local_persistent_volumes[] = $persistentStorage->host_path.':'.$persistentStorage->mount_path;
124124
} else {
125125
$volume_name = $persistentStorage->name;
126-
$local_persistent_volumes[] = $volume_name . ':' . $persistentStorage->mount_path;
126+
$local_persistent_volumes[] = $volume_name.':'.$persistentStorage->mount_path;
127127
}
128128
}
129129

@@ -154,18 +154,18 @@ private function generate_environment_variables()
154154
$environment_variables->push("$env->key=$env->real_value");
155155
}
156156

157-
if ($environment_variables->filter(fn($env) => str($env)->contains('MARIADB_ROOT_PASSWORD'))->isEmpty()) {
157+
if ($environment_variables->filter(fn ($env) => str($env)->contains('MARIADB_ROOT_PASSWORD'))->isEmpty()) {
158158
$environment_variables->push("MARIADB_ROOT_PASSWORD={$this->database->mariadb_root_password}");
159159
}
160160

161-
if ($environment_variables->filter(fn($env) => str($env)->contains('MARIADB_DATABASE'))->isEmpty()) {
161+
if ($environment_variables->filter(fn ($env) => str($env)->contains('MARIADB_DATABASE'))->isEmpty()) {
162162
$environment_variables->push("MARIADB_DATABASE={$this->database->mariadb_database}");
163163
}
164164

165-
if ($environment_variables->filter(fn($env) => str($env)->contains('MARIADB_USER'))->isEmpty()) {
165+
if ($environment_variables->filter(fn ($env) => str($env)->contains('MARIADB_USER'))->isEmpty()) {
166166
$environment_variables->push("MARIADB_USER={$this->database->mariadb_user}");
167167
}
168-
if ($environment_variables->filter(fn($env) => str($env)->contains('MARIADB_PASSWORD'))->isEmpty()) {
168+
if ($environment_variables->filter(fn ($env) => str($env)->contains('MARIADB_PASSWORD'))->isEmpty()) {
169169
$environment_variables->push("MARIADB_PASSWORD={$this->database->mariadb_password}");
170170
}
171171

app/Actions/Database/StartMongodb.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function handle(StandaloneMongodb $database)
2323
$startCommand = 'mongod';
2424

2525
$container_name = $this->database->uuid;
26-
$this->configuration_dir = database_configuration_dir() . '/' . $container_name;
26+
$this->configuration_dir = database_configuration_dir().'/'.$container_name;
2727

2828
$this->commands = [
2929
"echo 'Starting {$database->name}.'",
@@ -77,7 +77,7 @@ public function handle(StandaloneMongodb $database)
7777
],
7878
],
7979
];
80-
if (!is_null($this->database->limits_cpuset)) {
80+
if (! is_null($this->database->limits_cpuset)) {
8181
data_set($docker_compose, "services.{$container_name}.cpuset", $this->database->limits_cpuset);
8282
}
8383
if ($this->database->destination->server->isLogDrainEnabled() && $this->database->isLogDrainEnabled()) {
@@ -97,19 +97,19 @@ public function handle(StandaloneMongodb $database)
9797
if (count($volume_names) > 0) {
9898
$docker_compose['volumes'] = $volume_names;
9999
}
100-
if (!is_null($this->database->mongo_conf) || !empty($this->database->mongo_conf)) {
100+
if (! is_null($this->database->mongo_conf) || ! empty($this->database->mongo_conf)) {
101101
$docker_compose['services'][$container_name]['volumes'][] = [
102102
'type' => 'bind',
103-
'source' => $this->configuration_dir . '/mongod.conf',
103+
'source' => $this->configuration_dir.'/mongod.conf',
104104
'target' => '/etc/mongo/mongod.conf',
105105
'read_only' => true,
106106
];
107-
$docker_compose['services'][$container_name]['command'] = $startCommand . ' --config /etc/mongo/mongod.conf';
107+
$docker_compose['services'][$container_name]['command'] = $startCommand.' --config /etc/mongo/mongod.conf';
108108
}
109109
$this->add_default_database();
110110
$docker_compose['services'][$container_name]['volumes'][] = [
111111
'type' => 'bind',
112-
'source' => $this->configuration_dir . '/docker-entrypoint-initdb.d',
112+
'source' => $this->configuration_dir.'/docker-entrypoint-initdb.d',
113113
'target' => '/docker-entrypoint-initdb.d',
114114
'read_only' => true,
115115
];
@@ -136,10 +136,10 @@ private function generate_local_persistent_volumes()
136136
$local_persistent_volumes = [];
137137
foreach ($this->database->persistentStorages as $persistentStorage) {
138138
if ($persistentStorage->host_path !== '' && $persistentStorage->host_path !== null) {
139-
$local_persistent_volumes[] = $persistentStorage->host_path . ':' . $persistentStorage->mount_path;
139+
$local_persistent_volumes[] = $persistentStorage->host_path.':'.$persistentStorage->mount_path;
140140
} else {
141141
$volume_name = $persistentStorage->name;
142-
$local_persistent_volumes[] = $volume_name . ':' . $persistentStorage->mount_path;
142+
$local_persistent_volumes[] = $volume_name.':'.$persistentStorage->mount_path;
143143
}
144144
}
145145

@@ -170,15 +170,15 @@ private function generate_environment_variables()
170170
$environment_variables->push("$env->key=$env->real_value");
171171
}
172172

173-
if ($environment_variables->filter(fn($env) => str($env)->contains('MONGO_INITDB_ROOT_USERNAME'))->isEmpty()) {
173+
if ($environment_variables->filter(fn ($env) => str($env)->contains('MONGO_INITDB_ROOT_USERNAME'))->isEmpty()) {
174174
$environment_variables->push("MONGO_INITDB_ROOT_USERNAME={$this->database->mongo_initdb_root_username}");
175175
}
176176

177-
if ($environment_variables->filter(fn($env) => str($env)->contains('MONGO_INITDB_ROOT_PASSWORD'))->isEmpty()) {
177+
if ($environment_variables->filter(fn ($env) => str($env)->contains('MONGO_INITDB_ROOT_PASSWORD'))->isEmpty()) {
178178
$environment_variables->push("MONGO_INITDB_ROOT_PASSWORD={$this->database->mongo_initdb_root_password}");
179179
}
180180

181-
if ($environment_variables->filter(fn($env) => str($env)->contains('MONGO_INITDB_DATABASE'))->isEmpty()) {
181+
if ($environment_variables->filter(fn ($env) => str($env)->contains('MONGO_INITDB_DATABASE'))->isEmpty()) {
182182
$environment_variables->push("MONGO_INITDB_DATABASE={$this->database->mongo_initdb_database}");
183183
}
184184

app/Actions/Database/StartMysql.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function handle(StandaloneMysql $database)
2121
$this->database = $database;
2222

2323
$container_name = $this->database->uuid;
24-
$this->configuration_dir = database_configuration_dir() . '/' . $container_name;
24+
$this->configuration_dir = database_configuration_dir().'/'.$container_name;
2525

2626
$this->commands = [
2727
"echo 'Starting {$database->name}.'",
@@ -69,7 +69,7 @@ public function handle(StandaloneMysql $database)
6969
],
7070
],
7171
];
72-
if (!is_null($this->database->limits_cpuset)) {
72+
if (! is_null($this->database->limits_cpuset)) {
7373
data_set($docker_compose, "services.{$container_name}.cpuset", $this->database->limits_cpuset);
7474
}
7575
if ($this->database->destination->server->isLogDrainEnabled() && $this->database->isLogDrainEnabled()) {
@@ -89,10 +89,10 @@ public function handle(StandaloneMysql $database)
8989
if (count($volume_names) > 0) {
9090
$docker_compose['volumes'] = $volume_names;
9191
}
92-
if (!is_null($this->database->mysql_conf) || !empty($this->database->mysql_conf)) {
92+
if (! is_null($this->database->mysql_conf) || ! empty($this->database->mysql_conf)) {
9393
$docker_compose['services'][$container_name]['volumes'][] = [
9494
'type' => 'bind',
95-
'source' => $this->configuration_dir . '/custom-config.cnf',
95+
'source' => $this->configuration_dir.'/custom-config.cnf',
9696
'target' => '/etc/mysql/conf.d/custom-config.cnf',
9797
'read_only' => true,
9898
];
@@ -120,10 +120,10 @@ private function generate_local_persistent_volumes()
120120
$local_persistent_volumes = [];
121121
foreach ($this->database->persistentStorages as $persistentStorage) {
122122
if ($persistentStorage->host_path !== '' && $persistentStorage->host_path !== null) {
123-
$local_persistent_volumes[] = $persistentStorage->host_path . ':' . $persistentStorage->mount_path;
123+
$local_persistent_volumes[] = $persistentStorage->host_path.':'.$persistentStorage->mount_path;
124124
} else {
125125
$volume_name = $persistentStorage->name;
126-
$local_persistent_volumes[] = $volume_name . ':' . $persistentStorage->mount_path;
126+
$local_persistent_volumes[] = $volume_name.':'.$persistentStorage->mount_path;
127127
}
128128
}
129129

@@ -154,18 +154,18 @@ private function generate_environment_variables()
154154
$environment_variables->push("$env->key=$env->real_value");
155155
}
156156

157-
if ($environment_variables->filter(fn($env) => str($env)->contains('MYSQL_ROOT_PASSWORD'))->isEmpty()) {
157+
if ($environment_variables->filter(fn ($env) => str($env)->contains('MYSQL_ROOT_PASSWORD'))->isEmpty()) {
158158
$environment_variables->push("MYSQL_ROOT_PASSWORD={$this->database->mysql_root_password}");
159159
}
160160

161-
if ($environment_variables->filter(fn($env) => str($env)->contains('MYSQL_DATABASE'))->isEmpty()) {
161+
if ($environment_variables->filter(fn ($env) => str($env)->contains('MYSQL_DATABASE'))->isEmpty()) {
162162
$environment_variables->push("MYSQL_DATABASE={$this->database->mysql_database}");
163163
}
164164

165-
if ($environment_variables->filter(fn($env) => str($env)->contains('MYSQL_USER'))->isEmpty()) {
165+
if ($environment_variables->filter(fn ($env) => str($env)->contains('MYSQL_USER'))->isEmpty()) {
166166
$environment_variables->push("MYSQL_USER={$this->database->mysql_user}");
167167
}
168-
if ($environment_variables->filter(fn($env) => str($env)->contains('MYSQL_PASSWORD'))->isEmpty()) {
168+
if ($environment_variables->filter(fn ($env) => str($env)->contains('MYSQL_PASSWORD'))->isEmpty()) {
169169
$environment_variables->push("MYSQL_PASSWORD={$this->database->mysql_password}");
170170
}
171171

app/Actions/Database/StartPostgresql.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ public function handle(StandalonePostgresql $database)
3737
$this->generate_init_scripts();
3838
$this->add_custom_conf();
3939

40-
4140
$docker_compose = [
4241
'services' => [
4342
$container_name => [

0 commit comments

Comments
 (0)