mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-17 17:55:42 +00:00
chore: update ENTITY_HANDLE_BLACKLIST
This commit is contained in:
parent
531a929c3b
commit
e270a3d970
59
migrations/Version20250811115400.php
Normal file
59
migrations/Version20250811115400.php
Normal file
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use App\Service\RDAPService;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
*/
|
||||
final class Version20250811115400 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Remove blacklisted entities from database';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$handlesList = implode(
|
||||
', ',
|
||||
array_map(fn ($h) => "'".addslashes($h)."'", RDAPService::ENTITY_HANDLE_BLACKLIST)
|
||||
);
|
||||
|
||||
$this->addSql("
|
||||
DELETE FROM entity_event
|
||||
WHERE entity_uid IN (
|
||||
SELECT id FROM entity WHERE handle IN ($handlesList)
|
||||
)
|
||||
");
|
||||
|
||||
$this->addSql("
|
||||
DELETE FROM domain_entity
|
||||
WHERE entity_uid IN (
|
||||
SELECT id FROM entity WHERE handle IN ($handlesList)
|
||||
)
|
||||
");
|
||||
|
||||
$this->addSql("
|
||||
DELETE FROM nameserver_entity
|
||||
WHERE entity_uid IN (
|
||||
SELECT id FROM entity WHERE handle IN ($handlesList)
|
||||
)
|
||||
");
|
||||
|
||||
$this->addSql("
|
||||
DELETE FROM entity
|
||||
WHERE handle IN ($handlesList)
|
||||
");
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->write('Cannot restore deleted entities');
|
||||
}
|
||||
}
|
||||
@ -80,10 +80,14 @@ readonly class RDAPService
|
||||
'ANO00-FRNIC',
|
||||
'not applicable',
|
||||
'REDACTED FOR PRIVACY-REGISTRANT',
|
||||
'REDACTED FOR PRIVACY-TECH',
|
||||
'REDACTED FOR PRIVACY',
|
||||
'REDACTED-SIDN',
|
||||
'REGISTRANT',
|
||||
'REGISTRAR',
|
||||
'ABUSE-CONTACT',
|
||||
'None',
|
||||
'Private',
|
||||
];
|
||||
|
||||
/* @see https://www.iana.org/assignments/registrar-ids/registrar-ids.xhtml */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user