Page MenuHomePhorge

Basic PowerDNS functionality
ClosedPublic

Authored by vanmeeuwen on Aug 16 2021, 3:00 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 22 2024, 12:12 PM
Unknown Object (File)
Feb 20 2024, 6:33 PM
Unknown Object (File)
Feb 15 2024, 8:37 AM
Unknown Object (File)
Feb 10 2024, 7:39 PM
Unknown Object (File)
Jan 24 2024, 7:05 AM
Unknown Object (File)
Jan 24 2024, 6:42 AM
Unknown Object (File)
Jan 24 2024, 6:27 AM
Unknown Object (File)
Jan 24 2024, 5:49 AM
Subscribers
Restricted Project

Details

Reviewers
machniak
Group Reviewers
Restricted Project
Commits
rK6cf47624770c: Basic PowerDNS functionality
Summary

This change adds basic powerdns functionality (for, among others, woat)

Test Plan

./phpunit

Diff Detail

Repository
rK kolab
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

vanmeeuwen created this revision.
  • Remove another irrelevant change
machniak subscribed.

Minor comments just after the code review, no testing and closer look on it yet.

src/app/Console/Commands/PowerDNS/Domain/CreateCommand.php
41

Theinput should be validated.

src/app/Observers/PowerDNS/DomainObserver.php
15

Just $domain->name everywhere.

src/app/PowerDNS/Domain.php
18

You could use $this->records()->where('type', 'SOA')->first() here.

src/tests/Feature/PowerDNS/DomainTest.php
60

It should have a test for the domain observer - domain creation.

This revision now requires changes to proceed.Aug 16 2021, 4:08 PM
src/app/Observers/PowerDNS/DomainObserver.php
26

Four of these Record::create() calls will invoke bumpSerial() on the domain. We should disable the Record 'created' event handler temporarily. Look for withoutEvents on https://stackoverflow.com/questions/29407818/is-it-possible-to-temporarily-disable-event-in-laravel/51301753 or do manual inserts.

vanmeeuwen marked 5 inline comments as done.

Incoming! ;-)

  • Minimal validation.
  • Just use $domain->name everywhere
  • Disable domain observer events in turn bumping the serial
  • Make use of the records relation
  • Fix typo, test domain creation/observer

One last issue. Other than that it looks good. I didn't test the docker part, I guess we'll need some intergration tests later.

src/tests/Feature/PowerDNS/DomainTest.php
19

This 'domain' property needs to be declared, otherwise there's a phpstan error.

  • Describe $domain
  • Rebase on master
This revision is now accepted and ready to land.Aug 17 2021, 11:59 AM
This revision was automatically updated to reflect the committed changes.