admin: configure maintenance tasks via admin.toml (#9926)

* admin: configure maintenance tasks via admin.toml

Maintenance task settings could only be edited in the admin UI and live
under <dataDir>/conf, so they silently reverted to defaults whenever the
data directory was recreated. An optional admin.toml now declares vacuum,
balance, and erasure coding settings; keys set there are written through
to the persisted task configs at every startup, overriding UI edits, so
the configuration stays declarative. Generate an example with
"weed scaffold -config=admin".

* vacuum: round min volume age up to whole hours

MinVolumeAgeSeconds was truncated by integer division when converted to
the hour-granular protobuf field, so a sub-hour setting silently became
0 and disabled the age guard.

* admin: split and normalize preferred_tags from admin.toml

A comma-separated string, as set via environment variable, came through
viper as a single slice element. Split on commas and reuse
util.NormalizeTagList, matching the plugin config path.

* scaffold: clarify admin.toml wording
This commit is contained in:
Chris Lu authored and GitHub committed 2026-06-11 11:04:52 -07:00
1 parent 42030381ae
commit 37962e2445
9 files changed
+312 -6

No files matched your search

+3
View File
@@ -35,3 +35,6 @@ var Shell string
//go:embed credential.toml
var Credential string
//go:embed admin.toml
var Admin string