mirror of
https://github.com/Melorise/nPanel.git
synced 2026-11-07 14:49:35 +00:00
fix: synchronize runtime panel version
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
@@ -5,7 +5,7 @@
|
||||
}:
|
||||
|
||||
let
|
||||
version = "2.0.0";
|
||||
version = "2.0.1";
|
||||
|
||||
frontend = buildNpmPackage {
|
||||
pname = "npanel-frontend";
|
||||
|
||||
Reference in New Issue
Block a user