SqlConsistencyChecks
class SqlConsistencyChecks extends AbstractConsistencyChecks (View source)
Consistency checks against the PowerDNS tables in the local database.
Methods
No description
Assign $currentUserId as the owner of a zone that has none.
The zone's PowerDNS account, or null where this backend does not read it.
Apply the single-item repair for a consistency page check type (zones_without_owners, zones_without_canonical_ids, records_with_uppercase_names, slave_zones_without_masters, orphaned_records, duplicate_soa, zones_without_soa) to one finding.
Apply a check type's bulk repair to every finding; only the two zone checks offer one.
One finding per zone name used by more than one zone in different letter case.
No description
SQL mode stores a domains foreign key in zones.domain_id, where the row's own id is not a valid substitute, so there is nothing this check may safely report or repair.
Zones with owners or grants but no zones row carrying their exact name, which a switch to the API backend would add again without them. Only the SQL backend can have them.
SQL mode keys every zone by its unique domains.id, so no id can be shared.
SQL mode keys zones by domains.id only, so no group assignment holds a row id.
API key zone restrictions naming a zone id no zone has, which a zone later given that id would fall under. Only the SQL backend hands out an id again.
Zone names that exist more than once in different letter case, such as Example.com and example.com, which PowerDNS treats as the same name. Report only.
Records whose name holds uppercase letters, which PowerDNS never serves and the record lookups never find. Only the SQL backend can store them.
No description
No description
No description
No description
Run every check, keyed by check name. Null means the backend could not be read and no result can be trusted.
Point a stranded zones row's domain_id at its own id; $zoneId is the row's primary key.
No description
Point the API key restrictions on $zoneId, which no zone has, at no zone.
No description
Give the zone a zones row carrying its PowerDNS name; $zoneId is the domains.id.
No description
Renames the record to its lowercase name. When that name already holds the same record the mixed-case copy is deleted instead. A rename that would leave two versions of one record, or a CNAME next to other data, is refused.
No description
No description
No description
Keep the first SOA record of the zone and delete the rest.
No description
Details
__construct(PDO $db, TableNameService $tableNameService, ZoneOwnerRepair $ownerRepair, DefaultSoaBuilder $defaultSoa, AccountOwnerLookup|null $accountOwners = null, ZoneChangeRequestRepositoryInterface|null $changeRequests = null, LoggerInterface $logger = new NullLogger())
No description
bool
fixZoneWithoutOwner(int $zoneId, int $currentUserId)
Assign $currentUserId as the owner of a zone that has none.
protected string|null
zoneAccount(int $zoneId)
The zone's PowerDNS account, or null where this backend does not read it.
array
fixAllZonesWithoutOwner(int $currentUserId)
No description
array
fixOne(string $type, int $id, int $currentUserId)
Apply the single-item repair for a consistency page check type (zones_without_owners, zones_without_canonical_ids, records_with_uppercase_names, slave_zones_without_masters, orphaned_records, duplicate_soa, zones_without_soa) to one finding.
array
fixAll(string $type, int $currentUserId)
Apply a check type's bulk repair to every finding; only the two zone checks offer one.
protected array
groupByLowerName(array $zones)
One finding per zone name used by more than one zone in different letter case.
array
checkZonesHaveOwners()
No description
array
checkZonesHaveCanonicalIds()
SQL mode stores a domains foreign key in zones.domain_id, where the row's own id is not a valid substitute, so there is nothing this check may safely report or repair.
array
checkZonesHaveNames()
Zones with owners or grants but no zones row carrying their exact name, which a switch to the API backend would add again without them. Only the SQL backend can have them.
array
checkSharedZoneIds()
SQL mode keys every zone by its unique domains.id, so no id can be shared.
array
checkGroupGrantsOnRowIds()
SQL mode keys zones by domains.id only, so no group assignment holds a row id.
array
checkApiKeyScopesNameZones()
API key zone restrictions naming a zone id no zone has, which a zone later given that id would fall under. Only the SQL backend hands out an id again.
array
checkZoneNamesDifferingInCase()
Zone names that exist more than once in different letter case, such as Example.com and example.com, which PowerDNS treats as the same name. Report only.
array
checkRecordNamesInLowercase()
Records whose name holds uppercase letters, which PowerDNS never serves and the record lookups never find. Only the SQL backend can store them.
array
checkSlaveZonesHaveMasters()
No description
array
checkRecordsBelongToZones()
No description
array
checkDuplicateSOARecords()
No description
array
checkZonesWithoutSOA()
No description
array|null
runAllChecks()
Run every check, keyed by check name. Null means the backend could not be read and no result can be trusted.
bool
fixZoneCanonicalId(int $zoneId)
Point a stranded zones row's domain_id at its own id; $zoneId is the row's primary key.
array
fixAllZonesWithCanonicalIdIssue()
No description
bool
fixApiKeyScopesOnMissingZone(int $zoneId)
Point the API key restrictions on $zoneId, which no zone has, at no zone.
array
fixAllApiKeyScopesOnMissingZones()
No description
bool
fixZoneName(int $zoneId)
Give the zone a zones row carrying its PowerDNS name; $zoneId is the domains.id.
array
fixAllZonesWithoutName()
No description
bool
fixRecordNameCase(int $recordId)
Renames the record to its lowercase name. When that name already holds the same record the mixed-case copy is deleted instead. A rename that would leave two versions of one record, or a CNAME next to other data, is refused.
array
fixAllRecordNamesCase()
No description
bool
deleteSlaveZone(int $zoneId)
No description
bool
deleteOrphanedRecord(int $recordId)
No description
bool
fixDuplicateSOA(int $zoneId)
Keep the first SOA record of the zone and delete the rest.
bool
createDefaultSOA(int $zoneId)
No description