fix: service ports for services + caddy

This commit is contained in:
Andras Bacsai
2024-03-12 15:09:24 +01:00
parent a67576b447
commit 25ae54cab7
23 changed files with 156 additions and 61 deletions

View File

@@ -100,6 +100,12 @@ class ServicesGenerate extends Command
} else {
$tags = null;
}
$port = collect(preg_grep('/^# port:/', explode("\n", $content)))->values();
if ($port->count() > 0) {
$port = str($port[0])->after('# port:')->trim()->value();
} else {
$port = null;
}
$json = Yaml::parse($content);
$yaml = base64_encode(Yaml::dump($json, 10, 2));
$payload = [
@@ -111,6 +117,9 @@ class ServicesGenerate extends Command
'logo' => $logo,
'minversion' => $minversion,
];
if ($port) {
$payload['port'] = $port;
}
if ($env_file) {
$env_file_content = file_get_contents(base_path("templates/compose/$env_file"));
$env_file_base64 = base64_encode($env_file_content);

View File

@@ -4,7 +4,6 @@ namespace App\Livewire\Admin;
use App\Models\User;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Crypt;
use Livewire\Component;
class Index extends Component