feat: update settings move under updates, with an interval

updates.autoCheck (was updateCheck) and updates.updateSources (was
releases) sit together with updates.autoCheckInterval, a duration (24h
by default) for how often lazysecrets looks for a newer release on its
own.
This commit is contained in:
keb committed 2026-10-13 19:40:42 +02:00
1 parent 5cd6d90555
commit b47733e543
9 files changed
+66 -34

No files matched your search

+7 -2
View File
@@ -225,6 +225,10 @@ Flags:
if cfg.LoadDelay != nil {
loadDelay = *cfg.LoadDelay
}
var updateEvery time.Duration // 0: the app's default, a day
if cfg.Updates.AutoCheckInterval != nil {
updateEvery = *cfg.Updates.AutoCheckInterval
}
if !set["icons"] {
switch {
case os.Getenv("LAZYSECRETS_ICONS") != "":
@@ -379,8 +383,9 @@ Flags:
ExpiryWarning: time.Duration(expiryDays) * 24 * time.Hour,
HideOnBlur: config.On(cfg.HideOnBlur),
HandlerSetup: setup,
Updater: updater(cfg.Releases),
UpdateCheck: config.On(cfg.UpdateCheck),
Updater: updater(cfg.Updates.UpdateSources),
UpdateCheck: config.On(cfg.Updates.AutoCheck),
UpdateEvery: updateEvery,
Keys: &keymap,
Commands: cfg.CustomCommands,
Version: versionString(),
+1 -1
View File
@@ -43,7 +43,7 @@ func updateCmd(configPath string, args []string) error {
current := versionString()
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
defer cancel()
c := &update.Client{Servers: cfg.Releases}
c := &update.Client{Servers: cfg.Updates.UpdateSources}
r, err := c.Latest(ctx)
if err != nil {
return fmt.Errorf("looking for a newer lazysecrets: %w", err)