Skip to content

Commit

Permalink
feat: 为面板安装添加 checksum 验证
Browse files Browse the repository at this point in the history
  • Loading branch information
devhaozi committed Oct 23, 2023
1 parent a7de247 commit af21a63
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ unit_test:
extends: .go_cache
allow_failure: true
script:
- rm -rf /etc/apt/sources.list
- rm -rf /etc/apt/sources.list.d/*
- wget -O /etc/apt/sources.list https://mirrors.ustc.edu.cn/repogen/conf/debian-http-4-bookworm
- apt-get update
- apt-get install -y curl jq
- go test -v -coverprofile=coverage.txt -covermode=atomic ./...

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ CentOS Stream 可使用迁移脚本迁移至支持的系统: [CentOS 8/9 迁移
如果你决定继续,请以`root`用户登录服务器,执行以下命令安装面板:

```shell
bash <(curl -sSL https://jihulab.com/haozi-team/download/-/raw/main/panel/install_panel.sh)
HAOZI_DL_URL="https://jihulab.com/haozi-team/download/-/raw/main/panel"; curl -sSL -O ${HAOZI_DL_URL}/install_panel.sh && curl -sSL -O ${HAOZI_DL_URL}/install_panel.sh_checksums.txt && sha256sum -c install_panel.sh_checksums.txt && bash install_panel.sh || echo "Checksum 验证失败,文件可能被篡改,已终止操作"
```

## 卸载面板
Expand All @@ -62,7 +62,7 @@ bash <(curl -sSL https://jihulab.com/haozi-team/download/-/raw/main/panel/instal
如果你无法重装系统,请以`root`用户登录服务器,执行以下命令卸载面板:

```shell
bash <(curl -sSL https://jihulab.com/haozi-team/download/-/raw/main/panel/uninstall_panel.sh)
HAOZI_DL_URL="https://jihulab.com/haozi-team/download/-/raw/main/panel"; curl -sSL -O ${HAOZI_DL_URL}/uninstall_panel.sh && curl -sSL -O ${HAOZI_DL_URL}/uninstall_panel.sh_checksums.txt && sha256sum -c uninstall_panel.sh_checksums.txt && bash uninstall_panel.sh || echo "Checksum 验证失败,文件可能被篡改,已终止操作"
```

卸载面板前请务必备份好所有数据,提前卸载面板全部插件。卸载后数据将**无法恢复**
Expand Down
4 changes: 2 additions & 2 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Before installing the panel, you need to understand the basic knowledge of the L
If you decide to continue, please log in to the server as `root` user and execute the following command to install the panel:

```shell
bash <(curl -sSL https://jihulab.com/haozi-team/download/-/raw/main/panel/install_panel.sh)
HAOZI_DL_URL="https://jihulab.com/haozi-team/download/-/raw/main/panel"; curl -sSL -O ${HAOZI_DL_URL}/install_panel.sh && curl -sSL -O ${HAOZI_DL_URL}/install_panel.sh_checksums.txt && sha256sum -c install_panel.sh_checksums.txt && bash install_panel.sh || echo "Checksum Verification Failed, File May Have Been Tampered With, Operation Terminated"
```

## Uninstall Panel
Expand All @@ -58,7 +58,7 @@ Recommended to back up data and reinstall the system first, so that the system c
If you are unable to reinstall the system, log in to the server as the `root` user and execute the following command to uninstall the panel:

```shell
bash <(curl -sSL https://jihulab.com/haozi-team/download/-/raw/main/panel/uninstall_panel.sh)
HAOZI_DL_URL="https://jihulab.com/haozi-team/download/-/raw/main/panel"; curl -sSL -O ${HAOZI_DL_URL}/uninstall_panel.sh && curl -sSL -O ${HAOZI_DL_URL}/uninstall_panel.sh_checksums.txt && sha256sum -c uninstall_panel.sh_checksums.txt && bash uninstall_panel.sh || echo "Checksum Verification Failed, File May Have Been Tampered With, Operation Terminated"
```

Before uninstalling the panel, please be sure to back up all data and uninstall all panel plugins in advance. The data will **not be recoverable** after uninstallation!
Expand Down
2 changes: 2 additions & 0 deletions scripts/install_panel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,8 @@ EOF
echo -e $HR
panel init
panel getInfo
rm -f install_panel.sh
rm -f install_panel.sh_checksums.txt
}

clear
Expand Down
3 changes: 3 additions & 0 deletions scripts/uninstall_panel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,6 @@ echo -e "${LOGO}"
echo '耗子Linux面板卸载完成。'
echo '感谢您的使用,欢迎您再次使用耗子Linux面板。'
echo -e $HR

rm -f uninstall_panel.sh
rm -f uninstall_panel.sh_checksums.txt

0 comments on commit af21a63

Please sign in to comment.