fix(server-transfer): accept legacy database port values and allow the kit VM network

- Do not check database port mappings in a bundle: the UI checks them
  only since March 2026, so older servers could not be transferred, and
  the values stay on the server owner's own host.
- The dev .env runs Cloud mode, where the import check refuses private
  addresses. reset.sh now allows the VM network of A on both instances.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Andras BacsaiandClaude Opus 5.5 committed 2026-10-23 21:23:40 +02:00
1 parent cf9f254507
commit 9e52c6a140
2 files changed
+3 -19

No files matched your search

@@ -213,7 +213,6 @@ class ServerTransferBundle
}
foreach (self::items($environment['databases'] ?? null) as $d => $database) {
self::checkDatabaseAttributes($errors, "{$at}.databases.{$d}", (array) ($database['attributes'] ?? []));
self::checkStorages($errors, "{$at}.databases.{$d}", $database);
self::checkScheduledBackups($errors, "{$at}.databases.{$d}", $database);
}
@@ -396,21 +395,4 @@ class ServerTransferBundle
self::checkPath($errors, "{$at}.scheduled_backups.{$i}.databases_to_backup", $backup['databases_to_backup'] ?? null);
}
}
/**
* The port checks of the database API. Names and passwords are not checked: older databases
* have values that the current patterns refuse, and the values stay inside the containers.
*
* @param list<string> $errors
* @param array<string, mixed> $attributes
*/
private static function checkDatabaseAttributes(array &$errors, string $at, array $attributes): void
{
if (array_key_exists('ports_mappings', $attributes)) {
self::check($errors, "{$at}.ports_mappings", $attributes['ports_mappings'], ValidationPatterns::portMappingRules());
}
if (array_key_exists('public_port', $attributes)) {
self::check($errors, "{$at}.public_port", $attributes['public_port'], ['nullable', 'integer', 'between:1024,65535']);
}
}
}
+3 -1
View File
@@ -57,7 +57,9 @@ tinker "$A" 'foreach (App\Models\Server::where("id", "!=", 0)->get() as $s) { $s
for side in source target; do
C="$A"
[[ "$side" == target ]] && C="$B"
tinker "$C" '$s = App\Models\InstanceSettings::get(); $s->is_api_enabled = true; $s->save(); session(["currentTeam" => App\Models\Team::find(0)]); echo App\Models\User::find(0)->createToken("transfer-test", ["root"])->plainTextToken;' | tail -1 >"$STATE_DIR/$side.token"
# The dev .env runs Cloud mode, where the import check refuses private addresses unless the
# instance allows them. The VMs of A are on a private network.
tinker "$C" '$s = App\Models\InstanceSettings::get(); $s->is_api_enabled = true; $s->webhook_allowed_internal_hosts = ["10.221.'"$A_SLOT"'.0/24"]; $s->save(); session(["currentTeam" => App\Models\Team::find(0)]); echo App\Models\User::find(0)->createToken("transfer-test", ["root"])->plainTextToken;' | tail -1 >"$STATE_DIR/$side.token"
chmod 600 "$STATE_DIR/$side.token"
docker exec -u www-data "$C" php artisan horizon:terminate >/dev/null
done