-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add Beszel Agent #6940
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
not-first
wants to merge
25
commits into
SynoCommunity:master
Choose a base branch
from
not-first:beszel-agent
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+168
−0
Open
Add Beszel Agent #6940
Changes from 22 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
ccb861a
create cross compile makefile
not-first 97c37fc
create basic spk structure
not-first b09f6aa
fix incorrect regex validation format
not-first e78d64d
update description
not-first 9bff3db
Merge branch 'SynoCommunity:master' into beszel-agent
not-first a026b52
add support for extra filesystems
not-first 7c64901
allow upgrades and create uifile to handle config value changing and …
not-first 666bcd3
improve text field width and add empty text for example content
not-first 8331851
utilise temp upgrade folder instead of upgrade uifile
not-first cddd72a
update to 0.18.0 and enable basic SMART monitoring
not-first c16ad09
integrate proper SMART device file storage
not-first 599c264
update to 0.18.1
not-first 23ff3be
update digests
not-first 3f5fd49
update initial version to 1.18.3
not-first 412ce47
remove uneeded hub patch
not-first 13fef49
remove windows only conditionals
not-first ecb6502
revert patch change
not-first 8d19810
Merge branch 'SynoCommunity:master' into beszel-agent
not-first 8b29315
update descriptions to mention SMART monitoring docs
not-first 4e5a382
remove debug log level export
not-first f4efa99
declare unsupported ARCHS
not-first 2cc771e
Merge branch 'SynoCommunity:master' into beszel-agent
not-first d811dfe
add newline to end of uifile, remove reduntant upgrade functions
not-first 29a6827
add SKIP_SYSTEMD env var
not-first 073cf21
R\revert "add SKIP_SYSTEMD env var"
not-first File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| PKG_NAME = beszel-agent | ||
| REAL_PKG_NAME = beszel | ||
| PKG_VERS = 0.18.3 | ||
| PKG_EXT = tar.gz | ||
| PKG_DIST_NAME = v$(PKG_VERS).$(PKG_EXT) | ||
| PKG_DIST_SITE = https://github.com/henrygd/beszel/archive/refs/tags | ||
| PKG_DIST_FILE = $(REAL_PKG_NAME)-$(PKG_VERS).$(PKG_EXT) | ||
|
|
||
| PKG_DIR = $(PKG_NAME)/$(REAL_PKG_NAME)-$(PKG_VERS) | ||
| EXTRACT_PATH = $(WORK_DIR)/$(PKG_NAME) | ||
|
|
||
| BUILD_DEPENDS = native/go | ||
|
|
||
| HOMEPAGE = https://beszel.dev/ | ||
| COMMENT = Simple, lightweight server monitoring agent. | ||
| LICENSE = MIT | ||
|
|
||
| UNSUPPORTED_ARCHS = $(PPC_ARCHS) | ||
|
|
||
| COMPILE_MAKE_OPTIONS = OS=$(GOOS) ARCH=$(GO_ARCH) build-agent | ||
| INSTALL_TARGET = install_beszel | ||
|
|
||
| include ../../mk/spksrc.cross-go.mk | ||
|
|
||
| .PHONY: install_beszel | ||
| install_beszel: | ||
| @install -d -m 755 $(STAGING_INSTALL_PREFIX)/bin | ||
| @install -m 755 $(WORK_DIR)/$(PKG_DIR)/build/beszel-agent $(STAGING_INSTALL_PREFIX)/bin/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| bin:bin/beszel-agent |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| beszel-0.18.3.tar.gz SHA1 78548d3555a4ff79b642509fde9fc3cc9eb280cf | ||
| beszel-0.18.3.tar.gz SHA256 a16680096326ae5e510d694fbc5b324a4144df898ecf9a5a5ee229f3291a1357 | ||
| beszel-0.18.3.tar.gz MD5 091f34021bc6def3480cb0530757f078 |
9 changes: 9 additions & 0 deletions
9
cross/beszel-agent/patches/001-disable-vcs-and-normalize-agent-binary.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| --- Makefile.orig | ||
| +++ Makefile | ||
| @@ -54,7 +54,7 @@ | ||
|
|
||
| # Update build-agent to include conditional .NET build | ||
| build-agent: tidy build-dotnet-conditional fetch-smartctl-conditional | ||
| - GOOS=$(OS) GOARCH=$(ARCH) go build -o ./build/beszel-agent_$(OS)_$(ARCH)$(EXE_EXT) -ldflags "-w -s" ./internal/cmd/agent | ||
| + GOOS=$(OS) GOARCH=$(ARCH) go build -buildvcs=false -o ./build/beszel-agent -ldflags "-w -s" ./internal/cmd/agent | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| SPK_NAME = beszel-agent | ||
| SPK_VERS = 0.18.3 | ||
| SPK_REV = 1 | ||
| SPK_ICON = src/beszel.png | ||
|
|
||
| DEPENDS = cross/beszel-agent | ||
|
|
||
| MAINTAINER = not-first | ||
| DESCRIPTION = Lightweight server monitoring with historical data, docker stats, and alerts. This package provides only the agent, and requires Beszel Hub to be running elsewhere. See Beszel documentation for information on setting up SMART monitoring. | ||
|
|
||
| DISPLAY_NAME = Beszel Agent | ||
| CHANGELOG = "Initial package release for Beszel 0.18.3" | ||
|
|
||
| HOMEPAGE = https://beszel.dev/ | ||
| LICENSE = MIT | ||
|
|
||
| STARTABLE = yes | ||
| SERVICE_SETUP = src/service-setup.sh | ||
| SERVICE_PORT = 45876 | ||
| NO_SERVICE_SHORTCUT = y | ||
|
|
||
| WIZARDS_DIR = src/wizard/ | ||
|
|
||
| include ../../mk/spksrc.spk.mk |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| export PATH="/usr/local/bin:$PATH" | ||
|
|
||
| KEY_FILE="${SYNOPKG_PKGVAR}/key.pub" | ||
| EXTRA_FS_FILE="${SYNOPKG_PKGVAR}/extra_fs.conf" | ||
| SMART_DEVICES_FILE="${SYNOPKG_PKGVAR}/smart_devices.conf" | ||
|
|
||
| # Read the public key from the saved file | ||
| if [ -f "${KEY_FILE}" ]; then | ||
| BESZEL_PUBLIC_KEY=$(cat "${KEY_FILE}") | ||
| export KEY="${BESZEL_PUBLIC_KEY}" | ||
| fi | ||
|
|
||
| # Read the extra filesystems from the saved file | ||
| if [ -f "${EXTRA_FS_FILE}" ]; then | ||
| EXTRA_FS=$(cat "${EXTRA_FS_FILE}") | ||
| export EXTRA_FILESYSTEMS="${EXTRA_FS}" | ||
| fi | ||
|
|
||
| # Read the SMART devices from the saved file | ||
| if [ -f "${SMART_DEVICES_FILE}" ]; then | ||
| SMART_DEVS=$(cat "${SMART_DEVICES_FILE}") | ||
| export SMART_DEVICES="${SMART_DEVS}" | ||
| fi | ||
|
|
||
| BESZEL_AGENT="${SYNOPKG_PKGDEST}/bin/beszel-agent" | ||
| SERVICE_COMMAND="${BESZEL_AGENT}" | ||
|
|
||
| SVC_BACKGROUND=y | ||
| SVC_WRITE_PID=y | ||
|
|
||
| service_postinst () | ||
| { | ||
| # Save the public key only if provided | ||
| if [ -n "${wizard_pub_key}" ]; then | ||
| echo "${wizard_pub_key}" > "${KEY_FILE}" | ||
| fi | ||
|
|
||
| # Save the extra filesystems only if provided | ||
| if [ -n "${wizard_extra_fs}" ]; then | ||
| echo "${wizard_extra_fs}" > "${EXTRA_FS_FILE}" | ||
| fi | ||
|
|
||
| # Save the SMART devices only if provided | ||
| if [ -n "${wizard_smart_devices}" ]; then | ||
| echo "${wizard_smart_devices}" > "${SMART_DEVICES_FILE}" | ||
| fi | ||
| } | ||
|
|
||
| service_preupgrade () | ||
| { | ||
| # Backup configuration files before upgrade | ||
| if [ -f "${KEY_FILE}" ]; then | ||
| cp "${KEY_FILE}" "${SYNOPKG_TEMP_UPGRADE_FOLDER}/" | ||
| fi | ||
| if [ -f "${EXTRA_FS_FILE}" ]; then | ||
| cp "${EXTRA_FS_FILE}" "${SYNOPKG_TEMP_UPGRADE_FOLDER}/" | ||
| fi | ||
| if [ -f "${SMART_DEVICES_FILE}" ]; then | ||
| cp "${SMART_DEVICES_FILE}" "${SYNOPKG_TEMP_UPGRADE_FOLDER}/" | ||
| fi | ||
| } | ||
|
|
||
| service_postupgrade () | ||
| { | ||
| # Restore configuration files after upgrade | ||
| if [ -f "${SYNOPKG_TEMP_UPGRADE_FOLDER}/key.pub" ]; then | ||
| cp "${SYNOPKG_TEMP_UPGRADE_FOLDER}/key.pub" "${KEY_FILE}" | ||
| fi | ||
| if [ -f "${SYNOPKG_TEMP_UPGRADE_FOLDER}/extra_fs.conf" ]; then | ||
| cp "${SYNOPKG_TEMP_UPGRADE_FOLDER}/extra_fs.conf" "${EXTRA_FS_FILE}" | ||
| fi | ||
| if [ -f "${SYNOPKG_TEMP_UPGRADE_FOLDER}/smart_devices.conf" ]; then | ||
| cp "${SYNOPKG_TEMP_UPGRADE_FOLDER}/smart_devices.conf" "${SMART_DEVICES_FILE}" | ||
| fi | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| [ | ||
| { | ||
| "step_title": "Beszel Agent Configuration", | ||
| "items": [ | ||
| { | ||
| "type": "textfield", | ||
| "desc": "Provide the SSH public key of the Beszel Hub you want to add this system to.", | ||
| "subitems": [ | ||
| { | ||
| "key": "wizard_pub_key", | ||
| "desc": "Public Key", | ||
| "defaultValue": "", | ||
| "emptyText": "ssh-ed25519 ....", | ||
| "width": "400", | ||
| "validator": { | ||
| "allowBlank": false, | ||
| "regex": { | ||
| "expr": "/^(ssh-(rsa|ed25519)|ecdsa-sha2-nistp(256|384|521)) [A-Za-z0-9+/]+={0,3}( .+)?$/", | ||
| "errorText": "Please enter a valid SSH public key." | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "type": "textfield", | ||
| "desc": "Enter additional filesystems to monitor.", | ||
| "subitems": [ | ||
| { | ||
| "key": "wizard_extra_fs", | ||
| "desc": "Extra Filesystems", | ||
| "emptyText": "/volume1,/volumeUSB1/usbshare", | ||
| "width": "400", | ||
| "defaultValue": "" | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "type": "textfield", | ||
| "desc": "Configure SMART monitoring devices. List devices with :sat suffix for proper detection. Refer to Beszel documentation for details.", | ||
| "subitems": [ | ||
| { | ||
| "key": "wizard_smart_devices", | ||
| "desc": "SMART Devices", | ||
| "emptyText": "/dev/sda:sat,/dev/sdb:sat", | ||
| "width": "400", | ||
| "defaultValue": "" | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "desc": "The Beszel agent listens on port 45876 by default. Make sure this port is accessible from your Beszel Hub." | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
not-first marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.