Skip to content

配置文件

yml
server:
  port: 8080
  address: 0.0.0.0
  shutdown: graceful
  # 启用HTTP响应压缩
  compression:
    enabled: true
  servlet:
    encoding:
      enabled: true
      charset: UTF-8 # 必须设置 UTF-8,避免 WebFlux 流式返回(AI 场景)会乱码问题
      force: true
spring:
  profiles:
    active: dev
  datasource:
    # !!! 注意:useInformationSchema=true 是必须的,用于支持 MyBatis-Flex 正确读取表注释。
    url: jdbc:mysql://127.0.0.1:3306/aiflowy?useInformationSchema=true&characterEncoding=utf-8
    username: root
    password: 123456
  servlet:
    multipart:
      max-file-size: 100MB
      max-request-size: 100MB
  web:
    resources:
      # 示例:windows【file: C:\aiflowy\attachment】 linux【file: /www/aiflowy/attachment】
      static-locations: file:C:\aiflowy\attachment
  mvc:
    pathmatch:
      matching-strategy: ant_path_matcher
    # 静态资源路径,用于访问本地文件
    # !!! 注意,这里要和下面的 aiflowy.storage.local.prefix 后面的路径 /attachment 保持一致!
    static-path-pattern: /attachment/**
  # quartz 相关配置
  quartz:
    startup-delay: 1
    job-store-type: jdbc
    jdbc:
      platform: mysql
      initialize-schema: never
    properties:
      org:
        quartz:
          jobStore:
            misfireThreshold: 1000
            # 如果数据库大小写敏感,可将ddl里的相关表名改为大写
            tablePrefix: TB_QRTZ_
          threadPool:
            threadCount: 20
            threadPriority: 5
  threads:
    virtual:
      enabled: true
aiflowy:
  # 语音播放、识别服务(阿里云)
  audio:
    type: aliAudioService
    ali:
      access-key-id: xxx
      access-key-secret: xxx
      app-key: xxx
      voice: siyue
  login:
    # 放行接口路径
    excludes: /api/v1/auth/**, /static/**, /userCenter/auth/**, /userCenter/public/**
  storage:
    type: local # xFileStorage / local
    # 本地文件存储配置
    local:
      # 示例:windows【C:\aiflowy\attachment】 linux【/www/aiflowy/attachment】
      root: C:\aiflowy\attachment
      # 后端接口地址,用于拼接完整 url
      prefix: http://localhost:8080/attachment
# xFileStorage存储文件配置
dromara:
  x-file-storage: #文件存储配置
    default-platform: aliyun-oss-1 #默认使用的存储平台
    aliyun-oss:
      - platform: aliyun-oss-1 # 存储平台标识
        enable-storage: true  # 启用存储
        access-key: yourAccessKeyId
        secret-key: yourAccessKeySecret
        end-point: yourEndpoint # 示例:https://oss-cn-beijing.aliyuncs.com
        bucket-name: yourBucketName
        domain: yourDomain # 访问域名,注意“/”结尾,例如:https://bucketname.oss-cn-shanghai.aliyuncs.com/
        base-path: attachment # 基础路径
# 自定义节点相关配置
node:
  # 文件内容提取节点,默认使用简单文档读取器,可自行实现 ReadDocService
  reader: 'defaultReader'
  # gitee 文档读取的实现,需要配置gitee的appKey
  gitee:
    appKey: 'xxx'
  # 搜索引擎节点 - 目前只支持博查搜索
  bochaai:
    apiKey: 'xxx'
jetcache:
  # 缓存类型,可选值:local/remote/both CacheConfig 类初始化
  cacheType: local
  statIntervalMinutes: 15
  areaInCacheName: false
  local:
    default:
      type: linkedhashmap
      keyConvertor: fastjson
  remote:
    default:
      type: redis
      keyConvertor: fastjson2
      broadcastChannel: projectA
      valueEncoder: java
      valueDecoder: java
      poolConfig:
        minIdle: 5
        maxIdle: 20
        maxTotal: 50
      host: 127.0.0.1
      port: 6379
      password: pwd
      database: 0
# 多路召回搜索引擎配置
rag:
  searcher:
    # 搜索方式 默认lucene
    # type : elasticSearch / lucene
    type: lucene
    lucene:
      indexDirPath: ./luceneKnowledge
    elastic:
      host: https://127.0.0.1:9200
      userName: elastic
      password: elastic
      indexName: aiflowy
logging:
  file:
    path: .logs/
    name: aiflowy.log
  level:
    root: info
    tech.aiflowy.ai: debug
# 行为验证码配置
captcha:
  # 初始化默认资源
  init-default-resource: true
  # 开启二次验证
  secondary:
    enabled: true