Files
certd/packages/ui/certd-server/src/config/config.default.ts

89 lines
1.8 KiB
TypeScript
Raw Normal View History

2023-01-29 13:44:19 +08:00
import { join } from 'path';
import { FlywayHistory } from 'midway-flyway-js/dist/entity';
import { MidwayConfig } from '@midwayjs/core';
import { UserEntity } from '../modules/authority/entity/user';
2023-05-25 10:43:22 +08:00
import { PipelineEntity } from '../modules/pipeline/entity/pipeline';
2023-05-26 16:18:24 +08:00
//import { logger } from '../utils/logger';
2023-05-25 15:17:58 +08:00
// load .env file in process.cwd
2023-06-28 09:44:35 +08:00
import { mergeConfig } from './loader';
2023-06-26 12:26:59 +08:00
const development = {
2023-06-28 09:44:35 +08:00
keys: '',
2023-01-29 13:44:19 +08:00
koa: {
port: 7001,
},
2023-05-25 13:43:32 +08:00
staticFile: {
2023-07-03 09:15:52 +08:00
usePrecompiledGzip: true,
buffer: true,
maxAge: 60 * 60 * 24 * 30 * 1000,
gzip: true,
2023-05-25 13:43:32 +08:00
dirs: {
default: {
prefix: '/',
dir: 'public',
2023-05-25 15:17:58 +08:00
alias: {
'/': '/index.html',
},
2023-07-03 10:29:06 +08:00
files: {
'/index.html': {
maxAge: 60 * 60 * 1000,
},
},
2023-05-25 13:43:32 +08:00
},
},
},
2023-01-29 13:44:19 +08:00
cron: {},
/**
*
*/
preview: {
enabled: false,
},
/**
*
*/
typeorm: {
dataSource: {
default: {
/**
*
*/
type: 'sqlite',
database: join(__dirname, '../../data/db.sqlite'),
synchronize: false, // 如果第一次使用,不存在表,有同步的需求可以写 true
logging: true,
// 配置实体模型 或者 entities: '/entity',
2023-05-25 10:43:22 +08:00
entities: [
'**/modules/*/entity/*.ts',
'**/entity/*.js',
'**/entity/*.d.ts',
PipelineEntity,
FlywayHistory,
UserEntity,
],
2023-01-29 13:44:19 +08:00
},
},
},
/**
*
*/
flyway: {
scriptDir: join(__dirname, '../../db/migration'),
},
2023-06-28 09:44:35 +08:00
auth: {
2023-01-29 13:44:19 +08:00
jwt: {
2023-06-26 12:26:59 +08:00
secret: 'certd666',
2023-06-29 08:56:09 +08:00
expire: 7 * 24 * 60 * 60, //单位秒
2023-01-29 13:44:19 +08:00
},
},
2023-06-28 15:16:19 +08:00
certd: {
fileRootDir: '/app/data/files',
},
2023-01-29 13:44:19 +08:00
} as MidwayConfig;
2023-06-28 09:44:35 +08:00
mergeConfig(development, 'development');
2023-06-26 12:26:59 +08:00
export default development;