Merge pull request #1901 from pterodactyl/feature/auto-deploy

re-enable auto-deploy daemon endpoint
This commit is contained in:
Dane Everitt 2020-04-10 09:54:11 -07:00 committed by GitHub
commit 558f7ba6dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 5 deletions

View file

@ -102,6 +102,6 @@ class ActionController extends Controller
$node = Node::findOrFail($nodeId); $node = Node::findOrFail($nodeId);
// Manually as getConfigurationAsJson() returns it in correct format already // Manually as getConfigurationAsJson() returns it in correct format already
return []; return $node->getJsonConfiguration();
} }
} }

View file

@ -151,13 +151,13 @@ class Node extends Model
} }
/** /**
* Returns the configuration in JSON format. * Returns the configuration as an array.
* *
* @return string * @return string
*/ */
public function getYamlConfiguration() private function getConfiguration()
{ {
$config = [ return [
'debug' => false, 'debug' => false,
'api' => [ 'api' => [
'host' => '0.0.0.0', 'host' => '0.0.0.0',
@ -204,8 +204,24 @@ class Node extends Model
'remote' => route('index'), 'remote' => route('index'),
'token' => $this->daemonSecret, 'token' => $this->daemonSecret,
]; ];
}
return Yaml::dump($config, 4, 2); /**
* Returns the configuration in Yaml format.
*
* @return string
*/
public function getYamlConfiguration() {
return Yaml::dump($this->getConfiguration(), 4, 2);
}
/**
* Returns the configuration in JSON format.
*
* @return string
*/
public function getJsonConfiguration(bool $pretty = false) {
return json_encode($this->getConfiguration(), $pretty ? JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT : JSON_UNESCAPED_SLASHES);
} }
/** /**