2026-05-12 17:43:03 +08:00
|
|
|
/* eslint valid-jsdoc: "off" */
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param {Egg.EggAppInfo} appInfo app info
|
|
|
|
|
*/
|
|
|
|
|
const process = require('process'),
|
2026-05-15 16:36:55 +08:00
|
|
|
path = require('path');
|
2026-05-12 17:43:03 +08:00
|
|
|
|
|
|
|
|
module.exports = appInfo => {
|
|
|
|
|
/**
|
|
|
|
|
* built-in config
|
|
|
|
|
* @type {Egg.EggAppConfig}
|
|
|
|
|
**/
|
|
|
|
|
const config = exports = {};
|
|
|
|
|
|
|
|
|
|
// use for cookie sign key, should change to your own and keep security
|
|
|
|
|
config.keys = appInfo.name + '_1776061883917_3511';
|
|
|
|
|
|
|
|
|
|
// add your middleware config here
|
|
|
|
|
// config.middleware = [];
|
|
|
|
|
|
|
|
|
|
// 修改Egg.js的public路径配置到运行路径下
|
|
|
|
|
config.static = {
|
|
|
|
|
prefix: '/',
|
|
|
|
|
dir: process.cwd() + '/public',
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 配置执行时临时文件的路径到运行路径
|
|
|
|
|
config.rundir = process.cwd() + '/run';
|
|
|
|
|
|
|
|
|
|
// 配置普通日志文件地址
|
|
|
|
|
config.logger = {
|
|
|
|
|
dir: path.join(process.cwd(), 'logs'),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 配置定时任务日志文件地址
|
|
|
|
|
config.customLogger = {
|
|
|
|
|
scheduleLogger: {
|
|
|
|
|
file: path.join(process.cwd(), 'logs', 'egg-schedule.log'),
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
config.security = {
|
|
|
|
|
csrf: {
|
|
|
|
|
enable: false
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
2026-05-15 16:31:52 +08:00
|
|
|
// ntrip-caster配置
|
2026-05-12 17:43:03 +08:00
|
|
|
config.caster = {
|
|
|
|
|
ip: '127.0.0.1',
|
|
|
|
|
port: 2101
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
config.redis = {
|
|
|
|
|
// 开发/测试环境
|
|
|
|
|
clients: {
|
|
|
|
|
db0: {
|
|
|
|
|
port: 6379,
|
|
|
|
|
host: '127.0.0.1',
|
|
|
|
|
password: '74191221',
|
|
|
|
|
db: 0,
|
|
|
|
|
},
|
|
|
|
|
db1: {
|
|
|
|
|
port: 6379,
|
|
|
|
|
host: '127.0.0.1',
|
|
|
|
|
password: '74191221',
|
|
|
|
|
db: 1,
|
|
|
|
|
},
|
|
|
|
|
db2: {
|
|
|
|
|
port: 6379,
|
|
|
|
|
host: '127.0.0.1',
|
|
|
|
|
password: '74191221',
|
|
|
|
|
db: 2,
|
|
|
|
|
},
|
|
|
|
|
db3: {
|
|
|
|
|
port: 6379,
|
|
|
|
|
host: '127.0.0.1',
|
|
|
|
|
password: '74191221',
|
|
|
|
|
db: 3,
|
|
|
|
|
},
|
|
|
|
|
db5: {
|
|
|
|
|
port: 6379,
|
|
|
|
|
host: '127.0.0.1',
|
|
|
|
|
password: '74191221',
|
|
|
|
|
db: 5,
|
|
|
|
|
},
|
|
|
|
|
db8: {
|
|
|
|
|
port: 6379,
|
|
|
|
|
host: '127.0.0.1',
|
|
|
|
|
password: '74191221',
|
|
|
|
|
db: 8,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 生产环境
|
|
|
|
|
// clients: {
|
|
|
|
|
// db0: {
|
|
|
|
|
// port: 6379,
|
|
|
|
|
// host: '127.0.0.1',
|
|
|
|
|
// password: 'bd3@htcc2023',
|
|
|
|
|
// db: 2,
|
|
|
|
|
// },
|
|
|
|
|
// db1: {
|
|
|
|
|
// port: 6379,
|
|
|
|
|
// host: '127.0.0.1',
|
|
|
|
|
// password: 'bd3@htcc2023',
|
|
|
|
|
// db: 3,
|
|
|
|
|
// },
|
|
|
|
|
// db2: {
|
|
|
|
|
// port: 6379,
|
|
|
|
|
// host: '127.0.0.1',
|
|
|
|
|
// password: 'bd3@htcc2023',
|
|
|
|
|
// db: 4,
|
|
|
|
|
// },
|
|
|
|
|
// db3: {
|
|
|
|
|
// port: 6379,
|
|
|
|
|
// host: '127.0.0.1',
|
|
|
|
|
// password: 'bd3@htcc2023',
|
|
|
|
|
// db: 5,
|
2026-05-15 16:36:55 +08:00
|
|
|
// },
|
2026-05-12 17:43:03 +08:00
|
|
|
// db5: {
|
|
|
|
|
// port: 6379,
|
|
|
|
|
// host: '127.0.0.1',
|
|
|
|
|
// password: 'bd3@htcc2023',
|
|
|
|
|
// db: 7,
|
|
|
|
|
// },
|
2026-05-15 16:36:55 +08:00
|
|
|
// db8: {
|
|
|
|
|
// port: 6379,
|
|
|
|
|
// host: '127.0.0.1',
|
|
|
|
|
// password: 'bd3@htcc2023',
|
|
|
|
|
// db: 10,
|
|
|
|
|
// }
|
2026-05-12 17:43:03 +08:00
|
|
|
// }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
config.sequelize = {
|
|
|
|
|
// 开发/测试环境
|
|
|
|
|
datasources: [
|
|
|
|
|
{
|
|
|
|
|
dialect: 'mariadb',
|
|
|
|
|
host: 'localhost',
|
|
|
|
|
port: 3306,
|
|
|
|
|
username: 'root',
|
|
|
|
|
password: '74191221',
|
|
|
|
|
database: 'bside',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
dialect: 'mariadb',
|
|
|
|
|
host: 'localhost',
|
|
|
|
|
port: 3306,
|
|
|
|
|
username: 'root',
|
|
|
|
|
password: '74191221',
|
|
|
|
|
database: 'cside',
|
|
|
|
|
delegate: 'model2',
|
|
|
|
|
baseDir: 'model2',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
dialect: 'mariadb',
|
|
|
|
|
host: 'localhost',
|
|
|
|
|
port: 3306,
|
|
|
|
|
username: 'root',
|
|
|
|
|
password: '74191221',
|
|
|
|
|
database: 'insiders',
|
|
|
|
|
delegate: 'model3',
|
|
|
|
|
baseDir: 'model3',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
dialect: 'mariadb',
|
|
|
|
|
host: 'localhost',
|
|
|
|
|
port: 3306,
|
|
|
|
|
username: 'root',
|
|
|
|
|
password: '74191221',
|
|
|
|
|
database: 'bdContest',
|
|
|
|
|
delegate: 'model4',
|
|
|
|
|
baseDir: 'model4',
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
// 生产环境
|
|
|
|
|
// datasources: [
|
|
|
|
|
// {
|
|
|
|
|
// dialect: 'mariadb',
|
|
|
|
|
// host: 'localhost',
|
|
|
|
|
// port: 3306,
|
|
|
|
|
// username: 'bdqh_platform',
|
|
|
|
|
// password: '124689@XXxx',
|
|
|
|
|
// database: 'bside',
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// dialect: 'mariadb',
|
|
|
|
|
// host: 'localhost',
|
|
|
|
|
// port: 3306,
|
|
|
|
|
// username: 'bdqh_platform',
|
|
|
|
|
// password: '124689@XXxx',
|
|
|
|
|
// database: 'cside',
|
|
|
|
|
// delegate: 'model2',
|
|
|
|
|
// baseDir: 'model2',
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// dialect: 'mariadb',
|
|
|
|
|
// host: 'localhost',
|
|
|
|
|
// port: 3306,
|
|
|
|
|
// username: 'bdqh_platform',
|
|
|
|
|
// password: '124689@XXxx',
|
|
|
|
|
// database: 'insiders',
|
|
|
|
|
// delegate: 'model3',
|
|
|
|
|
// baseDir: 'model3',
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// dialect: 'mariadb',
|
|
|
|
|
// host: 'localhost',
|
|
|
|
|
// port: 3306,
|
|
|
|
|
// username: 'bdqh_platform',
|
|
|
|
|
// password: '124689@XXxx',
|
|
|
|
|
// database: 'bdContest',
|
|
|
|
|
// delegate: 'model4',
|
|
|
|
|
// baseDir: 'model4',
|
|
|
|
|
// }
|
|
|
|
|
// ]
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// add your user config here
|
|
|
|
|
const userConfig = {
|
|
|
|
|
// myAppName: 'egg',
|
|
|
|
|
salt: 'ntripCaster'
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
...config,
|
|
|
|
|
...userConfig,
|
|
|
|
|
};
|
|
|
|
|
};
|