mirror of
https://github.com/coollabsio/coolify.git
synced 2026-09-25 07:50:35 -05:00
fix(domains): sync Docker Compose domains for noindex settings
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user