Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions bin/rr
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ declare(strict_types=1);

use Spiral\RoadRunner\Console\DownloadProtocBinaryCommand;
use Spiral\RoadRunner\Console\GetBinaryCommand;
use Spiral\RoadRunner\Console\MakeConfigCommand;
use Spiral\RoadRunner\Console\VersionsCommand;
use Spiral\RoadRunner\Version;

Expand Down Expand Up @@ -70,5 +71,6 @@ $app = new Symfony\Component\Console\Application('RoadRunner CLI', Version::curr
$app->add(new GetBinaryCommand());
$app->add(new VersionsCommand());
$app->add(new DownloadProtocBinaryCommand());
$app->add(new MakeConfigCommand());

$app->run();
21 changes: 1 addition & 20 deletions src/Configuration/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function generate(Plugins $plugins): string
{
$this->collectSections($plugins->getPlugins());

return $this->getHeaderComment() . PHP_EOL . Yaml::dump($this->getContent(), 10);
return Yaml::dump($this->getContent(), 10);
}

protected function getContent(): array
Expand Down Expand Up @@ -57,23 +57,4 @@ protected function fromSection(SectionInterface $section): void
$this->fromSection(new $required());
}
}

protected function getHeaderComment(): string
{
$comment = [
'########################################################################################',
'# THIS IS SAMPLE OF THE CONFIGURATION #',
'# IT\'S NOT A DEFAULT CONFIGURATION, IT\'S JUST A SIMPLE SAMPLE #',
'# MORE DOCS CAN BE FOUND HERE: <https://roadrunner.dev/docs/intro-config> #',
'########################################################################################',
'',
'# Hint: RR will replace any config options using reference to environment variables,',
'# eg.: `option_key: ${ENVIRONMENT_VARIABLE_NAME}`.',
'',
'# Important: TCP port numbers for each plugin (rpc, http, etc) must be unique!',
''
];

return \implode(PHP_EOL, $comment);
}
}
56 changes: 28 additions & 28 deletions src/Configuration/Section/Broadcast.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,34 @@ public function render(): array
'driver' => 'memory',
'config' => []
],
'default-redis' => [
'driver' => 'redis',
'config' => [
'addrs' => [
'localhost:6379'
],
'master_name' => '',
'username' => '',
'password' => '',
'db' => 0,
'sentinel_password' => '',
'route_by_latency' => false,
'route_randomly' => false,
'dial_timeout' => 0,
'max_retries' => 1,
'min_retry_backoff' => 0,
'max_retry_backoff' => 0,
'pool_size' => 0,
'min_idle_conns' => 0,
'max_conn_age' => 0,
'read_timeout' => 0,
'write_timeout' => 0,
'pool_timeout' => 0,
'idle_timeout' => 0,
'idle_check_freq' => 0,
'read_only' => false
]
]
// 'default-redis' => [
// 'driver' => 'redis',
// 'config' => [
// 'addrs' => [
// 'localhost:6379'
// ],
// 'master_name' => '',
// 'username' => '',
// 'password' => '',
// 'db' => 0,
// 'sentinel_password' => '',
// 'route_by_latency' => false,
// 'route_randomly' => false,
// 'dial_timeout' => 0,
// 'max_retries' => 1,
// 'min_retry_backoff' => 0,
// 'max_retry_backoff' => 0,
// 'pool_size' => 0,
// 'min_idle_conns' => 0,
// 'max_conn_age' => 0,
// 'read_timeout' => 0,
// 'write_timeout' => 0,
// 'pool_timeout' => 0,
// 'idle_timeout' => 0,
// 'idle_check_freq' => 0,
// 'read_only' => false
// ]
// ]
]
];
}
Expand Down
36 changes: 18 additions & 18 deletions src/Configuration/Section/Fileserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,24 @@ public function render(): array
'calculate_etag' => true,
'weak' => false,
'stream_request_body' => true,
'serve' => [
[
'prefix' => '/foo',
'root' => '../../../tests',
'compress' => false,
'cache_duration' => 10,
'max_age' => 10,
'bytes_range' => true
],
[
'prefix' => '/foo/bar',
'root' => '../../../tests',
'compress' => false,
'cache_duration' => 10,
'max_age' => 10,
'bytes_range' => true
]
]
// 'serve' => [
// [
// 'prefix' => '/foo',
// 'root' => '../../../tests',
// 'compress' => false,
// 'cache_duration' => 10,
// 'max_age' => 10,
// 'bytes_range' => true
// ],
// [
// 'prefix' => '/foo/bar',
// 'root' => '../../../tests',
// 'compress' => false,
// 'cache_duration' => 10,
// 'max_age' => 10,
// 'bytes_range' => true
// ]
// ]
]
];
}
Expand Down
42 changes: 21 additions & 21 deletions src/Configuration/Section/Grpc.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,31 @@ public function render(): array
{
return [
self::NAME => [
'listen' => 'tcp://localhost:9001',
'listen' => 'tcp://127.0.0.1:9001',
'proto' => [
'first.proto',
'second.proto'
],
'tls' => [
'key' => '',
'cert' => '',
'root_ca' => '',
'client_auth_type' => 'no_client_certs'
],
'max_send_msg_size' => 50,
'max_recv_msg_size' => 50,
'max_connection_idle' => '0s',
'max_connection_age' => '0s',
'max_connection_age_grace' => '0s8h',
'max_concurrent_streams' => 10,
'ping_time' => '1s',
'timeout' => '200s',
'pool' => [
'num_workers' => 2,
'max_jobs' => 0,
'allocate_timeout' => '60s',
'destroy_timeout' => 60
]
// 'tls' => [
// 'key' => '',
// 'cert' => '',
// 'root_ca' => '',
// 'client_auth_type' => 'no_client_certs'
// ],
// 'max_send_msg_size' => 50,
// 'max_recv_msg_size' => 50,
// 'max_connection_idle' => '0s',
// 'max_connection_age' => '0s',
// 'max_connection_age_grace' => '0s8h',
// 'max_concurrent_streams' => 10,
// 'ping_time' => '1s',
// 'timeout' => '200s',
// 'pool' => [
// 'num_workers' => 2,
// 'max_jobs' => 0,
// 'allocate_timeout' => '60s',
// 'destroy_timeout' => 60
// ]
]
];
}
Expand Down
16 changes: 8 additions & 8 deletions src/Configuration/Section/Kv.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ public function render(): array
'interval' => 60
]
],
'redis' => [
'driver' => 'redis',
'config' => [
'addrs' => [
'localhost:6379'
]
]
]
// 'redis' => [
// 'driver' => 'redis',
// 'config' => [
// 'addrs' => [
// 'localhost:6379'
// ]
// ]
// ]
]
];
}
Expand Down
68 changes: 34 additions & 34 deletions src/Configuration/Section/Logs.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,40 +14,40 @@ public function render(): array
self::NAME => [
'mode' => 'development',
'level' => 'debug',
'encoding' => 'console',
'line_ending' => '\n',
'output' => 'stderr',
'err_output' => 'stderr',
'file_logger_options' => [
'log_output' => '/tmp/my.log',
'max_size' => 100,
'max_age' => 1,
'max_backups' => 5,
'compress' => false
],
'channels' => [
'http' => [
'mode' => 'development',
'level' => 'panic',
'encoding' => 'console',
'output' => 'stdout',
'err_output' => 'stderr'
],
'server' => [
'mode' => 'production',
'level' => 'info',
'encoding' => 'json',
'output' => 'stdout',
'err_output' => 'stdout'
],
'rpc' => [
'mode' => 'raw',
'level' => 'debug',
'encoding' => 'console',
'output' => 'stderr',
'err_output' => 'stdout'
]
]
// 'encoding' => 'console',
// 'line_ending' => '\n',
// 'output' => 'stderr',
// 'err_output' => 'stderr',
// 'file_logger_options' => [
// 'log_output' => '/tmp/my.log',
// 'max_size' => 100,
// 'max_age' => 1,
// 'max_backups' => 5,
// 'compress' => false
// ],
// 'channels' => [
// 'http' => [
// 'mode' => 'development',
// 'level' => 'panic',
// 'encoding' => 'console',
// 'output' => 'stdout',
// 'err_output' => 'stderr'
// ],
// 'server' => [
// 'mode' => 'production',
// 'level' => 'info',
// 'encoding' => 'json',
// 'output' => 'stdout',
// 'err_output' => 'stdout'
// ],
// 'rpc' => [
// 'mode' => 'raw',
// 'level' => 'debug',
// 'encoding' => 'console',
// 'output' => 'stderr',
// 'err_output' => 'stdout'
// ]
// ]
]
];
}
Expand Down
2 changes: 1 addition & 1 deletion src/Configuration/Section/Metrics.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public function render(): array
{
return [
self::NAME => [
'address' => 'localhost:2112'
'address' => '127.0.0.1:2112'
]
];
}
Expand Down
40 changes: 20 additions & 20 deletions src/Configuration/Section/Redis.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,26 @@ public function render(): array
'addrs' => [
'localhost:6379'
],
'master_name' => '',
'username' => '',
'password' => '',
'db' => 0,
'sentinel_password' => '',
'route_by_latency' => false,
'route_randomly' => false,
'dial_timeout' => 0,
'max_retries' => 1,
'min_retry_backoff' => 0,
'max_retry_backoff' => 0,
'pool_size' => 0,
'min_idle_conns' => 0,
'max_conn_age' => 0,
'read_timeout' => 0,
'write_timeout' => 0,
'pool_timeout' => 0,
'idle_timeout' => 0,
'idle_check_freq' => 0,
'read_only' => false
// 'master_name' => '',
// 'username' => '',
// 'password' => '',
// 'db' => 0,
// 'sentinel_password' => '',
// 'route_by_latency' => false,
// 'route_randomly' => false,
// 'dial_timeout' => 0,
// 'max_retries' => 1,
// 'min_retry_backoff' => 0,
// 'max_retry_backoff' => 0,
// 'pool_size' => 0,
// 'min_idle_conns' => 0,
// 'max_conn_age' => 0,
// 'read_timeout' => 0,
// 'write_timeout' => 0,
// 'pool_timeout' => 0,
// 'idle_timeout' => 0,
// 'idle_check_freq' => 0,
// 'read_only' => false
]
];
}
Expand Down
22 changes: 11 additions & 11 deletions src/Configuration/Section/Tcp.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ public function render(): array
'servers' => [
'server1' => [
'addr' => '127.0.0.1:7778',
'delimiter' => '\r\n',
'read_buf_size' => 1
// 'delimiter' => '\r\n',
// 'read_buf_size' => 1
],
'server2' => [
'addr' => '127.0.0.1:8811',
'read_buf_size' => 10
],
'server3' => [
'addr' => '127.0.0.1:8812',
'delimiter' => '\r\n',
'read_buf_size' => 1
]
// 'server2' => [
// 'addr' => '127.0.0.1:8811',
// 'read_buf_size' => 10
// ],
// 'server3' => [
// 'addr' => '127.0.0.1:8812',
// 'delimiter' => '\r\n',
// 'read_buf_size' => 1
// ]
],
'pool' => [
'command' => '',
Expand Down
Loading