irc_dicom_service/config/config.default.js

167 lines
5.9 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

'use strict';
// const { url } = require('inspector');
const path = require('path');
module.exports = appInfo => {
const config = exports = {};
config.moveScu = {
lock: false
}
config.upload = {
// url: 'http://192.168.1.66:7002'
url: 'http://127.0.0.1:7002'
}
config.site = {
debug: true,
SALT_STRENGTH: 10, // 密码加密强度
ROOT_PATH: path.join(__dirname, '..'), //定义根路径
APP_PATH: path.join(__dirname, '../app'), //定义app路径
PUBLIC: path.join(__dirname, '../app/public'), //定义PUBLIC目录
COOKIEMAXAGE: 7 * 24 * 60 * 60 * 1000, //cookie存储maxage
TYPES: ['CT', 'MR', 'DR'],
CACHE_SAVE_PATH: path.join(__dirname, '../app/public/DICOM'), //文件存储地址
CACHE_SHOW_PATH: `/public/DICOM/`, //文件展示地址
GETLIMIT: 8,
MOVE_PORT: 7100,
STORYESCPPATH: path.join(__dirname, '../app/python/storescp.py'),
MOVE: {
PATH: path.join(__dirname, '../app/python/getFirstImageFromStudy.py'),
IP: '172.17.1.131',
PORT: 104,
AEC: "SERVER",
WORKPORT: 7010,
MAXWORKPORTNUM: 5,
LOCKTIME: 1 * 60 * 60 * 1000
},
PACS_QR_CFG: path.join(__dirname, "../app/python/patqry.txt"), //pacs查询配置文件
PACS_QR_FILE: path.join(__dirname, "../app/python/patqry.dcm"), //pacs查询dcm
PACS_SCP_STORE: path.join(__dirname, "../app/public/SCP_STORE"), //pacs store存储地址
PACS_SCP_PORT: 3030, //pacs store存储端口
// PACS_SCP_AET: 'RAYPLUSAE', //pacs store aet
PACS_SCP_AET: 'xiongfei2', //pacs store aet
PACS_JOB_QUREY_DAY: 3,
DICOM_SAVE_PATH: path.join(__dirname, "../app/public/DICOM"), //DICOM保存地址
PNG_SAVE_PATH: path.join(__dirname, "../app/public/IMAGE"), //PNG保存地址
PNG_SHOW_PATH: `/public/IMAGE`, //PNG展示地址
DICOM_SHOW_PATH: "/public/DICOM", //DICOM展示地址
};
// use for cookie sign key, should change to your own and keep security
config.keys = appInfo.name + 'v1';
// add your config here
config.middleware = ["error"];
config.gzip = {
threshold: 1024 // 小于 1k 的响应体不压缩
};
config.security = {
csrf: {
enable: false
}
};
/**
* 客户端请求如果需要保存本地凭条cookie则会带有特别的请求字段 withCredentials
* 服务端需要同样开启这个字段才能响应这些请求
* 本质上应该是在响应头里增加了这个字段: Access-Control-Allow-Credentials: true
* 这里应该是全局设置,单独在响应头里加这个字段好像不行。应该是这个框架问题
*/
config.cors = {
origin: "*",
allowMethods: "GET,HEAD,PUT,POST,DELETE,PATCH,OPTIONS",
credentials: false
};
config.logger = {
// level: 'ERROR',
dir: path.join(process.cwd(), 'logs'),
consoleLevel: 'DEBUG',
appLogName: `${appInfo.name}-api.log`, //应用相关日志,
coreLogName: "web.log", //框架内核、插件日志。
agentLogName: "agent.log", //agent 进程日志
errorLogName: "error.log" //error 异常日志
};
// mongoose
config.mongoose = {
client: {
// url: `mongodb://rayplus_admin:rayplus1234@192.168.1.50:27017/rayplus`,
// url: `mongodb://mongouser:mongo123456@192.168.3.69:27017/rayplus`,
// url: `mongodb://mongouser:mongo123456@47.117.164.182:27017/rayplus?authSource=admin`,
url: `mongodb://mongouser:mongo123456@192.168.3.68:27017/?authSource=admin`,
// url: `mongodb://rayplus_admin:rayplus1234@192.168.1.25:27017/rayplus`,
// url: `mongodb://rayplus_admin:rayplus1234@127.0.0.1:27017/rayplus`,
options: {
socketTimeoutMS: 0,
keepAlive: true,
useNewUrlParser: true,
}
}
};
config.httpclient = {
// 是否开启本地 DNS 缓存,默认关闭,开启后有两个特性
// 1. 所有的 DNS 查询都会默认优先使用缓存的,即使 DNS 查询错误也不影响应用
// 2. 对同一个域名,在 dnsCacheLookupInterval 的间隔内(默认 10s只会查询一次
enableDNSCache: false,
// 对同一个域名进行 DNS 查询的最小间隔时间
dnsCacheLookupInterval: 10000,
// DNS 同时缓存的最大域名数量,默认 1000
dnsCacheMaxLength: 1000,
request: {
// 默认 request 超时时间
timeout: 3 * 60 * 1000,
}
};
config.clusterClient = {
maxWaitTime: 60000 * 3,
responseTimeout: 60000 * 3,
};
config.jwt = {
secret: "6YPhrbCSKLejwZ5F",
exp: 1000 * 24 * 60 * 60 //存在时间 单位位秒
};
config.regexp = {
username: /^[a-zA-Z0-9_-]{4,16}$/, //用户名正则4到16位字母数字下划线减号
password: /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,21}$/, //6-21字母和数字组成不能是纯数字或纯英文
email: /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/, //Email正则
phone: /^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0,2,5-9]))\d{8}$/, //手机号正则
// name: /^[\u4E00-\u9FA5]{2,5}(?:·[\u4E00-\u9FA5]{2,5})*$/, //姓名正则
name: /^[A-Za-z0-9_\-\u4e00-\u9fa5]{1,10}$/, //名字正则
idcard: /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/, //18位身份证
url: /^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/, // url验证
money: /^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/, //金额
imageCode: /^[a-zA-Z0-9]{6}$/, //图形验证码
msgCode: /^[0-9]{6}$/, //手机验证码
objectId: /^[a-zA-Z0-9]{24}$/, //mongodb ObjectId正则
};
config.initData = {}
config.static = {
prefix: '/',
dir: process.cwd() + '/public'
}
config.rundir = process.cwd() + '/run'
config.development = {
enable: false, // 禁用 egg-development 插件
}
config.watcher = { // 关闭文件监听
enable: false,
}
config.png16 = {
};
return config;
};