[feature] Change instance-stats-randomize to instance-stats-mode with multiple options; implement nodeinfo 2.1 (#3734)

* [feature] Change `instance-stats-randomize` to `instance-stats-mode` with multiple options; implement nodeinfo 2.1

* swaggalaggadingdong
This commit is contained in:
tobi
2025-02-04 16:52:42 +01:00
committed by GitHub
parent e1781ff52e
commit 07d2770995
18 changed files with 283 additions and 77 deletions

View File

@@ -115,6 +115,19 @@ func Validate() error {
SetInstanceLanguages(parsedLangs)
}
// `instance-stats-mode` should be
// "", "zero", "serve", or "baffle"
switch statsMode := GetInstanceStatsMode(); statsMode {
case InstanceStatsModeDefault, InstanceStatsModeZero, InstanceStatsModeServe, InstanceStatsModeBaffle:
// No problem.
default:
errf(
"%s must be set to empty string, zero, serve, or baffle, provided value was %s",
InstanceFederationModeFlag(), statsMode,
)
}
// `web-assets-base-dir`.
webAssetsBaseDir := GetWebAssetBaseDir()
if webAssetsBaseDir == "" {