mirror of
https://github.com/getnamingo/registry.git
synced 2025-05-15 17:16:59 +02:00
BRDA fixes
This commit is contained in:
parent
c06c7c3496
commit
0a4057f812
2 changed files with 307 additions and 299 deletions
|
@ -14,6 +14,7 @@ return [
|
||||||
'escrow_deleteXML' => false,
|
'escrow_deleteXML' => false,
|
||||||
'escrow_RDEupload' => false,
|
'escrow_RDEupload' => false,
|
||||||
'escrow_BRDAupload' => false,
|
'escrow_BRDAupload' => false,
|
||||||
|
'escrow_BRDAday' => 'Tuesday',
|
||||||
'escrow_keyPath' => '/opt/escrow/escrowKey.asc',
|
'escrow_keyPath' => '/opt/escrow/escrowKey.asc',
|
||||||
'escrow_keyPath_brda' => '/opt/escrow/icann-brda-gpg.pub',
|
'escrow_keyPath_brda' => '/opt/escrow/icann-brda-gpg.pub',
|
||||||
'escrow_privateKey' => '/opt/escrow/privatekey.asc',
|
'escrow_privateKey' => '/opt/escrow/privatekey.asc',
|
||||||
|
|
|
@ -530,7 +530,7 @@ try {
|
||||||
$reportXML->writeElement('rdeReport:version', '1');
|
$reportXML->writeElement('rdeReport:version', '1');
|
||||||
$reportXML->writeElement('rdeReport:rydeSpecEscrow', 'RFC8909');
|
$reportXML->writeElement('rdeReport:rydeSpecEscrow', 'RFC8909');
|
||||||
$reportXML->writeElement('rdeReport:rydeSpecMapping', 'RFC9022');
|
$reportXML->writeElement('rdeReport:rydeSpecMapping', 'RFC9022');
|
||||||
$reportXML->writeElement('rdeReport:resend', $deposit_id['revision']);
|
$reportXML->writeElement('rdeReport:resend', $finalDepositId);
|
||||||
$currentDateTime = new DateTime();
|
$currentDateTime = new DateTime();
|
||||||
$crDateWithMilliseconds = $currentDateTime->format("Y-m-d\TH:i:s.v\Z");
|
$crDateWithMilliseconds = $currentDateTime->format("Y-m-d\TH:i:s.v\Z");
|
||||||
$reportXML->writeElement('rdeReport:crDate', $crDateWithMilliseconds);
|
$reportXML->writeElement('rdeReport:crDate', $crDateWithMilliseconds);
|
||||||
|
@ -584,6 +584,10 @@ try {
|
||||||
$reportFilePath = $c['escrow_deposit_path']."/{$tldname}_".date('Y-m-d')."_full_R{$finalDepositId}.rep";
|
$reportFilePath = $c['escrow_deposit_path']."/{$tldname}_".date('Y-m-d')."_full_R{$finalDepositId}.rep";
|
||||||
file_put_contents($reportFilePath, $reps, LOCK_EX);
|
file_put_contents($reportFilePath, $reps, LOCK_EX);
|
||||||
|
|
||||||
|
$dayOfWeekToRunBRDA = $c['escrow_BRDAday'];
|
||||||
|
$currentDayOfWeek = date('l');
|
||||||
|
|
||||||
|
if ($currentDayOfWeek === $dayOfWeekToRunBRDA) {
|
||||||
// Start BRDA generation
|
// Start BRDA generation
|
||||||
$xml = new XMLWriter();
|
$xml = new XMLWriter();
|
||||||
$xml->openMemory();
|
$xml->openMemory();
|
||||||
|
@ -797,12 +801,12 @@ try {
|
||||||
$deposit = $xml->outputMemory();
|
$deposit = $xml->outputMemory();
|
||||||
|
|
||||||
// Define the base name without the extension
|
// Define the base name without the extension
|
||||||
$baseFileName = "{$tldname}_".date('Y-m-d')."_brda_S1_R{$finalDepositId}";
|
$baseFileNameBrda = "{$tldname}_".date('Y-m-d')."_brda_S1_R{$finalDepositId}";
|
||||||
|
|
||||||
// XML, tar, and gzip filenames
|
// XML, tar, and gzip filenames
|
||||||
$xmlFileName = $baseFileName . ".xml";
|
$xmlFileName = $baseFileNameBrda . ".xml";
|
||||||
$tarFileName = $baseFileName . ".tar";
|
$tarFileName = $baseFileNameBrda . ".tar";
|
||||||
$gzipFileName = $baseFileName . ".tar.gz";
|
$gzipFileName = $baseFileNameBrda . ".tar.gz";
|
||||||
|
|
||||||
// Save the main XML file
|
// Save the main XML file
|
||||||
file_put_contents($c['escrow_deposit_path']."/".$xmlFileName, $deposit, LOCK_EX);
|
file_put_contents($c['escrow_deposit_path']."/".$xmlFileName, $deposit, LOCK_EX);
|
||||||
|
@ -851,12 +855,12 @@ try {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save the encrypted data to a new file
|
// Save the encrypted data to a new file
|
||||||
file_put_contents($c['escrow_deposit_path'] . "/" . $baseFileName . ".ryde", $encryptedData);
|
file_put_contents($c['escrow_deposit_path'] . "/" . $baseFileNameBrda . ".ryde", $encryptedData);
|
||||||
|
|
||||||
// Delete the original .tar.gz file
|
// Delete the original .tar.gz file
|
||||||
unlink($c['escrow_deposit_path'] . "/" . $gzipFileName);
|
unlink($c['escrow_deposit_path'] . "/" . $gzipFileName);
|
||||||
|
|
||||||
$encryptedFilePathBrda = $c['escrow_deposit_path'] . "/" . $baseFileName . ".ryde";
|
$encryptedFilePathBrda = $c['escrow_deposit_path'] . "/" . $baseFileNameBrda . ".ryde";
|
||||||
|
|
||||||
// Initialize the GnuPG extension
|
// Initialize the GnuPG extension
|
||||||
$gpg = new gnupg();
|
$gpg = new gnupg();
|
||||||
|
@ -883,6 +887,7 @@ try {
|
||||||
|
|
||||||
// Optionally, delete the encrypted file if you don't need it anymore
|
// Optionally, delete the encrypted file if you don't need it anymore
|
||||||
// unlink($encryptedFilePathBrda);
|
// unlink($encryptedFilePathBrda);
|
||||||
|
}
|
||||||
|
|
||||||
if ($c['escrow_RDEupload']) {
|
if ($c['escrow_RDEupload']) {
|
||||||
// Connect to the SFTP server
|
// Connect to the SFTP server
|
||||||
|
@ -944,6 +949,7 @@ try {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($currentDayOfWeek === $dayOfWeekToRunBRDA) {
|
||||||
if ($c['escrow_BRDAupload']) {
|
if ($c['escrow_BRDAupload']) {
|
||||||
// Connect to the SFTP server
|
// Connect to the SFTP server
|
||||||
$sftp = new SFTP($c['brda_sftp_host']);
|
$sftp = new SFTP($c['brda_sftp_host']);
|
||||||
|
@ -971,6 +977,7 @@ try {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$depositDate = date('Y-m-d');
|
$depositDate = date('Y-m-d');
|
||||||
$fileName = $c['escrow_deposit_path'] . "/" . $baseFileName . ".ryde";
|
$fileName = $c['escrow_deposit_path'] . "/" . $baseFileName . ".ryde";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue