# ServerAgent **Repository Path**: ten/ServerAgent ## Basic Information - **Project Name**: ServerAgent - **Description**: 呵呵呵呵呵呵额呵呵呵呵呵 - **Primary Language**: Go - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-09-14 - **Last Updated**: 2026-07-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Nezha Agent Agent of Nezha Monitoring ## Build compatibility - Windows 7 uses the `windows/386` or `windows/amd64` release. These artifacts use the primary `go.mod` dependency set and a checksum-pinned [XTLS/go-win7](https://github.com/XTLS/go-win7) Go 1.26.5 toolchain. The legacy source overlay also covers systems without KB3125574. - Windows ARM64 uses the modern dependency set and targets supported Windows 10/11 systems. Windows 7 did not provide an ARM64 platform. - Linux, macOS, FreeBSD, and Windows ARM64 builds use the official Go 1.26.5 toolchain. - Official Go releases only support Windows 7 through Go 1.20. The Windows 7 artifacts therefore depend on the pinned third-party toolchain above; update its version and both archive checksums together. ## Self-update - The updater is implemented locally in `internal/selfupdate` and uses only the Go standard library plus the project's semantic-version package. - Stable releases are queried from GitHub or Cloudflare R2. The updater selects the exact `server-agent__.zip` asset and never installs an equal or older version. - Every archive must match the SHA-256 value published in the same release's `checksums.txt`. Missing checksums, oversized responses, invalid ZIP files, or unexpected executable names abort the update without replacing the current binary. - Unix systems stage and atomically rename the new executable. Windows moves the running executable aside, activates the new file, and removes the hidden old file on the next start. - Update checks are serialized in-process. If an R2 release lacks the current-platform asset, the agent falls back to the matching GitHub release. - `--disable-auto-update` disables startup and periodic checks. `--disable-force-update` ignores update tasks sent by the panel, and `--r2` selects R2 as the primary release source. `--r2-url` overrides its public base URL. ## Release synchronization - GitHub Releases are the binary source of truth. `.github/workflows/sync-release.yml` copies versioned archives and `checksums.txt` to Cloudflare R2, then publishes `index.json` last. - The workflow requires `R2_ACCESS_KEY_ID`, `R2_SECRET_ACCESS_KEY`, `R2_ACCOUNT_ID`, and `R2_BUCKET` secrets. Version directories are immutable and retained for rollback; the latest index is never cached. ## Localized dependencies - `pkg/service` is a project-local fork of `github.com/nezhahq/service` at revision `5f38afb105e9`, retained because the Agent needs customized Windows 7 and Darwin behavior. Its zlib license is preserved in `pkg/service/LICENSE`. - `internal/selfupdate` is the local updater implementation. It replaced the previous external self-update dependency and is covered by archive, checksum, downgrade, and replacement tests. ## Contributors naiba UUBulb Leon zhangnew :D Darc Z. xykt 卖女孩的小火柴 Chisato22