Skip to content

🎧 Your Personal Streaming Service

Remove LastFM shared key

Deluan78d557c1854b
diff --git a/conf/configuration.go b/conf/configuration.go
index 0614c1a29..5c6835971 100644
--- a/conf/configuration.go
+++ b/conf/configuration.go
@@ -335,8 +335,8 @@ func init() {
viper.SetDefault("agents", "lastfm,spotify")
viper.SetDefault("lastfm.enabled", true)
viper.SetDefault("lastfm.language", "en")
- viper.SetDefault("lastfm.apikey", consts.LastFMAPIKey)
- viper.SetDefault("lastfm.secret", consts.LastFMAPISecret)
+ viper.SetDefault("lastfm.apikey", "")
+ viper.SetDefault("lastfm.secret", "")
viper.SetDefault("spotify.id", "")
viper.SetDefault("spotify.secret", "")
viper.SetDefault("listenbrainz.enabled", true)
diff --git a/consts/consts.go b/consts/consts.go
index 3f99d0347..b1f284abf 100644
--- a/consts/consts.go
+++ b/consts/consts.go
@@ -81,12 +81,6 @@ const (
DefaultCacheCleanUpInterval = 10 * time.Minute
)
-// Shared secrets (only add here "secrets" that can be public)
-const (
- LastFMAPIKey = "9b94a5515ea66b2da3ec03c12300327e" // nolint:gosec
- LastFMAPISecret = "74cb6557cec7171d921af5d7d887c587" // nolint:gosec
-)
-
var (
DefaultDownsamplingFormat = "opus"
DefaultTranscodings = []map[string]interface{}{
diff --git a/core/agents/lastfm/agent.go b/core/agents/lastfm/agent.go
index a108f222b..ca3045c48 100644
--- a/core/agents/lastfm/agent.go
+++ b/core/agents/lastfm/agent.go
@@ -311,12 +311,14 @@ func (l *lastfmAgent) IsAuthorized(ctx context.Context, userId string) bool {
func init() {
conf.AddHook(func() {
if conf.Server.LastFM.Enabled {
- agents.Register(lastFMAgentName, func(ds model.DataStore) agents.Interface {
- return lastFMConstructor(ds)
- })
- scrobbler.Register(lastFMAgentName, func(ds model.DataStore) scrobbler.Scrobbler {
- return lastFMConstructor(ds)
- })
+ if conf.Server.LastFM.ApiKey != "" && conf.Server.LastFM.Secret != "" {
+ agents.Register(lastFMAgentName, func(ds model.DataStore) agents.Interface {
+ return lastFMConstructor(ds)
+ })
+ scrobbler.Register(lastFMAgentName, func(ds model.DataStore) scrobbler.Scrobbler {
+ return lastFMConstructor(ds)
+ })
+ }
}
})
}