env: prod
http:
  host: 0.0.0.0
  #   host: 127.0.0.1
  port: 8000
security:
  api_sign:
    app_key: 123456
    app_security: 123456
  jwt:
    key: QQYnRFerJTSEcrfB89fw8prOaObmrch8
data:
  db:
    user:
      driver: mysql
      dsn: 183_136_132_25:xGrNJphcmGcXiajE@tcp(183.136.132.25:3306)/183_136_132_25?charset=utf8mb4&parseTime=True&loc=Local
      logLevel: "warn"
    admin:
      driver: mysql
      dsn: admin:GhCbHDRDnMbAkZHw@tcp(110.42.96.15:3306)/admin?charset=utf8mb4&parseTime=True&loc=Local
      logLevel: "warn"
      casbin: true
    cdn:
      driver: mysql
      dsn: root:671119d76d73b5c9d4182d71e8e91eaa@tcp(110.42.96.120:3306)/clouds?charset=utf8mb4&parseTime=True&loc=Local
      logLevel: "warn"
#    second:
#      driver: mysql
#      dsn: root:Mgrj9hMF3QQ3atX5hFIo@tcp(115.238.186.121:3306)/0panel?charset=utf8mb4&parseTime=True&loc=Local
#      logLevel: "info"
  #    user:
  #      driver: sqlite
  #      dsn: storage/nunu-test.db?_busy_timeout=5000
  #    user:
  #      driver: postgres
  #      dsn: host=localhost user=gorm password=gorm dbname=gorm port=9920 sslmode=disable TimeZone=Asia/Shanghai
  mongodb:
    uri: "mongodb://nunuUser:61cba0aauim0zituxxgyd0zr@110.42.96.15:27017"
    database: "nunu"
    timeout: 10s  # 连接超时时间
    max_pool_size: 100  # 连接池大小
  redis:
    addr: 110.42.96.15:26739
    password: "rzcmhtLCKpsYfFcZ"
    db: 0
    read_timeout: 0.2s
    write_timeout: 0.2s

log:
  log_level: info
  encoding: console           # json or console
  log_format: "2006-01-02"   # 按天生成日志文件
  # 区分API和Task日志
  api_log_file: "./storage/logs/api-%s.log" # %s会被替换为日期
  task_log_file: "./storage/logs/task-%s.log" # %s会被替换为日期
  # 兼容旧版本配置
  log_file_name: "./storage/logs/server.log"
  max_backups: 30
  max_age: 30            # 保存30天日志
  max_size: 200          # 单个文件最大200M
  compress: true         # 自动压缩
  # 日志过滤和美化
  hide_sql_args: true    # 隐藏SQL参数详情
  hide_request_body: false # 是否隐藏请求体内容

crawler:
  username: "admin"
  password: "mr7c6r61jIRLGhcnT5j9"
  Url: "http://api.hongxingdun.net:8700/"
  keyUrl: "http://api.hongxingdun.net:13350/sdk/key?app_name="
#  Url: "http://115.238.186.121:8700/"
#  keyUrl: "http://115.238.186.121:13350/sdk/key?app_name="

flexCdn:
  AccessKeyID : "oH3v5Kr0Q9WLKxzA"
  AccessKeySecret : "MAB1z3KdEFj8NCZN4KQtE7srTdkNqmYm"
  Url: "http://110.42.96.120:8002/"
# 令牌桶限流配置
limiter:
  # 全局限流配置
  capacity: 20    # 令牌桶容量（允许的突发请求数）
  fillRate: 5    # 每秒填充速率（QPS）
  # 特定API限流配置
  api:
    login:         # 登录接口限流
      capacity: 20
      fillRate: 2
    register:      # 注册接口限流
      capacity: 50
      fillRate: 5

# IP白名单配置
ip_allowlist:
  enabled: true    # 是否启用IP白名单
  ips:             # 允许访问的IP列表
    - 127.0.0.1    # 本地开发
    - ::1          # IPv6本地回环地址
    - 183.136.132.25  # 示例局域网IP
    - 172.17.0.2    # Docker容器IP
    - 172.17.0.1    # Docker网关
    - 172.16.0.0/12 # 整个Docker网络范围(包含172.17.x.x)

aodun:
  username: "zznet_api"
  password: "Nbgaofang.com!@#4"
  clientId: "bd9d36fc-17e1-11ef-8a72-549f35180370"
  Url: "https://115.238.184.13:16008"
aodunSmall:
  clientId: "3f4ab936-0527-11ef-8065-801844e71378"
  Url: "https://115.238.186.169:16008"

domainWhite:
  username: "自用_高防产品"
  password: "bduaSDxGvWc5ALWl"

rabbitmq:
  host: "110.42.96.15"
  port: 5672
  username: "fusu"
  password: "fusu12332ATQREW"
  vhost: "/"
  connection_timeout: 15s
  tasks:
    # IP白名单更新任务
    ip_white:
      exchange: "tasks_direct_exchange" # 改为使用 Topic 交换机，与域名任务保持一致
      exchange_type: "topic"              # 显式指定交换机类型
      queue: "ip_white_queue"
      routing_key: "task.ip_white.*"      # 使用通配符路由键，匹配 task.ip_white.add, task.ip_white.del 等
      consumer_count: 2
      prefetch_count: 1

    # 用户注册后续任务（例如：发送欢迎邮件）
#    user_register:
#      exchange: "tasks_direct_exchange"
#      queue: "user_register_queue"
#      routing_key: "task.user.register.notify"
#      consumer_count: 3
#      prefetch_count: 1

    # 域名白名单任务
    domain_whitelist:
      exchange: "whitelist_topic_exchange" # Topic 类型的交换机
      exchange_type: "topic"              # 显式指定交换机类型
      queue: "domain_whitelist_queue"
      routing_key: "whitelist.domain.*"   # 消费者监听的绑定键，能接收所有 domain 相关的任务
      consumer_count: 3
      prefetch_count: 1