tidy the file tree

This commit is contained in:
2026-06-08 12:09:53 +08:00
parent 8cd942be2d
commit 83acd3049b
13 changed files with 53 additions and 39 deletions
+1
View File
@@ -1,2 +1,3 @@
b43527c b43527c
60176fa 60176fa
8cd942b
+5 -5
View File
@@ -15,17 +15,17 @@ Minecraft 服务器守护进程
```bash ```bash
# 复制文件 # 复制文件
mkdir -p /opt/minecraft/sentinel mkdir -p /opt/minecraft/sentinel/src
cp main.rb method_executor.rb server_status_detector.rb systemd_notifier.rb config.rb updates.rb /opt/minecraft/sentinel/ cp src/main.rb src/method_executor.rb src/server_status_detector.rb src/systemd_notifier.rb src/config.rb src/updates.rb /opt/minecraft/sentinel/src/
# 安装 systemd 服务 # 安装 systemd 服务
cp minesentinel.service /etc/systemd/system/ cp src/minesentinel.service /etc/systemd/system/
systemctl daemon-reload systemctl daemon-reload
systemctl enable minesentinel systemctl enable minesentinel
systemctl start minesentinel systemctl start minesentinel
# 手动运行(调试用) # 手动运行(调试用)
cd /opt/minecraft/sentinel cd /opt/minecraft/sentinel/src
ruby main.rb ruby main.rb
``` ```
@@ -68,7 +68,7 @@ MineSentinel 通过 `Before=minecraft.service` 确保先于 MC 启动,避免 M
## 完整文档 ## 完整文档
参见 [DEPLOY.md](DEPLOY.md) 或 [官网](OfficialWebsite/index.html)。 参见 [DEPLOY.md](docs/DEPLOY.md) 或 [官网](static/index.html)。
## 许可证 ## 许可证
+13 -12
View File
@@ -20,12 +20,13 @@ MineSentinel 是一个 Minecraft 服务器守护进程,每 1.5 秒检测服务
``` ```
/opt/minecraft/sentinel/ # 推荐部署目录 /opt/minecraft/sentinel/ # 推荐部署目录
── main.rb # 主程序入口 —— 检测循环 + 冷却期 + 初始宽限期 ── src/ # 源码目录
├── method_executor.rb # 日志系统 + 重启逻辑 + 重试计数器 ├── main.rb # 主程序入口 —— 检测循环 + 冷却期 + 初始宽限期
├── server_status_detector.rb # TCP 端口检测模块 ├── method_executor.rb # 日志系统 + 重启逻辑 + 重试计数器
├── systemd_notifier.rb # systemd watchdog 心跳发送 ├── server_status_detector.rb # TCP 端口检测模块
├── config.rb # 可调参数配置 ├── systemd_notifier.rb # systemd watchdog 心跳发送
└── updates.rb # 更新检查模块 ├── config.rb # 可调参数配置
└── updates.rb # 更新检查模块
minesentinel.service # systemd 单元文件(项目源码中) minesentinel.service # systemd 单元文件(项目源码中)
``` ```
@@ -37,8 +38,8 @@ minesentinel.service # systemd 单元文件(项目源码中)
### 1. 创建目录并复制文件 ### 1. 创建目录并复制文件
```bash ```bash
mkdir -p /opt/minecraft/sentinel mkdir -p /opt/minecraft/sentinel/src
cp main.rb method_executor.rb server_status_detector.rb systemd_notifier.rb config.rb updates.rb /opt/minecraft/sentinel/ cp src/main.rb src/method_executor.rb src/server_status_detector.rb src/systemd_notifier.rb src/config.rb src/updates.rb /opt/minecraft/sentinel/src/
``` ```
### 2. 确认 Minecraft systemd 服务存在 ### 2. 确认 Minecraft systemd 服务存在
@@ -52,7 +53,7 @@ systemctl status minecraft
### 3. 手动测试 ### 3. 手动测试
```bash ```bash
cd /opt/minecraft/sentinel cd /opt/minecraft/sentinel/src
ruby main.rb ruby main.rb
# 调试模式:LOG_LEVEL=debug ruby main.rb # 调试模式:LOG_LEVEL=debug ruby main.rb
``` ```
@@ -62,7 +63,7 @@ ruby main.rb
项目源码中已提供 `minesentinel.service`,直接复制: 项目源码中已提供 `minesentinel.service`,直接复制:
```bash ```bash
cp minesentinel.service /etc/systemd/system/ cp src/minesentinel.service /etc/systemd/system/
``` ```
单元文件内容(`minesentinel.service`): 单元文件内容(`minesentinel.service`):
@@ -76,8 +77,8 @@ Wants=minecraft.service
[Service] [Service]
Type=simple Type=simple
WorkingDirectory=/opt/minecraft/sentinel WorkingDirectory=/opt/minecraft/sentinel/src
ExecStart=/usr/bin/ruby /opt/minecraft/sentinel/main.rb ExecStart=/usr/bin/ruby /opt/minecraft/sentinel/src/main.rb
Restart=always Restart=always
RestartSec=10 RestartSec=10
StandardOutput=journal StandardOutput=journal
View File
View File
@@ -13,8 +13,8 @@ Wants=minecraft.service
[Service] [Service]
Type=simple Type=simple
WorkingDirectory=/opt/minecraft/sentinel WorkingDirectory=/opt/minecraft/sentinel/src
ExecStart=/usr/bin/ruby /opt/minecraft/sentinel/main.rb ExecStart=/usr/bin/ruby /opt/minecraft/sentinel/src/main.rb
Restart=always Restart=always
RestartSec=10 RestartSec=10
StandardOutput=journal StandardOutput=journal
+1 -1
View File
@@ -22,7 +22,7 @@ RELEASE_SERIAL_CODE = '60176fa'
# @type const CHANNEL: String # @type const CHANNEL: String
CHANNEL = 'master' CHANNEL = 'master'
# @type const VERSION_LIST_URL: String # @type const VERSION_LIST_URL: String
VERSION_LIST_URL = "https://raw.giteeusercontent.com/scu_team/minesentinel/#{CHANNEL}/APP_VERSIONS_LIST" VERSION_LIST_URL = "https://raw.giteeusercontent.com/SCU_team/mine-sentinel/#{CHANNEL}/APP_VERSIONS_LIST"
# @type const RECURSIVE_RETRY_DEPTH: Integer # @type const RECURSIVE_RETRY_DEPTH: Integer
RECURSIVE_RETRY_DEPTH = 3 RECURSIVE_RETRY_DEPTH = 3
@@ -3,7 +3,7 @@ name = "MineSentinel"
description = "Minecraft 服务器智能守护进程,TCP 端口检测 + 崩溃自动重启 + 防循环冷却期" description = "Minecraft 服务器智能守护进程,TCP 端口检测 + 崩溃自动重启 + 防循环冷却期"
repo_url = "https://gitee.com/snoware/minesentinel" repo_url = "https://gitee.com/snoware/minesentinel"
demo_url = "https://swe-iss.rth1.xyz/softwares/minesentinel" demo_url = "https://swe-iss.rth1.xyz/softwares/minesentinel"
doc_url = "https://gitee.com/snoware/minesentinel/blob/master/DEPLOY.md" doc_url = "https://gitee.com/snoware/minesentinel/blob/master/docs/DEPLOY.md"
tags = ["Ruby", "Minecraft", "Server", "Monitoring", "Daemon", "SNOWARE"] tags = ["Ruby", "Minecraft", "Server", "Monitoring", "Daemon", "SNOWARE"]
[[projects]] [[projects]]
File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB