Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Remove dead autoUpdateCheckInterval and autoUpdateTime settings

[email protected]193c96afc311
diff --git a/docs/AUTO_UPDATE.md b/docs/AUTO_UPDATE.md
index 79bdfcde7d..78d87da811 100644
--- a/docs/AUTO_UPDATE.md
+++ b/docs/AUTO_UPDATE.md
@@ -58,7 +58,7 @@ In **Settings → System → Updates**:
| Setting | Description |
|---------|-------------|
| **Update Channel** | Stable (recommended for production) or Pre-release (opt-in preview) |
-| **Auto-Check** | Background update check interval (hours); `0` disables |
+| **Auto-Check** | Enable or disable automatic updates |
### Stored Settings (system.json)
@@ -67,13 +67,11 @@ Auto-update preferences are stored in `system.json` and edited via the UI.
```json
{
"autoUpdateEnabled": false,
- "updateChannel": "stable",
- "autoUpdateCheckInterval": 24,
- "autoUpdateTime": "03:00"
+ "updateChannel": "stable"
}
```
-**Note:** `autoUpdateTime` is stored for UI reference. The systemd timer still runs on its own schedule (02:00 + jitter). Background update checks follow `autoUpdateCheckInterval`.
+**Note:** The update schedule itself lives in the systemd timer (daily at 02:00 plus up to 4 hours of random delay), not in `system.json`. The legacy `autoUpdateCheckInterval` and `autoUpdateTime` fields were never consumed by anything and are ignored if present in older files.
**Channel policy note:** `stable` is the default and only recommended channel for paid or production environments. `rc` remains the internal channel key, but the user-facing meaning is an explicit pre-release preview path. In v6, unattended systemd auto-updates remain `stable`-only even if `updateChannel` is set to `rc`.
diff --git a/docs/CONFIGURATION.md b/docs/CONFIGURATION.md
index 010c979344..5ce1be2ad7 100644
--- a/docs/CONFIGURATION.md
+++ b/docs/CONFIGURATION.md
@@ -144,7 +144,6 @@ Controls runtime behavior like logging, polling intervals, and UI preferences. L
```
> **Note**: `logFormat` is only configurable via the `LOG_FORMAT` environment variable, not in `system.json`.
-> **Note**: `autoUpdateTime` is stored by the UI, but the systemd timer uses its own schedule.
</details>
### Supported system.json Keys
@@ -170,8 +169,6 @@ Numeric intervals are **seconds** unless noted otherwise.
| `webhookAllowedPrivateCIDRs` | Allowlist for private webhook targets |
| `updateChannel` | Update channel (`stable` or `rc`) |
| `autoUpdateEnabled` | Allow one-click updates |
-| `autoUpdateCheckInterval` | Update check interval (hours) |
-| `autoUpdateTime` | UI-stored preferred update time |
| `publicURL` | Public URL used in links/notifications |
| `hideLocalLogin` | Hide username/password login form |
| `temperatureMonitoringEnabled` | Enable temperature monitoring (where supported) |
@@ -354,10 +351,8 @@ These are stored in `system.json` and managed via the UI.
| ----- | ------------- | --------- |
| `updateChannel` | Update channel (`stable` or `rc`) | `stable` |
| `autoUpdateEnabled` | Allow one-click updates | `false` |
-| `autoUpdateCheckInterval` | Background update check interval in hours (`0` disables) | `24` |
-| `autoUpdateTime` | Stored UI preference (systemd timer has its own schedule) | `03:00` |
-> **Note**: Update settings are stored in `system.json`. Legacy `.env` entries (`UPDATE_CHANNEL`, `AUTO_UPDATE_ENABLED`, `AUTO_UPDATE_CHECK_INTERVAL`, `AUTO_UPDATE_TIME`) are kept in sync for backwards compatibility but are not read at runtime.
+> **Note**: Update settings are stored in `system.json`. Legacy `.env` entries (`UPDATE_CHANNEL`, `AUTO_UPDATE_ENABLED`) are kept in sync for backwards compatibility but are not read at runtime. The former `autoUpdateCheckInterval` / `autoUpdateTime` fields were never consumed and are ignored if present; the update schedule lives in the systemd timer.
>
> `stable` is the default and recommended production channel. `rc` is an
> opt-in preview channel. In v6, unattended systemd auto-updates remain
diff --git a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
index cc3e2655b3..1c918f08c8 100644
--- a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
+++ b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
@@ -2201,6 +2201,15 @@ Agent` secondary handoff against the live setup wizard instead of relying
## Current State
+### Shared system-settings boundary dropped dead auto-update schedule fields
+
+The shared `internal/api` system-settings surface this subsystem consumes
+(`internal/api/system_settings.go`, `internal/api/config_system_handlers.go`)
+removed the never-consumed `autoUpdateCheckInterval` / `autoUpdateTime`
+fields. No agent-lifecycle behavior keyed off them — agent update targeting
+and command admission are unaffected — and the extension-point expectations
+on the system-settings boundary are otherwise unchanged.
+
### Monitor housekeeping prunes only live memory-evidence caches
The shared monitor housekeeping pass in `internal/monitoring/monitor_agents.go`
diff --git a/docs/release-control/v6/internal/subsystems/api-contracts.md b/docs/release-control/v6/internal/subsystems/api-contracts.md
index 22ff8d4df7..f58b9d0d87 100644
--- a/docs/release-control/v6/internal/subsystems/api-contracts.md
+++ b/docs/release-control/v6/internal/subsystems/api-contracts.md
@@ -3668,6 +3668,21 @@ auto-register mutation boundary.
## Current State
+### System settings shed the dead auto-update schedule fields
+
+The system settings payload (`internal/config.SystemSettings`, projected by
+`internal/api/config_system_handlers.go` and mutated through
+`internal/api/system_settings.go`) no longer includes
+`autoUpdateCheckInterval` or `autoUpdateTime`. Nothing ever consumed the
+fields — the unattended update schedule is owned entirely by the
+install.sh-rendered systemd timer, and no UI control set them — so the API
+accepted, validated, and persisted a schedule preference that could never
+take effect. Legacy clients may still send the keys: the update endpoint
+ignores them without a validation error and never writes them back into
+`system.json`. `TestSystemSettingsUpdate_LegacyAutoUpdateFieldsIgnored` in
+`internal/api/system_settings_telemetry_test.go` and the response snapshot in
+`internal/api/contract_test.go` pin that payload shape.
+
### Connections command-channel liveness tolerates stale host token IDs
The `/api/connections` ledger's `RemoteControl` and `CommandPolicy` signals
diff --git a/docs/release-control/v6/internal/subsystems/security-privacy.md b/docs/release-control/v6/internal/subsystems/security-privacy.md
index 5fc76fceba..fd64e449c6 100644
--- a/docs/release-control/v6/internal/subsystems/security-privacy.md
+++ b/docs/release-control/v6/internal/subsystems/security-privacy.md
@@ -575,6 +575,21 @@ tokens, and path-normalization variants.
## Current State
+### System settings mutation surface no longer accepts dead schedule inputs
+
+The governed system-settings write path in `internal/api/system_settings.go`
+and the runtime config in `internal/config/config.go` dropped the
+`autoUpdateCheckInterval` / `autoUpdateTime` fields, which were stored but
+never consumed by any runtime. Dead accepted-but-unread input is surface the
+security review has to reason about for no benefit, so the fields, their
+validation, and their persistence were removed together. Legacy keys in a
+POSTed settings body are ignored rather than rejected, and a `system.json`
+written before the removal still loads cleanly with the legacy keys ignored
+(`TestLoad_IgnoresLegacyAutoUpdateScheduleFields` in
+`internal/config/config_load_test.go`,
+`TestSystemSettingsUpdate_LegacyAutoUpdateFieldsIgnored` in
+`internal/api/system_settings_telemetry_test.go`).
+
### Canonical mutation-plane dependency
Raw command, file-write, arbitrary pod-exec, and legacy remediation authority
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.md
index ab1b8990ea..67949e322e 100644
--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md
+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md
@@ -1985,6 +1985,15 @@ that Safe auto-fix or Autopilot remediation is verified.
## Current State
+### Shared system-settings boundary dropped dead auto-update schedule fields
+
+The shared `internal/api` system-settings surface this subsystem consumes
+(`internal/api/system_settings.go`, `internal/api/config_system_handlers.go`)
+removed the never-consumed `autoUpdateCheckInterval` / `autoUpdateTime`
+fields. Persisted `system.json` files that still carry the legacy keys load
+cleanly with the keys ignored, so tenant workspace preservation and recovery
+flows that copy `system.json` forward are unaffected.
+
### Agent exec token binding repairs are fail-closed durable writes
Command-token binding metadata (`bound_agent_id`, `bound_hostname`,
diff --git a/frontend-modern/public/docs/CONFIGURATION.md b/frontend-modern/public/docs/CONFIGURATION.md
index 010c979344..5ce1be2ad7 100644
--- a/frontend-modern/public/docs/CONFIGURATION.md
+++ b/frontend-modern/public/docs/CONFIGURATION.md
@@ -144,7 +144,6 @@ Controls runtime behavior like logging, polling intervals, and UI preferences. L
```
> **Note**: `logFormat` is only configurable via the `LOG_FORMAT` environment variable, not in `system.json`.
-> **Note**: `autoUpdateTime` is stored by the UI, but the systemd timer uses its own schedule.
</details>
### Supported system.json Keys
@@ -170,8 +169,6 @@ Numeric intervals are **seconds** unless noted otherwise.
| `webhookAllowedPrivateCIDRs` | Allowlist for private webhook targets |
| `updateChannel` | Update channel (`stable` or `rc`) |
| `autoUpdateEnabled` | Allow one-click updates |
-| `autoUpdateCheckInterval` | Update check interval (hours) |
-| `autoUpdateTime` | UI-stored preferred update time |
| `publicURL` | Public URL used in links/notifications |
| `hideLocalLogin` | Hide username/password login form |
| `temperatureMonitoringEnabled` | Enable temperature monitoring (where supported) |
@@ -354,10 +351,8 @@ These are stored in `system.json` and managed via the UI.
| ----- | ------------- | --------- |
| `updateChannel` | Update channel (`stable` or `rc`) | `stable` |
| `autoUpdateEnabled` | Allow one-click updates | `false` |
-| `autoUpdateCheckInterval` | Background update check interval in hours (`0` disables) | `24` |
-| `autoUpdateTime` | Stored UI preference (systemd timer has its own schedule) | `03:00` |
-> **Note**: Update settings are stored in `system.json`. Legacy `.env` entries (`UPDATE_CHANNEL`, `AUTO_UPDATE_ENABLED`, `AUTO_UPDATE_CHECK_INTERVAL`, `AUTO_UPDATE_TIME`) are kept in sync for backwards compatibility but are not read at runtime.
+> **Note**: Update settings are stored in `system.json`. Legacy `.env` entries (`UPDATE_CHANNEL`, `AUTO_UPDATE_ENABLED`) are kept in sync for backwards compatibility but are not read at runtime. The former `autoUpdateCheckInterval` / `autoUpdateTime` fields were never consumed and are ignored if present; the update schedule lives in the systemd timer.
>
> `stable` is the default and recommended production channel. `rc` is an
> opt-in preview channel. In v6, unattended systemd auto-updates remain
diff --git a/frontend-modern/src/types/config.ts b/frontend-modern/src/types/config.ts
index 7462ef9ce5..5076e3fcc3 100644
--- a/frontend-modern/src/types/config.ts
+++ b/frontend-modern/src/types/config.ts
@@ -31,8 +31,6 @@ export interface SystemConfig {
connectionTimeout?: number; // Seconds before timeout (default: 10)
autoUpdateEnabled: boolean; // Enable auto-updates
updateChannel?: UpdateChannel; // Update channel: 'stable' | 'rc'
- autoUpdateCheckInterval?: number; // Hours between update checks
- autoUpdateTime?: string; // Time for updates (HH:MM format)
backupPollingInterval?: number; // Backup polling interval in seconds (0 = default cadence)
backupPollingEnabled?: boolean; // Enable backup polling of PVE/PBS data
temperatureMonitoringEnabled?: boolean; // Collect CPU/NVMe temperatures via SSH
diff --git a/internal/api/config_handlers_cluster_additional_test.go b/internal/api/config_handlers_cluster_additional_test.go
index 4b10f32779..66a4cba889 100644
--- a/internal/api/config_handlers_cluster_additional_test.go
+++ b/internal/api/config_handlers_cluster_additional_test.go
@@ -400,8 +400,6 @@ func TestHandleGetSystemSettings_ConfigOverrides(t *testing.T) {
ConnectionTimeout: 15 * time.Second,
UpdateChannel: "stable",
AutoUpdateEnabled: true,
- AutoUpdateCheckInterval: 6 * time.Hour,
- AutoUpdateTime: "03:30",
LogLevel: "debug",
DiscoveryEnabled: true,
DiscoverySubnet: "10.0.0.0/24",
diff --git a/internal/api/config_system_handlers.go b/internal/api/config_system_handlers.go
index c13ceffefa..355ef3bab9 100644
--- a/internal/api/config_system_handlers.go
+++ b/internal/api/config_system_handlers.go
@@ -47,8 +47,6 @@ func (h *ConfigHandlers) handleGetSystemSettings(w http.ResponseWriter, r *http.
settings.ConnectionTimeout = int(cfg.ConnectionTimeout.Seconds())
settings.UpdateChannel = cfg.UpdateChannel
settings.AutoUpdateEnabled = cfg.AutoUpdateEnabled
- settings.AutoUpdateCheckInterval = int(cfg.AutoUpdateCheckInterval.Hours())
- settings.AutoUpdateTime = cfg.AutoUpdateTime
settings.LogLevel = cfg.LogLevel
settings.DiscoveryEnabled = cfg.DiscoveryEnabled
settings.DiscoverySubnet = cfg.DiscoverySubnet
diff --git a/internal/api/contract_test.go b/internal/api/contract_test.go
index 082fadf4ce..d5e453c687 100644
--- a/internal/api/contract_test.go
+++ b/internal/api/contract_test.go
@@ -10053,8 +10053,6 @@ func TestContract_SystemSettingsResponseJSONSnapshot(t *testing.T) {
BackupPollingInterval: 3600,
UpdateChannel: "rc",
AutoUpdateEnabled: false,
- AutoUpdateCheckInterval: 24,
- AutoUpdateTime: "03:00",
DiscoveryEnabled: true,
DiscoverySubnet: "10.0.0.0/24",
DiscoveryConfig: config.DefaultDiscoveryConfig(),
@@ -10078,8 +10076,6 @@ func TestContract_SystemSettingsResponseJSONSnapshot(t *testing.T) {
"backupPollingInterval":3600,
"updateChannel":"rc",
"autoUpdateEnabled":false,
- "autoUpdateCheckInterval":24,
- "autoUpdateTime":"03:00",
"discoveryEnabled":true,
"discoverySubnet":"10.0.0.0/24",
"discoveryConfig":{
diff --git a/internal/api/system_settings.go b/internal/api/system_settings.go
index 37d5555fb5..ad32d84b9b 100644
--- a/internal/api/system_settings.go
+++ b/internal/api/system_settings.go
@@ -480,23 +480,6 @@ func validateSystemSettings(_ *config.SystemSettings, rawRequest map[string]inte
}
}
- // Validate auto-update check interval (min 1 hour, max 7 days)
- if val, ok := rawRequest["autoUpdateCheckInterval"]; ok {
- if interval, ok := val.(float64); ok {
- if interval < 0 {
- return fmt.Errorf("auto-update check interval cannot be negative")
- }
- if interval > 0 && interval < 1 {
- return fmt.Errorf("auto-update check interval must be at least 1 hour")
- }
- if interval > 168 {
- return fmt.Errorf("auto-update check interval cannot exceed 168 hours (7 days)")
- }
- } else {
- return fmt.Errorf("auto-update check interval must be a number")
- }
- }
-
if cfgMap, cfgProvided := discoveryConfigMap(rawRequest); cfgProvided {
if cfgMap == nil {
return fmt.Errorf("discoveryConfig must be an object")
@@ -899,12 +882,6 @@ func (h *SystemSettingsHandler) HandleUpdateSystemSettings(w http.ResponseWriter
if updates.UpdateChannel != "" {
settings.UpdateChannel = updates.UpdateChannel
}
- if _, ok := rawRequest["autoUpdateCheckInterval"]; ok {
- settings.AutoUpdateCheckInterval = updates.AutoUpdateCheckInterval
- }
- if updates.AutoUpdateTime != "" {
- settings.AutoUpdateTime = updates.AutoUpdateTime
- }
if updates.Theme != "" {
settings.Theme = updates.Theme
}
@@ -1047,12 +1024,6 @@ func (h *SystemSettingsHandler) HandleUpdateSystemSettings(w http.ResponseWriter
}
h.config.UpdateChannel = settings.UpdateChannel
h.config.AutoUpdateEnabled = config.EffectiveAutoUpdateEnabled(settings.UpdateChannel, settings.AutoUpdateEnabled)
- if settings.AutoUpdateCheckInterval > 0 {
- h.config.AutoUpdateCheckInterval = time.Duration(settings.AutoUpdateCheckInterval) * time.Hour
- }
- if settings.AutoUpdateTime != "" {
- h.config.AutoUpdateTime = settings.AutoUpdateTime
- }
h.config.DiscoveryEnabled = settings.DiscoveryEnabled
if settings.DiscoverySubnet != "" {
h.config.DiscoverySubnet = settings.DiscoverySubnet
diff --git a/internal/api/system_settings_telemetry_test.go b/internal/api/system_settings_telemetry_test.go
index 5b1c43f029..7e1710e378 100644
--- a/internal/api/system_settings_telemetry_test.go
+++ b/internal/api/system_settings_telemetry_test.go
@@ -443,3 +443,62 @@ func TestCIDRUpdate_ValidCIDRPersisted(t *testing.T) {
t.Errorf("persisted CIDRs should be updated, got %q", saved.WebhookAllowedPrivateCIDRs)
}
}
+
+// The autoUpdateCheckInterval and autoUpdateTime settings were removed as dead
+// surface: nothing ever consumed them (the systemd timer schedule is rendered
+// by install.sh) and no UI control set them, so accepting and persisting them
+// only pretended a schedule preference existed (#1643/#1637 triage). Legacy
+// clients may still send the fields; the update endpoint must ignore them
+// without erroring — including values the retired validation used to reject —
+// and must not write them back into system.json.
+func TestSystemSettingsUpdate_LegacyAutoUpdateFieldsIgnored(t *testing.T) {
+ tempDir := t.TempDir()
+ cfg := &config.Config{
+ DataPath: tempDir,
+ ConfigPath: tempDir,
+ EnvOverrides: map[string]bool{},
+ }
+ handler, persistence, token := setupTelemetryTest(t, cfg)
+
+ initial := config.DefaultSystemSettings()
+ if err := persistence.SaveSystemSettings(*initial); err != nil {
+ t.Fatal(err)
+ }
+
+ body, _ := json.Marshal(map[string]interface{}{
+ "autoUpdateCheckInterval": float64(9999), // rejected by the retired validation
+ "autoUpdateTime": "99:99",
+ "connectionTimeout": float64(30),
+ })
+ req := httptest.NewRequest(http.MethodPost, "/api/system-settings", bytes.NewReader(body))
+ req.Header.Set("X-API-Token", token)
+ rec := httptest.NewRecorder()
+
+ handler.HandleUpdateSystemSettings(rec, req)
+
+ if rec.Code != http.StatusOK {
+ t.Fatalf("legacy auto-update fields must be ignored, got %d: %s", rec.Code, rec.Body.String())
+ }
+
+ raw, err := os.ReadFile(filepath.Join(tempDir, "system.json"))
+ if err != nil {
+ t.Fatalf("read persisted system.json: %v", err)
+ }
+ var persisted map[string]interface{}
+ if err := json.Unmarshal(raw, &persisted); err != nil {
+ t.Fatalf("parse persisted system.json: %v", err)
+ }
+ for _, key := range []string{"autoUpdateCheckInterval", "autoUpdateTime"} {
+ if _, ok := persisted[key]; ok {
+ t.Fatalf("persisted system.json still carries dead setting %q:\n%s", key, raw)
+ }
+ }
+
+ saved, err := persistence.LoadSystemSettings()
+ if err != nil {
+ t.Fatalf("load persisted settings: %v", err)
+ }
+ if saved.ConnectionTimeout != 30 {
+ t.Fatalf("real setting alongside legacy fields was dropped: connectionTimeout=%d", saved.ConnectionTimeout)
+ }
+}
diff --git a/internal/api/system_settings_validate_test.go b/internal/api/system_settings_validate_test.go
index 70ef2c96eb..1cdd494c4a 100644
--- a/internal/api/system_settings_validate_test.go
+++ b/internal/api/system_settings_validate_test.go
@@ -283,50 +283,6 @@ func TestValidateSystemSettings(t *testing.T) {
errorText: "boolean",
},
- // =================================================================
- // autoUpdateCheckInterval validation
- // NOTE: Like backupPollingInterval, this allows 0 to disable.
- // =================================================================
- {
- name: "autoUpdateCheckInterval: zero is valid (disables check)",
- input: map[string]interface{}{"autoUpdateCheckInterval": float64(0)},
- expectError: false,
- },
- {
- name: "autoUpdateCheckInterval: valid minimum positive (1)",
- input: map[string]interface{}{"autoUpdateCheckInterval": float64(1)},
- expectError: false,
- },
- {
- name: "autoUpdateCheckInterval: valid maximum (168)",
- input: map[string]interface{}{"autoUpdateCheckInterval": float64(168)},
- expectError: false,
- },
- {
- name: "autoUpdateCheckInterval: negative is invalid",
- input: map[string]interface{}{"autoUpdateCheckInterval": float64(-1)},
- expectError: true,
- errorText: "negative",
- },
- {
- name: "autoUpdateCheckInterval: below minimum if positive (0.5)",
- input: map[string]interface{}{"autoUpdateCheckInterval": float64(0.5)},
- expectError: true,
- errorText: "1 hour",
- },
- {
- name: "autoUpdateCheckInterval: above maximum (169)",
- input: map[string]interface{}{"autoUpdateCheckInterval": float64(169)},
- expectError: true,
- errorText: "168",
- },
- {
- name: "autoUpdateCheckInterval: string instead of number",
- input: map[string]interface{}{"autoUpdateCheckInterval": "24"},
- expectError: true,
- errorText: "number",
- },
-
// =================================================================
// discoveryConfig validation - field name variants (camelCase and snake_case)
// =================================================================
@@ -962,14 +918,13 @@ func TestValidateSystemSettings(t *testing.T) {
{
name: "multiple valid fields together",
input: map[string]interface{}{
- "pvePollingInterval": float64(60),
- "pbsPollingInterval": float64(120),
- "autoUpdateEnabled": true,
- "theme": "dark",
- "connectionTimeout": float64(30),
- "backupPollingInterval": float64(3600),
- "backupPollingEnabled": true,
- "autoUpdateCheckInterval": float64(24),
+ "pvePollingInterval": float64(60),
+ "pbsPollingInterval": float64(120),
+ "autoUpdateEnabled": true,
+ "theme": "dark",
+ "connectionTimeout": float64(30),
+ "backupPollingInterval": float64(3600),
+ "backupPollingEnabled": true,
},
expectError: false,
},
@@ -1064,12 +1019,6 @@ func TestValidateSystemSettings_BoundaryConditions(t *testing.T) {
{name: "backupPollingInterval: 604799.999", input: map[string]interface{}{"backupPollingInterval": 604799.999}, expectError: false},
{name: "backupPollingInterval: 604800.001", input: map[string]interface{}{"backupPollingInterval": 604800.001}, expectError: true},
- // Auto-update check interval boundaries
- {name: "autoUpdateCheckInterval: 0.999", input: map[string]interface{}{"autoUpdateCheckInterval": 0.999}, expectError: true},
- {name: "autoUpdateCheckInterval: 1.001", input: map[string]interface{}{"autoUpdateCheckInterval": 1.001}, expectError: false},
- {name: "autoUpdateCheckInterval: 167.999", input: map[string]interface{}{"autoUpdateCheckInterval": 167.999}, expectError: false},
- {name: "autoUpdateCheckInterval: 168.001", input: map[string]interface{}{"autoUpdateCheckInterval": 168.001}, expectError: true},
-
// Connection timeout boundaries
{name: "connectionTimeout: 0.999", input: map[string]interface{}{"connectionTimeout": 0.999}, expectError: true},
{name: "connectionTimeout: 1.001", input: map[string]interface{}{"connectionTimeout": 1.001}, expectError: false},
diff --git a/internal/config/config.go b/internal/config/config.go
index c844d5ee4e..3214d686c4 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -228,10 +228,8 @@ type Config struct {
HTTPRedirectPort int `envconfig:"HTTP_REDIRECT_PORT" default:"0"` // When HTTPS is enabled, start an HTTP listener on this port that redirects to HTTPS (0 = disabled)
// Update settings
- UpdateChannel string
- AutoUpdateEnabled bool
- AutoUpdateCheckInterval time.Duration
- AutoUpdateTime string
+ UpdateChannel string
+ AutoUpdateEnabled bool
// Discovery settings
DiscoveryEnabled bool `envconfig:"DISCOVERY_ENABLED" default:"false"`
@@ -882,12 +880,6 @@ func load(initLogging bool) (*Config, error) {
cfg.UpdateChannel = EffectiveUpdateChannel(systemSettings.UpdateChannel, cfg.UpdateChannel)
cfg.AutoUpdateEnabled = EffectiveAutoUpdateEnabled(cfg.UpdateChannel, systemSettings.AutoUpdateEnabled)
- if systemSettings.AutoUpdateCheckInterval > 0 {
- cfg.AutoUpdateCheckInterval = time.Duration(systemSettings.AutoUpdateCheckInterval) * time.Hour
- }
- if systemSettings.AutoUpdateTime != "" {
- cfg.AutoUpdateTime = systemSettings.AutoUpdateTime
- }
if systemSettings.AllowedOrigins != "" {
cfg.AllowedOrigins = systemSettings.AllowedOrigins
}
diff --git a/internal/config/config_load_test.go b/internal/config/config_load_test.go
index 56acb85ef9..70d15bfbed 100644
--- a/internal/config/config_load_test.go
+++ b/internal/config/config_load_test.go
@@ -521,3 +521,22 @@ func TestLoad_Persistence_InvalidFiles(t *testing.T) {
// Should not crash, just empty/defailts
assert.Empty(t, cfg.PVEInstances)
}
+
+// The dead autoUpdateCheckInterval / autoUpdateTime settings were removed from
+// SystemSettings (#1643/#1637 triage): nothing ever consumed them — the
+// update schedule is owned by the install.sh-rendered systemd timer. Boxes
+// that persisted the fields before the removal must keep loading cleanly,
+// with the legacy keys ignored and the real update settings still honored.
+func TestLoad_IgnoresLegacyAutoUpdateScheduleFields(t *testing.T) {
+ dataDir := t.TempDir()
+ t.Setenv("PULSE_DATA_DIR", dataDir)
+
+ systemJSON := `{"autoUpdateEnabled":true,"updateChannel":"stable","autoUpdateCheckInterval":24,"autoUpdateTime":"03:00"}`
+ require.NoError(t, os.WriteFile(filepath.Join(dataDir, "system.json"), []byte(systemJSON), 0600))
+
+ cfg, err := Load()
+ require.NoError(t, err)
+
+ assert.True(t, cfg.AutoUpdateEnabled, "autoUpdateEnabled from a legacy system.json must still apply")
+ assert.Equal(t, "stable", cfg.UpdateChannel)
+}
diff --git a/internal/config/persistence.go b/internal/config/persistence.go
index 67b9083f4a..556500eec4 100644
--- a/internal/config/persistence.go
+++ b/internal/config/persistence.go
@@ -1456,8 +1456,6 @@ type SystemSettings struct {
ConnectionTimeout int `json:"connectionTimeout,omitempty"`
UpdateChannel string `json:"updateChannel,omitempty"`
AutoUpdateEnabled bool `json:"autoUpdateEnabled"` // Removed omitempty so false is saved
- AutoUpdateCheckInterval int `json:"autoUpdateCheckInterval,omitempty"`
- AutoUpdateTime string `json:"autoUpdateTime,omitempty"`
LogLevel string `json:"logLevel,omitempty"`
DiscoveryEnabled bool `json:"discoveryEnabled"`
DiscoverySubnet string `json:"discoverySubnet,omitempty"`
@@ -3527,8 +3525,6 @@ func (c *ConfigPersistence) updateEnvFile(envFile string, settings SystemSetting
} else if strings.HasPrefix(line, "AUTO_UPDATE_ENABLED=") {
// Always update AUTO_UPDATE_ENABLED when the line exists
lines = append(lines, fmt.Sprintf("AUTO_UPDATE_ENABLED=%t", settings.AutoUpdateEnabled))
- } else if strings.HasPrefix(line, "AUTO_UPDATE_CHECK_INTERVAL=") && settings.AutoUpdateCheckInterval > 0 {
- lines = append(lines, fmt.Sprintf("AUTO_UPDATE_CHECK_INTERVAL=%d", settings.AutoUpdateCheckInterval))
} else {
lines = append(lines, line)
}
diff --git a/internal/config/persistence_env_update_test.go b/internal/config/persistence_env_update_test.go
index e0f109d0aa..7c3bded4a4 100644
--- a/internal/config/persistence_env_update_test.go
+++ b/internal/config/persistence_env_update_test.go
@@ -28,9 +28,8 @@ OTHER_VAR=value
// 2. Save settings that should update .env
settings := SystemSettings{
- UpdateChannel: "stable",
- AutoUpdateEnabled: false,
- AutoUpdateCheckInterval: 7200,
+ UpdateChannel: "stable",
+ AutoUpdateEnabled: false,
}
err = cp.SaveSystemSettings(settings)
@@ -44,16 +43,19 @@ OTHER_VAR=value
// Check updates
assert.Contains(t, content, "UPDATE_CHANNEL=stable")
assert.Contains(t, content, "AUTO_UPDATE_ENABLED=false")
- assert.Contains(t, content, "AUTO_UPDATE_CHECK_INTERVAL=7200")
assert.Contains(t, content, "OTHER_VAR=value")
+ // A legacy AUTO_UPDATE_CHECK_INTERVAL line is preserved verbatim; the
+ // setting was removed as dead (nothing ever consumed it) so saves no
+ // longer rewrite it.
+ assert.Contains(t, content, "AUTO_UPDATE_CHECK_INTERVAL=3600")
+
// Check removal of deprecated
assert.NotContains(t, content, "POLLING_INTERVAL=")
// Check original values are gone
assert.NotContains(t, content, "UPDATE_CHANNEL=beta")
assert.NotContains(t, content, "AUTO_UPDATE_ENABLED=true")
- assert.NotContains(t, content, "AUTO_UPDATE_CHECK_INTERVAL=3600")
}
func TestSaveSystemSettings_UpdateEnvFile_NoUpdate(t *testing.T) {
@@ -65,7 +67,7 @@ func TestSaveSystemSettings_UpdateEnvFile_NoUpdate(t *testing.T) {
// Based on code:
// UPDATE_CHANNEL replaced if settings.UpdateChannel != ""
// AUTO_UPDATE_ENABLED always replaced
- // AUTO_UPDATE_CHECK_INTERVAL replaced if > 0
+ // AUTO_UPDATE_CHECK_INTERVAL is legacy and always preserved verbatim
initialContent := `
UPDATE_CHANNEL=beta
@@ -75,8 +77,7 @@ AUTO_UPDATE_CHECK_INTERVAL=3600
require.NoError(t, err)
settings := SystemSettings{
- UpdateChannel: "", // Empty, should not replace
- AutoUpdateCheckInterval: 0, // Zero, should not replace
+ UpdateChannel: "", // Empty, should not replace
}
err = cp.SaveSystemSettings(settings)
diff --git a/internal/config/persistence_extended_test.go b/internal/config/persistence_extended_test.go
index 0d46ae0aba..d1aab982f5 100644
--- a/internal/config/persistence_extended_test.go
+++ b/internal/config/persistence_extended_test.go
@@ -200,9 +200,8 @@ CUSTOM_VAR=value`
cp := config.NewConfigPersistence(tempDir)
settings := config.SystemSettings{
- UpdateChannel: "beta",
- AutoUpdateEnabled: true,
- AutoUpdateCheckInterval: 3600,
+ UpdateChannel: "beta",
+ AutoUpdateEnabled: true,
}
if err := cp.SaveSystemSettings(settings); err != nil {