Skip to content

Commit 558f7ba

Browse files
authored
Merge pull request pterodactyl#1901 from pterodactyl/feature/auto-deploy
re-enable auto-deploy daemon endpoint
2 parents 06707fd + a1f4baa commit 558f7ba

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

app/Http/Controllers/Daemon/ActionController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,6 @@ public function configuration(Request $request, $token)
102102
$node = Node::findOrFail($nodeId);
103103

104104
// Manually as getConfigurationAsJson() returns it in correct format already
105-
return [];
105+
return $node->getJsonConfiguration();
106106
}
107107
}

app/Models/Node.php

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,13 @@ public function getConnectionAddress(): string
151151
}
152152

153153
/**
154-
* Returns the configuration in JSON format.
154+
* Returns the configuration as an array.
155155
*
156156
* @return string
157157
*/
158-
public function getYamlConfiguration()
158+
private function getConfiguration()
159159
{
160-
$config = [
160+
return [
161161
'debug' => false,
162162
'api' => [
163163
'host' => '0.0.0.0',
@@ -204,8 +204,24 @@ public function getYamlConfiguration()
204204
'remote' => route('index'),
205205
'token' => $this->daemonSecret,
206206
];
207+
}
208+
209+
/**
210+
* Returns the configuration in Yaml format.
211+
*
212+
* @return string
213+
*/
214+
public function getYamlConfiguration() {
215+
return Yaml::dump($this->getConfiguration(), 4, 2);
216+
}
207217

208-
return Yaml::dump($config, 4, 2);
218+
/**
219+
* Returns the configuration in JSON format.
220+
*
221+
* @return string
222+
*/
223+
public function getJsonConfiguration(bool $pretty = false) {
224+
return json_encode($this->getConfiguration(), $pretty ? JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT : JSON_UNESCAPED_SLASHES);
209225
}
210226

211227
/**

0 commit comments

Comments
 (0)