local.yml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. env: local
  2. http:
  3. # host: 0.0.0.0
  4. host: 127.0.0.1
  5. port: 8000
  6. security:
  7. api_sign:
  8. app_key: QQYnRFerJTSEcrfB89fw8prOaObmrch8123456
  9. app_security: 123456QQYnRFerJTSEcrfB89fw8prOaObmrch8
  10. jwt:
  11. key: QQYnRFerJTSEcrfB89fw8prOaObmrch8
  12. data:
  13. db:
  14. user:
  15. driver: mysql
  16. dsn: mofangtest:M3a4RewbedtyFsXc@tcp(110.42.96.15:3306)/mofangtest?charset=utf8mb4&parseTime=True&loc=Local
  17. logLevel: "info" # 记录所有日志
  18. admin:
  19. driver: mysql
  20. dsn: admin_test:xwKhr3bes3nY7mYE@tcp(110.42.96.15:3306)/admin_test?charset=utf8mb4&parseTime=True&loc=Local
  21. logLevel: "info"
  22. casbin: true
  23. cdn:
  24. driver: mysql
  25. dsn: root:671119d76d73b5c9d4182d71e8e91eaa@tcp(110.42.96.120:3306)/clouds?charset=utf8mb4&parseTime=True&loc=Local
  26. logLevel: "info"
  27. # 分表配置
  28. sharding:
  29. strategy: "monthly" # 分表策略: monthly(按月)
  30. enabled: true # 是否启用分表
  31. keep_months: 120 # 保留数据的月数(旧数据会被自动清理)
  32. auto_create: true # 是否自动创建分表
  33. # 数据量阈值配置
  34. threshold:
  35. enabled: true # 是否启用基于数据量的动态分表
  36. max_rows: 5000000 # 单表最大行数(500万条)
  37. check_interval: "1h" # 检查间隔
  38. tables: # 需要分表的表配置
  39. - name: "log" # 表名
  40. enabled: true # 是否对此表启用分表
  41. max_rows: 3000000 # 此表的最大行数(可覆盖全局配置)
  42. - name: "waf_log" # WAF日志表
  43. enabled: true
  44. max_rows: 5000000 # WAF日志表的最大行数
  45. # user:
  46. # driver: postgres
  47. # dsn: host=localhost user=gorm password=gorm dbname=gorm port=9920 sslmode=disable TimeZone=Asia/Shanghai
  48. mongodb:
  49. uri: "mongodb://nunuUser:61cba0aauim0zituxxgyd0zr@110.42.96.15:27017"
  50. database: "nunutest"
  51. timeout: 10s # 连接超时时间
  52. max_pool_size: 100 # 连接池大小
  53. redis:
  54. addr: 110.42.96.15:26739
  55. password: "rzcmhtLCKpsYfFcZ"
  56. db: 10
  57. read_timeout: 0.2s
  58. write_timeout: 0.2s
  59. log:
  60. log_level: debug
  61. encoding: console # json or console
  62. log_format: "2006-01-02" # 按天生成日志文件
  63. # 区分API和Task日志
  64. api_log_file: "./storage/logs/api-%s.log" # %s会被替换为日期
  65. task_log_file: "./storage/logs/task-%s.log" # %s会被替换为日期
  66. # 兼容旧版本配置
  67. log_file_name: "./storage/logs/server.log"
  68. max_backups: 30
  69. max_age: 30 # 保存30天日志
  70. max_size: 200 # 单个文件最大200M
  71. compress: true # 自动压缩
  72. # 日志过滤和美化
  73. hide_sql_args: true # 隐藏SQL参数详情
  74. hide_request_body: false # 是否隐藏请求体内容
  75. crawler:
  76. username: "admin"
  77. password: "mr7c6r61jIRLGhcnT5j9"
  78. # Url: "http://api.hongxingdun.net:8700/"
  79. # keyUrl: "http://api.hongxingdun.net:13350/sdk/key?app_name="
  80. Url: "http://115.238.186.121:8700/"
  81. keyUrl: "http://115.238.186.121:13350/sdk/key?app_name="
  82. flexCdn:
  83. AccessKeyID : "oH3v5Kr0Q9WLKxzA"
  84. AccessKeySecret : "MAB1z3KdEFj8NCZN4KQtE7srTdkNqmYm"
  85. Url: "http://110.42.96.120:8002/"
  86. # 令牌桶限流配置
  87. limiter:
  88. # 全局限流配置
  89. capacity: 20 # 令牌桶容量(允许的突发请求数)
  90. fillRate: 5 # 每秒填充速率(QPS)
  91. # 特定API限流配置
  92. api:
  93. login: # 登录接口限流
  94. capacity: 20
  95. fillRate: 2
  96. register: # 注册接口限流
  97. capacity: 50
  98. fillRate: 5
  99. # IP白名单配置
  100. ip_allowlist:
  101. enabled: true # 是否启用IP白名单
  102. ips: # 允许访问的IP列表
  103. - 127.0.0.1 # 本地开发
  104. - ::1 # IPv6本地回环地址
  105. - 183.136.132.25 # 示例局域网IP
  106. aodun:
  107. username: "zznet_api"
  108. password: "Nbgaofang.com!@#4"
  109. clientId: "bd9d36fc-17e1-11ef-8a72-549f35180370"
  110. Url: "https://115.238.184.13:16008"
  111. aodunSmall:
  112. clientId: "3f4ab936-0527-11ef-8065-801844e71378"
  113. Url: "https://115.238.186.169:16008"
  114. domainWhite:
  115. username: "自用_高防产品"
  116. password: "bduaSDxGvWc5ALWl"
  117. # RabbitMQ Configuration
  118. rabbitmq:
  119. host: "110.42.96.15"
  120. port: 5672
  121. username: "fusu"
  122. password: "fusu12332ATQREW"
  123. vhost: "/"
  124. connection_timeout: 15s
  125. tasks:
  126. # IP白名单更新任务
  127. ip_white:
  128. exchange: "tasks_direct_exchange_test" # 改为使用 Topic 交换机,与域名任务保持一致
  129. exchange_type: "topic" # 显式指定交换机类型
  130. queue: "ip_white_queue_test"
  131. routing_key: "task.ip_white.*" # 使用通配符路由键,匹配 task.ip_white.add, task.ip_white.del 等
  132. consumer_count: 2
  133. prefetch_count: 1
  134. # 用户注册后续任务(例如:发送欢迎邮件)
  135. # user_register:
  136. # exchange: "tasks_direct_exchange_test"
  137. # queue: "user_register_queue_test"
  138. # routing_key: "task.user.register.notify"
  139. # consumer_count: 3
  140. # prefetch_count: 1
  141. # 域名白名单任务
  142. domain_whitelist:
  143. exchange: "whitelist_topic_exchange_test" # Topic 类型的交换机
  144. exchange_type: "topic" # 显式指定交换机类型
  145. queue: "domain_whitelist_queue_test"
  146. routing_key: "whitelist.domain.*" # 消费者监听的绑定键,能接收所有 domain 相关的任务
  147. consumer_count: 3
  148. prefetch_count: 1
  149. # 记录日志任务
  150. waf_log:
  151. exchange: "wafLog_topic_exchange_test" # Topic 类型的交换机
  152. exchange_type: "topic" # 显式指定交换机类型
  153. queue: "wafLog_queue_test"
  154. routing_key: "wafLog.*" # 消费者监听的绑定键,能接收所有 domain 相关的任务
  155. consumer_count: 3
  156. prefetch_count: 1
  157. addServerIp:
  158. 宁波:
  159. - 192.168.14.111
  160. - 192.168.14.112
  161. 香港:
  162. - 192.168.14.113