Skip to content

Commit 33a7762

Browse files
committed
Fix connection issues when changing node FQDN; closes pterodactyl#1931
1 parent 86dbb14 commit 33a7762

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

app/Services/Nodes/NodeUpdateService.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,19 @@ public function handle(Node $node, array $data, bool $resetToken = false)
7777
$updated = $this->repository->withFreshModel()->update($node->id, $data, true, true);
7878

7979
try {
80+
// If we're changing the FQDN for the node, use the newly provided FQDN for the connection
81+
// address. This should alleviate issues where the node gets pointed to a "valid" FQDN that
82+
// isn't actually running the daemon software, and therefore you can't actually change it
83+
// back.
84+
//
85+
// This makes more sense anyways, because only the Panel uses the FQDN for connecting, the
86+
// node doesn't actually care about this.
87+
//
88+
// @see https://github.com/pterodactyl/panel/issues/1931
89+
if (! empty($data['fqdn'])) {
90+
$node->fqdn = $data['fqdn'];
91+
}
92+
8093
$this->configurationRepository->setNode($node)->update($updated);
8194
} catch (DaemonConnectionException $exception) {
8295
if (! is_null($exception->getPrevious()) && $exception->getPrevious() instanceof ConnectException) {

0 commit comments

Comments
 (0)