Skip to content

beszel: 0.12.3 -> 0.12.9#445185

Closed
non-bin wants to merge 1 commit intoNixOS:masterfrom
non-bin:updateBeszelPkg
Closed

beszel: 0.12.3 -> 0.12.9#445185
non-bin wants to merge 1 commit intoNixOS:masterfrom
non-bin:updateBeszelPkg

Conversation

@non-bin
Copy link
Contributor

@non-bin non-bin commented Sep 22, 2025

I added myself as a maintainer to the new module I made in #444936, but it's not merged, so I didn't add myself to this yet. I will in the next update after the module is merged.

I have a patch to reduce the required go version because 1.25.1 isn't in master yet #441125

Changes

https://github.com/henrygd/beszel/releases/tag/v0.12.4

Add battery charge monitoring.
[Chore] Improve auto update mechanism by @svenvg93 in henrygd/beszel#1009
Add fallback mirror to the update commands. (henrygd/beszel#1035)
Fix blank token field in insecure contexts.
Allow opening internal router links in new tab.
Add /api/beszel/user-alerts endpoint. Remove use of batch API for alerts in hub.
Update Go and JS dependencies.
New translations by @Radotornado, @AlexVanSteenhoven, @harupong, @dymek37, @NaNomicon, Tommaso Cavazza, Caio Garcia, and others.

https://github.com/henrygd/beszel/releases/tag/v0.12.5

Fixes a couple of FreeBSD-specific issues.

Downgrade gopsutil to v4.25.6 to fix panic on FreeBSD (#1083)
Exclude FreeBSD from battery charge monitoring to fix deadlock. (#1081)
Minor hub UI improvements.

https://github.com/henrygd/beszel/releases/tag/v0.12.6

Add maximum 1 minute memory usage.
Add status filtering to Systems Table by @svenvg93 in #927
Virtualize All Systems table to improve performance with hundreds of systems. (#1100)
Add missing os.Chmod step to Hub update by @svenvg93 in #1093
Fix system table links in Safari in #1092
Use older cuda image in henrygd/beszel-agent-nvidia for increased compatibility by @Impact123 in #1103
Fix alignment for metrics by @svenvg93 in #1109
Truncate long system names in web UI (#1104)
Fix update mirror and add --china-mirrors flag. (#1035)

https://github.com/henrygd/beszel/releases/tag/v0.12.7

Make LibreHardwareMonitor opt-in with LHM=true environment variable. (#1130)
Fix bug where token was not refreshed when adding a new system. (#1141)
Add USER_EMAIL and USER_PASSWORD environment variables to set the email and password of the initial user. (#1137)
Display system counts (active, paused, down) in All Systems 'view' options. (#1078)
Remember All Systems sort order during session.
[Feature] improved support for mips and mipsle architectures by @a-mnich in #1112
[Bug] Update install script to use crontab on Alpine by @svenvg93 in #1136
[Fix] fix GitHub workflow errors in forks by @a-mnich in #1113

https://github.com/henrygd/beszel/releases/tag/v0.12.8

Add per-interface network traffic charts. (#926)
Add cumulative network traffic charts. (#926)
Add setting for time format (12h / 24h). (#424)
Add experimental MFA one-time password (OTP) support (configured in PocketBase; reference OAuth docs).
Add TRUSTED_AUTH_HEADER environment variable for authentication forwarding. (#399)
Add AUTO_LOGIN environment variable for automatic login. (#399)
Add FreeBSD support for agent install script and update command.
Fix status alerts not being resolved when system comes up. (#1052)
Add openwrt restart procedure after updating the agent automatically by @sashablue in #1151
[FIX] OpenWRT auto update by @a-mnich in #1155
[Fix] zh-CN translation by @fankes in #1160
Fixing helm chart service/ingress by @twentybit in #1166

https://github.com/henrygd/beszel/releases/tag/v0.12.9

Fix divide by zero error introduced in 0.12.8 :) (#1175)

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 12.first-time contribution This PR is the author's first one; please be gentle! labels Sep 22, 2025
@nix-owners nix-owners bot requested a review from Bot-wxt1221 September 22, 2025 10:10
npmHash = "sha256-2zpJgkDXZoMWI6SkcfrhzozAITUR9ZUVtMbRtYKM13w=";
goHash = "sha256-8Sr7MYQnIfNx9hvfjCTYKQOUZIBxpGPbsR75jEB0mbk=";
in
buildGoModule rec {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rec should be slowly replaced with the finalAttrs syntax, which will make the let in block depricated.
I am also not sure if the update-script will work if the hashes are somewhere else in the nix file.

Copy link
Contributor

@arunoruto arunoruto Sep 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also regardin the nix-update-script, maybe an extraArgs argument should be passed down, so the webui also gets updated with the script (could be the cause for now auto-updates being triggered).
Something like this should work:

  passthru.updateScript = nix-update-script {
    extraArgs = [
      "--subpackage"
      "webui"
    ];
  };

If you want, you can put in this commit too, or I can make a separate PR after this gets merged (with 0.12.10 maybe?) since the folder structure changed...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly I'm really new to writing nix modules so I don't think I understand what whis does, or your comment about rec and finalAttrs :P

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change would enable it to auto-update in the future and we don't have to fetch the correct hash values. Regarding the other comment, maybe look at this version of the nix file:

{
  buildGoModule,
  lib,
  fetchFromGitHub,
  nix-update-script,
  buildNpmPackage,
}:
buildGoModule (finalAttrs: {
  pname = "beszel";
  version = "0.12.10";

  src = fetchFromGitHub {
    owner = "henrygd";
    repo = "beszel";
    tag = "v${finalAttrs.version}";
    hash = "sha256-6hqRlttuDU5mAqgClc5I+lSx+XHpNPuOLirbVEA08/g=";
  };

  webui = buildNpmPackage {
    inherit (finalAttrs)
      pname
      version
      src
      meta
      ;

    npmFlags = [ "--legacy-peer-deps" ];

    buildPhase = ''
      runHook preBuild

      npx lingui extract --overwrite
      npx lingui compile
      node --max_old_space_size=1024000 ./node_modules/vite/bin/vite.js build

      runHook postBuild
    '';

    installPhase = ''
      runHook preInstall

      mkdir -p $out
      cp -r dist/* $out

      runHook postInstall
    '';

    sourceRoot = "${finalAttrs.src.name}/internal/site";

    npmDepsHash = "sha256-8Y/Klpy2VIeg/o6n+EeYMvh0Y3GrNgIo7kRxYye3Rr4=";
  };

  # sourceRoot = "${src.name}";

  vendorHash = "sha256-8Y/Klpy2VIeg/o6n+EeYMvh0Y3GrNgIo7kRxYye3Rr4=";

  postPatch = ''substituteInPlace go.mod --replace "go 1.25.1" "go 1.25.0"'';

  preBuild = ''
    mkdir -p site/dist
    cp -r ${finalAttrs.webui}/* site/dist
  '';

  postInstall = ''
    mv $out/bin/agent $out/bin/beszel-agent
    mv $out/bin/hub $out/bin/beszel-hub
  '';

  passthru.updateScript = nix-update-script {
    extraArgs = [
      "--subpackage"
      "webui"
    ];
  };

  meta = {
    homepage = "https://github.com/henrygd/beszel";
    changelog = "https://github.com/henrygd/beszel/releases/tag/v${finalAttrs.version}";
    description = "Lightweight server monitoring hub with historical data, docker stats, and alerts";
    maintainers = with lib.maintainers; [ bot-wxt1221 ];
    license = lib.licenses.mit;
  };
})

Copy link
Member

@Bot-wxt1221 Bot-wxt1221 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as @arunoruto

vendorHash = goHash;

# TODO remove when #441125 is merged into master
postPatch = ''substituteInPlace go.mod --replace "go 1.25.1" "go 1.25.0"'';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#441125 is merged into master !

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the hint! I was able to make some final tweaks and make it build!

@arunoruto
Copy link
Contributor

arunoruto commented Oct 7, 2025

Here is what worked for me, including updating it 0.13.1:

{
  buildGoModule,
  lib,
  fetchFromGitHub,
  nix-update-script,
  buildNpmPackage,
}:
buildGoModule (finalAttrs: {
  pname = "beszel";
  version = "0.13.1";

  src = fetchFromGitHub {
    owner = "henrygd";
    repo = "beszel";
    tag = "v${finalAttrs.version}";
    hash = "sha256-b7VooNii3cmGZxRIQKs0QoflMA6XNknERNPETJyhPSQ=";
  };

  webui = buildNpmPackage {
    inherit (finalAttrs)
      pname
      version
      src
      meta
      ;

    npmFlags = [ "--legacy-peer-deps" ];

    buildPhase = ''
      runHook preBuild

      npx lingui extract --overwrite
      npx lingui compile
      node --max_old_space_size=1024000 ./node_modules/vite/bin/vite.js build

      runHook postBuild
    '';

    installPhase = ''
      runHook preInstall

      mkdir -p $out
      cp -r dist/* $out

      runHook postInstall
    '';

    sourceRoot = "${finalAttrs.src.name}/internal/site";

    npmDepsHash = "sha256-a+G1SouUcc/iG7H1lC2t/CcTH4SrRmMujMZWLpLe7U0=";
  };

  vendorHash = "sha256-IfwgL4Ms5Uho1l0yGCyumbr1N/SN+j5HaFl4hACkTsQ=";

  preBuild = ''
    mkdir -p internal/site/dist
    cp -r ${finalAttrs.webui}/* internal/site/dist
  '';

  postInstall = ''
    mv $out/bin/agent $out/bin/beszel-agent
    mv $out/bin/hub $out/bin/beszel-hub
  '';

  passthru.updateScript = nix-update-script {
    extraArgs = [
      "--subpackage"
      "webui"
    ];
  };

  meta = {
    homepage = "https://github.com/henrygd/beszel";
    changelog = "https://github.com/henrygd/beszel/releases/tag/v${finalAttrs.version}";
    description = "Lightweight server monitoring hub with historical data, docker stats, and alerts";
    maintainers = with lib.maintainers; [ bot-wxt1221 ];
    license = lib.licenses.mit;
  };
})

@non-bin FYI: this uses the finalAttrs syntax and is a bit more elegant than using rec and let & in. Also, I included a small extra, which should enable auto-updates in the future :)
Feel free to incorporate the changes in your commit, and you can also add me to the maintainers list, since I am a beszel user too!

@nixpkgs-ci nixpkgs-ci bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Oct 14, 2025
@BonusPlay
Copy link
Member

outdated

@BonusPlay BonusPlay closed this Nov 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.status: merge conflict This PR has merge conflicts with the target branch 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 12.first-time contribution This PR is the author's first one; please be gentle!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants