Skip to content

appsettings.json配置文件说明

md-frank edited this page Oct 18, 2018 · 2 revisions
{
  "Logging": {
    "IncludeScopes": false,
    "LogLevel": {
      "Default": "Debug",
      "System": "Information",
      "Microsoft": "Information"
    },
    //日志文件目录
    "LogsDir": "/var/log/Mondol.FileService"
  },
  "Server": {
    //当前是否使用了反向代理,例如:nginx
    "ReverseProxy": true
  },
  "Db": {
    //1 - MySQL | 2 - MSSQL
    "DbType": 1,
    "MasterConnectionString": "server=127.0.0.1;user id=xxx;password=xxx;database=file-service; pooling=true;",
    //分表数量,无特殊需求保持64
    "FileTableCount": 64
  },
  "General": {
    //上传的文件存储根目录
    "RootPath": "/data/Mondol.FileService/files",
    //加密密钥,与业务服务器相同
    "AppSecret": "xxxxxxxxxxxxxxx",
    //下载文件时是否查询文件名。true:从属性库查询文件名返回给客户端 | false: 不查询数据库,性能好
    "QueryFileName": false
  },
  //图片处理器转换参数,参考imagemagick
  "ImageConverter": {
    "ConverterPath": "convert",
    "ResizeArgs": "${width}x${height}>",
    "ConvertTimeout": 60
  },
  "Manage": {
    //业务服务器IP白名单,只有在白名单里的IP才能管理文件服务器
    "IpWhitelist": [
      "*"
    ]
  },
  //集群配置
  "Cluster": {
    //当前服务器的ID
    "SelfServerId": 1,
    "Servers": [
      {
        //服务器ID,唯一
        "Id": 1,
        //服务器域名或IP,例如:fs.domain.com
        "Host": "127.0.0.1:5001",
        //权重,权重大的服务器会优先上传文件
        "Weight": 1,
        //本台服务器是否允许上传
        "AllowUpload": true
      }
    ]
  }
}
Clone this wiki locally