diff options
author | Leo | 2020-10-01 01:59:55 +0800 |
---|---|---|
committer | Leo | 2020-10-01 01:59:55 +0800 |
commit | d34b9720dda3ba7c4ac10f3e6e5bc2d2bbbb7c79 (patch) | |
tree | 017b9720b347eec6e363a0bab57d1f5612c7868a | |
download | aur-d34b9720dda3ba7c4ac10f3e6e5bc2d2bbbb7c79.tar.gz |
New upstream version 1.8.3
-rw-r--r-- | .SRCINFO | 19 | ||||
-rw-r--r-- | .rr.yaml.sample-full | 196 | ||||
-rw-r--r-- | .rr.yaml.sample-minimal | 3 | ||||
-rw-r--r-- | PKGBUILD | 46 |
4 files changed, 264 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..fd052cea6171 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,19 @@ +pkgbase = roadrunner + pkgdesc = High-performance PHP application server, load-balancer and process manager written in Golang + pkgver = 1.8.3 + pkgrel = 1 + url = https://roadrunner.dev/ + arch = x86_64 + license = MIT + makedepends = go>=1.13 + depends = php>=7.1 + options = !buildflags + source = https://github.com/spiral/roadrunner/archive/v1.8.3.tar.gz + source = .rr.yaml.sample-full + source = .rr.yaml.sample-minimal + sha256sums = 0438537fab3f20de1225a586715533863f3fe0618c2955efacc93a2228bec463 + sha256sums = SKIP + sha256sums = SKIP + +pkgname = roadrunner + diff --git a/.rr.yaml.sample-full b/.rr.yaml.sample-full new file mode 100644 index 000000000000..5bd586f81f27 --- /dev/null +++ b/.rr.yaml.sample-full @@ -0,0 +1,196 @@ +# defines environment variables for all underlying php processes +env: + key: value + +# rpc bus allows php application and external clients to talk to rr services. +rpc: + # enable rpc server + enable: true + + # rpc connection DSN. Supported TCP and Unix sockets. + listen: tcp://127.0.0.1:6001 + +metrics: + # prometheus client address (path /metrics added automatically) + address: localhost:2112 + collect: + app_metric: + type: histogram + help: "Custom application metric" + labels: ["type"] + buckets: [0.1, 0.2, 0.3, 1.0] + +# http service configuration. +http: + # http host to listen. + address: 0.0.0.0:8080 + + ssl: + # custom https port (default 443) + port: 443 + + # force redirect to https connection + redirect: true + + # ssl cert + cert: server.crt + + # ssl private key + key: server.key + + # rootCA certificate path + rootCa: root.crt + + # HTTP service provides FastCGI as frontend + fcgi: + # FastCGI connection DSN. Supported TCP and Unix sockets. + address: tcp://0.0.0.0:6920 + + # HTTP service provides HTTP2 transport + http2: + # enable HTTP/2, only with TLS + enabled: true + + # to enable H2C on TCP connections, false by default + h2c: true + + # max transfer channels + maxConcurrentStreams: 128 + + # max POST request size, including file uploads in MB. + maxRequestSize: 200 + + # file upload configuration. + uploads: + # 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. + command: "php psr-worker.php pipes" + + # User under which process will be started. To use this feature RR needs to be run under the root + # https://www.man7.org/linux/man-pages/man7/user_namespaces.7.html + user: "" + + # connection method (pipes, tcp://:9000, unix://socket.unix). default "pipes" + relay: "pipes" + + # worker pool configuration. + pool: + # number of workers to be serving. + numWorkers: 4 + + # maximum jobs per worker, 0 - unlimited. + maxJobs: 0 + + # for how long worker is allowed to be bootstrapped. + allocateTimeout: 60 + + # amount of time given to the worker to gracefully destruct itself. + destroyTimeout: 60 + +# Additional HTTP headers and CORS control. +headers: + # Middleware to handle CORS requests, https://www.w3.org/TR/cors/ + cors: + # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin + allowedOrigin: "*" + + # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Headers + allowedHeaders: "*" + + # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Methods + allowedMethods: "GET,POST,PUT,DELETE" + + # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials + allowCredentials: true + + # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Expose-Headers + exposedHeaders: "Cache-Control,Content-Language,Content-Type,Expires,Last-Modified,Pragma" + + # Max allowed age in seconds + maxAge: 600 + + # Automatically add headers to every request passed to PHP. + request: + "Example-Request-Header": "Value" + + # Automatically add headers to every response. + response: + "X-Powered-By": "RoadRunner" + +# monitors rr server(s) +limit: + # check worker state each second + interval: 1 + + # custom watch configuration for each service + services: + # monitor HTTP workers + http: + # maximum allowed memory consumption per worker (soft) + maxMemory: 100 + + # maximum time to live for the worker (soft) + TTL: 0 + + # maximum allowed amount of time worker can spend in idle before being removed (for weak db connections, soft) + idleTTL: 0 + + # max_execution_time (brutal) + execTTL: 60 + +# static file serving. remove this section to disable static file serving. +static: + # root directory for static file (HTTP would not serve .php and .htaccess files). + dir: "public" + + # list of extensions for forbid for serving. + forbid: [".php", ".htaccess"] + + # Automatically add headers to every request. + request: + "Example-Request-Header": "Value" + + # Automatically add headers to every response. + response: + "X-Powered-By": "RoadRunner" + +# health service configuration +health: + # http host to serve health requests. + address: localhost:2113 + +reload: + # enable or disable file watcher + enabled: true + # sync interval + interval: 1s + # global patterns to sync + patterns: [".php"] + # list of included for sync services + services: + http: + # recursive search for file patterns to add + recursive: true + # ignored folders + ignore: ["vendor"] + # service specific file pattens to sync + patterns: [".php", ".go",".md",] + # directories to sync. If recursive is set to true, + # recursive sync will be applied only to the directories in `dirs` section + dirs: ["."] + jobs: + recursive: false + ignore: ["service/metrics"] + dirs: ["./jobs"] + rpc: + recursive: true + patterns: [".json"] + # to include all project directories from workdir, leave `dirs` empty or add a dot "." + dirs: [""]
\ No newline at end of file diff --git a/.rr.yaml.sample-minimal b/.rr.yaml.sample-minimal new file mode 100644 index 000000000000..a5a6931ea53f --- /dev/null +++ b/.rr.yaml.sample-minimal @@ -0,0 +1,3 @@ +http: + address: ":8080" + workers.command: "php psr-worker.php"
\ No newline at end of file diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..fe4d1d643666 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,46 @@ +# Maintainer: Leo <i@setuid0.dev> + +pkgname=roadrunner +pkgver=1.8.3 +pkgrel=1 +pkgdesc="High-performance PHP application server, load-balancer and process manager written in Golang" +arch=(x86_64) +url="https://roadrunner.dev/" +license=(MIT) +depends=("php>=7.1") +makedepends=("go>=1.13") +source=( + "https://github.com/spiral/$pkgname/archive/v$pkgver.tar.gz" + ".rr.yaml.sample-full" + ".rr.yaml.sample-minimal" +) +sha256sums=( + "0438537fab3f20de1225a586715533863f3fe0618c2955efacc93a2228bec463" + SKIP + SKIP +) +options=("!buildflags") + +build() { + export GOPATH="$srcdir"/gopath + export CGO_CPPFLAGS="${CPPFLAGS}" + export CGO_CFLAGS="${CFLAGS}" + export CGO_CXXFLAGS="${CXXFLAGS}" + export CGO_LDFLAGS="${LDFLAGS}" + cd "$pkgname-$pkgver" + go mod download -x + make +} + +check() { + export GOPATH="$srcdir"/gopath + cd "$pkgname-$pkgver" + make test +} + +package() { + cd "$pkgname-$pkgver" + install -Dt "$pkgdir/usr/bin/" -m755 rr + install -Dt "$pkgdir/usr/share/$pkgname/" -m644 "$srcdir/.rr.yaml.sample-full" + install -Dt "$pkgdir/usr/share/$pkgname/" -m644 "$srcdir/.rr.yaml.sample-minimal" +} |