Skip to content

🎧 Your Personal Streaming Service

New config to disable all external integrations. Closes #102

Deluan1823159b2535
diff --git a/conf/configuration.go b/conf/configuration.go
index 5ddec29f7..aa1b1a146 100644
--- a/conf/configuration.go
+++ b/conf/configuration.go
@@ -29,6 +29,7 @@ type configOptions struct {
UILoginBackgroundURL string
EnableTranscodingConfig bool
EnableDownloads bool
+ EnableExternalServices bool
TranscodingCacheSize string
ImageCacheSize string
AutoImportPlaylists bool
@@ -138,12 +139,24 @@ func Load() {
fmt.Println(prettyConf)
}
+ if !Server.EnableExternalServices {
+ disableExternalServices()
+ }
+
// Call init hooks
for _, hook := range hooks {
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 {
if Server.ScanInterval != -1 {
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("playlistspath", consts.DefaultPlaylistsPath)
viper.SetDefault("enabledownloads", true)
+ viper.SetDefault("enableexternalservices", true)
// Config options only valid for file/env configuration
viper.SetDefault("searchfullstring", false)
diff --git a/consts/consts.go b/consts/consts.go
index 0471cf7f5..af7f74a6a 100644
--- a/consts/consts.go
+++ b/consts/consts.go
@@ -35,6 +35,8 @@ const (
// Login backgrounds from https://unsplash.com/collections/20072696/navidrome
DefaultUILoginBackgroundURL = "https://source.unsplash.com/collection/20072696/1600x900"
+ // In case external integrations are disabled
+ DefaultUILoginBackgroundURLOffline = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAIAAAAiOjnJAAAABGdBTUEAALGPC/xhBQAAAiJJREFUeF7t0IEAAAAAw6D5Ux/khVBhwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDDwMDDVlwABBWcSrQAAAABJRU5ErkJggg=="
RequestThrottleBacklogLimit = 100
RequestThrottleBacklogTimeout = time.Minute