feat: 允许从环境变量中读取配置

This commit is contained in:
2023-05-31 06:51:52 +08:00
parent f9504a7163
commit 503ba16c6e
3 changed files with 18 additions and 13 deletions

View File

@@ -6,15 +6,17 @@
# 环境变量
除了从 `config.yml` 中配置服务器信息以外,本插件还支持从环境变量中读取
为了适配 pterodactyl 面板,本插件除了从 `config.yml` 中配置服务器信息以外,还支持从环境变量中读取
| 环境变量名称 | 描述 | 对应 config 值 |
|:-----------------------|:------------------|:------------------------------|
| BALL_SERVER_HOST | 服务器唯一识别码,最长 32 字符 | ball-server.host |
| BALL_SERVER_PORT | 服务器唯一识别码,最长 32 字符 | ball-server.port |
| BALL_EVENT_LOOP_THREAD | 服务器唯一识别码,最长 32 字符 | ball-server.event-loop-thread |
| BALL_SERVER_INFO_ID | 服务器唯一识别码,最长 32 字符 | server-info.id |
| BALL_SERVER_INFO_NAME | 服务端名称,用于展示给玩家看 | server-info.name |
| 环境变量名称 | 描述 | 对应 config 值 |
|:-----------------------|:-------------------|:------------------------------|
| BALL_SERVER_HOST | 仓鼠球服务器地址 | ball-server.host |
| BALL_SERVER_PORT | 仓鼠球服务器端口 | ball-server.port |
| BALL_EVENT_LOOP_THREAD | 处理器线程数 | ball-server.event-loop-thread |
| SERVER_IP | 服务器 IP | server-info.host |
| SERVER_PORT | 服务器端口 | server-info.port |
| BALL_SERVER_INFO_ID | 本服务器唯一识别码,最长 32 字符 | server-info.id |
| BALL_SERVER_INFO_NAME | 本服务端名称,用于展示给玩家看 | server-info.name |
# 添加依赖