summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2019-05-04 18:52:24 +0300
committerWolfy-J <[email protected]>2019-05-04 18:52:24 +0300
commit117a347b5234bce4168c332f5471855427399b7b (patch)
tree256eccc13a6a8f8e29684a9c4e0ed1892a4139ec
parent17c259e8e0a7988b4336643c4d180733663dbaa3 (diff)
polish
-rw-r--r--.rr.yaml5
-rw-r--r--CHANGELOG.md20
-rwxr-xr-xbuild.sh4
-rw-r--r--cmd/util/rpc.go2
-rw-r--r--service/http/config.go2
-rw-r--r--service/http/response.go2
-rw-r--r--service/http/service.go2
-rw-r--r--service/rpc/system.go2
-rw-r--r--service/watcher/service.go4
-rw-r--r--service/watcher/watcher.go2
-rw-r--r--[-rwxr-xr-x]src/bin/rr (renamed from src/bin/roadrunner)2
11 files changed, 26 insertions, 21 deletions
diff --git a/.rr.yaml b/.rr.yaml
index a58ea112..295eb99a 100644
--- a/.rr.yaml
+++ b/.rr.yaml
@@ -36,6 +36,9 @@ http:
# list of file extensions which are forbidden for uploading.
forbid: [".php", ".exe", ".bat"]
+ # cidr blocks which can set ip using X-Real-Ip or X-Forwarded-For
+ trustedSubnets: ["10.0.0.0/8", "127.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16", "::1/128", "fc00::/7", "fe80::/10"]
+
# http worker pool configuration.
workers:
# php worker command.
@@ -58,7 +61,7 @@ http:
# amount of time given to worker to gracefully destruct itself.
destroyTimeout: 60
-# monitors roadrunner server(s)
+# monitors rr server(s)
watch:
# check worker state each second
interval: 1
diff --git a/CHANGELOG.md b/CHANGELOG.md
index fcfdf990..9b6f380b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,17 +4,19 @@ CHANGELOG
v1.4.0
-------------------
- ENV variables in configs (automatic RR_ mapping and manual definition using "${ENV_NAME}" value)
-- add the ability to remove the worker from the pool in runtime
+- the ability to safely remove the worker from the pool in runtime
- minor performance improvements
-- real ip resolution using X-Real-Ip and X-Forwarded-For (+cidr verification)
-- watchers
- - maxTTL (graceful)
- - maxExecTTL (brute, max_execution_time)
- - maxIdleTTL (graceful)
- - maxMemory (graceful)
-- stop command
+- `real ip` resolution using X-Real-Ip and X-Forwarded-For (+cidr verification)
+- automatic worker lifecycle manager (watcher)
+ - maxMemory (graceful stop)
+ - maxTTL (graceful stop)
+ - maxIdleTTL (graceful stop)
+ - maxExecTTL (brute, max_execution_time)
+- the ability to stop rr using `rr stop`
- `maxRequest` option has been deprecated in favor of `maxRequestSize`
-- download rr command (symfony/console based) by @Alex-Bond
+- `/vendor/bin/rr get` to download rr server binary (symfony/console) by @Alex-Bond
+- `/vendor/bin/rr init` to init rr config by @Alex-Bond
+- quick builds are no longer supported
- PSR-12
- strict_types=1 added to all php files
diff --git a/build.sh b/build.sh
index da45fd1c..8be6b3c7 100755
--- a/build.sh
+++ b/build.sh
@@ -6,8 +6,8 @@ OD="$(pwd)"
RR_VERSION=1.3.7
# Hardcode some values to the core package
-LDFLAGS="$LDFLAGS -X github.com/spiral/roadrunner/cmd/rr/cmd.Version=${RR_VERSION}"
-LDFLAGS="$LDFLAGS -X github.com/spiral/roadrunner/cmd/rr/cmd.BuildTime=$(date +%FT%T%z)"
+LDFLAGS="$LDFLAGS -X github.com/spiral/rr/cmd/rr/cmd.Version=${RR_VERSION}"
+LDFLAGS="$LDFLAGS -X github.com/spiral/rr/cmd/rr/cmd.BuildTime=$(date +%FT%T%z)"
build(){
echo Packaging $1 Build
diff --git a/cmd/util/rpc.go b/cmd/util/rpc.go
index ee3414a6..8ff6720a 100644
--- a/cmd/util/rpc.go
+++ b/cmd/util/rpc.go
@@ -7,7 +7,7 @@ import (
"net/rpc"
)
-// RPCClient returns RPC client associated with given roadrunner service container.
+// RPCClient returns RPC client associated with given rr service container.
func RPCClient(container service.Container) (*rpc.Client, error) {
svc, st := container.Get(rrpc.ID)
if st < service.StatusOK {
diff --git a/service/http/config.go b/service/http/config.go
index 165b45de..ecd5a3a8 100644
--- a/service/http/config.go
+++ b/service/http/config.go
@@ -28,7 +28,7 @@ type Config struct {
// Uploads configures uploads configuration.
Uploads *UploadsConfig
- // Workers configures roadrunner server and worker pool.
+ // Workers configures rr server and worker pool.
Workers *roadrunner.ServerConfig
}
diff --git a/service/http/response.go b/service/http/response.go
index 2d17278d..8bd770ec 100644
--- a/service/http/response.go
+++ b/service/http/response.go
@@ -19,7 +19,7 @@ type Response struct {
body interface{}
}
-// NewResponse creates new response based on given roadrunner payload.
+// NewResponse creates new response based on given rr payload.
func NewResponse(p *roadrunner.Payload) (*Response, error) {
r := &Response{body: p.Body}
if err := json.Unmarshal(p.Context, r); err != nil {
diff --git a/service/http/service.go b/service/http/service.go
index 651284b4..800d3ca9 100644
--- a/service/http/service.go
+++ b/service/http/service.go
@@ -128,7 +128,7 @@ func (s *Service) Stop() {
go s.http.Shutdown(context.Background())
}
-// Server returns associated roadrunner server (if any).
+// Server returns associated rr server (if any).
func (s *Service) Server() *roadrunner.Server {
s.mu.Lock()
defer s.mu.Unlock()
diff --git a/service/rpc/system.go b/service/rpc/system.go
index d1368a05..ffba3782 100644
--- a/service/rpc/system.go
+++ b/service/rpc/system.go
@@ -2,7 +2,7 @@ package rpc
import "github.com/spiral/roadrunner/service"
-// systemService service controls roadrunner server.
+// systemService service controls rr server.
type systemService struct {
c service.Container
}
diff --git a/service/watcher/service.go b/service/watcher/service.go
index c81ff3f5..0d419716 100644
--- a/service/watcher/service.go
+++ b/service/watcher/service.go
@@ -8,13 +8,13 @@ import (
// ID defines watcher service name.
const ID = "watch"
-// Watchable defines the ability to attach roadrunner watcher.
+// Watchable defines the ability to attach rr watcher.
type Watchable interface {
// Watch attaches watcher to the service.
Watch(w roadrunner.Watcher)
}
-// Services to watch the state of roadrunner service inside other services.
+// Services to watch the state of rr service inside other services.
type Service struct {
cfg *Config
lsns []func(event int, ctx interface{})
diff --git a/service/watcher/watcher.go b/service/watcher/watcher.go
index e92d0677..788ee703 100644
--- a/service/watcher/watcher.go
+++ b/service/watcher/watcher.go
@@ -11,7 +11,7 @@ const (
// EventMaxMemory caused when worker consumes more memory than allowed.
EventMaxMemory = iota + 8000
- // EventMaxTTL thrown when worker is removed due TTL being reached. Context is roadrunner.WorkerError
+ // EventMaxTTL thrown when worker is removed due TTL being reached. Context is rr.WorkerError
EventMaxTTL
// EventMaxIdleTTL triggered when worker spends too much time at rest.
diff --git a/src/bin/roadrunner b/src/bin/rr
index 3b521c9b..e3311499 100755..100644
--- a/src/bin/roadrunner
+++ b/src/bin/rr
@@ -186,7 +186,7 @@ class RRHelper
}
(new Application('RoadRunner', RRHelper::getVersion()))
- ->register('get')
+ ->register('get-binary')
->setDescription("Install or update RoadRunner binaries in specified folder (current folder by default)")
->addOption('location', 'l', InputArgument::OPTIONAL, 'destination folder', '.')
->setCode(function (InputInterface $input, OutputInterface $output) {