fix(domains): sync Docker Compose domains for noindex settings

This commit is contained in:
Andras Bacsai
2026-09-04 15:19:21 +02:00
parent 89a66dd255
commit 51cab061be
2 changed files with 32 additions and 1 deletions
+10 -1
View File
@@ -58,7 +58,16 @@ trait HasNoindexDomains
private function currentDomains(): Collection
{
return collect(ValidationPatterns::applicationDomainList($this->fqdn))
$domains = collect(ValidationPatterns::applicationDomainList($this->fqdn));
$composeDomains = json_decode((string) ($this->getAttributes()['docker_compose_domains'] ?? null), true);
if (is_array($composeDomains)) {
foreach ($composeDomains as $entry) {
$domains->push(...ValidationPatterns::applicationDomainList(composeDomainEntryString($entry)));
}
}
return $domains
->map(fn (string $domain) => $this->normalizeNoindexDomain($domain));
}
+22
View File
@@ -2066,6 +2066,28 @@ it('updates search engine indexing from the domains view', function () {
->toBe(['https://staging.example.com']);
});
it('updates search engine indexing for a git docker compose domain', function () {
$this->application->update([
'build_pack' => 'dockercompose',
'fqdn' => null,
'docker_compose_domains' => json_encode([
'web' => ['domain' => 'https://compose.example.com'],
]),
]);
$component = Livewire::test(Domains::class, ['application' => $this->application->fresh()])
->call('toggleNoindexDomain', 'https://compose.example.com', 'noindex')
->assertDispatched('configurationChanged')
->assertDispatched('success');
expect($this->application->refresh()->noindexDomains()->all())
->toBe(['https://compose.example.com']);
$component->call('toggleNoindexDomain', 'https://compose.example.com', 'index');
expect($this->application->refresh()->noindexDomains()->all())->toBe([]);
});
it('keeps noindex domains when normalizing a custom domain port', function () {
$this->application->update([
'fqdn' => 'https://staging.example.com:8080',