/** * 系统配置 * * @author hbomb qiqi.zhou@yoho.cn * @date 2016/05/06 */ const isProduction = process.env.NODE_ENV === 'production'; const isTest = process.env.NODE_ENV === 'test'; // 修改 sockets 默认设置 require('http').globalAgent.maxSockets = 10; module.exports = { app: 'web', appName: 'yohobuy-node', appVersion: '6.3.0', // 调用api的版本 port: 6002, siteUrl: 'http://www.yohobuy.com', cookieDomain: '.yohobuy.com', // yohoVerifyUdid: '0de0250d-eb4c-4d52-9aaf-0c3816d53cf2', domains: { // test3 singleApi: 'http://api-test3.dev.yohocorp.com/', api: 'http://api-test3.dev.yohocorp.com/', service: 'http://api-test3.dev.yohocorp.com/', serviceNotify: 'http://api-test3.dev.yohocorp.com/', global: 'http://global-test-soa.yohops.com:9999/', platformApi: 'http://192.168.102.48:8088/', yohoNowApi: 'http://yohonow-test.yohops.com:9999/', // test2 // singleApi: 'http://api-test2.yohops.com:9999/', // api: 'http://api-test2.yohops.com:9999/', // service: 'http://api-test2.yohops.com:9999/', // serviceNotify: 'http://service-test2.yohops.com:9999/', // global: 'http://global-test-soa.yohops.com:9999/', // platformApi: 'http://192.168.102.48:8088/', // prod // singleApi: 'http://api.yoho.cn/', // api: 'http://api.yoho.cn/', // service: 'http://api.yoho.cn/', // serviceNotify: 'http://service.yoho.cn/', // platformApi: 'http://172.16.6.210:8088/', // gray // singleApi: 'http://apigray.yoho.cn/', // api: 'http://apigray.yoho.cn/', // service: 'http://apigray.yoho.cn/', // platformApi: 'http://172.16.6.210:8088/', // dev // api: 'http://dev-api.yohops.com:9999/', // service: 'http://dev-api.yohops.com:9999/', // serviceNotify: 'http://dev-service.yohops.com:9999/', // singleApi: 'http://dev-api.yohops.com:9999/', // platformApi: 'http://192.168.102.48:8088/', imSocket: 'ws://socket.yohobuy.com:10240', imCs: 'http://im.yohobuy.com/api', unionApi: 'http://172.16.6.90:8080/' }, subDomains: { host: '.yohobuy.com', default: '//www.yohobuy.com', guang: '//guang.yohobuy.com', list: '//list.yohobuy.com', search: '//search.yohobuy.com', huodong: '//huodong.yohobuy.com', activity: '//activity.yohobuy.com', index: '//yohobuy.com' }, signExtend: { business_line: 'yohobuy' }, report: { host: 'localhost', port: 6009, db: 'web-apm' }, useOneapm: false, useCache: true, loggers: { infoFile: { name: 'info', level: 'info', filename: '/Data/logs/yohobuy-node/info/info.log', maxFiles: 1, tailable: true, maxsize: Math.pow(1024, 3), zippedArchive: true, timestamp() { return new Date().toString(); } }, errorFile: { name: 'error', level: 'error', filename: '/Data/logs/yohobuy-node/error/error.log', maxFiles: 1, tailable: true, maxsize: Math.pow(1024, 3), zippedArchive: true, handleExceptions: true, timestamp() { return new Date().toString(); } }, udp: { // send by udp measurement: 'yohobuy_node_log', level: 'debug', // logger level host: 'influxdblog.web.yohoops.org', // influxdb host port: '4444' // influxdb port }, console: { close: true, level: 'info', colorize: 'all', prettyPrint: true } }, thirdLogin: { wechat: { appID: 'wx3ae21dcbb82ad672', appSecret: 'e78afb2321e6a19085767e1a0f0d52c1' }, sina: { appID: '3739328910', appSecret: '9d44cded26d048e23089e5e975c93df1' }, qq: { appID: '100229394', appSecret: 'c0af9c29e0900813028c2ccb42021792' }, alipay: { appID: '2088701661478015', appSecret: 'kcxawi9bb07mzh0aq2wcirsf9znusobw' }, douban: { appID: '03b4e36bf13dc75a0b1eaa43d3b9560e', appSecret: 'f16d5913e8610672' }, renren: { appID: '783130c654c94a77ace97054ae266019', appSecret: '05e430de8c1e40d3a1f39ca8d3f8252c' } }, gee_captcha: { id: '356b333091cdb78cd788e7bdd5f05c9f', key: '6fef8ee77e41429de68455eeb052ce37' }, UNIVERSAL_CAPTCHA: '93c70db61fe276f93ce781ad17dc47cd', apiCache: { cache: true }, zookeeperServer: '127.0.0.1:2181', redis: { connect: { // host: '127.0.0.1', host: '192.168.102.49', port: '6379', enable_offline_queue: false, retry_strategy(options) { if (options.error && options.error.code === 'ECONNREFUSED') { console.log('connect redis server fail'); } if (options.attempt < 10) { return Math.min(options.attempt * 100, 1000); } else if (options.attempt > 10 && options.attempt < 100) { return 1000; } else { return 1000 * 10; } } }, session: { host: '127.0.0.1', // host: '192.168.102.49', port: '6379', prefix: 'yohobuy_session:' } }, REQUEST_LIMIT: { // 10s 最多访问5次 10: 5, // 30s 最多访问10次 30: 10, // 60s 最多访问15次 60: 15, // 100s 最多访问100次 600: 100 } }; if (isProduction) { Object.assign(module.exports, { appName: 'yohobuy-node', domains: { singleApi: 'http://api.yoho.yohoops.org/', api: 'http://api.yoho.yohoops.org/', service: 'http://api.yoho.yohoops.org/', search: 'http://search.yohoops.org/yohosearch/', global: 'http://api-global.yohobuy.com/', serviceNotify: 'http://service.yoho.cn/', imSocket: 'wss://imsocket.yohobuy.com:443', imCs: 'https://imhttp.yohobuy.com/api', platformApi: 'http://api.platform.yohoops.org', unionApi: 'http://union.yoho.cn/', yohoNowApi: 'http://new.yohoboys.com/', }, useOneapm: true, useCache: true, zookeeperServer: 'web.zookeeper.yohoops.org:2181', redis: { connect: { host: 'redis.web.yohoops.org', port: '6379', password: 'redis9646', enable_offline_queue: false, retry_strategy(options) { if (options.error && options.error.code === 'ECONNREFUSED') { console.log('connect redis server fail'); } if (options.attempt < 10) { return Math.min(options.attempt * 100, 1000); } else if (options.attempt > 10 && options.attempt < 100) { return 1000; } else { return 1000 * 10; } } }, session: { host: 'redis.web.yohoops.org', port: '6379', pass: 'redis9646', prefix: 'yohobuy_session:' } }, report: { host: 'badjs.yoho.cn', port: 80, db: 'web-apm' }, monitorReport: { host: '10.66.4.25', port: 8086, db: 'web_monitor', } }); } else if (isTest) { Object.assign(module.exports, { appName: 'yohobuy-node', domains: { singleApi: process.env.TEST_API || 'http://testapi.yoho.cn:28078/', api: process.env.TEST_API || 'http://testapi.yoho.cn:28078/', service: process.env.TEST_API || 'http://testapi.yoho.cn:28078/', global: process.env.TEST_GOLBAL || 'http://global-test-soa.yohops.com:9999/', search: process.env.TEST_SEARCH || 'http://192.168.102.216:8080/yohosearch/', serviceNotify: process.env.TEST_API || 'http://testapi.yoho.cn:28078/', imSocket: 'ws://socket.yohobuy.com:10240', imCs: 'http://im.yohobuy.com/api', yohoNowApi: process.env.YOHO_NOW_API || 'http://yohonow-test.yohops.com:9999/', }, useOneapm: true, useCache: true, monitorReport: { host: '192.168.102.22', port: 8086, db: 'web_monitor', } }); }