From e544b6c4a0325bebe2773e14b80bc6c41f8aae1b Mon Sep 17 00:00:00 2001 From: "Theunis J. Botha" Date: Wed, 19 Oct 2016 19:32:40 +0200 Subject: [PATCH 01/13] 3d editor config --- 3d-editor.conf | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 3d-editor.conf diff --git a/3d-editor.conf b/3d-editor.conf new file mode 100644 index 0000000..466f988 --- /dev/null +++ b/3d-editor.conf @@ -0,0 +1,46 @@ +server { + listen 80; + listen 443 ssl; + + server_name 3d-editor.gamewheel.local 3d-editor-debug.gamewheel.local; + + root /srv/gamewheel.local/3d-editor; + index index.php; + + access_log /var/log/nginx/3d-editor.gamewheel.local.access.log; + error_log /var/log/nginx/3d-editor.gamewheel.local.error.log; + + ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem; + ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key; + ssl_session_timeout 5m; + ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2; + ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES"; + ssl_prefer_server_ciphers on; + + location ~ \.php$ { + fastcgi_pass 127.0.0.1:9001; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param SCRIPT_URL $request_uri; + fastcgi_param SERVER_NAME $http_host; + include fastcgi_params; + } + + location / { + add_header Access-Control-Allow-Origin $http_origin; + autoindex on; + try_files $uri $uri/ @node; + } + + location @node { + proxy_pass_request_headers on; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-NginX-Proxy true; + # Replace here with proper host/port + proxy_pass http://127.0.0.1:3103; + proxy_ssl_session_reuse off; + proxy_set_header Host $http_host; + proxy_redirect off; + } +} From 21d900baaa6261565a5bc1d26f2a1862fd92887e Mon Sep 17 00:00:00 2001 From: "Theunis J. Botha" Date: Mon, 24 Oct 2016 15:58:07 +0200 Subject: [PATCH 02/13] revert - will create a build system based on environment --- 3d-editor.conf | 18 +++++++++--------- config.js | 3 +++ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/3d-editor.conf b/3d-editor.conf index 466f988..dd15c76 100644 --- a/3d-editor.conf +++ b/3d-editor.conf @@ -5,7 +5,7 @@ server { server_name 3d-editor.gamewheel.local 3d-editor-debug.gamewheel.local; root /srv/gamewheel.local/3d-editor; - index index.php; + index index.html; access_log /var/log/nginx/3d-editor.gamewheel.local.access.log; error_log /var/log/nginx/3d-editor.gamewheel.local.error.log; @@ -17,14 +17,14 @@ server { ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES"; ssl_prefer_server_ciphers on; - location ~ \.php$ { - fastcgi_pass 127.0.0.1:9001; - fastcgi_index index.php; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - fastcgi_param SCRIPT_URL $request_uri; - fastcgi_param SERVER_NAME $http_host; - include fastcgi_params; - } +# location ~ \.php$ { +# fastcgi_pass 127.0.0.1:9001; +# fastcgi_index index.php; +# fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; +# fastcgi_param SCRIPT_URL $request_uri; +# fastcgi_param SERVER_NAME $http_host; +# include fastcgi_params; +# } location / { add_header Access-Control-Allow-Origin $http_origin; diff --git a/config.js b/config.js index d1205a4..f7d2201 100644 --- a/config.js +++ b/config.js @@ -47,6 +47,9 @@ var config = { } }, sessionKey: 'iJswK29klj20Jos02mJK8ud9239j23' + }, + environment: { + mode : 'development' } }; From 3e07851f2895028447aa67d5efdd6f64e54c2dc4 Mon Sep 17 00:00:00 2001 From: "Theunis J. Botha" Date: Tue, 25 Oct 2016 17:59:38 +0200 Subject: [PATCH 03/13] config updates for integration tests --- config.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/config.js b/config.js index f7d2201..c43e884 100644 --- a/config.js +++ b/config.js @@ -13,7 +13,13 @@ var config = { url: "http://3d-editor.gamewheel.local", port: 3103, debugPort: 3203, - cluster: false + cluster: false, + default: { + platform: 'gamewheel', + account: 'root', + subAccount: 'root' + }, + uploadPath : '/upload' }, api16: { url: "http://api.gamewheel.local", From d147b68e456a3dfa86706ea1d775de3be39d5e2f Mon Sep 17 00:00:00 2001 From: "Theunis J. Botha" Date: Mon, 31 Oct 2016 09:33:26 +0100 Subject: [PATCH 04/13] config now contains upload data --- config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.js b/config.js index c43e884..3e84b70 100644 --- a/config.js +++ b/config.js @@ -19,7 +19,7 @@ var config = { account: 'root', subAccount: 'root' }, - uploadPath : '/upload' + uploadPath : '/uploads' }, api16: { url: "http://api.gamewheel.local", From 95662fa21aa2a6765a8e0986125a08d3cada12f9 Mon Sep 17 00:00:00 2001 From: "Theunis J. Botha" Date: Mon, 31 Oct 2016 12:05:28 +0100 Subject: [PATCH 05/13] 3d racing for tj dev --- 3d-racing.conf | 46 ++++++++++++++++++++++++++++++++++++++++++++++ config.js | 2 +- 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 3d-racing.conf diff --git a/3d-racing.conf b/3d-racing.conf new file mode 100644 index 0000000..ec5b7c3 --- /dev/null +++ b/3d-racing.conf @@ -0,0 +1,46 @@ +server { + listen 80; + listen 443 ssl; + + server_name 3d-racing.gamewheel.local 3d-racing-debug.gamewheel.local; + + root /srv/gamewheel.local/3d-racing; + index index.html; + + access_log /var/log/nginx/3d-racing.gamewheel.local.access.log; + error_log /var/log/nginx/3d-racing.gamewheel.local.error.log; + + ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem; + ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key; + ssl_session_timeout 5m; + ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2; + ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES"; + ssl_prefer_server_ciphers on; + +# location ~ \.php$ { +# fastcgi_pass 127.0.0.1:9001; +# fastcgi_index index.php; +# fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; +# fastcgi_param SCRIPT_URL $request_uri; +# fastcgi_param SERVER_NAME $http_host; +# include fastcgi_params; +# } + + location / { + add_header Access-Control-Allow-Origin $http_origin; + autoindex on; + try_files $uri $uri/ @node; + } + + location @node { + proxy_pass_request_headers on; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-NginX-Proxy true; + # Replace here with proper host/port + proxy_pass http://127.0.0.1:3102; + proxy_ssl_session_reuse off; + proxy_set_header Host $http_host; + proxy_redirect off; + } +} diff --git a/config.js b/config.js index 3e84b70..d96c257 100644 --- a/config.js +++ b/config.js @@ -22,7 +22,7 @@ var config = { uploadPath : '/uploads' }, api16: { - url: "http://api.gamewheel.local", + url: "http://api16.gamewheel.com", port: 3104, debugPort: 3204, cluster: false, From 2488c4fd969c9fe2e376faafeb47c90e3308e504 Mon Sep 17 00:00:00 2001 From: "Theunis J. Botha" Date: Mon, 31 Oct 2016 12:38:33 +0100 Subject: [PATCH 06/13] api config --- api.conf | 37 +++++++++++++++++++++++++++++++++++++ config.js | 2 +- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 api.conf diff --git a/api.conf b/api.conf new file mode 100644 index 0000000..039c488 --- /dev/null +++ b/api.conf @@ -0,0 +1,37 @@ +server { + listen 80; + listen 443 ssl; + # Replace here with proper server FQDN + server_name api.gamewheel.local; + + # Replace here with proper logs paths + access_log /var/log/nginx/api.gamewheel.local.access.log; + error_log /var/log/nginx/api.gamewheel.local.error.log; + + # Replace here with proper certificates paths + ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem; + ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key; + + ssl_session_timeout 5m; + ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2; + ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES"; + ssl_prefer_server_ciphers on; + + # Replace here with proper allowed origins + # add_header Access-Control-Allow-Origin "http://app.gamewheel.local"; + # add_header Access-Control-Allow-Credentials true; + add_header Access-Control-Allow-Methods 'HEAD, GET, POST, PUT, DELETE, OPTIONS'; + add_header Access-Control-Allow-Headers 'origin, x-requested-with, content-type, accept, authorization, Access-Control-Request-Headers, Access-Control-Request-Method, x-gw-api-rt-key, x-gw-api-rt-token'; + + location / { + proxy_pass_request_headers on; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-NginX-Proxy true; + # Replace here with proper host/port + proxy_pass http://127.0.0.1:3104; + proxy_ssl_session_reuse off; + proxy_set_header Host $http_host; + proxy_redirect off; + } +} diff --git a/config.js b/config.js index d96c257..7d174bc 100644 --- a/config.js +++ b/config.js @@ -10,7 +10,7 @@ var config = { debugPort: 3202 }, editor: { - url: "http://3d-editor.gamewheel.local", + url: "http://3d-editor.gamewheel.com", port: 3103, debugPort: 3203, cluster: false, From ec2a6bf53e56a7a474f76a7516fc4961fb205d58 Mon Sep 17 00:00:00 2001 From: "Theunis J. Botha" Date: Tue, 1 Nov 2016 14:06:08 +0100 Subject: [PATCH 07/13] reset to local --- config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.js b/config.js index 7d174bc..3e84b70 100644 --- a/config.js +++ b/config.js @@ -10,7 +10,7 @@ var config = { debugPort: 3202 }, editor: { - url: "http://3d-editor.gamewheel.com", + url: "http://3d-editor.gamewheel.local", port: 3103, debugPort: 3203, cluster: false, @@ -22,7 +22,7 @@ var config = { uploadPath : '/uploads' }, api16: { - url: "http://api16.gamewheel.com", + url: "http://api.gamewheel.local", port: 3104, debugPort: 3204, cluster: false, From c21ff2779e5e5318369b476890febfe3ac69650c Mon Sep 17 00:00:00 2001 From: "Theunis J. Botha" Date: Mon, 7 Nov 2016 12:43:38 +0100 Subject: [PATCH 08/13] config updates - tools --- config.js | 23 +++++++++++++++++++++-- secure.js | 13 +++++++++++++ tools.conf | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 80 insertions(+), 2 deletions(-) create mode 100644 secure.js create mode 100644 tools.conf diff --git a/config.js b/config.js index 3e84b70..04dc03b 100644 --- a/config.js +++ b/config.js @@ -19,7 +19,7 @@ var config = { account: 'root', subAccount: 'root' }, - uploadPath : '/uploads' + uploadPath: '/uploads' }, api16: { url: "http://api.gamewheel.local", @@ -54,8 +54,27 @@ var config = { }, sessionKey: 'iJswK29klj20Jos02mJK8ud9239j23' }, + tools: { + url: "http://tools.gamewheel.local", + port: 3105, + debugPort: 3205, + mysqlUserExport: { + host: "gwdb.cpuanrat3vd1.eu-central-1.rds.amazonaws.com", + port: 3306, + user: "root", + password: "5t0bURlq" + }, + mongoUserImport: { + host: "127.0.0.1", + port: 27017, + options: { + user: '', + pass: '' + } + } + }, environment: { - mode : 'development' + mode: 'development' } }; diff --git a/secure.js b/secure.js new file mode 100644 index 0000000..2d707ed --- /dev/null +++ b/secure.js @@ -0,0 +1,13 @@ +var secure = { + vr_pong : { + }, + vr_racer : { + }, + editor : { + } +}; + +if (typeof module !== 'undefined') { + module.exports = secure; +} + diff --git a/tools.conf b/tools.conf new file mode 100644 index 0000000..e237f11 --- /dev/null +++ b/tools.conf @@ -0,0 +1,46 @@ +server { + listen 80; + listen 443 ssl; + + server_name tools.gamewheel.local tools-debug.gamewheel.local; + + root /srv/gamewheel.local/tools; + index index.html; + + access_log /var/log/nginx/tools.gamewheel.local.access.log; + error_log /var/log/nginx/tools.gamewheel.local.error.log; + + ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem; + ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key; + ssl_session_timeout 5m; + ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2; + ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES"; + ssl_prefer_server_ciphers on; + +# location ~ \.php$ { +# fastcgi_pass 127.0.0.1:9001; +# fastcgi_index index.php; +# fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; +# fastcgi_param SCRIPT_URL $request_uri; +# fastcgi_param SERVER_NAME $http_host; +# include fastcgi_params; +# } + + location / { + add_header Access-Control-Allow-Origin $http_origin; + autoindex on; + try_files $uri $uri/ @node; + } + + location @node { + proxy_pass_request_headers on; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-NginX-Proxy true; + # Replace here with proper host/port + proxy_pass http://127.0.0.1:3105; + proxy_ssl_session_reuse off; + proxy_set_header Host $http_host; + proxy_redirect off; + } +} From 64d59cb5bfb6ae915e3da88d4ca53e955eb591e4 Mon Sep 17 00:00:00 2001 From: "Theunis J. Botha" Date: Mon, 7 Nov 2016 15:34:33 +0100 Subject: [PATCH 09/13] mysql import config --- config.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/config.js b/config.js index 04dc03b..28992f2 100644 --- a/config.js +++ b/config.js @@ -58,11 +58,17 @@ var config = { url: "http://tools.gamewheel.local", port: 3105, debugPort: 3205, + default: { + platform: 'gamewheel', + account: 'root', + subAccount: 'root' + }, mysqlUserExport: { host: "gwdb.cpuanrat3vd1.eu-central-1.rds.amazonaws.com", port: 3306, user: "root", - password: "5t0bURlq" + password: "5t0bURlq", + database: "gw_core" }, mongoUserImport: { host: "127.0.0.1", From 47fb14fa71a376262e78915d9b64e37e4653038c Mon Sep 17 00:00:00 2001 From: "Theunis J. Botha" Date: Tue, 8 Nov 2016 12:34:17 +0100 Subject: [PATCH 10/13] server configuration updated --- 3d-editor.conf | 31 ++++++----------- 3d-racing.conf | 26 ++------------ README.md | 24 +++++++++++++ api-runtime.conf | 69 +++++++++++++++++++++++++++++++++++++ api.conf | 48 ++++++++++---------------- api16.conf | 26 ++++++++++++++ app.conf | 20 +++++++++++ config.js | 86 ++++++++++++++++----------------------------- gate.conf | 25 ++++++++++++++ package.json | 12 +++++++ port.conf | 25 ++++++++++++++ secure.js | 90 ++++++++++++++++++++++++++++++++++++++++++++++-- tools.conf | 32 ++++++----------- 13 files changed, 358 insertions(+), 156 deletions(-) create mode 100644 README.md create mode 100644 api-runtime.conf create mode 100644 api16.conf create mode 100644 app.conf create mode 100644 gate.conf create mode 100644 package.json create mode 100644 port.conf diff --git a/3d-editor.conf b/3d-editor.conf index dd15c76..a566053 100644 --- a/3d-editor.conf +++ b/3d-editor.conf @@ -1,30 +1,19 @@ +#origin git@github.com:ToywheelDev/3d_editor.git server { listen 80; - listen 443 ssl; - + server_name 3d-editor.gamewheel.local 3d-editor-debug.gamewheel.local; root /srv/gamewheel.local/3d-editor; - index index.html; - access_log /var/log/nginx/3d-editor.gamewheel.local.access.log; - error_log /var/log/nginx/3d-editor.gamewheel.local.error.log; - - ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem; - ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key; - ssl_session_timeout 5m; - ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2; - ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES"; - ssl_prefer_server_ciphers on; - -# location ~ \.php$ { -# fastcgi_pass 127.0.0.1:9001; -# fastcgi_index index.php; -# fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; -# fastcgi_param SCRIPT_URL $request_uri; -# fastcgi_param SERVER_NAME $http_host; -# include fastcgi_params; -# } + location ~ \.php$ { + fastcgi_pass 127.0.0.1:9001; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param SCRIPT_URL $request_uri; + fastcgi_param SERVER_NAME $http_host; + include fastcgi_params; + } location / { add_header Access-Control-Allow-Origin $http_origin; diff --git a/3d-racing.conf b/3d-racing.conf index ec5b7c3..4c6887c 100644 --- a/3d-racing.conf +++ b/3d-racing.conf @@ -1,33 +1,13 @@ +#origin https://github.com/ToywheelDev/3d-racing.git server { listen 80; - listen 443 ssl; - + server_name 3d-racing.gamewheel.local 3d-racing-debug.gamewheel.local; root /srv/gamewheel.local/3d-racing; - index index.html; - - access_log /var/log/nginx/3d-racing.gamewheel.local.access.log; - error_log /var/log/nginx/3d-racing.gamewheel.local.error.log; - - ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem; - ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key; - ssl_session_timeout 5m; - ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2; - ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES"; - ssl_prefer_server_ciphers on; - -# location ~ \.php$ { -# fastcgi_pass 127.0.0.1:9001; -# fastcgi_index index.php; -# fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; -# fastcgi_param SCRIPT_URL $request_uri; -# fastcgi_param SERVER_NAME $http_host; -# include fastcgi_params; -# } location / { - add_header Access-Control-Allow-Origin $http_origin; + add_header Access-Control-Allow-Origin $http_origin; autoindex on; try_files $uri $uri/ @node; } diff --git a/README.md b/README.md new file mode 100644 index 0000000..20303fc --- /dev/null +++ b/README.md @@ -0,0 +1,24 @@ +#Configuration Package for Gamewheel +This is a central repository which aims to be a replacement +for all configuration packages. + +Every configuration lies in a different branch. + +Each branch corresponds to a server configuration, ex. tj-dev is for +TJ's dev machine. + +gw-3d should be deployed on the gw-3d server + +if we have a gw-3d-beta server, this branch would be called gw-3d-beta + +and so on. + +Secure (Sensitive configuration options) go into secure.js. + +public configuration options go into config.js. + +config.js is linked to from every other package via symbolic link. + +When config.js is required server side, it is automatically merged +with secure.js in order to produce a global server side configuration, +whilst only exposing config.js public to client side. \ No newline at end of file diff --git a/api-runtime.conf b/api-runtime.conf new file mode 100644 index 0000000..ced8b3d --- /dev/null +++ b/api-runtime.conf @@ -0,0 +1,69 @@ +#origin git@github.com:ToywheelDev/GW_Runtime.git +#origin git@github.com:ToywheelDev/gw-statistic.git +server { + listen 80; + + server_name api-runtime.gamewheel.local; + + #root /usr/share/gamewheel/GW_Runtime - port 3108 (old api runtime) + #root /usr/share/gamewheel/gw-statistic - port 3109 (new api runtime) + + location /lead/trigger/ { + auth_basic "Restricted"; #For Basic Auth + auth_basic_user_file /etc/nginx/.htpasswd; #For Basic Auth + proxy_pass_request_headers on; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-NginX-Proxy true; + proxy_pass http://127.0.0.1:3109; + proxy_ssl_session_reuse off; + proxy_set_header Host $http_host; + proxy_redirect off; + proxy_read_timeout 99999s; + proxy_connect_timeout 99999s; + proxy_send_timeout 99999s; + } + + location /form { + proxy_pass_request_headers on; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-NginX-Proxy true; + proxy_pass http://127.0.0.1:3108; + proxy_ssl_session_reuse off; + proxy_set_header Host $http_host; + proxy_redirect off; + proxy_read_timeout 99999s; + proxy_connect_timeout 99999s; + proxy_send_timeout 99999s; + } + + location /lead { + proxy_pass_request_headers on; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-NginX-Proxy true; + proxy_pass http://127.0.0.1:3108; + proxy_ssl_session_reuse off; + proxy_set_header Host $http_host; + proxy_redirect off; + proxy_read_timeout 99999s; + proxy_connect_timeout 99999s; + proxy_send_timeout 99999s; + } + + location / { + proxy_pass_request_headers on; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-NginX-Proxy true; + proxy_pass http://127.0.0.1:3109; + proxy_ssl_session_reuse off; + proxy_set_header Host $http_host; + proxy_redirect off; + proxy_read_timeout 99999s; + proxy_connect_timeout 99999s; + proxy_send_timeout 99999s; + } +} + diff --git a/api.conf b/api.conf index 039c488..e83e15a 100644 --- a/api.conf +++ b/api.conf @@ -1,37 +1,25 @@ +#origin git@github.com:ToywheelDev/gamewheel-api.git server { listen 80; - listen 443 ssl; - # Replace here with proper server FQDN + server_name api.gamewheel.local; - # Replace here with proper logs paths - access_log /var/log/nginx/api.gamewheel.local.access.log; - error_log /var/log/nginx/api.gamewheel.local.error.log; + root /usr/share/gamewheel/api; - # Replace here with proper certificates paths - ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem; - ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key; + location / { + add_header Access-Control-Allow-Origin $http_origin; + autoindex on; + try_files $uri $uri/ @node; + } - ssl_session_timeout 5m; - ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2; - ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES"; - ssl_prefer_server_ciphers on; - - # Replace here with proper allowed origins - # add_header Access-Control-Allow-Origin "http://app.gamewheel.local"; - # add_header Access-Control-Allow-Credentials true; - add_header Access-Control-Allow-Methods 'HEAD, GET, POST, PUT, DELETE, OPTIONS'; - add_header Access-Control-Allow-Headers 'origin, x-requested-with, content-type, accept, authorization, Access-Control-Request-Headers, Access-Control-Request-Method, x-gw-api-rt-key, x-gw-api-rt-token'; - - location / { - proxy_pass_request_headers on; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-NginX-Proxy true; - # Replace here with proper host/port - proxy_pass http://127.0.0.1:3104; - proxy_ssl_session_reuse off; - proxy_set_header Host $http_host; - proxy_redirect off; - } + location @node { + proxy_pass_request_headers on; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-NginX-Proxy true; + proxy_pass http://127.0.0.1:3107; + proxy_ssl_session_reuse off; + proxy_set_header Host $http_host; + proxy_redirect off; + } } diff --git a/api16.conf b/api16.conf new file mode 100644 index 0000000..99cec80 --- /dev/null +++ b/api16.conf @@ -0,0 +1,26 @@ +#origin git@github.com:ToywheelDev/GW_Config.git +server { + listen 80; + + server_name api16.gamewheel.local; + + root /usr/share/gamewheel/GW_Config; + + location / { + add_header Access-Control-Allow-Origin $http_origin; + autoindex on; + try_files $uri $uri/ @node; + } + + location @node { + proxy_pass_request_headers on; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-NginX-Proxy true; + # Replace here with proper host/port + proxy_pass http://127.0.0.1:3104; + proxy_ssl_session_reuse off; + proxy_set_header Host $http_host; + proxy_redirect off; + } +} diff --git a/app.conf b/app.conf new file mode 100644 index 0000000..4b225ee --- /dev/null +++ b/app.conf @@ -0,0 +1,20 @@ +#origin git@github.com:ToywheelDev/gw-app.git +server { + listen 80; + + server_name app.gamewheel.local; + + root /usr/share/gamewheel/gw-app; + + location / { + proxy_pass_request_headers on; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-NginX-Proxy true; + # Replace here with proper host/port + proxy_pass http://127.0.0.1:3104; + proxy_ssl_session_reuse off; + proxy_set_header Host $http_host; + proxy_redirect off; + } +} diff --git a/config.js b/config.js index 28992f2..a14cdf2 100644 --- a/config.js +++ b/config.js @@ -1,19 +1,12 @@ var config = { vr_pong: { - url: "http://pong.gamewheel.local", - port: 3101, - debugPort: 3201 + url: "http://pong.gamewheel.local" }, vr_racer: { - url: "http://racer.gamewheel.local", - port: 3102, - debugPort: 3202 + url: "http://racer.gamewheel.local" }, editor: { url: "http://3d-editor.gamewheel.local", - port: 3103, - debugPort: 3203, - cluster: false, default: { platform: 'gamewheel', account: 'root', @@ -22,69 +15,48 @@ var config = { uploadPath: '/uploads' }, api16: { - url: "http://api.gamewheel.local", - port: 3104, - debugPort: 3204, - cluster: false, - cors: false, - mailer: { - host: 'localhost', - port: 9025, - secure: false, - debug: true, - ignoreTLS: true - }, - mongodb: { - host: 'mongodb://127.0.0.1', - db: 'gamewheel', - port: 27017, - shardPort: 27018, - options: { - db: { - native_parser: true - }, - server: { - poolSize: 5, - keepAlive: 120 - }, - user: '', - pass: '', - autoIndex: false - } - }, - sessionKey: 'iJswK29klj20Jos02mJK8ud9239j23' + url: "http://api16.gamewheel.local" }, tools: { url: "http://tools.gamewheel.local", - port: 3105, - debugPort: 3205, default: { platform: 'gamewheel', account: 'root', subAccount: 'root' - }, - mysqlUserExport: { - host: "gwdb.cpuanrat3vd1.eu-central-1.rds.amazonaws.com", - port: 3306, - user: "root", - password: "5t0bURlq", - database: "gw_core" - }, - mongoUserImport: { - host: "127.0.0.1", - port: 27017, - options: { - user: '', - pass: '' - } } }, + app : { + url: 'http://app.gamewheel.local' + }, + api : { + url : 'http://api.gamewheel.local' + }, + old_api_runtime : { + url : 'http://api-runtime.gamewheel.local' + }, + statistics : { + url : 'http://api-runtime.gamewheel.local' + }, + port : { + url: 'http://port.gamewheel.local' + }, + gate : { + url: 'http://gate.gamewheel.local' + }, environment: { mode: 'development' } }; if (typeof module !== 'undefined') { + + if (typeof require !== 'undefined') { + var secure = require('./secure'); + var _ = require('lodash'); + + _.merge(config, secure); + } + module.exports = config; } diff --git a/gate.conf b/gate.conf new file mode 100644 index 0000000..d04cd5b --- /dev/null +++ b/gate.conf @@ -0,0 +1,25 @@ +#origin git@github.com:ToywheelDev/gamewheel-gate.git +server { + listen 80; + + server_name gate.gamewheel.local; + + root /usr/share/gamewheel/gate; + + location / { + add_header Access-Control-Allow-Origin $http_origin; + autoindex on; + try_files $uri $uri/ @node; + } + + location @node { + proxy_pass_request_headers on; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-NginX-Proxy true; + proxy_pass http://127.0.0.1:3111; + proxy_ssl_session_reuse off; + proxy_set_header Host $http_host; + proxy_redirect off; + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..3b7fb62 --- /dev/null +++ b/package.json @@ -0,0 +1,12 @@ +{ + "name": "gamewheel-config", + "version": "0.0.1", + "author": "Theunis J. Botha", + "description": "Tools for Gamewheel", + "repository": "https://github.com/ToywheelDev/config.git", + "license": "UNLICENSED", + "readme": "README.md", + "dependencies": { + "lodash": "^4.16.6" + } +} diff --git a/port.conf b/port.conf new file mode 100644 index 0000000..8c1cf76 --- /dev/null +++ b/port.conf @@ -0,0 +1,25 @@ +#origin git@github.com:ToywheelDev/gamewheel-port.git +server { + listen 80; + + server_name port.gamewheel.local; + + root /usr/share/gamewheel/port; + + location / { + add_header Access-Control-Allow-Origin $http_origin; + autoindex on; + try_files $uri $uri/ @node; + } + + location @node { + proxy_pass_request_headers on; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-NginX-Proxy true; + proxy_pass http://127.0.0.1:3110; + proxy_ssl_session_reuse off; + proxy_set_header Host $http_host; + proxy_redirect off; + } +} diff --git a/secure.js b/secure.js index 2d707ed..90a873a 100644 --- a/secure.js +++ b/secure.js @@ -1,9 +1,93 @@ var secure = { - vr_pong : { + vr_pong: { + url: "http://pong.gamewheel.local", + port: 3101, + debugPort: 3201 }, - vr_racer : { + vr_racer: { + url: "http://racer.gamewheel.local", + port: 3102, + debugPort: 3202 }, - editor : { + editor: { + port: 3103, + debugPort: 3203, + cluster: false + }, + api16: { + port: 3104, + debugPort: 3204, + cluster: false, + cors: false, + mailer: { + host: 'localhost', + port: 9025, + secure: false, + debug: true, + ignoreTLS: true + }, + mongodb: { + host: 'mongodb://127.0.0.1', + db: 'gamewheel', + port: 27017, + shardPort: 27018, + options: { + db: { + native_parser: true + }, + server: { + poolSize: 5, + keepAlive: 120 + }, + user: '', + pass: '', + autoIndex: false + } + }, + sessionKey: 'iJswK29klj20Jos02mJK8ud9239j23' + }, + tools: { + port: 3105, + debugPort: 3205, + mysqlUserExport: { + host: "gwdb.cpuanrat3vd1.eu-central-1.rds.amazonaws.com", + port: 3306, + user: "root", + password: "5t0bURlq", + database: "gw_core" + }, + mongoUserImport: { + host: "127.0.0.1", + port: 27017, + options: { + user: '', + pass: '' + } + } + }, + app: { + port: 3106, + debugPort: 3206 + }, + api: { + port: 3107, + debugPort: 3207 + }, + old_api_runtime: { + port: 3108, + debugPort: 3208 + }, + statistics: { + port: 3109, + debugPort: 3209 + }, + port: { + port: 3110, + debugPort: 3210 + }, + gate: { + port: 3111, + debugPort: 3211 } }; diff --git a/tools.conf b/tools.conf index e237f11..5cb6979 100644 --- a/tools.conf +++ b/tools.conf @@ -1,30 +1,19 @@ +#origin git@github.com:ToywheelDev/tools.git server { listen 80; - listen 443 ssl; - + server_name tools.gamewheel.local tools-debug.gamewheel.local; root /srv/gamewheel.local/tools; - index index.html; - access_log /var/log/nginx/tools.gamewheel.local.access.log; - error_log /var/log/nginx/tools.gamewheel.local.error.log; - - ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem; - ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key; - ssl_session_timeout 5m; - ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2; - ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES"; - ssl_prefer_server_ciphers on; - -# location ~ \.php$ { -# fastcgi_pass 127.0.0.1:9001; -# fastcgi_index index.php; -# fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; -# fastcgi_param SCRIPT_URL $request_uri; -# fastcgi_param SERVER_NAME $http_host; -# include fastcgi_params; -# } + location ~ \.php$ { + fastcgi_pass 127.0.0.1:9001; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param SCRIPT_URL $request_uri; + fastcgi_param SERVER_NAME $http_host; + include fastcgi_params; + } location / { add_header Access-Control-Allow-Origin $http_origin; @@ -37,7 +26,6 @@ server { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-NginX-Proxy true; - # Replace here with proper host/port proxy_pass http://127.0.0.1:3105; proxy_ssl_session_reuse off; proxy_set_header Host $http_host; From 687427a7ffc27bb33be9bddff32a8703aa0ac5ef Mon Sep 17 00:00:00 2001 From: "Theunis J. Botha" Date: Tue, 8 Nov 2016 13:22:18 +0100 Subject: [PATCH 11/13] starting statistics setup --- 3d-editor.conf | 19 +++++++++---------- 3d-racing.conf | 19 +++++++++---------- api.conf | 16 ++++++++-------- api16.conf | 17 ++++++++--------- app.conf | 3 +-- gate.conf | 16 ++++++++-------- port.conf | 16 ++++++++-------- secure.js | 6 +++++- tools.conf | 18 +++++++++--------- 9 files changed, 65 insertions(+), 65 deletions(-) diff --git a/3d-editor.conf b/3d-editor.conf index a566053..f2b609d 100644 --- a/3d-editor.conf +++ b/3d-editor.conf @@ -4,7 +4,7 @@ server { server_name 3d-editor.gamewheel.local 3d-editor-debug.gamewheel.local; - root /srv/gamewheel.local/3d-editor; + root /usr/share/gamewheel/3d-editor; location ~ \.php$ { fastcgi_pass 127.0.0.1:9001; @@ -22,14 +22,13 @@ server { } location @node { - proxy_pass_request_headers on; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-NginX-Proxy true; - # Replace here with proper host/port - proxy_pass http://127.0.0.1:3103; - proxy_ssl_session_reuse off; - proxy_set_header Host $http_host; - proxy_redirect off; + proxy_pass_request_headers on; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-NginX-Proxy true; + proxy_pass http://127.0.0.1:3103; + proxy_ssl_session_reuse off; + proxy_set_header Host $http_host; + proxy_redirect off; } } diff --git a/3d-racing.conf b/3d-racing.conf index 4c6887c..a2ad20c 100644 --- a/3d-racing.conf +++ b/3d-racing.conf @@ -4,7 +4,7 @@ server { server_name 3d-racing.gamewheel.local 3d-racing-debug.gamewheel.local; - root /srv/gamewheel.local/3d-racing; + root /usr/share/gamewheel/3d-racing; location / { add_header Access-Control-Allow-Origin $http_origin; @@ -13,14 +13,13 @@ server { } location @node { - proxy_pass_request_headers on; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-NginX-Proxy true; - # Replace here with proper host/port - proxy_pass http://127.0.0.1:3102; - proxy_ssl_session_reuse off; - proxy_set_header Host $http_host; - proxy_redirect off; + proxy_pass_request_headers on; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-NginX-Proxy true; + proxy_pass http://127.0.0.1:3102; + proxy_ssl_session_reuse off; + proxy_set_header Host $http_host; + proxy_redirect off; } } diff --git a/api.conf b/api.conf index e83e15a..a27fd68 100644 --- a/api.conf +++ b/api.conf @@ -13,13 +13,13 @@ server { } location @node { - proxy_pass_request_headers on; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-NginX-Proxy true; - proxy_pass http://127.0.0.1:3107; - proxy_ssl_session_reuse off; - proxy_set_header Host $http_host; - proxy_redirect off; + proxy_pass_request_headers on; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-NginX-Proxy true; + proxy_pass http://127.0.0.1:3107; + proxy_ssl_session_reuse off; + proxy_set_header Host $http_host; + proxy_redirect off; } } diff --git a/api16.conf b/api16.conf index 99cec80..ed97c13 100644 --- a/api16.conf +++ b/api16.conf @@ -13,14 +13,13 @@ server { } location @node { - proxy_pass_request_headers on; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-NginX-Proxy true; - # Replace here with proper host/port - proxy_pass http://127.0.0.1:3104; - proxy_ssl_session_reuse off; - proxy_set_header Host $http_host; - proxy_redirect off; + proxy_pass_request_headers on; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-NginX-Proxy true; + proxy_pass http://127.0.0.1:3104; + proxy_ssl_session_reuse off; + proxy_set_header Host $http_host; + proxy_redirect off; } } diff --git a/app.conf b/app.conf index 4b225ee..3fd2408 100644 --- a/app.conf +++ b/app.conf @@ -11,10 +11,9 @@ server { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-NginX-Proxy true; - # Replace here with proper host/port proxy_pass http://127.0.0.1:3104; proxy_ssl_session_reuse off; proxy_set_header Host $http_host; proxy_redirect off; } -} +} \ No newline at end of file diff --git a/gate.conf b/gate.conf index d04cd5b..b537eba 100644 --- a/gate.conf +++ b/gate.conf @@ -13,13 +13,13 @@ server { } location @node { - proxy_pass_request_headers on; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-NginX-Proxy true; - proxy_pass http://127.0.0.1:3111; - proxy_ssl_session_reuse off; - proxy_set_header Host $http_host; - proxy_redirect off; + proxy_pass_request_headers on; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-NginX-Proxy true; + proxy_pass http://127.0.0.1:3111; + proxy_ssl_session_reuse off; + proxy_set_header Host $http_host; + proxy_redirect off; } } diff --git a/port.conf b/port.conf index 8c1cf76..1738fe6 100644 --- a/port.conf +++ b/port.conf @@ -13,13 +13,13 @@ server { } location @node { - proxy_pass_request_headers on; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-NginX-Proxy true; - proxy_pass http://127.0.0.1:3110; - proxy_ssl_session_reuse off; - proxy_set_header Host $http_host; - proxy_redirect off; + proxy_pass_request_headers on; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-NginX-Proxy true; + proxy_pass http://127.0.0.1:3110; + proxy_ssl_session_reuse off; + proxy_set_header Host $http_host; + proxy_redirect off; } } diff --git a/secure.js b/secure.js index 90a873a..0c5e3d8 100644 --- a/secure.js +++ b/secure.js @@ -79,7 +79,11 @@ var secure = { }, statistics: { port: 3109, - debugPort: 3209 + debugPort: 3209, + mongodb : { + host : 'mongodb://172.31.12.120', + db : 'statistic' + } }, port: { port: 3110, diff --git a/tools.conf b/tools.conf index 5cb6979..e857551 100644 --- a/tools.conf +++ b/tools.conf @@ -4,7 +4,7 @@ server { server_name tools.gamewheel.local tools-debug.gamewheel.local; - root /srv/gamewheel.local/tools; + root /usr/share/gamewheel/tools; location ~ \.php$ { fastcgi_pass 127.0.0.1:9001; @@ -22,13 +22,13 @@ server { } location @node { - proxy_pass_request_headers on; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-NginX-Proxy true; - proxy_pass http://127.0.0.1:3105; - proxy_ssl_session_reuse off; - proxy_set_header Host $http_host; - proxy_redirect off; + proxy_pass_request_headers on; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-NginX-Proxy true; + proxy_pass http://127.0.0.1:3105; + proxy_ssl_session_reuse off; + proxy_set_header Host $http_host; + proxy_redirect off; } } From 6593ef81ea16284b17f9445f86fc4105ddda323c Mon Sep 17 00:00:00 2001 From: "Theunis J. Botha" Date: Tue, 8 Nov 2016 18:30:09 +0100 Subject: [PATCH 12/13] fixed configs --- 3d-editor.conf | 2 +- app.conf | 6 +++--- config.js | 22 +++++++++++++--------- secure.js | 46 ++++++++++++++++++++++++++++++++++++---------- 4 files changed, 53 insertions(+), 23 deletions(-) diff --git a/3d-editor.conf b/3d-editor.conf index f2b609d..e913ec0 100644 --- a/3d-editor.conf +++ b/3d-editor.conf @@ -4,7 +4,7 @@ server { server_name 3d-editor.gamewheel.local 3d-editor-debug.gamewheel.local; - root /usr/share/gamewheel/3d-editor; + root /usr/share/gamewheel/gw_3d_editor; location ~ \.php$ { fastcgi_pass 127.0.0.1:9001; diff --git a/app.conf b/app.conf index 3fd2408..d0b2fd9 100644 --- a/app.conf +++ b/app.conf @@ -4,16 +4,16 @@ server { server_name app.gamewheel.local; - root /usr/share/gamewheel/gw-app; + root /usr/share/gamewheel/gw-app/dist; location / { proxy_pass_request_headers on; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-NginX-Proxy true; - proxy_pass http://127.0.0.1:3104; + proxy_pass http://127.0.0.1:3106; proxy_ssl_session_reuse off; proxy_set_header Host $http_host; proxy_redirect off; } -} \ No newline at end of file +} diff --git a/config.js b/config.js index a14cdf2..faa8579 100644 --- a/config.js +++ b/config.js @@ -25,22 +25,26 @@ var config = { subAccount: 'root' } }, - app : { + app: { url: 'http://app.gamewheel.local' }, - api : { - url : 'http://api.gamewheel.local' + api: { + url: 'http://api.gamewheel.local' }, - old_api_runtime : { - url : 'http://api-runtime.gamewheel.local' + api_runtime: { + url: 'http://api-runtime.gamewheel.local', + version: "1.0.0" }, - statistics : { - url : 'http://api-runtime.gamewheel.local' + masker: { + url: 'http://masker.gamewheel.local' }, - port : { + statistics: { + url: 'http://api-runtime.gamewheel.local' + }, + port: { url: 'http://port.gamewheel.local' }, - gate : { + gate: { url: 'http://gate.gamewheel.local' }, environment: { diff --git a/secure.js b/secure.js index 0c5e3d8..b7303a8 100644 --- a/secure.js +++ b/secure.js @@ -1,11 +1,9 @@ var secure = { vr_pong: { - url: "http://pong.gamewheel.local", port: 3101, debugPort: 3201 }, vr_racer: { - url: "http://racer.gamewheel.local", port: 3102, debugPort: 3202 }, @@ -49,11 +47,12 @@ var secure = { tools: { port: 3105, debugPort: 3205, + liveReloadPort: 3405, mysqlUserExport: { - host: "gwdb.cpuanrat3vd1.eu-central-1.rds.amazonaws.com", + host: "127.0.0.1", port: 3306, user: "root", - password: "5t0bURlq", + password: "", database: "gw_core" }, mongoUserImport: { @@ -67,22 +66,49 @@ var secure = { }, app: { port: 3106, - debugPort: 3206 + debugPort: 3206, + liveReloadPort: 3406 }, api: { port: 3107, debugPort: 3207 }, - old_api_runtime: { + api_runtime: { port: 3108, - debugPort: 3208 + debugPort: 3208, + liveReloadPort: 3408, + cors: true, + cluster: false, + auth: { + secret: "xDKsyQm2F52Y9hfqv7yG80tu1wv90zkH", + token_duration: 86400000, + api_key: "gw_rocks", + admin: { + email: "admin@gamewheel.com", + password: "gw_config_api_rocks" + } + }, + db: { + type: "mysql", + host: "127.0.0.1", + port: 3306, + database: "gw_core", + user: "root", + password: "", + max_connections: 10 + }, + game_session_timeout: 180000 + }, + masker: { + auth_key: "gw_masker_rocks" }, statistics: { port: 3109, debugPort: 3209, - mongodb : { - host : 'mongodb://172.31.12.120', - db : 'statistic' + liveReloadPort: 3409, + mongodb: { + host: 'mongodb://127.0.0.1', + db: 'statistic' } }, port: { From cb35ec1f71ae9ca904a92c28dce7d533de615052 Mon Sep 17 00:00:00 2001 From: "Theunis J. Botha" Date: Fri, 11 Nov 2016 18:29:57 +0100 Subject: [PATCH 13/13] more settings for api --- 3d-racing.conf | 2 ++ secure.js | 29 ++++++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/3d-racing.conf b/3d-racing.conf index a2ad20c..90154fe 100644 --- a/3d-racing.conf +++ b/3d-racing.conf @@ -6,6 +6,8 @@ server { root /usr/share/gamewheel/3d-racing; + index index.html; + location / { add_header Access-Control-Allow-Origin $http_origin; autoindex on; diff --git a/secure.js b/secure.js index b7303a8..dc697e5 100644 --- a/secure.js +++ b/secure.js @@ -71,7 +71,34 @@ var secure = { }, api: { port: 3107, - debugPort: 3207 + debugPort: 3207, + liveReloadPort: 3407, + mongodb: { + host: 'mongodb://127.0.0.1', + db: 'apidev', + port: 27017, + shardPort: 27018, + options: { + db: { + native_parser: true + }, + server: { + poolSize: 5, + keepAlive: 120 + }, + user: '', + pass: '', + autoIndex: false + } + }, + mailer: { + host: 'localhost', + port: 9025, + secure: false, + debug: true, + ignoreTLS: true + }, + sessionKey: 'iJswK29klj20Jos02mJK8ud9239j23' }, api_runtime: { port: 3108,