New config to disable all external integrations. Closes #102
This commit is contained in:
@@ -29,6 +29,7 @@ type configOptions struct {
|
|||||||
UILoginBackgroundURL string
|
UILoginBackgroundURL string
|
||||||
EnableTranscodingConfig bool
|
EnableTranscodingConfig bool
|
||||||
EnableDownloads bool
|
EnableDownloads bool
|
||||||
|
EnableExternalServices bool
|
||||||
TranscodingCacheSize string
|
TranscodingCacheSize string
|
||||||
ImageCacheSize string
|
ImageCacheSize string
|
||||||
AutoImportPlaylists bool
|
AutoImportPlaylists bool
|
||||||
@@ -138,12 +139,24 @@ func Load() {
|
|||||||
fmt.Println(prettyConf)
|
fmt.Println(prettyConf)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !Server.EnableExternalServices {
|
||||||
|
disableExternalServices()
|
||||||
|
}
|
||||||
|
|
||||||
// Call init hooks
|
// Call init hooks
|
||||||
for _, hook := range hooks {
|
for _, hook := range hooks {
|
||||||
hook()
|
hook()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func disableExternalServices() {
|
||||||
|
log.Info("All external integrations are DISABLED!")
|
||||||
|
Server.LastFM.Enabled = false
|
||||||
|
Server.Spotify.ID = ""
|
||||||
|
Server.UILoginBackgroundURL = consts.DefaultUILoginBackgroundURLOffline
|
||||||
|
Server.DevListenBrainzEnabled = false
|
||||||
|
}
|
||||||
|
|
||||||
func validateScanSchedule() error {
|
func validateScanSchedule() error {
|
||||||
if Server.ScanInterval != -1 {
|
if Server.ScanInterval != -1 {
|
||||||
log.Warn("ScanInterval is DEPRECATED. Please use ScanSchedule. See docs at https://navidrome.org/docs/usage/configuration-options/")
|
log.Warn("ScanInterval is DEPRECATED. Please use ScanSchedule. See docs at https://navidrome.org/docs/usage/configuration-options/")
|
||||||
@@ -195,6 +208,7 @@ func init() {
|
|||||||
viper.SetDefault("autoimportplaylists", true)
|
viper.SetDefault("autoimportplaylists", true)
|
||||||
viper.SetDefault("playlistspath", consts.DefaultPlaylistsPath)
|
viper.SetDefault("playlistspath", consts.DefaultPlaylistsPath)
|
||||||
viper.SetDefault("enabledownloads", true)
|
viper.SetDefault("enabledownloads", true)
|
||||||
|
viper.SetDefault("enableexternalservices", true)
|
||||||
|
|
||||||
// Config options only valid for file/env configuration
|
// Config options only valid for file/env configuration
|
||||||
viper.SetDefault("searchfullstring", false)
|
viper.SetDefault("searchfullstring", false)
|
||||||
|
|||||||
@@ -35,6 +35,8 @@ const (
|
|||||||
|
|
||||||
// Login backgrounds from https://unsplash.com/collections/20072696/navidrome
|
// Login backgrounds from https://unsplash.com/collections/20072696/navidrome
|
||||||
DefaultUILoginBackgroundURL = "https://source.unsplash.com/collection/20072696/1600x900"
|
DefaultUILoginBackgroundURL = "https://source.unsplash.com/collection/20072696/1600x900"
|
||||||
|
// In case external integrations are disabled
|
||||||
|
DefaultUILoginBackgroundURLOffline = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAIAAAAiOjnJAAAABGdBTUEAALGPC/xhBQAAAiJJREFUeF7t0IEAAAAAw6D5Ux/khVBhwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDDwMDDVlwABBWcSrQAAAABJRU5ErkJggg=="
|
||||||
|
|
||||||
RequestThrottleBacklogLimit = 100
|
RequestThrottleBacklogLimit = 100
|
||||||
RequestThrottleBacklogTimeout = time.Minute
|
RequestThrottleBacklogTimeout = time.Minute
|
||||||
|
|||||||
Reference in New Issue
Block a user