feat(config): add box owner policy settings
Adds configuration options and environment variables to manage box owner policies, including settings for refresh counts and expiry.
This commit is contained in:
@@ -64,6 +64,12 @@ func (cfg *Config) assignBool(key string, value bool, source Source) {
|
||||
cfg.RenewOnAccessEnabled = value
|
||||
case SettingRenewOnDownloadEnabled:
|
||||
cfg.RenewOnDownloadEnabled = value
|
||||
case SettingBoxOwnerEditEnabled:
|
||||
cfg.BoxOwnerEditEnabled = value
|
||||
case SettingBoxOwnerRefreshEnabled:
|
||||
cfg.BoxOwnerRefreshEnabled = value
|
||||
case SettingBoxOwnerPasswordEdit:
|
||||
cfg.BoxOwnerPasswordEditEnabled = value
|
||||
}
|
||||
cfg.setValue(key, formatBool(value), source)
|
||||
}
|
||||
@@ -82,6 +88,10 @@ func (cfg *Config) assignInt64(key string, value int64, source Source) {
|
||||
cfg.DefaultUserMaxBoxSizeBytes = value
|
||||
case SettingSessionTTLSeconds:
|
||||
cfg.SessionTTLSeconds = value
|
||||
case SettingBoxOwnerMaxRefreshAmount:
|
||||
cfg.BoxOwnerMaxRefreshAmountSeconds = value
|
||||
case SettingBoxOwnerMaxTotalExpiry:
|
||||
cfg.BoxOwnerMaxTotalExpirySeconds = value
|
||||
}
|
||||
cfg.setValue(key, strconv.FormatInt(value, 10), source)
|
||||
}
|
||||
@@ -94,6 +104,8 @@ func (cfg *Config) assignInt(key string, value int, source Source) {
|
||||
cfg.ThumbnailBatchSize = value
|
||||
case SettingThumbnailIntervalSeconds:
|
||||
cfg.ThumbnailIntervalSeconds = value
|
||||
case SettingBoxOwnerMaxRefreshCount:
|
||||
cfg.BoxOwnerMaxRefreshCount = value
|
||||
}
|
||||
cfg.setValue(key, strconv.Itoa(value), source)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user