Преглед на файлове

Add configuration for nginx-unit

George Baugh преди 2 години
родител
ревизия
b1ab3f87bc
променени са 3 файла, в които са добавени 38 реда и са изтрити 0 реда
  1. 1 0
      config/nginx-unit/.gitignore
  2. 14 0
      config/nginx-unit/Makefile
  3. 23 0
      config/nginx-unit/config.json.tmpl

+ 1 - 0
config/nginx-unit/.gitignore

@@ -0,0 +1 @@
+config.json

+ 14 - 0
config/nginx-unit/Makefile

@@ -0,0 +1,14 @@
+.PHONY: install
+install:
+	export WD=`realpath "$$PWD/../.."`
+	[ -n "$$WD" ] || ( echo "cannot determine path to TCMS directory" && /bin/false )
+	[ -n "$$PERSON" ] || ( echo "Please set the PERSON environment variable before running (user to run tcms as)" && /bin/false )
+	sed -e s/__USER__/$$PERSON/g config.json.tmpl > config.json.tmp1
+	sed -e 's|__WD__|'$$WD'|g' config.json.tmp1 > config.json
+	rm config.json.tmp1
+	/bin/false
+	sudo curl -X PUT --data-binary @config.json --unix-socket /var/run/control.unit.sock http://localhost/config
+
+.PHONY: restart
+restart:
+	sudo curl -X GET --data-binary @config.json --unix-socket /var/run/control.unit.sock http://localhost/control/applications/tcms/restart

+ 23 - 0
config/nginx-unit/config.json.tmpl

@@ -0,0 +1,23 @@
+{
+   "applications" : {
+      "tcms" : {
+         "group" : "__USER__",
+         "processes" : 5,
+         "script" : "__WD__/www/server.psgi",
+         "type" : "perl",
+         "user" : "__USER__",
+         "working_directory" : "__WD__"
+      }
+   },
+   "listeners" : {
+      "*:5001" : {
+         "pass" : "applications/tcms"
+      }
+   },
+   "settings" : {
+      "http" : {
+         "body_read_timeout" : 60,
+         "max_body_size" : 85899345920
+      }
+   }
+}