mirror of
https://github.com/tiennm99/coolify.git
synced 2026-08-20 08:23:25 +00:00
feat(dev): add coold VM dev workflow
Add scripts and Lima config for managing local coold endpoint VMs, mint Flux dev host JWTs, expose coold host details on the V5 home page, and document the local development workflow.
This commit is contained in:
@@ -21,6 +21,7 @@ class HomeController extends Controller
|
||||
return Inertia::render('Home', [
|
||||
'status' => 'v5-ready',
|
||||
'flux' => $fluxHealth->check(),
|
||||
'cooldHosts' => $this->cooldHosts(),
|
||||
'currentTeam' => $currentTeam instanceof Team ? [
|
||||
'id' => $currentTeam->id,
|
||||
'name' => $currentTeam->name,
|
||||
@@ -41,4 +42,29 @@ class HomeController extends Controller
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<int, array{id: string, wireguardIp: string|null, capabilities: array<int, string>, builderEnabled: bool, builderCapacity: int}>
|
||||
*/
|
||||
private function cooldHosts(): array
|
||||
{
|
||||
$baseId = (string) config('coold.dev_host_id');
|
||||
$count = max(0, (int) config('coold.dev_host_count'));
|
||||
$builderCapacity = (int) config('coold.dev_builder_capacity');
|
||||
$builderEnabled = $builderCapacity > 0;
|
||||
|
||||
if ($count === 0 || $baseId === '') {
|
||||
return [];
|
||||
}
|
||||
|
||||
return collect(range(1, $count))
|
||||
->map(fn (int $index) => [
|
||||
'id' => $index === 1 ? $baseId : (string) config("coold.dev_host_id_{$index}", "{$baseId}-{$index}"),
|
||||
'wireguardIp' => (string) config("coold.dev_wireguard_ip_{$index}") ?: null,
|
||||
'capabilities' => $builderEnabled ? ['coold', 'builder'] : ['coold'],
|
||||
'builderEnabled' => $builderEnabled,
|
||||
'builderCapacity' => $builderCapacity,
|
||||
])
|
||||
->all();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user