Add ntfy config settings
This commit is contained in:
@@ -1,13 +1,19 @@
|
||||
package config
|
||||
|
||||
import "strconv"
|
||||
|
||||
const (
|
||||
KeyUploadMaxFileSizeBytes = "upload.max_file_size_bytes"
|
||||
KeyUploadMultiMaxFiles = "upload.multi.max_files"
|
||||
KeyUploadMaxHours = "upload.max_hours"
|
||||
KeyRateLimitLoginPerMinute = "ratelimit.login.per_minute"
|
||||
KeyRateLimitApiPerMinute = "ratelimit.api.per_minute"
|
||||
KeyRateLimitApiBurst = "ratelimit.api.burst"
|
||||
KeyRateLimitLoginBurst = "ratelimit.login.burst"
|
||||
KeyUploadMaxFileSizeBytes = "upload.max_file_size_bytes"
|
||||
KeyUploadMultiMaxFiles = "upload.multi.max_files"
|
||||
KeyUploadMaxHours = "upload.max_hours"
|
||||
KeyRateLimitLoginPerMinute = "ratelimit.login.per_minute"
|
||||
KeyRateLimitApiPerMinute = "ratelimit.api.per_minute"
|
||||
KeyRateLimitApiBurst = "ratelimit.api.burst"
|
||||
KeyRateLimitLoginBurst = "ratelimit.login.burst"
|
||||
|
||||
KeyUseNtfy = "use_ntfy"
|
||||
KeyNtfyUrl = "ntfy.url"
|
||||
KeyNtfyTopic = "ntfy.topic"
|
||||
)
|
||||
|
||||
// Defaults (used when DB does not have an override)
|
||||
@@ -20,4 +26,27 @@ const (
|
||||
DefaultRateLimitLoginBurst = 10
|
||||
DefaultRateLimitApiPerMinute = 60
|
||||
DefaultRateLimitApiBurst = 30
|
||||
|
||||
DefaultUseNtfy = 0
|
||||
DefaultNtfyUrl = ""
|
||||
DefaultNtfyTopic = ""
|
||||
)
|
||||
|
||||
// DefaultKeyValues returns a map of config keys to their default string values, for use when initializing the database.
|
||||
// Code duplication be dammed
|
||||
func DefaultKeyValues() map[string]string {
|
||||
return map[string]string{
|
||||
KeyUploadMaxFileSizeBytes: strconv.FormatInt(DefaultUploadMaxFileSizeBytes, 10),
|
||||
KeyUploadMultiMaxFiles: strconv.Itoa(DefaultUploadMultiMaxFiles),
|
||||
KeyUploadMaxHours: strconv.Itoa(DefaultUploadMaxHours),
|
||||
|
||||
KeyRateLimitLoginPerMinute: strconv.Itoa(DefaultRateLimitLoginPerMinute),
|
||||
KeyRateLimitLoginBurst: strconv.Itoa(DefaultRateLimitLoginBurst),
|
||||
KeyRateLimitApiPerMinute: strconv.Itoa(DefaultRateLimitApiPerMinute),
|
||||
KeyRateLimitApiBurst: strconv.Itoa(DefaultRateLimitApiBurst),
|
||||
|
||||
KeyUseNtfy: strconv.Itoa(DefaultUseNtfy),
|
||||
KeyNtfyUrl: DefaultNtfyUrl,
|
||||
KeyNtfyTopic: DefaultNtfyTopic,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user