diff --git a/bash_aliases b/bash_aliases index 61de5cf..2719440 100644 --- a/bash_aliases +++ b/bash_aliases @@ -12,9 +12,7 @@ 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' +alias e1='cd /usr/share/gamewheel && ./start_editor' alias logs='cd /usr/share/gamewheel && ./logs' alias m='pm2 monit' alias list='pm2 list' diff --git a/bash_history b/bash_history index 357b265..6b12edd 100644 --- a/bash_history +++ b/bash_history @@ -17966,7 +17966,7 @@ cd .. mv gw_3d_editor 3d-editor ls mv GW_Config api-1.6 -mv api-1.6 api-v1.6 +mv api-1.6 api-v1 mv vr_pong 3d-pong vim /etc/mysql/my.cnf cd /etc/nginx/ @@ -17984,7 +17984,7 @@ sudo rm port.conf ls -l ln -s ../sites-available/3d-pong.conf sudo ln -s ../sites-available/3d-pong.conf -sudo ln -s ../sites-available/api-v1.6.conf +sudo ln -s ../sites-available/api-v1.conf sudo ln -s ../sites-available/api-v2.conf ls sudo service nginx restart @@ -18050,7 +18050,7 @@ ls cd .. ls cd .. -cd api-v1.6/ +cd api-v1/ LS -L lg git branch @@ -18070,7 +18070,7 @@ cd .. ls pm2 list ls -cd api-v1.6/ +cd api-v1/ cd .. cd api-v2 cd .. @@ -18598,7 +18598,7 @@ cd v1 ls mv ../game-lib . ls -mv ../api-v1.6 ./api +mv ../api-v1 ./api ls cd .. ls @@ -18693,7 +18693,7 @@ cd v1 ls rm config ls -mv api ../api-v1.6 +mv api ../api-v1 ls mv * ../ ls @@ -18738,13 +18738,13 @@ s r s st -pm2 start api-v1.6 +pm2 start api-v1 pm2 start 3d-pong pm2 start 3d-editor pm2 start api-v1 pm2 list -pm2 start api-v1.6/ -pm2 start api-v1.6 +pm2 start api-v1/ +pm2 start api-v1 pm2 logs ./delete ./start @@ -19389,7 +19389,7 @@ git commit -am "client connect and rooms - pretty stable - need to do disconnect git push cd .. ls -cd api-v1.6/ +cd api-v1/ git diff git commit -am "don't log result for now - its too much info" git push @@ -20557,7 +20557,7 @@ git push git commit -am "ios copy" git push cd .. -cd api-v1.6/ +cd api-v1/ git remote -v cd .. ls @@ -20731,7 +20731,7 @@ grep "threeScene" * -R grep "threeScene" * -Rl | xargs sed -i "s/threeScene/scene.instance/g" grep "divContainerId" * -R cd .. -cd api-v1.6/ +cd api-v1/ git checkout stable git status vim .gitignore @@ -20918,12 +20918,12 @@ d e1 r r# -cd api-v1.6/ +cd api-v1/ git diff grep "<<" * -R grep "<<.*HEAD" * -R r -cd api-v1.6/ +cd api-v1/ npm install r sudo service nginx restart @@ -20967,7 +20967,7 @@ git checkout v2_v3_stable git push -u origin v2_v3_stable git checkout stable cd .. -cd api-v1.6/ +cd api-v1/ git diff git commit -am "merge conflicts" git push @@ -21153,7 +21153,7 @@ exit r l ssh gw-3d -cd api-v1.6/ +cd api-v1/ git remote -v exit gnome-screenshot -d 3 -f "reservations.png" -w @@ -21731,7 +21731,7 @@ sudo rm * sudo ln -s ../sites-available/gate-content-asset.conf 01-gate-content-asset.conf sudo ln -s ../sites-available/port-gamestate.conf 05-port-gamestate.conf sudo ln -s ../sites-available/api.conf 10-api.conf -sudo ln -s ../sites-available/api-v1.6.conf 10-api-v1.6.conf +sudo ln -s ../sites-available/api-v1.conf 10-api-v1.conf sudo ln -s ../sites-available/app.conf 10-app.conf sudo ln -s ../sites-available/cdn.conf 20-cdn.conf sudo ln -s ../sites-available/3d-pong.conf 30-3d-pong.conf @@ -22988,3 +22988,248 @@ cd model/ git pull r exit +r +cd controller/ +git pull +git mergetool +git status +git diff +git status +vim user.js +git reset --hard HEAD +git pull +git mergetool +git commit -am "merge conflict" +git push +find . -name "*.orig" | xargs rm +ls +r +sudo service nginx restart +r +sudo service nginx restart +r +cd 3d-editor +cd src/ +grep "normalRender" * -R +exit +gedit +exit +vim .my.cnf +mysql +sudo service nginx restart +c +cd config/ +git diff +git commit -am "serve index.html" +git push +git diff +exit +c +ls +cd 3d- +cd 3d-editor +cd .. +cd game-lib +git diff +git branch -a +git pull +git checkout v2_v3_stable +cd .. +cd blender-node +git branch - +git branch -a +git checkout v2_v3_stable +rm -rf node_modules +npm install +cd .. +cd 3d-editor +git diff +git commit -am "fix" +git push +rm -rf node_modules/ +npm install +gulp build +sudo npm install -g gulp +gulp build +cd .. +cd game-lib +rm -rf node_modules/ +npm install +gulp build +ls +cd node_modules/ +ls +cd c-preprocessor/ +ls +cd lib/ +ls +cd .. +ls +cd bin/ +ls +cd .. +ls +cd .. +npm install +cd node_modules/gulp-c-preprocessor/ +ls +cd node_modules/ +ls +cd readable-stream/ +ls +cd .. +ls +cd through2/ +ls +cd .. +ls +cd .. +ls +cd .. +gulp build +exit +s +cd api +vim ~/.bashrc +cd +cc +c +./start_editor +l +logs +exit +3 +c +cd 3d-editor +gulp +exir +exit +c +cd game-lib +cd src/ +grep "ifdef" * -R +gulp build +gulp +exit +cd /etc/nginx/ +ls +cd sites-enabled/ +ls +vim gamewheel.conf +c +cd 3d-editor +ls +rm game-lib-runtime.js +ln -s ../game-lib/build/game-lib.js +ls -l +git status +git add game-lib.js +git commit -am "there can be only one game-lib" +git push +r +sudo service nginx restart +exit +c +ls +cd api-v1/ +git branch -a +git checkout v2_v3_stable +rm -rf node_modules/ +npm install +ls -l +cd .. +ls +cd config/ +ls +cp start_api start_api-v1 +sudo vim start_api-v1 +cd .. +ls +ln -s config/start_api-v1 +ls -l +vim start +vim start_editor +./start_editor +l +r +l +logs +cd api-v1/ +ls +grep "api_v2 +grep "api_v2" * -R +grep "api_v3" * -R +ls -l +r +cd api-v1/ +grep "blender-node" * -R +r +d +./start_editor +cd api-v1/ +grep "api_v3" *-R +grep "blender-node" * -R +grep "game-lib" * -R +cd .. +ls +cd api-v1/ +ls +git diff +git commit -am "fix paths" +git push +exit +r +exit +c +cd game-lib +gulp +exit +c +cd 3d-editor +gulp +exit +nginx --version +nginx -version +nginx -v +sudo add-apt-repository ppa:nginx/stable +sudo apt-get update +sudo apt-get install nginx +cd /etc/nginx/ +ls +vim nginx.conf +exit +c +cd config/ +ls +cat secure.js +sudo service nginx restart +tail -f /var/log/syslog +tail -f /var/log/nginx/*.lof +tail -f /var/log/nginx/*.log +l +logs +tail -f /var/log/nginx/*.log +exit +mysql +exit +sudo service nginx restart +sudo poweroff +editor +ls +vim .bash_aliases +c +ls +vim start_editor +mv api-v1.6 api-v1 +ls -l +grep "api-v1.6" * -R +cd api-v1/ +ls +grep "api-v1.6" * -R +rm -rf node_modules +npm install +cd .. +grep "api-v1.6" * -R +grep "api-v1.6" * -Rl | xargs sed -i "s/api-v1.6/api-v1/g" +sudo service nginx restart +exit diff --git a/config.js b/config.js index da26fa3..9974881 100644 --- a/config.js +++ b/config.js @@ -1,12 +1,12 @@ var config = { vr_pong: { - url: "http://tj-3d-pong.gamewheel.com" + url: "https://tj-3d-pong.gamewheel.com" }, vr_racer: { - url: "http://tj-3d-racing.gamewheel.com" + url: "https://tj-3d-racing.gamewheel.com" }, editor: { - url: "http://tj-3d-editor.gamewheel.com", + url: "https://tj-3d-editor.gamewheel.com", default: { platform: 'gamewheel', account: 'root', @@ -16,10 +16,10 @@ var config = { uploadPath: '/uploads' }, api16: { - url: "http://tj-api-v1.6.gamewheel.com" + url: "https://tj-api-v1.gamewheel.com" }, tools: { - url: "http://tj-tools.gamewheel.com", + url: "https://tj-tools.gamewheel.com", default: { platform: 'gamewheel', account: 'root', @@ -27,25 +27,25 @@ var config = { } }, app: { - url: 'http://tj-app.gamewheel.com' + url: 'https://tj-app.gamewheel.com' }, api: { - url: 'http://tj-api.gamewheel.com' + url: 'https://tj-api.gamewheel.com' }, cdn: { - url: 'http://tj-cdn.gamewheel.com' + url: 'https://tj-cdn.gamewheel.com' }, gate: { - url: 'http://tj-gate.gamewheel.com' + url: 'https://tj-gate.gamewheel.com' }, content: { - url: 'http://tj-content.gamewheel.com' + url: 'https://tj-content.gamewheel.com' }, asset: { - url: 'http://tj-asset.gamewheel.com' + url: 'https://tj-asset.gamewheel.com' }, port: { - url: 'http://tj-port.gamewheel.com' + url: 'https://tj-port.gamewheel.com' }, environment: { mode: 'development' diff --git a/hosts b/hosts index 528d11b..a69e596 100644 --- a/hosts +++ b/hosts @@ -7,7 +7,7 @@ 127.0.1.1 tj-3d-pong.gamewheel.com 127.0.1.1 tj-3doo.gamewheel.com 127.0.1.1 tj-3d-racing.gamewheel.com -127.0.1.1 tj-api-v1.6.gamewheel.com +127.0.1.1 tj-api-v1.gamewheel.com 127.0.1.1 tj-tools.gamewheel.com 127.0.1.1 tj-gate.gamewheel.com 127.0.1.1 tj-content.gamewheel.com diff --git a/nginx/conf.d/ports.conf b/nginx/conf.d/ports.conf index c86ef8b..5ddffc5 100644 --- a/nginx/conf.d/ports.conf +++ b/nginx/conf.d/ports.conf @@ -14,7 +14,7 @@ upstream 3d-editor { server 127.0.0.1:3103; } -upstream api-v1.6 { +upstream api-v1 { server 127.0.0.1:3104; } diff --git a/nginx/sites-available/gamewheel.conf b/nginx/sites-available/gamewheel.conf index 509bb87..ed59403 100644 --- a/nginx/sites-available/gamewheel.conf +++ b/nginx/sites-available/gamewheel.conf @@ -15,6 +15,17 @@ server { root /usr/share/gamewheel/$app; location ~ \.php$ { + + if ($request_method = OPTIONS) { + add_header Content-Length 0; + add_header Content-Type text/plain; + add_header Access-Control-Allow-Origin $http_origin; + add_header Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS"; + add_header Access-Control-Allow-Headers "Authorization, Content-Type"; + add_header Access-Control-Allow-Credentials true; + return 200; + } + fastcgi_pass php; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; @@ -24,10 +35,34 @@ server { } location = / { + + if ($request_method = OPTIONS) { + add_header Content-Length 0; + add_header Content-Type text/plain; + add_header Access-Control-Allow-Origin $http_origin; + add_header Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS"; + add_header Access-Control-Allow-Headers "Authorization, Content-Type"; + add_header Access-Control-Allow-Credentials true; + return 200; + } + + add_header Access-Control-Allow-Origin $http_origin; + try_files /index.html @node; } location ~ { + + if ($request_method = OPTIONS) { + add_header Content-Length 0; + add_header Content-Type text/plain; + add_header Access-Control-Allow-Origin $http_origin; + add_header Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS"; + add_header Access-Control-Allow-Headers "Authorization, Content-Type"; + add_header Access-Control-Allow-Credentials true; + return 200; + } + add_header Access-Control-Allow-Origin $http_origin; try_files $uri dist/$uri @node; } diff --git a/start_editor b/start_editor index 18eb05f..769a5ab 100755 --- a/start_editor +++ b/start_editor @@ -1,5 +1,5 @@ #!/bin/bash -cd /usr/share/gamewheel/api-v1.6 -pm2 start bin/start --node-args="--max-old-space-size=16000 --debug=3204" --name api-v1.6 +cd /usr/share/gamewheel/api-v1 +pm2 start bin/start --node-args="--max-old-space-size=16000 --debug=3204" --name api-v1 cd /usr/share/gamewheel/3d-editor pm2 start server.js --node-args="--max-old-space-size=16000 --debug=3203" --name 3d-editor \ No newline at end of file diff --git a/start_pong b/start_pong index 26f53f9..acde08b 100755 --- a/start_pong +++ b/start_pong @@ -1,5 +1,5 @@ #!/bin/bash -cd /usr/share/gamewheel/api-v1.6 -pm2 start bin/start --node-args="--max-old-space-size=16000 --debug=3204" --name api-v1.6 +cd /usr/share/gamewheel/api-v1 +pm2 start bin/start --node-args="--max-old-space-size=16000 --debug=3204" --name api-v1 cd /usr/share/gamewheel/3d-pong pm2 start server.js --node-args="--max-old-space-size=16000 --debug=3201" --name 3d-pong \ No newline at end of file