测试:jenkins web-server换成monitor数据库

This commit is contained in:
luying
2021-11-04 17:40:24 +08:00
parent f0c694d8a5
commit 73818dc8ac
2 changed files with 95 additions and 10 deletions

View File

@@ -0,0 +1,86 @@
import { EggAppConfig, EggAppInfo, PowerPartial } from 'egg';
const path = require('path');
export default (appInfo: EggAppInfo) => {
const config = {} as PowerPartial<EggAppConfig>;
// override config from framework / plugin
// use for cookie sign key, should change to your own and keep security
config.keys = appInfo.name + '_1597499383757_3508';
config.security = {
csrf: {
enable: false,
},
domainWhiteList: [ '*' ],
};
config.cors = {
origin: '*', // 匹配规则 域名+端口 *则为全匹配
allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH',
};
// add your egg config in here
config.middleware = [ 'parmsDecode' ];
config.mongoose = {
url: 'mongodb://dbop:zyzdbopbantu@dds-8vbdb47c6fb58a541.mongodb.zhangbei.rds.aliyuncs.com:3717,dds-8vbdb47c6fb58a542.mongodb.zhangbei.rds.aliyuncs.com:3717/zyz?replicaSet=mgset-500808098', // 内网
options: { useNewUrlParser: true, useUnifiedTopology: true },
};
config.redis = {
url: 'r-8vb4i2kgl91886fkxd.redis.zhangbei.rds.aliyuncs.com', // 内网
pw: 'zyz_2020'
};
// config.alinode = {
// appid: '86043',
// secret: '54ef0364995b0c4f2ab42150e29ad30df8327a3a',
// error_log: [ '/root/logs/zyz/zyz-web.log', '/root/logs/zyz/common-error.log', '/root/logs/zyz/egg-agent.log' ],
// packages: [ '/root/zyz/web-server/package.json' ],
// };
config.view = {
root: path.join(appInfo.baseDir, '/app/public'),
defaultViewEngine: 'nunjucks',
mapping: {
'.html': 'nunjucks' //左边写成.html后缀会自动渲染.html文件
},
};
config.decodeParm = true;
config.static = {
prefix: '/',
dir: path.join(appInfo.baseDir, '/app/public'),
};
config.xtransit = {
server: 'ws://172.26.117.35:9092',
appId: 3,
appSecret: 'a48ad5ca44e2d02cbd7f4c0326fa3101',
error_log: [ '/root/logs/zyz/zyz-web.log', '/root/logs/zyz/common-error.log', '/root/logs/zyz/egg-agent.log' ],
};
config.customLogger = {
linkLogger: {
file: path.join(appInfo.root, 'logs/web-server/link-log.log'),
formatter(meta) {
return `[${meta.level}] [${meta.date}] ${meta.message}`;
},
},
};
config.logrotator = {
filesRotateBySize: [
path.join(appInfo.root, 'logs/link-log.log'),
],
maxFileSize: 1024,
};
// add your special config in here
const bizConfig = {
sourceUrl: `https://github.com/eggjs/examples/tree/master/${appInfo.name}`,
};
// the return config will combines to EggAppConfig
return {
...config,
...bizConfig,
};
};