kenshin samourai
6 years ago
committed by
GitHub
16 changed files with 224 additions and 18 deletions
@ -0,0 +1,13 @@ |
|||
# |
|||
# EXPERT AND DEV SETTINGS |
|||
# |
|||
|
|||
|
|||
# |
|||
# NETWORK ENVIRONMENT |
|||
# |
|||
|
|||
# Select a Bitcoin network |
|||
# Do not modify this value after the first install |
|||
# Value: mainnet | testnet |
|||
COMMON_BTC_NETWORK=mainnet |
@ -0,0 +1,63 @@ |
|||
# Proxy WebSockets |
|||
# https://www.nginx.com/blog/websocket-nginx/ |
|||
map $http_upgrade $connection_upgrade { |
|||
default upgrade; |
|||
'' close; |
|||
} |
|||
|
|||
# WebSocket server listening here |
|||
upstream websocket { |
|||
server node:8080; |
|||
} |
|||
|
|||
# Site Configuration |
|||
server { |
|||
listen 80; |
|||
server_name _; |
|||
|
|||
# Set proxy timeouts for the application |
|||
proxy_connect_timeout 600; |
|||
proxy_read_timeout 600; |
|||
proxy_send_timeout 600; |
|||
send_timeout 600; |
|||
|
|||
# Proxy WebSocket connections first |
|||
location /test/v2/inv { |
|||
proxy_pass http://websocket; |
|||
proxy_http_version 1.1; |
|||
proxy_set_header Upgrade $http_upgrade; |
|||
proxy_set_header Connection $connection_upgrade; |
|||
} |
|||
|
|||
# PushTX server is separate, so proxy first |
|||
location /test/v2/pushtx/ { |
|||
proxy_pass http://node:8081/; |
|||
} |
|||
|
|||
# Proxy requests to maintenance tool |
|||
location /admin/ { |
|||
proxy_pass http://node:8080/static/admin/; |
|||
} |
|||
|
|||
# Proxy all other v2 requests to the accounts server |
|||
location /test/v2/ { |
|||
proxy_pass http://node:8080/; |
|||
} |
|||
|
|||
# Redirect onion address to maintenance tool |
|||
location = / { |
|||
return 301 /admin; |
|||
} |
|||
|
|||
# Serve remaining requests |
|||
location / { |
|||
return 200 '{"status":"ok"}'; |
|||
add_header Content-Type application/json; |
|||
} |
|||
|
|||
location /test/ { |
|||
return 200 '{"status":"ok"}'; |
|||
add_header Content-Type application/json; |
|||
} |
|||
} |
|||
|
@ -1,13 +1,13 @@ |
|||
#!/bin/bash |
|||
|
|||
cd /home/node/app/accounts |
|||
forever start -a -l /dev/null -o /data/logs/api-output.log -e /data/logs/api-error.log index.js |
|||
forever start -a -l /dev/null -o /data/logs/api-output.log -e /data/logs/api-error.log index.js "$COMMON_BTC_NETWORK" |
|||
|
|||
cd /home/node/app/pushtx |
|||
forever start -a -l /dev/null -o /data/logs/pushtx-output.log -e /data/logs/pushtx-error.log index.js |
|||
forever start -a -l /dev/null -o /data/logs/pushtx-orchest-output.log -e /data/logs/pushtx-orchest-error.log index-orchestrator.js |
|||
forever start -a -l /dev/null -o /data/logs/pushtx-output.log -e /data/logs/pushtx-error.log index.js "$COMMON_BTC_NETWORK" |
|||
forever start -a -l /dev/null -o /data/logs/pushtx-orchest-output.log -e /data/logs/pushtx-orchest-error.log index-orchestrator.js "$COMMON_BTC_NETWORK" |
|||
|
|||
cd /home/node/app/tracker |
|||
forever start -a -l /dev/null -o /data/logs/tracker-output.log -e /data/logs/tracker-error.log index.js |
|||
forever start -a -l /dev/null -o /data/logs/tracker-output.log -e /data/logs/tracker-error.log index.js "$COMMON_BTC_NETWORK" |
|||
|
|||
forever --fifo logs 0 |
@ -0,0 +1,25 @@ |
|||
var conf = { |
|||
|
|||
// Admin tool
|
|||
adminTool: { |
|||
baseUri: '/admin' |
|||
//baseUri: '/static/admin'
|
|||
}, |
|||
|
|||
// API
|
|||
api: { |
|||
baseUri: '/test/v2' |
|||
//baseUri: ''
|
|||
}, |
|||
|
|||
// Url prefixes
|
|||
prefixes: { |
|||
// Prefix for /support endpoint
|
|||
support: 'support', |
|||
// Prefix for /status endpoint
|
|||
status: 'status', |
|||
// Prefix for pushtx /status endpoint
|
|||
statusPushtx: 'status' |
|||
} |
|||
|
|||
}; |
Loading…
Reference in new issue