2025-11-21 04:32:08 +08:00
|
|
|
# 应用配置
|
2025-12-03 04:01:45 +08:00
|
|
|
spring.application.name=polyhermes-backend
|
2025-11-21 04:32:08 +08:00
|
|
|
|
2025-12-03 02:48:02 +08:00
|
|
|
# 数据源配置(默认配置,可通过环境变量覆盖)
|
2025-12-03 04:01:45 +08:00
|
|
|
spring.datasource.url=${DB_URL:jdbc:mysql://localhost:3306/polyhermes?useSSL=false&serverTimezone=UTC&characterEncoding=utf8&allowPublicKeyRetrieval=true}
|
2025-11-21 04:32:08 +08:00
|
|
|
spring.datasource.username=${DB_USERNAME:root}
|
|
|
|
|
spring.datasource.password=${DB_PASSWORD:11111111}
|
|
|
|
|
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
|
|
|
|
|
|
|
|
|
# HikariCP 连接池配置
|
|
|
|
|
spring.datasource.hikari.maximum-pool-size=10
|
|
|
|
|
spring.datasource.hikari.minimum-idle=2
|
|
|
|
|
spring.datasource.hikari.connection-timeout=30000
|
|
|
|
|
|
|
|
|
|
# JPA 配置
|
|
|
|
|
spring.jpa.hibernate.ddl-auto=validate
|
|
|
|
|
spring.jpa.show-sql=false
|
|
|
|
|
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect
|
|
|
|
|
|
|
|
|
|
# Flyway 配置
|
|
|
|
|
spring.flyway.enabled=true
|
|
|
|
|
spring.flyway.locations=classpath:db/migration
|
|
|
|
|
spring.flyway.baseline-on-migrate=true
|
|
|
|
|
|
|
|
|
|
# 服务器配置
|
|
|
|
|
server.port=${SERVER_PORT:8000}
|
|
|
|
|
|
2025-12-03 02:48:02 +08:00
|
|
|
# Spring Profile 配置
|
|
|
|
|
# 默认使用 dev 环境,可通过 --spring.profiles.active=prod 切换
|
|
|
|
|
spring.profiles.active=${SPRING_PROFILES_ACTIVE:dev}
|
|
|
|
|
|
2026-01-07 11:26:03 +08:00
|
|
|
# 日志配置(支持通过环境变量配置)
|
2026-01-08 11:56:52 +08:00
|
|
|
logging.level.root=${LOG_LEVEL_ROOT:WARN}
|
|
|
|
|
logging.level.com.wrbug.polymarketbot=${LOG_LEVEL_APP:INFO}
|
2025-11-21 04:32:08 +08:00
|
|
|
logging.pattern.console=%d{yyyy-MM-dd HH:mm:ss} - %msg%n
|
|
|
|
|
|
|
|
|
|
# Polymarket API 配置
|
2026-01-13 16:07:19 +08:00
|
|
|
# 注意:Polymarket API URL 现在使用代码常量(PolymarketConstants),不再从配置文件读取
|
|
|
|
|
# 如需修改,请修改 com.wrbug.polymarketbot.constants.PolymarketConstants 类
|
2025-11-21 04:32:08 +08:00
|
|
|
|
2025-12-06 23:10:26 +08:00
|
|
|
# Builder Relayer 配置(用于 Gasless 交易)
|
|
|
|
|
# 从 polymarket.com/settings?tab=builder 获取 Builder API 凭证
|
2025-12-07 02:06:19 +08:00
|
|
|
# Builder API Key、Secret、Passphrase 现在通过系统设置页面配置,存储在数据库中
|
2025-12-06 23:10:26 +08:00
|
|
|
# 如果未配置,将使用手动发送交易的方式(需要用户支付 gas)
|
2026-01-13 16:07:19 +08:00
|
|
|
# 注意:Builder Relayer URL 现在使用代码常量(PolymarketConstants.BUILDER_RELAYER_URL),不再从配置文件读取
|
2025-12-06 23:10:26 +08:00
|
|
|
|
2025-12-02 03:34:43 +08:00
|
|
|
# 跟单轮询配置
|
|
|
|
|
# 轮询间隔(毫秒),默认2秒
|
|
|
|
|
copy.trading.polling.interval=${COPY_TRADING_POLLING_INTERVAL:2000}
|
|
|
|
|
# 是否启用轮询,默认true
|
|
|
|
|
copy.trading.polling.enabled=${COPY_TRADING_POLLING_ENABLED:true}
|
|
|
|
|
|
2026-01-09 10:41:15 +08:00
|
|
|
# 跟单监听配置
|
|
|
|
|
# 链上 WebSocket 重连延迟(毫秒),默认3秒
|
|
|
|
|
copy.trading.onchain.ws.reconnect.delay=${COPY_TRADING_ONCHAIN_WS_RECONNECT_DELAY:3000}
|
|
|
|
|
|
2025-11-27 02:56:24 +08:00
|
|
|
# WebSocket 配置
|
|
|
|
|
websocket.heartbeat-timeout=${WEBSOCKET_HEARTBEAT_TIMEOUT:60000}
|
|
|
|
|
|
2025-12-03 00:24:46 +08:00
|
|
|
# JWT配置
|
|
|
|
|
jwt.secret=${JWT_SECRET:your-secret-key-change-in-production}
|
|
|
|
|
# 7天(毫秒)
|
|
|
|
|
jwt.expiration=604800000
|
|
|
|
|
# 1天(毫秒),超过此时间但未过期时自动刷新
|
|
|
|
|
jwt.refresh-threshold=86400000
|
|
|
|
|
|
2025-12-03 06:02:26 +08:00
|
|
|
# 加密配置(用于加密私钥等敏感数据)
|
|
|
|
|
# 如果不设置,默认使用 jwt.secret
|
|
|
|
|
encryption.key=${ENCRYPTION_KEY:${jwt.secret}}
|
|
|
|
|
|
2025-12-03 00:24:46 +08:00
|
|
|
# 密码重置配置
|
|
|
|
|
admin.reset-password.key=${ADMIN_RESET_PASSWORD_KEY:change-me-in-production}
|
|
|
|
|
|
|
|
|
|
# 频率限制配置
|
|
|
|
|
# 1分钟内最多3次
|
|
|
|
|
rate-limit.reset-password.max-attempts=3
|
|
|
|
|
# 时间窗口(秒)
|
|
|
|
|
rate-limit.reset-password.window-seconds=60
|
|
|
|
|
|
2025-12-07 16:15:59 +08:00
|
|
|
# GitHub 配置(用于公告功能)
|
|
|
|
|
github.repo.owner=WrBug
|
|
|
|
|
github.repo.name=PolyHermes
|
|
|
|
|
github.announcement.issue.number=1
|
|
|
|
|
|