mirror of
https://github.com/snowykami/server-status-client.git
synced 2024-11-26 00:55:19 +08:00
92 lines
2.2 KiB
Markdown
92 lines
2.2 KiB
Markdown
<div align="center">
|
||
|
||
# server-status-client
|
||
|
||
_✨ 服务器状态 - 客户端 ✨_
|
||
|
||
|
||
<a href="./LICENSE">
|
||
<img src="https://img.shields.io/github/license/snowykami/server-status-client.svg" alt="license">
|
||
</a>
|
||
<a href="https://pypi.python.org/pypi/server-status">
|
||
<img src="https://img.shields.io/pypi/v/server-status.svg" alt="pypi">
|
||
</a>
|
||
<img src="https://img.shields.io/badge/python-3.10+-blue.svg" alt="python">
|
||
|
||
</div>
|
||
|
||
## 📖 介绍
|
||
|
||
服务器状态的客户端命令行工具
|
||
|
||
- 跨平台支持
|
||
- 自动上报服务器状态
|
||
- 支持自定义标签、地域、链接等信息
|
||
|
||
## 💿 安装
|
||
- 先决条件:`curl` `python3` `pip` `venv` `git`
|
||
|
||
- Linux 可使用脚本安装,带自动部署和自启动
|
||
|
||
```shell
|
||
sudo bash -c "$(curl -sSL https://raw.githubusercontent.com/snowykami/server-status-client/refs/heads/main/deploy.sh)"
|
||
```
|
||
如果位于中国大陆无法访问GitHub,可使用中国版脚本
|
||
```shell
|
||
sudo bash -c "$(curl -sSL https://git.liteyuki.icu/snowykami/server-status-client/raw/branch/main/deploy-cn.sh)"
|
||
```
|
||
|
||
- 或手动部署
|
||
|
||
```shell
|
||
# 克隆仓库
|
||
git clone https://github.com/snowykami/server-status-client
|
||
cd server-status-client
|
||
|
||
# 配置环境
|
||
python3 -m venv venv
|
||
source venv/bin/activate
|
||
# 安装依赖
|
||
pip install pdm
|
||
pdm install
|
||
|
||
# 如需自启动请自行添加到系统服务
|
||
```
|
||
|
||
## 🎉 使用
|
||
|
||
### 命令
|
||
|
||
- `python main.py <server> <token> <id> run` - 运行客户端
|
||
- `python.main.py <server> <token> <id> rm` - 从服务端移除主机
|
||
|
||
#### 可选项
|
||
|
||
- `-n|--name` - 设置主机名称
|
||
- `--labels` - 设置主机标签
|
||
- `--interval` - 设置上报间隔
|
||
- `--location` - 设置主机地域
|
||
- `--link` - 设置前端点击跳转链接
|
||
|
||
#### 示例
|
||
|
||
```shell
|
||
python main.py https://status.liteyuki.icu 114514 myhost run -n "MyHost" --labels "标签1,标签2" --interval 5 --location "Chongqing" --link "https://example.com"
|
||
```
|
||
|
||
## 📝 其他
|
||
|
||
### 开机启动
|
||
|
||
- 安装脚本已自动添加到系统服务
|
||
|
||
### 更新
|
||
|
||
```shell
|
||
git pull
|
||
sudo systemctl restart server-status-client
|
||
```
|
||
|
||
### 服务端
|
||
|
||
请在中心服务器上部署 [server-status-server](https://github.com/snowykami/server-status-server) |