mirror of
https://github.com/miniflux/v2.git
synced 2025-09-15 18:57:04 +00:00
Make Invidious instance configurable
This commit is contained in:
parent
5879404fd2
commit
8329e9b46c
6 changed files with 26 additions and 4 deletions
|
@ -68,6 +68,7 @@ const (
|
|||
defaultMetricsRefreshInterval = 60
|
||||
defaultMetricsAllowedNetworks = "127.0.0.1/8"
|
||||
defaultWatchdog = true
|
||||
defaultInvidiousInstance = "yewtu.be"
|
||||
)
|
||||
|
||||
var defaultHTTPClientUserAgent = "Mozilla/5.0 (compatible; Miniflux/" + version.Version + "; +https://miniflux.app)"
|
||||
|
@ -135,6 +136,7 @@ type Options struct {
|
|||
metricsRefreshInterval int
|
||||
metricsAllowedNetworks []string
|
||||
watchdog bool
|
||||
invidiousInstance string
|
||||
}
|
||||
|
||||
// NewOptions returns Options with default values.
|
||||
|
@ -193,6 +195,7 @@ func NewOptions() *Options {
|
|||
metricsRefreshInterval: defaultMetricsRefreshInterval,
|
||||
metricsAllowedNetworks: []string{defaultMetricsAllowedNetworks},
|
||||
watchdog: defaultWatchdog,
|
||||
invidiousInstance: defaultInvidiousInstance,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -482,6 +485,11 @@ func (o *Options) HasWatchdog() bool {
|
|||
return o.watchdog
|
||||
}
|
||||
|
||||
// InvidiousInstance returns the invidious instance used by miniflux
|
||||
func (o *Options) InvidiousInstance() string {
|
||||
return o.invidiousInstance
|
||||
}
|
||||
|
||||
// SortedOptions returns options as a list of key value pairs, sorted by keys.
|
||||
func (o *Options) SortedOptions(redactSecret bool) []*Option {
|
||||
var keyValues = map[string]interface{}{
|
||||
|
@ -516,6 +524,7 @@ func (o *Options) SortedOptions(redactSecret bool) []*Option {
|
|||
"HTTP_CLIENT_USER_AGENT": o.httpClientUserAgent,
|
||||
"HTTP_SERVICE": o.httpService,
|
||||
"KEY_FILE": o.certKeyFile,
|
||||
"INVIDIOUS_INSTANCE": o.invidiousInstance,
|
||||
"LISTEN_ADDR": o.listenAddr,
|
||||
"LOG_DATE_TIME": o.logDateTime,
|
||||
"MAINTENANCE_MESSAGE": o.maintenanceMessage,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue