reformatted encoding algorithm

This commit is contained in:
strawmanbobi
2016-11-13 13:52:57 +08:00
parent c169499e3a
commit fb7c06afa6
40 changed files with 663 additions and 483 deletions

View File

@@ -10,120 +10,55 @@ exports.setupEnvironment = function () {
var env = process.env.NODE_ENV || 'development';
ENV = env;
if (undefined == typeof env || null == env || "" == env || enums.APP_PRODUCTION_MODE == env) {
console.log("production mode");
console.log("configuring MySQL db connection ability...");
MYSQL_DB_SERVER_ADDRESS = "rm-bp11c9w1bz8q47zzx.mysql.rds.aliyuncs.com";
MYSQL_DB_NAME = "ucon_generic";
MYSQL_DB_USER = "uconrds";
MYSQL_DB_PASSWORD = "ucon923";
console.log("configuring MongoDB kv connection ability...");
MONGO_DB_SERVER_ADDRESS = "127.0.0.1";
MONGO_DB_NAME = "yuekong_remote_code";
MONGO_DB_USER = "yuekong";
MONGO_DB_PASSWORD = "yuekong";
console.log("configuring kv storage ability...");
OSS_HOST = "oss-cn-hangzhou.aliyuncs.com";
OSS_PORT = "80";
OSS_APP_ID = "f6bWxSdkNyu9FlyC";
OSS_APP_SECRET = "nO2bzv8yETA6TwPsYNFlYpWRT867Zg";
console.log("configuring external PYTHON path");
FILE_TEMP_PATH = "/root/rc_extension";
PYTHON_PATH = "/usr/bin/python";
console.log("configuring external server connection ability...");
LISTEN_PORT = "8300";
MAIN_SERVER_ADDRESS = "yuekongdev.wicp.net";
MAIN_SERVER_PORT = LISTEN_PORT;
console.log("configuring cache ability...");
MEMCACHED_HOST = "127.0.0.1";
MEMCACHED_PORT = "11211";
MEMCACHED_SASL_USER = "";
MEMCACHED_SASL_PASSWORD = "";
console.log("configuring push credential");
PUSH_APP_KEY = "b5e8e6123de67977dcb9813a";
PUSH_APP_SECRET = "38c6aecde1c7f82c741b4a2a";
} else if (enums.APP_DEVELOPMENT_MODE == env) {
console.log("develop mode");
console.log("configuring MySQL db connection ability...");
MYSQL_DB_SERVER_ADDRESS = "127.0.0.1";
MYSQL_DB_NAME = "ucon_generic";
MYSQL_DB_SERVER_ADDRESS = "localhost";
MYSQL_DB_NAME = "irext";
MYSQL_DB_USER = "root";
MYSQL_DB_PASSWORD = "root";
console.log("configuring MongoDB kv connection ability...");
MONGO_DB_SERVER_ADDRESS = "127.0.0.1";
MONGO_DB_NAME = "yuekong_remote_code";
MONGO_DB_USER = "yuekong";
MONGO_DB_PASSWORD = "yuekong";
console.log("configuring kv storage ability...");
OSS_HOST = "oss-cn-hangzhou.aliyuncs.com";
OSS_HOST = "";
OSS_PORT = "80";
OSS_APP_ID = "f6bWxSdkNyu9FlyC";
OSS_APP_SECRET = "nO2bzv8yETA6TwPsYNFlYpWRT867Zg";
console.log("configuring external PYTHON path");
OSS_APP_ID = "";
OSS_APP_SECRET = "";
FILE_TEMP_PATH = "~/home/strawmanbobi/rc_extension";
PYTHON_PATH = "/usr/bin/python";
LISTEN_PORT = "8300";
MAIN_SERVER_ADDRESS = "localhost";
MAIN_SERVER_PORT = 80;
REDIS_HOST = "localhost";
REDIS_PORT = "6379";
REDIS_PASSWORD = "";
} else if (enums.APP_DEVELOPMENT_MODE == env) {
MYSQL_DB_SERVER_ADDRESS = "localhost";
MYSQL_DB_NAME = "irext";
MYSQL_DB_USER = "root";
MYSQL_DB_PASSWORD = "root";
OSS_HOST = "";
OSS_PORT = "80";
OSS_APP_ID = "";
OSS_APP_SECRET = "";
FILE_TEMP_PATH = "D:/rc_extension";
PYTHON_PATH = "C:/Python27/python.exe";
console.log("configuring external server connection ability...");
LISTEN_PORT = "8300";
MAIN_SERVER_ADDRESS = "192.168.1.170";
MAIN_SERVER_PORT = LISTEN_PORT;
console.log("configuring cache ability...");
MEMCACHED_HOST = "127.0.0.1";
MEMCACHED_PORT = "11211";
MEMCACHED_SASL_USER = "";
MEMCACHED_SASL_PASSWORD = "";
console.log("configuring push credential");
PUSH_APP_KEY = "b5e8e6123de67977dcb9813a";
PUSH_APP_SECRET = "38c6aecde1c7f82c741b4a2a";
MAIN_SERVER_ADDRESS = "localhost";
MAIN_SERVER_PORT = 80;
REDIS_HOST = "localhost";
REDIS_PORT = "6379";
REDIS_PASSWORD = "";
} else if (enums.APP_USERDEBUG_MODE == env) {
console.log("user debug mode");
console.log("configuring MySQL db connection ability...");
MYSQL_DB_SERVER_ADDRESS = "127.0.0.1";
MYSQL_DB_NAME = "ucon_generic";
MYSQL_DB_SERVER_ADDRESS = "localhost";
MYSQL_DB_NAME = "irext";
MYSQL_DB_USER = "root";
MYSQL_DB_PASSWORD = "root";
console.log("configuring MongoDB kv connection ability...");
MONGO_DB_SERVER_ADDRESS = "127.0.0.1";
MONGO_DB_NAME = "yuekong_remote_code";
MONGO_DB_USER = "yuekong";
MONGO_DB_PASSWORD = "yuekong";
console.log("configuring kv storage ability...");
OSS_HOST = "oss-cn-hangzhou.aliyuncs.com";
OSS_HOST = "";
OSS_PORT = "80";
OSS_APP_ID = "f6bWxSdkNyu9FlyC";
OSS_APP_SECRET = "nO2bzv8yETA6TwPsYNFlYpWRT867Zg";
console.log("configuring external PYTHON path");
FILE_TEMP_PATH = "/root/rc_extension";
PYTHON_PATH = "/usr/bin/python";
console.log("configuring external server connection ability...");
OSS_APP_ID = "";
OSS_APP_SECRET = "";
FILE_TEMP_PATH = "D:/rc_extension";
PYTHON_PATH = "C:/Python27/python.exe";
LISTEN_PORT = "8300";
MAIN_SERVER_ADDRESS = "yuekongdev.wicp.net";
MAIN_SERVER_PORT = LISTEN_PORT;
console.log("configuring cache ability...");
MEMCACHED_HOST = "127.0.0.1";
MEMCACHED_PORT = "11211";
MEMCACHED_SASL_USER = "";
MEMCACHED_SASL_PASSWORD = "";
console.log("configuring push credential");
PUSH_APP_KEY = "b5e8e6123de67977dcb9813a";
PUSH_APP_SECRET = "38c6aecde1c7f82c741b4a2a";
} else {
console.log("runtime mode err : " + env);
MAIN_SERVER_ADDRESS = "localhost";
MAIN_SERVER_PORT = 80;
REDIS_HOST = "localhost";
REDIS_PORT = "6379";
REDIS_PASSWORD = "";
}
};