feat(v5): add WireGuard and coold/corrosion config to clusters/servers

Add WireGuard networking fields (interface, management pool, listen port),
container network pool, coold/corrosion versioning, and builder CPU quota
to clusters and servers via new migrations and model fillables.

Expose full cluster and server CRUD on the Clusters page with private key
selection, pending state tracking, and new form primitives (Field, Input,
Textarea). Add server status check fields and a lima test VM config for
development.
This commit is contained in:
Andras Bacsai
2026-06-19 07:23:45 +02:00
parent 5d57b131ff
commit 3ae87334bd
30 changed files with 3876 additions and 103 deletions
+45 -3
View File
@@ -60,6 +60,11 @@ coold_vm_wg_port() {
read_coolify_env "COOLIFY_COOLD_VM_WG_PORT_${index}" "$((51820 + index))"
}
coold_vm_ssh_port() {
local index="$1"
read_coolify_env "COOLIFY_COOLD_VM_SSH_PORT_${index}" "6000${index}"
}
coold_vm_container_subnet() {
local index="$1"
read_coolify_env "COOLIFY_COOLD_VM_CONTAINER_SUBNET_${index}" "10.210.$((index - 1)).0/24"
@@ -172,6 +177,28 @@ lima_ssh_config() {
printf '%s\n' "$config"
}
lima_ssh_port() {
local index="$1"
local instance
local port
instance="$(coold_vm_instance "$index")"
if [ ! -f "$HOME/.lima/${instance}/ssh.config" ]; then
echo "ERROR: Lima SSH config for ${instance} was not found. Start it first with scripts/dev.sh up." >&2
exit 1
fi
port="$(awk 'tolower($1) == "port" { print $2; exit }' "$HOME/.lima/${instance}/ssh.config")"
if [ -z "$port" ]; then
echo "ERROR: Lima SSH port for ${instance} was not found in $HOME/.lima/${instance}/ssh.config." >&2
exit 1
fi
printf '%s\n' "$port"
}
coolify_nodes_arg() {
local count
local nodes=""
@@ -346,6 +373,7 @@ coold_vm() {
shift
COOLIFY_COOLD_LIMA_INSTANCE="$(coold_vm_instance "$index")" \
COOLIFY_COOLD_VM_WG_IP="$(coold_vm_wg_ip "$index")" \
COOLIFY_COOLD_VM_SSH_PORT="$(coold_vm_ssh_port "$index")" \
COOLIFY_COOLD_VM_CONTAINER_SUBNET="$(coold_vm_container_subnet "$index")" \
COOLIFY_COOLD_VM_CONTAINER_GATEWAY="$(coold_vm_container_gateway "$index")" \
scripts/coold-vm.sh "$@"
@@ -417,17 +445,31 @@ follow_logs() {
}
sync_v5_dev_lima_servers() {
local count
local index
local instance
local server_args=()
local ssh_port
local ssh_user
count="$(coold_vm_count)"
ssh_user="$(coolify_ssh_user)"
for index in $(seq 1 "$count"); do
instance="$(coold_vm_instance "$index")"
ssh_port="$(lima_ssh_port "$index")"
server_args+=(--server="${instance}|host.docker.internal|${ssh_user}|${ssh_port}")
done
echo "==> Running pending migrations before syncing v5 dev Lima state..."
spin exec -T coolify php artisan migrate --force
echo "==> Seeding dev Lima VM(s) into v5 clusters/servers..."
spin exec -T \
-e COOLIFY_CLI_SSH_USER="$ssh_user" \
coolify php artisan db:seed --class=V5DevLimaSeeder --force
coolify php artisan v5:sync-dev-lima-servers \
--builder-capacity="$(read_coolify_env COOLIFY_COOLD_VM_BUILDER_CAPACITY 2)" \
"${server_args[@]}"
}
configure_flux_dev_for_vm() {
@@ -491,9 +533,9 @@ up() {
echo "==> Starting Coolify Docker stack with Spin..."
if [ "${#spin_args[@]}" -gt 0 ]; then
spin up -d "${spin_args[@]}"
COOLIFY_CLI_SSH_USER="$(coolify_ssh_user)" spin up -d "${spin_args[@]}"
else
spin up -d
COOLIFY_CLI_SSH_USER="$(coolify_ssh_user)" spin up -d
fi
if [ "$naked" = "true" ]; then