Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
zdz committed Feb 16, 2024
1 parent 038ad03 commit bb3faeb
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 17 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ tmp
.prod
sync.sh
.server_status_sys_id
venv
venv
tls
24 changes: 14 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
- [2. 安装部署](#2-安装部署)
- [2.1 快速体验](#21-快速体验)
- [2.2 快速部署](#22-快速部署)
- [2.3 服务管理脚本部署](#23-服务管理脚本部署)
- [2.3 服务管理脚本](#23-服务管理脚本)
- [2.4 Railway 部署](#24-railway-部署)
- [2.5 Heroku 部署](#25-heroku-部署)
- [3. 服务端说明](#3-服务端说明)
Expand All @@ -59,6 +59,7 @@
- 多系统支持 `Linux``MacOS``Windows``Android``Raspberry Pi`
- 支持上下线和简单自定义规则告警 (`telegram``wechat``email``webhook`)
- 支持 `http` 协议上报,方便部署到各免费容器服务和配合 `cf` 等优化上报链路
- 支持 `cloudflare tunnels``mTLS` 部署
- 支持主机分组动态注册,简化配置
- 支持 `vnstat` 统计月流量,重启不丢流量数据
- 支持 `railway` 快速部署
Expand Down Expand Up @@ -143,25 +144,27 @@ ServerStatus-web 主题由 [@mjjrock](https://github.com/mjjrock) 修改提供
# for CentOS/Debian/Ubuntu x86_64
mkdir -p /opt/ServerStatus && cd /opt/ServerStatus
# apt install -y unzip / yum install -y unzip
wget --no-check-certificate -qO one-touch.sh 'https://raw.githubusercontent.com/zdz/ServerStatus-Rust/master/one-touch.sh'
wget --no-check-certificate -qO one-touch.sh 'https://raw.githubusercontent.com/zdz/ServerStatus-Rust/master/scripts/one-touch.sh'
bash -ex one-touch.sh
# 部署完毕,打开 http://127.0.0.1:8080/ 或 http://<你的IP>:8080/
# 自定义部署可参照 one-touch.sh 脚本
# 自定义部署可参照 scripts/one-touch.sh 脚本
```

### 2.2 快速部署

👉 [快速部署](https://doc.ssr.rs/rapid_deploy)

### 2.3 服务管理脚本部署
### 2.3 服务管理脚本

[@Colsro](https://github.com/Colsro) 提供
<details>
<summary>服务管理脚本说明</summary>

[@Yooona-Lim](https://github.com/Yooona-Lim) 更新
[@Colsro](https://github.com/Colsro) &
[@Yooona-Lim](https://github.com/Yooona-Lim) 贡献

```bash
# 下载脚本
wget --no-check-certificate -qO status.sh 'https://raw.githubusercontent.com/zdz/ServerStatus-Rust/master/status.sh'
wget --no-check-certificate -qO status.sh 'https://raw.githubusercontent.com/zdz/ServerStatus-Rust/master/scripts/status.sh'

# 安装 服务端
bash status.sh -i -s
Expand Down Expand Up @@ -210,6 +213,7 @@ help:
CN=true bash status.sh args
```

</details>

### 2.4 Railway 部署

Expand Down Expand Up @@ -297,7 +301,7 @@ custom_tpl = """

### 3.2 服务端运行
```bash
# systemd 方式, 参照 one-touch.sh 脚本 (推荐)
# systemd 方式, 参照 scripts/one-touch.sh 脚本 (推荐)

# 💪 手动方式
# help
Expand Down Expand Up @@ -343,7 +347,7 @@ docker-compose up -d
# alpine linux 需要安装相关命令 apk add procps iproute2 coreutils
# 如果 Rust 版客户端在你的系统无法使用,请切换到下面 4.2 Python 跨平台版本

# systemd 方式, 参照 one-touch.sh 脚本 (推荐)
# systemd 方式, 参照 scripts/one-touch.sh 脚本 (推荐)

# 💪 手动方式
# Rust 版本 Client
Expand Down Expand Up @@ -515,7 +519,7 @@ server {

```bash
# 按提示安装 rust 编译器
curl https://sh.rustup.rs -sSf | sh
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
yum install -y openssl-devel
git clone https://github.com/zdz/ServerStatus-Rust.git
cd ServerStatus-Rust
Expand Down
8 changes: 4 additions & 4 deletions client/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@ pub struct Args {
)]
ip_source: String,
#[arg(
long = "ipv4-address",
env = "SSR_IPV4_ADDRESS",
long = "ipv4-addr",
env = "SSR_IPV4_ADDR",
default_value = "ipv4.google.com:80",
help = "ipv4 check address"
)]
ipv4_address: String,
#[arg(
long = "ipv6-address",
env = "SSR_IPV6_ADDRESS",
long = "ipv6-addr",
env = "SSR_IPV6_ADDR",
default_value = "ipv6.google.com:80",
help = "ipv6 check address"
)]
Expand Down
3 changes: 3 additions & 0 deletions client/src/sys_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,10 @@ pub fn sample(args: &Args, stat: &mut StatRequest) {

// hdd KB -> KiB
let (mut hdd_total, mut hdd_avail) = (0_u64, 0_u64);

#[cfg(not(target_os = "windows"))]
let mut uniq_disk_set = HashSet::new();

let disks = Disks::new_with_refreshed_list();
for disk in &disks {
let di = DiskInfo {
Expand Down
4 changes: 2 additions & 2 deletions example.env
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ SSR_CM_ADDR=cm.tz.cloudcpp.com:80
SSR_CT_ADDR=ct.tz.cloudcpp.com:80
SSR_CU_ADDR=cu.tz.cloudcpp.com:80

SSR_IPV4_ADDRESS=ipv4.google.com:80
SSR_IPV6_ADDRESS=ipv6.google.com:80
SSR_IPV4_ADDR=ipv4.google.com:80
SSR_IPV6_ADDR=ipv6.google.com:80

# ip-api.com / ip.sb / ipapi.co / myip.la
SSR_IP_SOURCE=ip-api.com
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit bb3faeb

Please sign in to comment.