Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

bugfixes

Andras Bacsaic26002426f9a
diff --git a/app/Http/Livewire/Project/Application/General.php b/app/Http/Livewire/Project/Application/General.php
index 8b2ed89005..04be741405 100644
--- a/app/Http/Livewire/Project/Application/General.php
+++ b/app/Http/Livewire/Project/Application/General.php
@@ -152,7 +152,7 @@ class General extends Component
if ($this->application->publish_directory && $this->application->publish_directory !== '/') {
$this->application->publish_directory = rtrim($this->application->publish_directory, '/');
}
- $this->application->fqdn = $domains->implode(',');
+ $this->application->fqdn = data_get($domains->implode(','), '', null);
$this->application->save();
$this->emit('success', 'Application settings updated!');
} catch (\Exception $e) {
diff --git a/bootstrap/helpers/docker.php b/bootstrap/helpers/docker.php
index 760f520e92..7b78abe8a5 100644
--- a/bootstrap/helpers/docker.php
+++ b/bootstrap/helpers/docker.php
@@ -2,14 +2,15 @@
use App\Models\Server;
use Illuminate\Support\Collection;
+use Illuminate\Support\Str;
function format_docker_command_output_to_json($rawOutput): Collection
{
$outputLines = explode(PHP_EOL, $rawOutput);
return collect($outputLines)
- ->reject(fn($line) => empty($line))
- ->map(fn($outputLine) => json_decode($outputLine, true, flags: JSON_THROW_ON_ERROR));
+ ->reject(fn ($line) => empty($line))
+ ->map(fn ($outputLine) => json_decode($outputLine, true, flags: JSON_THROW_ON_ERROR));
}
function format_docker_labels_to_json($rawOutput): Collection
@@ -17,7 +18,7 @@ function format_docker_labels_to_json($rawOutput): Collection
$outputLines = explode(PHP_EOL, $rawOutput);
return collect($outputLines)
- ->reject(fn($line) => empty($line))
+ ->reject(fn ($line) => empty($line))
->map(function ($outputLine) {
$outputArray = explode(',', $outputLine);
return collect($outputArray)
@@ -54,7 +55,7 @@ function get_container_status(Server $server, string $container_id, bool $all_da
if ($all_data) {
return $container[0];
}
- return $container[0]['State']['Status'];
+ return data_get($container[0], 'State.Status', 'exited');
}
function generate_container_name(string $uuid, int $pull_request_id = 0)
@@ -67,11 +68,17 @@ function generate_container_name(string $uuid, int $pull_request_id = 0)
}
function get_port_from_dockerfile($dockerfile): int
{
- $port = preg_grep('/EXPOSE\s+(\d+)/', explode("\n", $dockerfile));
- if (count($port) > 0 && preg_match('/EXPOSE\s+(\d+)/', $port[1], $matches)) {
- $port = $matches[1];
- } else {
- $port = 80;
+ $dockerfile_array = explode("\n", $dockerfile);
+ $found_exposed_port = null;
+ foreach ($dockerfile_array as $line) {
+ $line_str = Str::of($line)->trim();
+ if ($line_str->startsWith('EXPOSE')) {
+ $found_exposed_port = $line_str->replace('EXPOSE', '')->trim();
+ break;
+ }
+ }
+ if ($found_exposed_port) {
+ return (int)$found_exposed_port->value();
}
- return $port;
+ return 80;
}