1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-10-05 19:31:01 +00:00
This commit is contained in:
Julien Voisin 2025-09-12 19:01:26 -04:00 committed by GitHub
commit 8cfeaa7716
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 27 additions and 5 deletions

View file

@ -90,6 +90,7 @@ const (
defaultWatchdog = true
defaultInvidiousInstance = "yewtu.be"
defaultWebAuthn = false
defaultDisableAPI = false
)
var defaultHTTPClientUserAgent = "Mozilla/5.0 (compatible; Miniflux/" + version.Version + "; +https://miniflux.app)"
@ -184,6 +185,7 @@ type options struct {
invidiousInstance string
mediaProxyPrivateKey []byte
webAuthn bool
API bool
}
// NewOptions returns Options with default values.
@ -264,6 +266,7 @@ func NewOptions() *options {
invidiousInstance: defaultInvidiousInstance,
mediaProxyPrivateKey: crypto.GenerateRandomBytes(16),
webAuthn: defaultWebAuthn,
API: !defaultDisableAPI,
}
}
@ -677,6 +680,11 @@ func (o *options) WebAuthn() bool {
return o.webAuthn
}
// EnableAPI returns true if API is enabled
func (o *options) EnableAPI() bool {
return o.API
}
// FilterEntryMaxAgeDays returns the number of days after which entries should be retained.
func (o *options) FilterEntryMaxAgeDays() int {
return o.filterEntryMaxAgeDays