diff --git a/bash_aliases b/bash_aliases index 3bd684a..06fd0f9 100644 --- a/bash_aliases +++ b/bash_aliases @@ -12,6 +12,10 @@ alias gl2='cd /usr/share/gamewheel/game-lib-v2' alias 3d3='cd /usr/share/gamewheel/3d-editor-v3' alias gl3='cd /usr/share/gamewheel/game-lib-v3' alias ps='cd /usr/share/gamewheel && ./start_pong' +alias api='cd /usr/share/gamewheel && ./start_api' +alias app='cd /usr/share/gamewheel && ./start_app' +alias port='cd /usr/share/gamewheel && ./start_port' +alias gate='cd /usr/share/gamewheel && ./start_gate' alias e1='cd /usr/share/gamewheel && ./start_editor_v1' alias e2='cd /usr/share/gamewheel && ./start_editor_v2' alias e3='cd /usr/share/gamewheel && ./start_editor_v3' diff --git a/bash_history b/bash_history index 4bc5015..ef5f2c9 100644 --- a/bash_history +++ b/bash_history @@ -21205,3 +21205,118 @@ cd .confi` cd .config ls exit +gconftool +dconf +sudo apt-get install dconf-editor +dconf-editor +exit +sudo apt-get install vino +g +l;s +ls +cd app +ls +npm install +git remote -v +cd .. +cd gate/ +git pull +git checkout develop +npm install +cd .. +cd cdn +git pull +git checkout develop +git pull +git status +rm npm-debug.log +ls +npm install +ls +rm npm-debug.log +ls -l +cd ... +cd connect +cd .. +git clone git@github.com:ToywheelDev/gamewheel-connect.git connect +cd connect/ +git pull +git checkout develop +git pull +git status +rm mongoose.js.orig +npm install +ls -l +cd .. +git clone git@github.com:ToywheelDev/gamewheel-gamewheel.git gamewheel +cd gamewheel +git branch -a +git checkout develop +ls +cd .. +cd helper/ +git pull +git checkout develop +npm install +cd .. +git clone git@github.com:ToywheelDev/gamewheel-config.git +cd gamewheel-config/ +ls +git branch -a +git checkout develop +ls +npm install +cd .. +cd /etc/nginx/ +ls +cd sites-enabled/ +ls +ln -s ../sites-available/gate.conf +sudo ln -s ../sites-available/gate.conf +sudo service nginx restart +c +cd gamewheel-config/ +ls +git branch -a +git checkout gw-crispy +cd .. +cd app +ls +gulp +bower install +gulp +gulp build +git branch -a +ls -l +cd .. +ls +cd /etc/nginx/ +ls +cd sites-enabled/ +ls +rm gate.conf +ls -l +sudo rm gate.conf +ls -l +sudo ln -s ../sites-available/app.conf +sudo ln -s ../sites-available/cdn.conf +sudo ln -s ../sites-available/gate-content-asset.conf +sudo ln -s ../sites-available/port-gamestate.conf +ls -l +sudo service nginx restart +ls -l +c +ls +cd api +ls +pm2 +ls +cd .. +ls +ln -s config/start_api +ln -s config/start_app +ln -s config/start_gate +ln -s config/start_port +ls -l +a +exit diff --git a/config.js b/config.js index b60137a..fccd308 100644 --- a/config.js +++ b/config.js @@ -59,10 +59,22 @@ var config = { api: { url: 'http://api.gamewheel.local' }, + cdn: { + url: 'http://cdn.gamewheel.local' + }, api_runtime: { url: 'http://api-runtime.gamewheel.com', version: "1.0.0" }, + gate: { + url: 'http://gate.gamewheel.local' + }, + content: { + url: 'http://content.gamewheel.local' + }, + asset: { + url: 'http://asset.gamewheel.local' + }, masker: { url: 'http://masker.gamewheel.local' }, @@ -72,9 +84,6 @@ var config = { port: { url: 'http://port.gamewheel.local' }, - gate: { - url: 'http://gate.gamewheel.local' - }, environment: { mode: 'development' } @@ -83,10 +92,10 @@ var config = { if (typeof module !== 'undefined') { if (typeof require !== 'undefined') { - var secure = require('./secure'); var _ = require('lodash'); - - _.merge(config, secure); + _.merge(config, require('./secure')); + _.merge(config, require('./connection')); + _.merge(config, require('./model')); } module.exports = config; diff --git a/connection.js b/connection.js new file mode 100644 index 0000000..e7e40b2 --- /dev/null +++ b/connection.js @@ -0,0 +1,20 @@ +var config = { + connection: { + model: { + // + // default model connection + default: 'connect/connect.mongoose' + } + }, + + schema: { + model: { + // + // default schema + default: 'connect/schema.mongoose' + } + } +}; + + +if (!!module) { module.exports = config; } \ No newline at end of file diff --git a/hosts b/hosts index b8ee0ba..579134c 100644 --- a/hosts +++ b/hosts @@ -22,6 +22,14 @@ 127.0.1.1 api-v3-debug.gamewheel.local 127.0.1.1 tools.gamewheel.local 127.0.1.1 tools-debug.gamewheel.local +127.0.1.1 gate.gamewheel.local +127.0.1.1 content.gamewheel.local +127.0.1.1 asset.gamewheel.local +127.0.1.1 port.gamewheel.local +127.0.1.1 app.gamewheel.local +127.0.1.1 api.gamewheel.local +127.0.1.1 cdn.gamewheel.local + # The following lines are desirable for IPv6 capable hosts diff --git a/model.js b/model.js new file mode 100644 index 0000000..4588661 --- /dev/null +++ b/model.js @@ -0,0 +1,21 @@ +var config = { + model: { + connection: { + // + // default model connection + default : 'connect/connect.mongoose', + ticket : 'connect/connect.memcached', + gamestate : 'connect/connect.memcached' + }, + schema: { + // + // default schema + default : 'connect/schema.mongoose', + ticket : 'connect/schema.memcached', + gamestate : 'connect/schema.memcached' + } + } +}; + + +if (!!module) { module.exports = exports = config; } \ No newline at end of file diff --git a/nginx/api.conf b/nginx/api.conf new file mode 100644 index 0000000..5f869c9 --- /dev/null +++ b/nginx/api.conf @@ -0,0 +1,25 @@ +#origin git@github.com:ToywheelDev/gamewheel-api.git +server { + listen 80; + + server_name api.gamewheel.local; + + root /usr/share/gamewheel/api; + + 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/nginx/app.conf b/nginx/app.conf new file mode 100644 index 0000000..99862d0 --- /dev/null +++ b/nginx/app.conf @@ -0,0 +1,28 @@ +#origin git@github.com:ToywheelDev/gamewheel-app.git +server { + listen 80; + + server_name app.gamewheel.local; + + root /usr/share/gamewheel/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:3110; + proxy_ssl_session_reuse off; + proxy_set_header Host $http_host; + proxy_redirect off; + + # WebSocket support (nginx 1.4) + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + + # Path rewriting + rewrite /(.*) /$1 break; + proxy_redirect off; + } +} diff --git a/nginx/cdn.conf b/nginx/cdn.conf new file mode 100644 index 0000000..19cd701 --- /dev/null +++ b/nginx/cdn.conf @@ -0,0 +1,14 @@ +#origin git@github.com:ToywheelDev/gamewheel-cdn.git +server { + listen 80; + + server_name cdn.gamewheel.local; + + root /usr/share/gamewheel/cdn; + + location / { + add_header Access-Control-Allow-Origin $http_origin; + autoindex on; + try_files $uri $uri/ 404; + } +} diff --git a/nginx/gate-content-asset.conf b/nginx/gate-content-asset.conf new file mode 100644 index 0000000..ee01026 --- /dev/null +++ b/nginx/gate-content-asset.conf @@ -0,0 +1,19 @@ +#origin git@github.com:ToywheelDev/gamewheel-gate.git +server { + listen 80; + + server_name gate.gamewheel.local content.gamewheel.local asset.gamewheel.local; + + root /usr/share/gamewheel/gate; + + 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:3115; + proxy_ssl_session_reuse off; + proxy_set_header Host $http_host; + proxy_redirect off; + } +} \ No newline at end of file diff --git a/nginx/port-gamestate.conf b/nginx/port-gamestate.conf new file mode 100644 index 0000000..9090ff6 --- /dev/null +++ b/nginx/port-gamestate.conf @@ -0,0 +1,30 @@ +#origin git@github.com:ToywheelDev/gamewheel-port.git +server { + listen 80; + + server_name port.gamewheel.local gamestate.gamewheel.local; + + root /usr/share/gamewheel/port; + + location / { + + # redirect all HTTP traffic to userInterface1 + proxy_pass http://127.0.0.1:3114; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-NginX-Proxy true; + + proxy_ssl_session_reuse off; + proxy_pass_request_headers on; + + # WebSocket support (nginx 1.4) + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + + # Path rewriting + #rewrite /(.*) /$1 break; + proxy_redirect off; + } +} diff --git a/start b/start index ed4b1e7..d2267c7 100755 --- a/start +++ b/start @@ -1,8 +1,12 @@ #!/bin/bash cd /usr/share/gamewheel +./start_api +./start_app ./start_editor_v1 ./start_editor_v2 ./start_editor_v3 +./start_gate ./start_pong +./start_port ./start_racing ./start_tools diff --git a/start_api b/start_api new file mode 100755 index 0000000..c16dbe1 --- /dev/null +++ b/start_api @@ -0,0 +1,3 @@ +#!/bin/bash +cd /usr/share/gamewheel/api +pm2 start bin/start --node-args="--debug=3211" --name api \ No newline at end of file diff --git a/start_app b/start_app new file mode 100755 index 0000000..054814b --- /dev/null +++ b/start_app @@ -0,0 +1,3 @@ +#!/bin/bash +cd /usr/share/gamewheel/app +pm2 start bin/start --node-args="--debug=3210" --name app \ No newline at end of file diff --git a/start_gate b/start_gate new file mode 100755 index 0000000..e68cc46 --- /dev/null +++ b/start_gate @@ -0,0 +1,3 @@ +#!/bin/bash +cd /usr/share/gamewheel/gate +pm2 start bin/start --node-args="--debug=3215" --name gate \ No newline at end of file diff --git a/start_port b/start_port new file mode 100755 index 0000000..97518da --- /dev/null +++ b/start_port @@ -0,0 +1,3 @@ +#!/bin/bash +cd /usr/share/gamewheel/port +pm2 start bin/start --node-args="--debug=3214" --name port \ No newline at end of file