Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: peaklabs-dev <122374094+peaklabs-dev@users.noreply.github.com>
Co-authored-by: Aditya Tripathi <aditya@climactic.co>
This commit is contained in:
Andras Bacsai
2026-11-06 14:25:02 +01:00
committed by GitHub
co-authored by Claude Opus 5.5 peaklabs-dev Aditya Tripathi
parent b7dc2e435b
commit 033f0c84da
581 changed files with 58626 additions and 2456 deletions
+7 -8
View File
@@ -40,6 +40,8 @@ use App\Models\SwarmDocker;
use App\Models\Team;
use App\Models\User;
use App\Services\Dns\CloudflareDnsProvider;
use App\Services\Dns\DnsRecord;
use App\Services\Dns\DnsResolver;
use App\Services\Security\SensitiveDataRedactor;
use App\Support\DnsRecordHints;
use Carbon\CarbonImmutable;
@@ -73,9 +75,6 @@ use Nubs\RandomNameGenerator\Alliteration;
use phpseclib3\Crypt\EC;
use phpseclib3\Crypt\RSA;
use Poliander\Cron\CronExpression;
use PurplePixie\PhpDns\DNSQuery;
use PurplePixie\PhpDns\DNSResult;
use PurplePixie\PhpDns\DNSTypes;
use Spatie\Url\Url;
use Symfony\Component\Yaml\Yaml;
@@ -746,7 +745,7 @@ function generate_random_name(?string $cuid = null): string
/**
* RSA keys get 4096 bits: GitHub rejects new RSA SSH keys smaller than 3072 bits, and phpseclib makes 2048-bit keys by default.
*/
function generateSSHKey(string $type = 'rsa')
function generateSSHKey(string $type = 'ed25519')
{
if ($type === 'rsa') {
$key = RSA::createKey(4096);
@@ -2528,7 +2527,7 @@ function validateDNSEntry(string $fqdn, Server $server)
$dns_servers = str($dns_servers)->explode(',');
$ip = serverDnsTargetIp($server);
$found_matching_ip = false;
$type = dnsRecordTypeForIp($ip) === 'AAAA' ? DNSTypes::NAME_AAAA : DNSTypes::NAME_A;
$type = dnsRecordTypeForIp($ip) === 'AAAA' ? DnsResolver::TYPE_AAAA : DnsResolver::TYPE_A;
foreach ($dns_servers as $dns_server) {
try {
$results = queryDnsServer($dns_server, $host, $type);
@@ -2553,9 +2552,9 @@ function validateDNSEntry(string $fqdn, Server $server)
return $found_matching_ip;
}
function createDnsQuery(string $dnsServer, int $timeout = 5, bool $udp = true): DNSQuery
function createDnsQuery(string $dnsServer, int $timeout = 5, bool $udp = true): DnsResolver
{
return app()->make(DNSQuery::class, [
return app()->make(DnsResolver::class, [
'server' => formatHostForUrl($dnsServer),
'port' => 53,
'timeout' => $timeout,
@@ -2568,7 +2567,7 @@ function createDnsQuery(string $dnsServer, int $timeout = 5, bool $udp = true):
* retry over TCP: resolvers such as 1.1.1.1 can truncate even small answers, and the
* records would otherwise be silently dropped.
*
* @return iterable<int, DNSResult>|false
* @return iterable<int, DnsRecord>|false
*/
function queryDnsServer(string $dnsServer, string $host, string $type, int $timeout = 5): iterable|false
{