From bc199ccb43b0f9de04ca5ef8186d7bb85b984348 Mon Sep 17 00:00:00 2001 From: isaacclad Date: Mon, 13 Jul 2026 17:05:28 +0000 Subject: [PATCH] Add PowerDNS config and DKIM/NS check tables required for zone provisioning. Hosting had PDNS env vars but no config/pdns.php and was missing domain_dkim_keys, so linked domains never got authoritative zones. Co-authored-by: Cursor --- config/pdns.php | 13 +++++ ..._domain_dkim_keys_and_ns_checks_tables.php | 56 +++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 config/pdns.php create mode 100644 database/migrations/2026_07_13_170000_create_domain_dkim_keys_and_ns_checks_tables.php diff --git a/config/pdns.php b/config/pdns.php new file mode 100644 index 0000000..e1254b2 --- /dev/null +++ b/config/pdns.php @@ -0,0 +1,13 @@ + env('PDNS_API_URL', 'http://127.0.0.1:8081'), + 'api_key' => env('PDNS_API_KEY', ''), + 'server' => env('PDNS_SERVER', 'localhost'), + 'timeout' => (int) env('PDNS_TIMEOUT', 5), + 'slave_masters' => array_filter(array_map('trim', explode(',', env('PDNS_SLAVE_MASTERS', '167.86.66.168')))), + + 'slave_api_url' => env('PDNS_SLAVE_API_URL', ''), + 'slave_api_key' => env('PDNS_SLAVE_API_KEY', ''), + 'slave_server' => env('PDNS_SLAVE_SERVER', 'localhost'), +]; diff --git a/database/migrations/2026_07_13_170000_create_domain_dkim_keys_and_ns_checks_tables.php b/database/migrations/2026_07_13_170000_create_domain_dkim_keys_and_ns_checks_tables.php new file mode 100644 index 0000000..2164682 --- /dev/null +++ b/database/migrations/2026_07_13_170000_create_domain_dkim_keys_and_ns_checks_tables.php @@ -0,0 +1,56 @@ +id(); + $table->foreignId('domain_id')->constrained('domains')->cascadeOnDelete(); + $table->string('selector'); + $table->longText('public_key_txt'); + $table->string('private_key_path')->nullable(); + $table->string('status')->default('active'); + $table->timestamp('generated_at')->nullable(); + $table->timestamps(); + + $table->unique(['domain_id', 'selector']); + }); + } + + if (! Schema::hasTable('domain_ns_checks')) { + Schema::create('domain_ns_checks', function (Blueprint $table) { + $table->id(); + $table->foreignId('domain_id')->constrained('domains')->cascadeOnDelete(); + $table->string('check_type')->default('onboarding'); + $table->string('result')->default('pending'); + $table->json('expected_nameservers')->nullable(); + $table->json('observed_nameservers')->nullable(); + $table->boolean('has_authoritative_answer')->nullable(); + $table->unsignedSmallInteger('manual_records_total')->default(0); + $table->unsignedSmallInteger('manual_records_verified')->default(0); + $table->string('status_before')->nullable(); + $table->string('status_after')->nullable(); + $table->string('state_before')->nullable(); + $table->string('state_after')->nullable(); + $table->text('notes')->nullable(); + $table->timestamp('checked_at')->nullable(); + $table->timestamps(); + + $table->index(['domain_id', 'checked_at']); + $table->index(['domain_id', 'result']); + }); + } + } + + public function down(): void + { + Schema::dropIfExists('domain_ns_checks'); + Schema::dropIfExists('domain_dkim_keys'); + } +};