跳转到内容

服务器配置

EasyShell 服务器通过 application.yml(或 application.properties)和环境变量进行配置。适用 Spring Boot 属性绑定规则 — 环境变量使用大写加下划线(例如 EASYSHELL_SERVER_PORT 对应 easyshell.server.port)。

application.yml
server:
port: 18080
spring:
application:
name: easyshell-server
application.yml
spring:
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: true
application.yml
spring:
data:
redis:
host: localhost
port: 6379
password: ""
database: 0
timeout: 5000

Redis 用于:

  • 会话管理
  • 缓存层
  • WebSocket 消息代理(多服务器实例运行时)
application.yml
easyshell:
agent:
heartbeat-interval: 30 # 秒
heartbeat-timeout-multiplier: 3 # 连续 3 次未收到心跳则标记为离线
metrics-interval: 60 # 秒
token-expiry: 365 # 天
application.yml
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}
application.yml
easyshell:
execution:
default-timeout: 300 # 秒(5 分钟)
max-timeout: 3600 # 秒(1 小时)
max-concurrent-per-host: 5
output-buffer-size: 1048576 # 每次执行 1MB
history-retention-days: 90
application.yml
easyshell:
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: 60
application.yml
logging:
level:
root: INFO
dev.easyshell: DEBUG
org.hibernate.SQL: WARN
file:
name: /var/log/easyshell/server.log
max-size: 100MB
max-history: 30
属性类型默认值说明
server.portnumber18080HTTP 服务器端口
spring.datasource.urlstringJDBC 连接 URL
spring.data.redis.hoststringlocalhostRedis 主机
spring.data.redis.portnumber6379Redis 端口
easyshell.agent.heartbeat-intervalnumber30Agent 心跳间隔(秒)
easyshell.agent.metrics-intervalnumber60指标上报间隔(秒)
easyshell.execution.default-timeoutnumber300默认脚本超时时间(秒)
easyshell.execution.max-concurrent-per-hostnumber5每台主机最大并发脚本数
easyshell.security.jwt.expirationnumber86400JWT 令牌过期时间(秒)
easyshell.storage.typestringlocal存储后端:locals3