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}
|
|
|
|
|
|
2025-11-21 04:32:08 +08:00
|
|
|
# 日志配置
|
|
|
|
|
logging.level.root=INFO
|
2025-12-03 04:01:45 +08:00
|
|
|
logging.level.com.wrbug.polyhermes=DEBUG
|
2025-11-21 04:32:08 +08:00
|
|
|
logging.pattern.console=%d{yyyy-MM-dd HH:mm:ss} - %msg%n
|
|
|
|
|
|
|
|
|
|
# Polymarket API 配置
|
|
|
|
|
polymarket.clob.base-url=https://clob.polymarket.com
|
2025-11-27 14:51:46 +08:00
|
|
|
polymarket.rtds.ws-url=wss://ws-subscriptions-clob.polymarket.com
|
2025-11-21 04:32:08 +08:00
|
|
|
polymarket.data-api.base-url=https://data-api.polymarket.com
|
2025-11-27 14:51:46 +08:00
|
|
|
polymarket.gamma.base-url=https://gamma-api.polymarket.com
|
2025-11-21 04:32:08 +08:00
|
|
|
|
2025-12-03 01:44:35 +08:00
|
|
|
# Polygon RPC 配置(用于查询链上余额)
|
|
|
|
|
# 可选:如果未配置,将无acc法查询 USDC 余额,但仍可通过 Subgraph API 查询持仓
|
2025-11-21 04:32:08 +08:00
|
|
|
# 示例:https://polygon-rpc.com 或 https://polygon-mainnet.infura.io/v3/YOUR_PROJECT_ID
|
2025-12-03 01:44:35 +08:00
|
|
|
polygon.rpc.url=${POLYGON_RPC_URL:https://polygon-rpc.com}
|
2025-11-21 04:32:08 +08:00
|
|
|
|
2025-11-27 02:56:24 +08:00
|
|
|
# 仓位推送配置
|
|
|
|
|
# 轮询间隔(毫秒),默认3秒
|
|
|
|
|
position.push.polling-interval=${POSITION_PUSH_POLLING_INTERVAL:3000}
|
|
|
|
|
# 心跳超时时间(毫秒),默认60秒,超过此时间未收到心跳则清理连接
|
|
|
|
|
position.push.heartbeat-timeout=${POSITION_PUSH_HEARTBEAT_TIMEOUT:60000}
|
|
|
|
|
|
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}
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
# 密码重置配置
|
|
|
|
|
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
|
|
|
|
|
|