diff --git a/.github/workflows/build-nezha.yml b/.github/workflows/build-nezha.yml index b8235ce..4b42a39 100644 --- a/.github/workflows/build-nezha.yml +++ b/.github/workflows/build-nezha.yml @@ -1,6 +1,6 @@ # -# Copyright (c) 2019-2020 P3TERX # Copyright (c) 2021-2022 zPonds +# Copyright (c) 2019-2020 P3TERX # # This is free software, licensed under the GPL License. # See /LICENSE for more information. diff --git a/.github/workflows/update-checker.yml b/.github/workflows/update-checker.yml new file mode 100644 index 0000000..bd28725 --- /dev/null +++ b/.github/workflows/update-checker.yml @@ -0,0 +1,56 @@ +# +# Copyright (c) 2021-2022 zPonds +# Copyright (c) 2019-2020 P3TERX +# +# This is free software, licensed under the MIT License. +# See /LICENSE for more information. +# +# https://github.com/Erope/openwrt_nezha/ +# Description: Build Nezha using GitHub Actions +# + +name: Update Checker + +env: + REPO_URL: https://github.com/naiba/nezha + +on: + workflow_dispatch: + schedule: + - cron: 10 20 * * * + +jobs: + check: + runs-on: ubuntu-latest + + steps: + + - name: Get Version + id: getVer + run: | + echo "::set-output name=Version::$(curl -m 10 -sL "https://api.github.com/repos/naiba/nezha/releases/latest" | grep "tag_name" | head -n 1 | awk -F ":" '{print $2}' | sed 's/\"//g;s/,//g;s/ //g')" + + - name: Compare Version + id: cacheVer + uses: actions/cache@v2 + with: + path: .savever + key: HEAD-${{ steps.getHash.outputs.Version }} + + - name: Save New Version + if: steps.cacheHash.outputs.cache-hit != 'true' + run: | + echo ${{ steps.getHash.outputs.Version }} | tee .savever + + - name: Trigger build + if: steps.cacheHash.outputs.cache-hit != 'true' + uses: peter-evans/repository-dispatch@v1 + with: + token: ${{ secrets.ACTIONS_TRIGGER_PAT }} + event-type: Source Code Update + + - name: Delete workflow runs + uses: GitRML/delete-workflow-runs@main + with: + retain_days: 1 + keep_minimum_runs: 1 \ No newline at end of file diff --git a/README.md b/README.md index 4d19609..a28d35b 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,60 @@ # openwrt_nezha + 哪吒监控 For OpenWRT -*暂时仅支持lua版本* + +**暂时仅支持lua版本** + + + +## 简介 + +用于在旧版OpenWRT及LEDE中快捷添加Nezha客户端的项目,解决OpenWRT需要手动添加服务的问题。 + + + +## 用法 + +### 编译 + +将 `src-git nezha https://github.com/Erope/openwrt_nezha` 添加至 `feeds.conf.default` 后执行 + +./scripts/feeds update -a && ./scripts/feeds install -a + +找到luci-app-nezha 选中后编译即可 + + + +## 安装IPK包 + +从Release中下载适合的包后自行安装(仅支持X64 X86和ARM64) + + + +## 致谢 + +部分代码来自P3TERX 和 KFERMercer + +源项目为: + +非常感谢! + + + +## Q/A + +1. Q: 我的架构并非X64 X86和ARM64 可以安装吗? + + A: 可以,请自行编译,但需要注意如果性能较弱或者内存过少,启动Nezha可能会严重消耗性能。 + +2. Q: 我想将其部署在工作压力较大的OpenWRT上,有什么需要注意的吗? + + A: 需要注意Nezha默认会监控连接数,在连接数较多的情况下可能会影响性能。 + +3. Q: Agent会自动更新吗? + + A: 会自动更新,因此未扩容的硬路由需要注意剩余空间是否足够。 + +4. Q: 我想更新Agent需要做什么吗? + + A: 一般情况下Agent会自动更新,但本项目的版本号不会自动更新,虽然安装包会跟随Nezha源项目而更新。如若Agent有特殊情况长期未能正常更新,可以考虑删除包后重新安装。 +