{"size": 2841, "ext": "js", "max_stars_repo_path": "config/config.default.js", "max_stars_repo_name": "freelogfe/freelog-resource-provider", "max_stars_repo_stars_event_min_datetime": "2017-10-11T02:12:12.000Z", "max_stars_repo_stars_event_max_datetime": "2019-01-21T16:34:34.000Z", "max_issues_repo_path": "config/config.default.js", "max_issues_repo_name": "freelogfe/freelog-resource-provider", "max_issues_repo_issues_event_min_datetime": "2021-03-02T00:58:40.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-03T23:01:45.000Z", "max_forks_repo_path": "config/config.default.js", "max_forks_repo_name": "freelogfe/freelog-resource-provider", "max_forks_repo_forks_event_min_datetime": "2017-10-11T02:28:32.000Z", "max_forks_repo_forks_event_max_datetime": "2017-10-11T02:28:32.000Z"}
{"max_stars_count": 3, "max_issues_count": 7, "max_forks_count": 1, "avg_line_length": 23.675, "max_line_length": 76, "alphanum_fraction": 0.4273143259}
'use strict';

const path = require('path')

module.exports = app => {
    return {
        cluster: {
            listen: {port: 7001}
        },

        keys: '20ab72d9397ff78c5058a106c635f008',

        i18n: {
            enable: true,
            defaultLocale: 'zh-CN'
        },

        /**
         * 关闭安全防护
         */
        security: {
            xframe: {
                enable: false,
            },
            csrf: {
                enable: false,
            }
        },

        ua: {
            enable: true
        },

        bodyParser: {
            enable: true,
            enableTypes: ['json', 'form', 'text']
        },

        middleware: ['errorHandler', 'identityAuthentication'],

        /**
         * 上传文件相关配置
         */
        uploadConfig: {
            aliOss: {
                enable: true,
                isCryptographic: true,
                accessKeyId: "TFRBSTRGcGNBRWdCWm05UHlON3BhY0tU",
                accessKeySecret: "M2NBYmRwQ1VESnpCa2ZDcnVzN1d2SXc1alhmNDNF",
                bucket: "freelog-shenzhen",
                internal: false,
                region: "oss-cn-shenzhen",
                timeout: 180000
            },
            amzS3: {}
        },

        multipart: {
            autoFields: false,
            defaultCharset: 'utf8',
            fieldNameSize: 100,
            fieldSize: '100kb',
            fields: 20,
            fileSize: '100mb',
            files: 10,
            fileExtensions: [],
            whitelist: (fileName) => true,
        },

        freelogBase: {
            retCodeEnum: {},
            errCodeEnum: {}
        },

        logger: {
            consoleLevel: 'NONE',
            level: 'ERROR',
        },

        //错误日志500MB自动分割
        logrotator: {
            filesRotateBySize: [
                path.join(app.root, 'logs', app.name, 'common-error.log'),
            ],
            maxFileSize: 1024 * 1024 * 1024 * 0.5,
        },

        notfound: {
            pageUrl: '/public/404.html',
        },

        clientCredentialInfo: {
            clientId: 1002,
            publicKey: 'ad472200bda12d65666df7b97282a7c6',
            privateKey: '9d3761da71ee041e648cafb2e322d968'
        },

        customFileLoader: ['app/event-handler/app-events-listener.js'],

        rabbitMq: {
            connOptions: {
                host: '192.168.164.165',
                port: 5672,
                login: 'guest',
                password: 'guest',
                authMechanism: 'AMQPLAIN',
                heartbeat: 120  //每2分钟保持一次连接
            },
            implOptions: {
                reconnect: true,
                reconnectBackoffTime: 20000  //10秒尝试连接一次
            },
            exchange: {
                name: 'freelog-resource-exchange',
            },
            queues: []
        }
    }
}
