Make opt-in flag

This commit is contained in:
binwiederhier
2026-05-31 14:28:04 -04:00
parent 301be79f0a
commit 204723f3c0
10 changed files with 236 additions and 43 deletions
+2
View File
@@ -116,6 +116,7 @@ type Config struct {
AuthTokens map[string][]*user.Token
AuthBcryptCost int
AuthStatsQueueWriterInterval time.Duration
AuthAccessCacheEnabled bool
AuthAccessCacheReloadInterval time.Duration
AttachmentCacheDir string
AttachmentTotalSizeLimit int64
@@ -224,6 +225,7 @@ func NewConfig() *Config {
AuthDefault: user.PermissionReadWrite,
AuthBcryptCost: user.DefaultUserPasswordBcryptCost,
AuthStatsQueueWriterInterval: user.DefaultUserStatsQueueWriterInterval,
AuthAccessCacheEnabled: user.DefaultAccessCacheEnabled, // Opt-in (e.g. ntfy.sh) via server.yml
AuthAccessCacheReloadInterval: user.DefaultAccessCacheReloadInterval,
AttachmentCacheDir: "",
AttachmentTotalSizeLimit: DefaultAttachmentTotalSizeLimit,
+1
View File
@@ -257,6 +257,7 @@ func New(conf *Config) (*Server, error) {
Tokens: conf.AuthTokens,
BcryptCost: conf.AuthBcryptCost,
QueueWriterInterval: conf.AuthStatsQueueWriterInterval,
AccessCacheEnabled: conf.AuthAccessCacheEnabled,
AccessCacheReloadInterval: conf.AuthAccessCacheReloadInterval,
}
if pool != nil {