Skip to content
Browse files

fix; zero-relay

  • Loading branch information...
1 parent 7d52610 commit 8d0947fe72c0d54940e391fd2ac90a9b7b47b79c @dvv committed Sep 29, 2011
View
9 0mq/Makefile
@@ -0,0 +1,9 @@
+all: bin
+
+bin: relay
+
+relay: relay.c
+ gcc -o $@ $^ -lzmq
+ strip -s $@
+
+.PHONE: all bin
View
4 Makefile
@@ -33,8 +33,8 @@ check:
#bin: $(ZEROMQNODE)/binding.node
#bin: $(ZEROMQ)/src/.libs/libzmq.a
#bin: $(MONGO)/bin/mongo $(HAPROXY)/haproxy $(STUD)/$(STUD_TARGET) $(REDIS)/src/redis-server $(RUNIT)/runsvdir $(LIGHTTPD)/src/lighttpd
-#bin: $(LIGHTTPD)/src/lighttpd
-bin: $(HAPROXY)/haproxy
+bin: $(LIGHTTPD)/src/lighttpd
+#bin: $(HAPROXY)/haproxy
#bin: $(NGINX)/src/nginx
#bin: $(STUD)/$(STUD_TARGET)
View
2 service/farm/conf
@@ -1,7 +1,7 @@
ADMIN_URI=/haproxy?stats
HTTP_SERVER=0.0.0.0:80
-HTTPS_PORT=0.0.0.0:443
+HTTPS_SERVER=0.0.0.0:443
HTTPS_TERMINATED_SERVER=127.0.0.1:65443
STUD_PARAMS='-B 2048 -C 16384 -c DHE-RSA-AES256-SHA --ssl' # N.B. --ssl due to older chrome errors...
View
9 service/farm/http/balance/run
@@ -23,7 +23,6 @@ defaults
option allbackups
option dontlognull
option forwardfor except 127.0.0.1 header X-Forwarded-For
- http-check disable-on-404
log global
option httplog
option log-separate-errors
@@ -43,7 +42,6 @@ defaults
stats uri $ADMIN_URI
stats hide-version
#stats refresh 3s
- stats admin if LOCALHOST
frontend farm
@@ -76,6 +74,7 @@ frontend farm
backend rpc
option httpchk GET /haproxy?monitor
+ http-check disable-on-404
server s1 $WORKER_1 check cookie s1
server s2 $WORKER_2 check cookie s2
server s3 $WORKER_3 check cookie s3
@@ -87,9 +86,12 @@ backend rpc
timeout server 25s
timeout http-keep-alive 1
+ stats admin if LOCALHOST
+
backend websocket
option httpchk GET /haproxy?monitor
+ http-check disable-on-404
server s1 $WORKER_1 check cookie s1
server s2 $WORKER_2 check cookie s2
server s3 $WORKER_3 check cookie s3
@@ -105,7 +107,8 @@ backend websocket
backend http
- option httpchk GET /index.html
+ option httpchk GET /$STATIC_INDEX
+ http-check disable-on-404
server s1 $STATIC_1 check
server s2 $STATIC_2 check backup
View
38 service/farm/http/static-backup/conf
@@ -1,38 +0,0 @@
-user web;
-worker_processes 1;
-daemon off;
-
-pid /etc/service/farm/http/nginx/.pid;
-
-#error_log logs/error.log;
-#error_log logs/error.log notice;
-#error_log logs/error.log info;
-
-events {
- worker_connections 16384;
-}
-
-http {
-
- include mime.types;
- default_type application/octet-stream;
- #access_log /dev/stdout;
- access_log /dev/null;
-
- sendfile on;
- #tcp_nopush on;
-
- keepalive_timeout 70;
-
- #gzip on;
-
- server {
- server_name localhost;
- listen 127.0.0.1:65441;
- root /home/dvv/node_modules/connection/example/public;
- location / {
- index index.html;
- }
- }
-
-}
View
48 service/farm/http/static-backup/run
@@ -1,2 +1,48 @@
#!/bin/sh
-exec nginx -c $PWD/conf 2>&1
+#exec nginx -c $PWD/conf 2>&1
+
+. ../../conf
+cat >.conf <<_EOF_
+
+user web;
+worker_processes 1;
+daemon off;
+
+pid $PWD/.pid;
+
+#error_log logs/error.log;
+#error_log logs/error.log notice;
+#error_log logs/error.log info;
+
+events {
+ worker_connections 16384;
+}
+
+http {
+
+ include mime.types;
+ default_type application/octet-stream;
+ #access_log /dev/stdout;
+ access_log /dev/null;
+
+ sendfile on;
+ #tcp_nopush on;
+
+ keepalive_timeout 70;
+
+ #gzip on;
+
+ server {
+ server_name localhost;
+ listen $STATIC_2;
+ root $STATIC_ROOT;
+ location / {
+ index $STATIC_INDEX;
+ }
+ }
+
+}
+
+_EOF_
+
+exec nginx -c $PWD/.conf 2>&1
View
40 service/farm/http/static/conf
@@ -1,40 +0,0 @@
-
-user web;
-worker_processes 1;
-daemon off;
-
-pid /home/dvv/node_modules/farm/service/farm/http/static/.pid;
-
-#error_log logs/error.log;
-#error_log logs/error.log notice;
-#error_log logs/error.log info;
-
-events {
- worker_connections 16384;
-}
-
-http {
-
- include mime.types;
- default_type application/octet-stream;
- #access_log /dev/stdout;
- access_log /dev/null;
-
- sendfile on;
- #tcp_nopush on;
-
- keepalive_timeout 70;
-
- #gzip on;
-
- server {
- server_name localhost;
- listen 127.0.0.1:65440;
- root /home/dvv/node_modules/connection/example/public;
- location / {
- index index.html;
- }
- }
-
-}
-
View
4 service/farm/http/static/run
@@ -2,7 +2,7 @@
#exec nginx -c $PWD/conf 2>&1
. ../../conf
-cat >conf <<_EOF_
+cat >.conf <<_EOF_
user web;
worker_processes 1;
@@ -45,4 +45,4 @@ http {
_EOF_
-exec nginx -c $PWD/conf 2>&1
+exec nginx -c $PWD/.conf 2>&1
View
2 service/farm/https-haproxy/65444/run
@@ -3,4 +3,4 @@
. ../../conf
ulimit -n 100000
-exec stud -n 1 -u stud -q dummy -f 127.0.0.1,${PWD##*/} -b 127.0.0.1,$HAPROXY_HTTP_LOCAL_PORT --write-proxy $STUD_PARAMS -- site.pem 2>&1
+exec stud -n 1 -u stud -q dummy -f 127.0.0.1,${PWD##*/} -b ${HTTPS_TERMINATED_SERVER/:/,} --write-proxy $STUD_PARAMS -- site.pem 2>&1
View
2 service/farm/https-haproxy/65445/run
@@ -3,4 +3,4 @@
. ../../conf
ulimit -n 100000
-exec stud -n 1 -u stud -q dummy -f 127.0.0.1,${PWD##*/} -b 127.0.0.1,$HAPROXY_HTTP_LOCAL_PORT --write-proxy $STUD_PARAMS -- site.pem 2>&1
+exec stud -n 1 -u stud -q dummy -f 127.0.0.1,${PWD##*/} -b ${HTTPS_TERMINATED_SERVER/:/,} --write-proxy $STUD_PARAMS -- site.pem 2>&1
View
2 service/farm/https-haproxy/65446/run
@@ -3,4 +3,4 @@
. ../../conf
ulimit -n 100000
-exec stud -n 1 -u stud -q dummy -f 127.0.0.1,${PWD##*/} -b 127.0.0.1,$HAPROXY_HTTP_LOCAL_PORT --write-proxy $STUD_PARAMS -- site.pem 2>&1
+exec stud -n 1 -u stud -q dummy -f 127.0.0.1,${PWD##*/} -b ${HTTPS_TERMINATED_SERVER/:/,} --write-proxy $STUD_PARAMS -- site.pem 2>&1
View
2 service/farm/https-haproxy/65447/run
@@ -3,4 +3,4 @@
. ../../conf
ulimit -n 100000
-exec stud -n 1 -u stud -q dummy -f 127.0.0.1,${PWD##*/} -b 127.0.0.1,$HAPROXY_HTTP_LOCAL_PORT --write-proxy $STUD_PARAMS -- site.pem 2>&1
+exec stud -n 1 -u stud -q dummy -f 127.0.0.1,${PWD##*/} -b ${HTTPS_TERMINATED_SERVER/:/,} --write-proxy $STUD_PARAMS -- site.pem 2>&1
View
2 service/farm/https/run
@@ -3,4 +3,4 @@
. ../conf
ulimit -n 100000
-exec stud -n 1 -u stud -q dummy -f \*,$HTTPS_PORT -b 127.0.0.1,$HAPROXY_HTTP_LOCAL_PORT --write-proxy $STUD_PARAMS -- site.pem 2>&1
+exec stud -n 1 -u stud -q dummy -f ${HTTPS_SERVER/:/,} -b ${HTTPS_TERMINATED_SERVER/:/,} --write-proxy $STUD_PARAMS -- site.pem 2>&1
View
2 service/farm/zero-relay/log/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec chpst svlogd -tt .
View
1 service/farm/zero-relay/messages
View
5 service/farm/zero-relay/run
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+. ../conf
+
+exec chpst -u web zero-relay 2>&1

0 comments on commit 8d0947f

Please sign in to comment.
Something went wrong with that request. Please try again.