mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-14 10:18:20 +00:00
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:
1 parent
3da9942bf3
commit
4afe131905
20 files changed
+617
-23
No files matched your search
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Traits\HasNoindexDomains;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
@@ -9,7 +10,7 @@ use Symfony\Component\Yaml\Yaml;
|
||||
|
||||
class ServiceApplication extends BaseModel
|
||||
{
|
||||
use HasFactory, SoftDeletes;
|
||||
use HasFactory, HasNoindexDomains, SoftDeletes;
|
||||
|
||||
protected $fillable = [
|
||||
'service_id',
|
||||
@@ -17,6 +18,7 @@ class ServiceApplication extends BaseModel
|
||||
'human_name',
|
||||
'description',
|
||||
'fqdn',
|
||||
'noindex_domains',
|
||||
'ports',
|
||||
'exposes',
|
||||
'status',
|
||||
@@ -42,9 +44,19 @@ class ServiceApplication extends BaseModel
|
||||
if ($service->isDirty('status')) {
|
||||
$service->last_online_at = now();
|
||||
}
|
||||
if ($service->isDirty('fqdn')) {
|
||||
$service->syncNoindexDomains();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'noindex_domains' => 'array',
|
||||
];
|
||||
}
|
||||
|
||||
public function restart()
|
||||
{
|
||||
$container_id = $this->name.'-'.$this->service->uuid;
|
||||
|
||||
Reference in new issue
Block a user