From 584e406af1df7f20ac54480323d3d340627fb22b Mon Sep 17 00:00:00 2001 From: naiba Date: Wed, 28 Apr 2021 23:21:54 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8=20=E5=A4=A7=E5=B9=85=E7=BC=A9?= =?UTF-8?q?=E5=87=8F=20agent=20=E4=BA=8C=E8=BF=9B=E5=88=B6=E4=BD=93?= =?UTF-8?q?=E7=A7=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/agent.yml | 4 ++++ .goreleaser.yml | 6 ++++++ README.md | 2 +- script/docker-compose.yaml | 2 +- script/install.sh | 4 ++-- 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/agent.yml b/.github/workflows/agent.yml index d738124..bf4524d 100644 --- a/.github/workflows/agent.yml +++ b/.github/workflows/agent.yml @@ -10,6 +10,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@master + - run: | + wget https://github.com/upx/upx/releases/download/v3.95/upx-3.95-amd64_linux.tar.xz + tar --strip-components=1 -xf upx-3.95-amd64_linux.tar.xz && mv upx /usr/bin/ + upx --version - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2 if: startsWith(github.ref, 'refs/tags/') diff --git a/.goreleaser.yml b/.goreleaser.yml index ed700e7..c0a13dd 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -3,6 +3,8 @@ before: - go mod tidy -v builds: - id: nezha-agent + ldflags: + - -s -w env: - CGO_ENABLED=0 goos: @@ -25,6 +27,10 @@ builds: goarch: arm64 main: ./cmd/agent binary: nezha-agent + hooks: + post: + # 为路由器、开发板缩小二进制体积 + - npx --best "{{.Path}}" checksum: name_template: "checksums.txt" snapshot: diff --git a/README.md b/README.md index 8800476..5823025 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@


-    +   

:trollface: 哪吒监控 一站式轻监控轻运维系统。支持系统状态、HTTP(SSL 证书变更、即将到期、到期)、TCP、Ping 监控报警,命令批量执行和计划任务。

diff --git a/script/docker-compose.yaml b/script/docker-compose.yaml index a7ec116..0f76d55 100644 --- a/script/docker-compose.yaml +++ b/script/docker-compose.yaml @@ -2,7 +2,7 @@ version: "3.3" services: dashboard: - image: image_url + image: nz_image_url restart: always volumes: - ./data:/dashboard/data diff --git a/script/install.sh b/script/install.sh index 65e45d4..37e1a1e 100755 --- a/script/install.sh +++ b/script/install.sh @@ -11,7 +11,7 @@ NZ_BASE_PATH="/opt/nezha" NZ_DASHBOARD_PATH="${NZ_BASE_PATH}/dashboard" NZ_AGENT_PATH="${NZ_BASE_PATH}/agent" NZ_AGENT_SERVICE="/etc/systemd/system/nezha-agent.service" -NZ_VERSION="v0.4.10" +NZ_VERSION="v0.5.0" red='\033[0;31m' green='\033[0;32m' @@ -266,7 +266,7 @@ modify_dashboard_config() { sed -i "s/nz_site_title/${nz_site_title}/" ${NZ_DASHBOARD_PATH}/data/config.yaml sed -i "s/nz_site_port/${nz_site_port}/" ${NZ_DASHBOARD_PATH}/docker-compose.yaml sed -i "s/nz_grpc_port/${nz_grpc_port}/" ${NZ_DASHBOARD_PATH}/docker-compose.yaml - sed -i "s/image_url/${Docker_IMG}/" ${NZ_DASHBOARD_PATH}/docker-compose.yaml + sed -i "s/nz_image_url/${Docker_IMG}/" ${NZ_DASHBOARD_PATH}/docker-compose.yaml echo -e "面板配置 ${green}修改成功,请稍等重启生效${plain}"