Skip to content

Commit

Permalink
Remove some useless variable assignments
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmichot committed Oct 10, 2024
1 parent 9943199 commit 0f8f2ad
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 17 deletions.
2 changes: 0 additions & 2 deletions app/Livewire/Boarding/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ public function mount()
}
$this->privateKeyName = generate_random_name();
$this->remoteServerName = generate_random_name();
$this->remoteServerPort = $this->remoteServerPort;
$this->remoteServerUser = $this->remoteServerUser;
if (isDev()) {
$this->privateKey = '-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
Expand Down
7 changes: 0 additions & 7 deletions app/Livewire/Server/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@ public function mount(Server $server)
$this->server = $server;
$this->timezones = collect(timezone_identifiers_list())->sort()->values()->toArray();
$this->wildcard_domain = $this->server->settings->wildcard_domain;
$this->server->settings->docker_cleanup_threshold = $this->server->settings->docker_cleanup_threshold;
$this->server->settings->docker_cleanup_frequency = $this->server->settings->docker_cleanup_frequency;
$this->server->settings->delete_unused_volumes = $server->settings->delete_unused_volumes;
$this->server->settings->delete_unused_networks = $server->settings->delete_unused_networks;
}
Expand Down Expand Up @@ -236,11 +234,6 @@ public function submit()
}
refresh_server_connection($this->server->privateKey);
$this->server->settings->wildcard_domain = $this->wildcard_domain;
if ($this->server->settings->force_docker_cleanup) {
$this->server->settings->docker_cleanup_frequency = $this->server->settings->docker_cleanup_frequency;
} else {
$this->server->settings->docker_cleanup_threshold = $this->server->settings->docker_cleanup_threshold;
}
$currentTimezone = $this->server->settings->getOriginal('server_timezone');
$newTimezone = $this->server->settings->server_timezone;
if ($currentTimezone !== $newTimezone || $currentTimezone === '') {
Expand Down
5 changes: 3 additions & 2 deletions app/Models/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -1459,9 +1459,10 @@ public function generateConfig($is_json = false)

return $config;
}
public function setConfig($config) {

$config = $config;
public function setConfig($config)
{

$validator = Validator::make(['config' => $config], [
'config' => 'required|json',
]);
Expand Down
12 changes: 6 additions & 6 deletions bootstrap/helpers/docker.php
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ function fqdnLabelsForCaddy(string $network, string $uuid, Collection $domains,
$labels->push("caddy_ingress_network={$network}");
}
foreach ($domains as $loop => $domain) {
$loop = $loop;
$url = Url::fromString($domain);
$host = $url->getHost();
$path = $url->getPath();
Expand Down Expand Up @@ -335,10 +334,11 @@ function fqdnLabelsForTraefik(string $uuid, Collection $domains, bool $is_force_
if (preg_match('/coolify\.traefik\.middlewares=(.*)/', $item, $matches)) {
return explode(',', $matches[1]);
}

return null;
})->flatten()
->filter()
->unique();
->filter()
->unique();
}
foreach ($domains as $loop => $domain) {
try {
Expand Down Expand Up @@ -388,7 +388,7 @@ function fqdnLabelsForTraefik(string $uuid, Collection $domains, bool $is_force_
if ($path !== '/') {
// Middleware handling
$middlewares = collect([]);
if ($is_stripprefix_enabled && !str($image)->contains('ghost')) {
if ($is_stripprefix_enabled && ! str($image)->contains('ghost')) {
$labels->push("traefik.http.middlewares.{$https_label}-stripprefix.stripprefix.prefixes={$path}");
$middlewares->push("{$https_label}-stripprefix");
}
Expand All @@ -402,7 +402,7 @@ function fqdnLabelsForTraefik(string $uuid, Collection $domains, bool $is_force_
$labels = $labels->merge($redirect_to_non_www);
$middlewares->push($to_non_www_name);
}
if ($redirect_direction === 'www' && !str($host)->startsWith('www.')) {
if ($redirect_direction === 'www' && ! str($host)->startsWith('www.')) {
$labels = $labels->merge($redirect_to_www);
$middlewares->push($to_www_name);
}
Expand All @@ -417,7 +417,7 @@ function fqdnLabelsForTraefik(string $uuid, Collection $domains, bool $is_force_
$middlewares = collect([]);
if ($is_gzip_enabled) {
$middlewares->push('gzip');
}
}
if (str($image)->contains('ghost')) {
$middlewares->push('redir-ghost');
}
Expand Down

0 comments on commit 0f8f2ad

Please sign in to comment.