fix styleci issues

This commit is contained in:
Jakob Schrettenbrunner 2017-01-07 18:39:41 +01:00
parent cc0d54e906
commit a661f71974
3 changed files with 43 additions and 39 deletions

View file

@ -119,55 +119,58 @@ class Node extends Model
}
/**
* Returns the configuration in JSON format
* Returns the configuration in JSON format.
*
* @param boolean $pretty Wether to pretty print the JSON or not
* @param bool $pretty Wether to pretty print the JSON or not
* @return string The configration in JSON format
*/
public function getConfigurationAsJson($pretty = false) {
$config = array(
'web' => array(
public function getConfigurationAsJson($pretty = false)
{
$config = [
'web' => [
'host' => '0.0.0.0',
'listen' => $this->daemonListen,
'ssl' => array(
'ssl' => [
'enabled' => $this->scheme === 'https',
'certificate' => '/etc/letsencrypt/live/localhost/fullchain.pem',
'key' => '/etc/letsencrypt/live/localhost/privkey.pem'
)
),
'docker' => array(
'key' => '/etc/letsencrypt/live/localhost/privkey.pem',
],
],
'docker' => [
'socket' => '/var/run/docker.sock',
'autoupdate_images' => true
),
'sftp' => array(
'autoupdate_images' => true,
],
'sftp' => [
'path' => $this->daemonBase,
'port' => $this->daemonSFTP,
'container' => 'ptdl-sftp'
),
'query' => array(
'container' => 'ptdl-sftp',
],
'query' => [
'kill_on_fail' => true,
'fail_limit' => 5
),
'logger' => array(
'fail_limit' => 5,
],
'logger' => [
'path' => 'logs/',
'src' => false,
'level' => 'info',
'period' => '1d',
'count' => 3
),
'remote' => array(
'count' => 3,
],
'remote' => [
'base' => config('app.url'),
'download' => route('remote.download'),
'installed' => route('remote.install')
),
'uploads' => array(
'size_limit' => $this->upload_size
),
'keys' => array($this->daemonSecret)
);
'installed' => route('remote.install'),
],
'uploads' => [
'size_limit' => $this->upload_size,
],
'keys' => [$this->daemonSecret],
];
$json_options = JSON_UNESCAPED_SLASHES;
if ($pretty) $json_options |= JSON_PRETTY_PRINT;
if ($pretty) {
$json_options |= JSON_PRETTY_PRINT;
}
return json_encode($config, $json_options);
}