fix: synchronize runtime panel version

This commit is contained in:
2026-07-29 18:34:39 +08:00
parent a1ca1a801a
commit 512710d54c
3 changed files with 10 additions and 1 deletions
+7
View File
@@ -36,6 +36,13 @@ func Init() {
// applyManagedSettings makes values declared by the NixOS module authoritative
// over the panel's mutable settings database on every core startup.
func applyManagedSettings(settingRepo repo.ISettingRepo) {
if version := ctl_conf.LoadWithoutPanic("MANAGED_VERSION"); version != "" {
if err := settingRepo.Update("SystemVersion", version); err != nil {
global.LOG.Fatalf("apply managed panel version failed, err: %v", err)
}
global.CONF.Base.Version = version
}
if port := ctl_conf.LoadWithoutPanic("MANAGED_PORT"); port != "" {
if err := settingRepo.Update("ServerPort", port); err != nil {
global.LOG.Fatalf("apply managed panel port failed, err: %v", err)
+2
View File
@@ -89,8 +89,10 @@ EOF
update_control_value ORIGINAL_PORT ${lib.escapeShellArg (toString cfg.port)}
update_control_value ORIGINAL_ENTRANCE ${lib.escapeShellArg cfg.securityEntrance}
update_control_value ORIGINAL_VERSION ${lib.escapeShellArg (cfg.package.version or "unknown")}
update_control_value MANAGED_PORT ${lib.escapeShellArg (toString cfg.port)}
update_control_value MANAGED_ENTRANCE ${lib.escapeShellArg cfg.securityEntrance}
update_control_value MANAGED_VERSION ${lib.escapeShellArg (cfg.package.version or "unknown")}
'';
commonServiceConfig = {
+1 -1
View File
@@ -5,7 +5,7 @@
}:
let
version = "2.0.0";
version = "2.0.1";
frontend = buildNpmPackage {
pname = "npanel-frontend";