服务器配置
EasyShell 服务器通过 application.yml(或 application.properties)和环境变量进行配置。适用 Spring Boot 属性绑定规则 — 环境变量使用大写加下划线(例如 EASYSHELL_SERVER_PORT 对应 easyshell.server.port)。
server: port: 18080
spring: application: name: easyshell-serverspring: datasource: url: jdbc:mysql://localhost:3306/easyshell?useUnicode=true&characterEncoding=utf8mb4&serverTimezone=UTC username: easyshell password: your_password driver-class-name: com.mysql.cj.jdbc.Driver jpa: hibernate: ddl-auto: update show-sql: false properties: hibernate: dialect: org.hibernate.dialect.MySQLDialect format_sql: trueexport SPRING_DATASOURCE_URL="jdbc:mysql://localhost:3306/easyshell"export SPRING_DATASOURCE_USERNAME="easyshell"export SPRING_DATASOURCE_PASSWORD="your_password"Redis 配置
Section titled “Redis 配置”spring: data: redis: host: localhost port: 6379 password: "" database: 0 timeout: 5000Redis 用于:
- 会话管理
- 缓存层
- WebSocket 消息代理(多服务器实例运行时)
Agent 通信
Section titled “Agent 通信”easyshell: agent: heartbeat-interval: 30 # 秒 heartbeat-timeout-multiplier: 3 # 连续 3 次未收到心跳则标记为离线 metrics-interval: 60 # 秒 token-expiry: 365 # 天easyshell: storage: type: local # local | s3 local: path: /data/easyshell/uploads s3: bucket: easyshell-site region: us-east-1 access-key: ${AWS_ACCESS_KEY_ID} secret-key: ${AWS_SECRET_ACCESS_KEY}easyshell: execution: default-timeout: 300 # 秒(5 分钟) max-timeout: 3600 # 秒(1 小时) max-concurrent-per-host: 5 output-buffer-size: 1048576 # 每次执行 1MB history-retention-days: 90easyshell: security: jwt: secret: ${JWT_SECRET:change-me-in-production} expiration: 86400 # 秒(24 小时) cors: allowed-origins: - http://localhost:5173 - https://easyshell.ai rate-limit: enabled: true requests-per-minute: 60logging: level: root: INFO dev.easyshell: DEBUG org.hibernate.SQL: WARN file: name: /var/log/easyshell/server.log max-size: 100MB max-history: 30所有配置属性
Section titled “所有配置属性”| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
server.port | number | 18080 | HTTP 服务器端口 |
spring.datasource.url | string | — | JDBC 连接 URL |
spring.data.redis.host | string | localhost | Redis 主机 |
spring.data.redis.port | number | 6379 | Redis 端口 |
easyshell.agent.heartbeat-interval | number | 30 | Agent 心跳间隔(秒) |
easyshell.agent.metrics-interval | number | 60 | 指标上报间隔(秒) |
easyshell.execution.default-timeout | number | 300 | 默认脚本超时时间(秒) |
easyshell.execution.max-concurrent-per-host | number | 5 | 每台主机最大并发脚本数 |
easyshell.security.jwt.expiration | number | 86400 | JWT 令牌过期时间(秒) |
easyshell.storage.type | string | local | 存储后端:local 或 s3 |