feat(domains): add per-domain noindex support

Flagged domains are served with X-Robots-Tag: noindex, nofollow via
Traefik and Caddy routing labels, so an auto-generated technical domain
can be excluded from indexing while the production domain on the same
resource stays indexable.
This commit is contained in:
Alberto Rizzi committed 2026-07-12 13:59:09 +02:00
1 parent 3da9942bf3
commit 4afe131905
20 files changed
+617 -23

No files matched your search

+6 -1
View File
@@ -10,6 +10,7 @@ use App\Services\DeploymentConfiguration\ConfigurationDiffer;
use App\Traits\ClearsGlobalSearchCache;
use App\Traits\HasConfiguration;
use App\Traits\HasMetrics;
use App\Traits\HasNoindexDomains;
use App\Traits\HasSafeStringAttribute;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
@@ -34,6 +35,7 @@ use Symfony\Component\Yaml\Yaml;
'uuid' => ['type' => 'string', 'description' => 'The application UUID.'],
'name' => ['type' => 'string', 'description' => 'The application name.'],
'fqdn' => ['type' => 'string', 'nullable' => true, 'description' => 'The application domains.'],
'noindex_domains' => ['type' => 'array', 'items' => ['type' => 'string'], 'nullable' => true, 'description' => 'The subset of the application domains served with an X-Robots-Tag: noindex, nofollow response header.'],
'config_hash' => ['type' => 'string', 'description' => 'Configuration hash.'],
'git_repository' => ['type' => 'string', 'description' => 'Git repository URL.'],
'git_branch' => ['type' => 'string', 'description' => 'Git branch.'],
@@ -116,7 +118,7 @@ use Symfony\Component\Yaml\Yaml;
class Application extends BaseModel
{
use ClearsGlobalSearchCache, HasConfiguration, HasFactory, HasMetrics, HasSafeStringAttribute, SoftDeletes;
use ClearsGlobalSearchCache, HasConfiguration, HasFactory, HasMetrics, HasNoindexDomains, HasSafeStringAttribute, SoftDeletes;
private static $parserVersion = '5';
@@ -124,6 +126,7 @@ class Application extends BaseModel
'name',
'description',
'fqdn',
'noindex_domains',
'git_repository',
'git_branch',
'git_commit_sha',
@@ -241,6 +244,7 @@ class Application extends BaseModel
'manual_webhook_secret_gitlab' => 'encrypted',
'manual_webhook_secret_bitbucket' => 'encrypted',
'manual_webhook_secret_gitea' => 'encrypted',
'noindex_domains' => 'array',
'restart_count' => 'integer',
'max_restart_count' => 'integer',
'last_restart_at' => 'datetime',
@@ -268,6 +272,7 @@ class Application extends BaseModel
$application->fqdn = null;
}
$payload['fqdn'] = $application->fqdn;
$application->syncNoindexDomains();
}
if ($application->isDirty('install_command')) {
$payload['install_command'] = str($application->install_command)->trim();