Disable external links when EnableExternalServices is false. Fix #2022
This commit is contained in:
@@ -62,6 +62,7 @@ func serveIndex(ds model.DataStore, fs fs.FS, shareInfo *model.Share) http.Handl
|
|||||||
"lastFMApiKey": conf.Server.LastFM.ApiKey,
|
"lastFMApiKey": conf.Server.LastFM.ApiKey,
|
||||||
"devShowArtistPage": conf.Server.DevShowArtistPage,
|
"devShowArtistPage": conf.Server.DevShowArtistPage,
|
||||||
"listenBrainzEnabled": conf.Server.ListenBrainz.Enabled,
|
"listenBrainzEnabled": conf.Server.ListenBrainz.Enabled,
|
||||||
|
"enableExternalServices": conf.Server.EnableExternalServices,
|
||||||
"enableReplayGain": conf.Server.EnableReplayGain,
|
"enableReplayGain": conf.Server.EnableReplayGain,
|
||||||
"defaultDownsamplingFormat": conf.Server.DefaultDownsamplingFormat,
|
"defaultDownsamplingFormat": conf.Server.DefaultDownsamplingFormat,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -310,6 +310,17 @@ var _ = Describe("serveIndex", func() {
|
|||||||
Expect(config).To(HaveKeyWithValue("enableReplayGain", true))
|
Expect(config).To(HaveKeyWithValue("enableReplayGain", true))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
It("sets the enableExternalServices", func() {
|
||||||
|
conf.Server.EnableExternalServices = true
|
||||||
|
r := httptest.NewRequest("GET", "/index.html", nil)
|
||||||
|
w := httptest.NewRecorder()
|
||||||
|
|
||||||
|
serveIndex(ds, fs, nil)(w, r)
|
||||||
|
|
||||||
|
config := extractAppConfig(w.Body.String())
|
||||||
|
Expect(config).To(HaveKeyWithValue("enableExternalServices", true))
|
||||||
|
})
|
||||||
|
|
||||||
Describe("loginBackgroundURL", func() {
|
Describe("loginBackgroundURL", func() {
|
||||||
Context("empty BaseURL", func() {
|
Context("empty BaseURL", func() {
|
||||||
BeforeEach(func() {
|
BeforeEach(func() {
|
||||||
|
|||||||
@@ -304,7 +304,9 @@ const AlbumDetails = (props) => {
|
|||||||
)}
|
)}
|
||||||
{!isXsmall && (
|
{!isXsmall && (
|
||||||
<Typography component={'div'} className={classes.recordMeta}>
|
<Typography component={'div'} className={classes.recordMeta}>
|
||||||
<AlbumExternalLinks className={classes.externalLinks} />
|
{config.enableExternalServices && (
|
||||||
|
<AlbumExternalLinks className={classes.externalLinks} />
|
||||||
|
)}
|
||||||
</Typography>
|
</Typography>
|
||||||
)}
|
)}
|
||||||
{isDesktop && (
|
{isDesktop && (
|
||||||
|
|||||||
@@ -135,7 +135,9 @@ const DesktopArtistDetails = ({ artistInfo, record, biography }) => {
|
|||||||
</Collapse>
|
</Collapse>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
<Typography component={'div'} className={classes.button}>
|
<Typography component={'div'} className={classes.button}>
|
||||||
<ArtistExternalLinks artistInfo={artistInfo} record={record} />
|
{config.enableExternalServices && (
|
||||||
|
<ArtistExternalLinks artistInfo={artistInfo} record={record} />
|
||||||
|
)}
|
||||||
</Typography>
|
</Typography>
|
||||||
</div>
|
</div>
|
||||||
{isLightboxOpen && (
|
{isLightboxOpen && (
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ const defaultConfig = {
|
|||||||
lastFMEnabled: true,
|
lastFMEnabled: true,
|
||||||
lastFMApiKey: '9b94a5515ea66b2da3ec03c12300327e',
|
lastFMApiKey: '9b94a5515ea66b2da3ec03c12300327e',
|
||||||
listenBrainzEnabled: true,
|
listenBrainzEnabled: true,
|
||||||
|
enableExternalServices: true,
|
||||||
enableCoverAnimation: true,
|
enableCoverAnimation: true,
|
||||||
devShowArtistPage: true,
|
devShowArtistPage: true,
|
||||||
enableReplayGain: true,
|
enableReplayGain: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user