argument('zone') ?? ''); $this->line(''); $this->line(" Current zone: {$current}"); $this->line(' Proposed zone: '.($target !== '' ? "{$target}" : 'none given')); $this->line(''); $instances = Instance::query() ->whereIn('status', ['active', 'provisioning', 'cancellation_scheduled']) ->get(); if ($instances->isEmpty()) { $this->info(' No instances in service. The zone can be changed with nothing to migrate.'); $this->line(''); return self::SUCCESS; } $this->warn(" {$instances->count()} instance(s) are addressed under the current zone."); $this->line(''); $this->line(' Each of these carries the old name in places this setting does NOT reach:'); $this->line(''); $records = DnsRecord::query()->whereIn('instance_id', $instances->pluck('id'))->count(); $targets = MonitoringTarget::query()->whereIn('instance_id', $instances->pluck('id'))->count(); $verified = $instances->filter(fn (Instance $i) => $i->domainIsVerified())->count(); $this->table(['What', 'Count', 'Consequence of changing the zone'], [ ['DNS records (dns_records.fqdn)', $records, 'still point the OLD name at the host'], ['Monitoring targets', $targets, 'keep watching the old URL and report down'], ['TLS certificates', $instances->count(), 'issued for the old name; the new one has none'], ['Nextcloud trusted_domains', $instances->count(), 'rejects the new name until rewritten'], ['Instances on their own domain', $verified, 'unaffected — they are served at custom_domain'], ]); $this->line(''); $this->line(' A change now is a migration with an outage, not a setting. Either do it'); $this->line(' before the first customer, or plan it as a maintenance window.'); $this->line(''); return self::SUCCESS; } }