temp ocmmit

beta.r3js.org
-=yb4f310 2017-05-09 17:27:31 +02:00
parent 29e2495c23
commit 98719a6465
5 changed files with 91 additions and 125 deletions

View File

@ -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

View File

@ -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##*/}

View File

@ -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'

View File

@ -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 ~^(?<environment>.*?)-(?<app>.*?)\.(?<host_domain>.*);
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;
}
}

View File

@ -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
}
}
}
}
};