Files
PolyHermes/backend/src/main/resources/application.properties
T

91 lines
3.4 KiB
Properties
Raw Normal View History

2025-11-21 04:32:08 +08:00
# 应用配置
spring.application.name=polyhermes-backend
2025-11-21 04:32:08 +08:00
2025-12-03 02:48:02 +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
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
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
polymarket.gamma.base-url=https://gamma-api.polymarket.com
2025-11-21 04:32:08 +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
polygon.rpc.url=${POLYGON_RPC_URL:https://polygon-rpc.com}
2025-11-21 04:32:08 +08:00
# Builder Relayer 配置(用于 Gasless 交易)
# 从 polymarket.com/settings?tab=builder 获取 Builder API 凭证
# 如果未配置,将使用手动发送交易的方式(需要用户支付 gas)
polymarket.builder.relayer-url=${POLYMARKET_BUILDER_RELAYER_URL:https://relayer-v2.polymarket.com/}
polymarket.builder.api-key=${POLYMARKET_BUILDER_API_KEY:}
polymarket.builder.secret=${POLYMARKET_BUILDER_SECRET:}
polymarket.builder.passphrase=${POLYMARKET_BUILDER_PASSPHRASE:}
# 仓位推送配置
# 轮询间隔(毫秒),默认3秒
position.push.polling-interval=${POSITION_PUSH_POLLING_INTERVAL:3000}
# 心跳超时时间(毫秒),默认60秒,超过此时间未收到心跳则清理连接
position.push.heartbeat-timeout=${POSITION_PUSH_HEARTBEAT_TIMEOUT:60000}
# 跟单轮询配置
# 轮询间隔(毫秒),默认2秒
copy.trading.polling.interval=${COPY_TRADING_POLLING_INTERVAL:2000}
# 是否启用轮询,默认true
copy.trading.polling.enabled=${COPY_TRADING_POLLING_ENABLED:true}
# WebSocket 配置
websocket.heartbeat-timeout=${WEBSOCKET_HEARTBEAT_TIMEOUT:60000}
# 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}}
# 密码重置配置
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