From 98719a64651edc5b4139499b8f7ba9ca5584ced2 Mon Sep 17 00:00:00 2001 From: -=yb4f310 Date: Tue, 9 May 2017 17:27:31 +0200 Subject: [PATCH] temp ocmmit --- bash_history | 39 ++++++++++++ checkout_all | 2 +- config.js | 42 ++++++++----- nginx/sites-available/gamewheel.conf | 93 ---------------------------- secure.js | 40 +++++++----- 5 files changed, 91 insertions(+), 125 deletions(-) delete mode 100644 nginx/sites-available/gamewheel.conf diff --git a/bash_history b/bash_history index 347d041..70cac7e 100644 --- a/bash_history +++ b/bash_history @@ -2228,3 +2228,42 @@ ls cd bin/ ls ./webstorm.sh +c +cd config/ +git checkout tj-dev +git checkout tj-dev -- config.js +vim config.js +sudo vim hosts +ls +vim hosts +ls +cd nginx/ +ls +cd sites-available/ +ls +mv gamewheel.conf cybafelo.conf +vim cybafelo.conf +cd /etc/ng +sudo apt-get install nginx +cd /etc/nginx/ +ls +cd sites-available/ +ls +cd .. +sudo mv sites-available sites-available.bak +sudo ln -s /usr/share/cybafelo/config/nginx/sites-available/ +ls +cd sites-available +ls +vim cybafelo.conf +cd .. +cd sites-available +vim cybafelo.conf +cd .. +ls +cd sites-enabled/ +ls +rm default +sudo rm default +sudo ln -s ../sites-available/cybafelo.conf +sudo service nginx restart diff --git a/checkout_all b/checkout_all index 77ea640..960aa8d 100755 --- a/checkout_all +++ b/checkout_all @@ -1,7 +1,7 @@ #!/bin/bash #for package in $() -for dir in /usr/share/plista/*/ +for dir in /usr/share/cybafelo/*/ do dir_short_name=${dir%*/} dir_short_name=${dir_short_name##*/} diff --git a/config.js b/config.js index 91caa26..ccfd0ff 100644 --- a/config.js +++ b/config.js @@ -1,12 +1,23 @@ +var environment = { + path : '/usr/share/cybafelo', + protocol : 'http', + environment : 'tj', + domain : 'cybafelo.com' +}; + +var protocol = environment.protocol; +var user = environment.environment; +var domain = environment.domain; + var config = { vr_pong: { - url: "https://tj-3d-pong.cybafelo.com" + url: protocol + '://' + user + '-3d-pong.' + domain }, vr_racer: { - url: "https://tj-3d-racing.cybafelo.com" + url: protocol + '://' + user + '-3d-racing.' + domain }, editor: { - url: "https://tj-3d-editor.cybafelo.com", + url: protocol + '://' + user + '-3d-editor.' + domain, default: { platform: 'cybafelo', account: 'root', @@ -16,39 +27,42 @@ var config = { uploadPath: '/uploads' }, api16: { - url: "https://tj-api-v1.cybafelo.com" + url: protocol + '://' + user + '-api-v1.' + domain }, tools: { - url: "https://tj-tools.cybafelo.com", + url: protocol + '://' + user + '-tools.' + domain, default: { - platform: 'cybafelo', + platform: 'gamewheel', account: 'root', subAccount: 'root' } }, app: { - url: 'https://tj-app.cybafelo.com' + url: protocol + '://' + user + '-app.' + domain }, api: { - url: 'https://tj-api.cybafelo.com' + url: protocol + '://' + user + '-api.' + domain }, cdn: { - url: 'https://tj-cdn.cybafelo.com' + url: protocol + '://' + user + '-cdn.' + domain }, gate: { - url: 'https://tj-gate.cybafelo.com' + url: protocol + '://' + user + '-gate.' + domain }, content: { - url: 'https://tj-content.cybafelo.com' + url: protocol + '://' + user + '-content.' + domain }, asset: { - url: 'https://tj-asset.cybafelo.com' + url: protocol + '://' + user + '-asset.' + domain }, port: { - url: 'https://tj-port.cybafelo.com' + url: protocol + '://' + user + '-port.' + domain }, cron: { - url: 'https://tj-cron.cybafelo.com' + url: protocol + '://' + user + '-cron.' + domain + }, + analytics: { + url: protocol + '://' + user + '-analytics.' + domain }, environment: { mode: 'development' diff --git a/nginx/sites-available/gamewheel.conf b/nginx/sites-available/gamewheel.conf deleted file mode 100644 index fb72d74..0000000 --- a/nginx/sites-available/gamewheel.conf +++ /dev/null @@ -1,93 +0,0 @@ -server { - listen 80 default_server; - listen [::]:80 default_server ipv6only=on; - return 301 https://$host$request_uri; -} - -server { - listen 443 ssl default_server; - listen [::]:443 ssl default_server ipv6only=on; - - include /etc/nginx/ssl/ssl.conf; - - server_name ~^(?.*?)-(?.*?)\.(?.*); - - root /usr/share/cybafelo/$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, x-cybafelo"; - 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; - fastcgi_param SCRIPT_URL $request_uri; - fastcgi_param SERVER_NAME $http_host; - include fastcgi_params; - } - - 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, x-cybafelo"; - 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, x-cybafelo"; - add_header Access-Control-Allow-Credentials true; - return 200; - } - - add_header Access-Control-Allow-Origin $http_origin; - try_files $uri dist/$uri @node; - } - - location @node { - # WebSocket support - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - - # Normal parameters - 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; - - # Set Environment, App, and Domain - proxy_set_header X-Gamewheel-Env $environment; - proxy_set_header X-Gamewheel-App $app; - proxy_set_header X-Gamewheel-Host $host_domain; - - # Pass Everything to our app - proxy_pass http://$app; - proxy_ssl_session_reuse off; - proxy_set_header Host $http_host; - proxy_redirect off; - } -} diff --git a/secure.js b/secure.js index 2e54387..d829342 100644 --- a/secure.js +++ b/secure.js @@ -92,23 +92,6 @@ var secure = { } }, uploadPath : 'uploads', - // mailer: { - // host: "smtp.office365.com", - // port: 587, - // auth: { - // user: "admin@cybafelo.com", - // pass: "Toypro42!" - // }, - // secureConnection: false, - // tls: { - // ciphers: "SSLv3", - // rejectUnauthorized: false - // }, - // emails: { - // founder: "evgeni@cybafelo.com", - // support: "support@cybafelo.com" - // } - // }, mailer: { host: 'localhost', port: 9025, @@ -131,6 +114,29 @@ var secure = { debugPort: 3216, apiUser : 'tj@cybafelo.com', apiPassword : 'test12345' + }, + // database + db : { + mongo : { + analytics : { + host: 'mongodb://127.0.0.1', + db: 'analyticsDev', + port: 27017, + shardPort: 27018, + options: { + db: { + native_parser: true + }, + server: { + poolSize: 5, + keepAlive: 120 + }, + user: '', + pass: '', + autoIndex: false + } + } + } } };