ready to serve

beta.r3js.org
cybafelo 2019-06-11 19:02:02 +00:00
parent 9752611b6d
commit 5f2d9509ba
5 changed files with 83 additions and 83 deletions

View File

@ -2,15 +2,13 @@ var environment = {
path : '/usr/share/cybafelo', path : '/usr/share/cybafelo',
protocol : 'https', protocol : 'https',
websocketProtocol : 'wss', websocketProtocol : 'wss',
websocketApp : 'r3-websocket', websocketApp : 'websocket',
context : 'dev', domain : 'r3js.org',
domain : 'cybafelo.local',
remoteDomain : 'cybafelo.com', remoteDomain : 'cybafelo.com',
remoteEnvironment : 'live' remoteEnvironment : 'live'
}; };
var protocol = environment.protocol; var protocol = environment.protocol;
var context = environment.context;
var domain = environment.domain; var domain = environment.domain;
var remoteDomain = environment.remoteDomain; var remoteDomain = environment.remoteDomain;
var remoteEnvironment = environment.remoteEnvironment; var remoteEnvironment = environment.remoteEnvironment;
@ -19,7 +17,7 @@ var websocketApp = environment.websocketApp;
var config = { var config = {
editor: { editor: {
url: protocol + '://' + context + '-r3-3ditor.' + domain, url: protocol + '://editor.' + domain,
default: { default: {
platform: 'cybafelo', platform: 'cybafelo',
account: 'root', account: 'root',
@ -28,7 +26,7 @@ var config = {
} }
}, },
api: { api: {
url: protocol + '://' + context + '-r3-api.' + domain, url: protocol + '://api.' + domain,
remoteUrl: protocol + '://' + remoteEnvironment + '-r3-api.' + remoteDomain, remoteUrl: protocol + '://' + remoteEnvironment + '-r3-api.' + remoteDomain,
uploadPath: '/uploads', uploadPath: '/uploads',
clientPassword: '"kent sent me" motherfucker!' clientPassword: '"kent sent me" motherfucker!'
@ -36,13 +34,12 @@ var config = {
websocket: { websocket: {
protocol : websocketProtocol, protocol : websocketProtocol,
domain : domain, domain : domain,
context : context,
application: websocketApp, application: websocketApp,
host : context + '-' + websocketApp + '.' + domain, host : websocketApp + '.' + domain,
url : websocketProtocol + '://' + context + '-' + websocketApp + '.' + domain url : websocketProtocol + '://' + websocketApp + '.' + domain
}, },
portal: { portal: {
url: protocol + '://' + context + '-r3-portal.' + domain url: protocol + '://portal.' + domain
}, },
db: {}, db: {},
environment : environment environment : environment

8
hosts
View File

@ -9,7 +9,7 @@
# the app has to have a 1 to 1 mapping to the folder name which you cloned from the repo: # the app has to have a 1 to 1 mapping to the folder name which you cloned from the repo:
127.0.1.1 dev-r3-3ditor.cybafelo.local 127.0.1.1 editor.r3js.org
127.0.1.1 dev-r3-portal.cybafelo.local 127.0.1.1 portal.r3js.org
127.0.1.1 dev-r3-api.cybafelo.local 127.0.1.1 api.r3js.org
127.0.1.1 dev-r3-websocket.cybafelo.local 127.0.1.1 websocket.r3js.org

View File

@ -1,9 +1,9 @@
# Define our node ports # Define our node ports
upstream r3-api { upstream api {
server 127.0.0.1:3104; server 127.0.0.1:3104;
} }
upstream r3-websocket { upstream websocket {
server 127.0.0.1:3105; server 127.0.0.1:3105;
} }
@ -18,16 +18,17 @@ server {
listen 80 default_server; listen 80 default_server;
listen [::]:80 default_server ipv6only=on; listen [::]:80 default_server ipv6only=on;
ssl_certificate /usr/share/cybafelo/r3-config/cybafelo.local.cert.pem; ssl_certificate /etc/letsencrypt/live/r3js.org/fullchain.pem;
ssl_certificate_key /usr/share/cybafelo/r3-config/cybafelo.local.key.pem; ssl_certificate_key /etc/letsencrypt/live/r3js.org/privkey.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5; ssl_ciphers HIGH:!aNULL:!MD5;
client_max_body_size 20M; client_max_body_size 20M;
server_name ~^(?<environment>.*?)-(?<app>.*?)\.(?<host_domain>.*); server_name ~^(?<app>.*?)\.(?<host_domain>.*);
root /usr/share/cybafelo/$app; root /usr/share/cybafelo/r3js.org/$app;
location ~ \.php$ { location ~ \.php$ {
@ -93,7 +94,7 @@ server {
proxy_set_header X-NginX-Proxy true; proxy_set_header X-NginX-Proxy true;
# Set Environment, App, and Domain # Set Environment, App, and Domain
proxy_set_header X-R3-Env $environment; proxy_set_header X-R3-Env live;
proxy_set_header X-R3-App $app; proxy_set_header X-R3-App $app;
proxy_set_header X-R3-Host $host_domain; proxy_set_header X-R3-Host $host_domain;

View File

@ -1,3 +1,4 @@
#!/bin/bash #!/bin/bash
cd /usr/share/cybafelo/r3-api cd /usr/share/cybafelo/r3-api
pm2 start bin/start --node-args="--inspect=3204" --name "r3-api" #pm2 start bin/start --node-args="--inspect=3204" --name "r3-api"
pm2 start bin/start --name "r3-api"

View File

@ -1,3 +1,4 @@
#!/bin/bash #!/bin/bash
cd /usr/share/cybafelo/r3-websocket cd /usr/share/cybafelo/r3-websocket
pm2 start index.js --node-args="--inspect=3205" --name "r3-websocket" #pm2 start index.js --node-args="--inspect=3205" --name "r3-websocket"
pm2 start index.js --name "r3-websocket"