From ae9efe63596493be6413650586725b881a24e6d2 Mon Sep 17 00:00:00 2001 From: Greg Lorenzen Date: Thu, 31 Oct 2024 15:30:51 +0000 Subject: [PATCH 01/10] Add keyboard focus to MultiSelectQueryInput edit and close --- client/components/ui/MultiSelectQueryInput.vue | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/client/components/ui/MultiSelectQueryInput.vue b/client/components/ui/MultiSelectQueryInput.vue index 099ee709..6b33acf3 100644 --- a/client/components/ui/MultiSelectQueryInput.vue +++ b/client/components/ui/MultiSelectQueryInput.vue @@ -5,9 +5,9 @@
-
- edit - close +
+ edit + close
{{ item[textKey] }}
@@ -65,6 +65,7 @@ export default { currentSearch: null, typingTimeout: null, isFocused: false, + inputFocused: false, menu: null, items: [] } @@ -114,6 +115,9 @@ export default { getIsSelected(itemValue) { return !!this.selected.find((i) => i.id === itemValue) }, + setInputFocused(focused) { + this.inputFocused = focused + }, search() { if (!this.textInput) return this.currentSearch = this.textInput From e55db0afdca634b4a0b9e4fafbb9bdf519c6b029 Mon Sep 17 00:00:00 2001 From: Greg Lorenzen Date: Thu, 31 Oct 2024 15:44:19 +0000 Subject: [PATCH 02/10] Add focus and enter key support to the add button in MultiSelectQueryInput --- client/components/ui/MultiSelectQueryInput.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/components/ui/MultiSelectQueryInput.vue b/client/components/ui/MultiSelectQueryInput.vue index 6b33acf3..d0bdcef2 100644 --- a/client/components/ui/MultiSelectQueryInput.vue +++ b/client/components/ui/MultiSelectQueryInput.vue @@ -12,7 +12,7 @@ {{ item[textKey] }}
- add + add
From a0b3960ee416ffd641e257b487171cc3a54817ab Mon Sep 17 00:00:00 2001 From: Greg Lorenzen Date: Thu, 31 Oct 2024 16:29:48 +0000 Subject: [PATCH 03/10] Fix enter key and focus for edit modal --- client/components/ui/MultiSelectQueryInput.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/components/ui/MultiSelectQueryInput.vue b/client/components/ui/MultiSelectQueryInput.vue index d0bdcef2..fe7187ee 100644 --- a/client/components/ui/MultiSelectQueryInput.vue +++ b/client/components/ui/MultiSelectQueryInput.vue @@ -6,7 +6,7 @@
- edit + edit close
{{ item[textKey] }} From 0812e189f74cb0cf176acf7924fb3b91a419a093 Mon Sep 17 00:00:00 2001 From: Greg Lorenzen Date: Thu, 7 Nov 2024 03:38:30 +0000 Subject: [PATCH 04/10] Add keyboard input to MultiSelect component --- client/components/ui/MultiSelect.vue | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/client/components/ui/MultiSelect.vue b/client/components/ui/MultiSelect.vue index 37018262..da4bcc13 100644 --- a/client/components/ui/MultiSelect.vue +++ b/client/components/ui/MultiSelect.vue @@ -5,9 +5,9 @@
-
+
edit - close + close
{{ item }}
@@ -66,7 +66,8 @@ export default { typingTimeout: null, isFocused: false, menu: null, - filteredItems: null + filteredItems: null, + inputFocused: false } }, watch: { @@ -129,6 +130,9 @@ export default { }, 100) this.setInputWidth() }, + setInputFocused(focused) { + this.inputFocused = focused + }, setInputWidth() { setTimeout(() => { var value = this.$refs.input.value From 61729881cb0bfca2f7a22da06597713acbc043b2 Mon Sep 17 00:00:00 2001 From: Nicholas Wallace Date: Sat, 7 Dec 2024 16:52:31 -0700 Subject: [PATCH 05/10] Change: no compression when downloading library item as zip file --- server/utils/zipHelpers.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/utils/zipHelpers.js b/server/utils/zipHelpers.js index c1617272..44b65296 100644 --- a/server/utils/zipHelpers.js +++ b/server/utils/zipHelpers.js @@ -7,7 +7,7 @@ module.exports.zipDirectoryPipe = (path, filename, res) => { res.attachment(filename) const archive = archiver('zip', { - zlib: { level: 9 } // Sets the compression level. + zlib: { level: 0 } // Sets the compression level. }) // listen for all archive data to be written @@ -49,4 +49,4 @@ module.exports.zipDirectoryPipe = (path, filename, res) => { archive.finalize() }) -} \ No newline at end of file +} From 91f17efd5f8f2982d5ee5bc30a116ac0d14b4c09 Mon Sep 17 00:00:00 2001 From: Brinly Date: Tue, 17 Dec 2024 12:42:28 +0100 Subject: [PATCH 06/10] feat: Added Australia and New Zealand podcast regions --- client/plugins/i18n.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/plugins/i18n.js b/client/plugins/i18n.js index 12d2b44b..5f6b1508 100644 --- a/client/plugins/i18n.js +++ b/client/plugins/i18n.js @@ -42,6 +42,7 @@ Vue.prototype.$languageCodeOptions = Object.keys(languageCodeMap).map((code) => // iTunes search API uses ISO 3166 country codes: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 const podcastSearchRegionMap = { + au: { label: 'Australia' }, br: { label: 'Brasil' }, be: { label: 'België / Belgique / Belgien' }, cz: { label: 'Česko' }, @@ -57,6 +58,7 @@ const podcastSearchRegionMap = { hu: { label: 'Magyarország' }, nl: { label: 'Nederland' }, no: { label: 'Norge' }, + nz: { label: 'New Zealand' }, at: { label: 'Österreich' }, pl: { label: 'Polska' }, pt: { label: 'Portugal' }, From 331c7c011c8ea4aa2907b7c7ff47b632db99aab5 Mon Sep 17 00:00:00 2001 From: advplyr Date: Mon, 23 Dec 2024 17:18:08 -0600 Subject: [PATCH 07/10] Support SSRF_REQUEST_FILTER_WHITELIST as a comma separated string of hostnames to pass through the ssrf request filter #3742 --- server/Server.js | 12 +++++++++++- server/utils/fileUtils.js | 4 ++-- server/utils/podcastUtils.js | 4 ++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/server/Server.js b/server/Server.js index 95e3d683..46850cbb 100644 --- a/server/Server.js +++ b/server/Server.js @@ -53,7 +53,17 @@ class Server { global.RouterBasePath = ROUTER_BASE_PATH global.XAccel = process.env.USE_X_ACCEL global.AllowCors = process.env.ALLOW_CORS === '1' - global.DisableSsrfRequestFilter = process.env.DISABLE_SSRF_REQUEST_FILTER === '1' + + if (process.env.DISABLE_SSRF_REQUEST_FILTER === '1') { + Logger.info(`[Server] SSRF Request Filter Disabled`) + global.DisableSsrfRequestFilter = () => true + } else if (process.env.SSRF_REQUEST_FILTER_WHITELIST?.length) { + const whitelistedUrls = process.env.SSRF_REQUEST_FILTER_WHITELIST.split(',').map((url) => url.trim()) + if (whitelistedUrls.length) { + Logger.info(`[Server] SSRF Request Filter Whitelisting: ${whitelistedUrls.join(',')}`) + global.DisableSsrfRequestFilter = (url) => whitelistedUrls.includes(new URL(url).hostname) + } + } if (!fs.pathExistsSync(global.ConfigPath)) { fs.mkdirSync(global.ConfigPath) diff --git a/server/utils/fileUtils.js b/server/utils/fileUtils.js index 8b87d3a0..109cab5b 100644 --- a/server/utils/fileUtils.js +++ b/server/utils/fileUtils.js @@ -277,8 +277,8 @@ module.exports.downloadFile = (url, filepath, contentTypeFilter = null) => { 'User-Agent': 'audiobookshelf (+https://audiobookshelf.org)' }, timeout: 30000, - httpAgent: global.DisableSsrfRequestFilter ? null : ssrfFilter(url), - httpsAgent: global.DisableSsrfRequestFilter ? null : ssrfFilter(url) + httpAgent: global.DisableSsrfRequestFilter?.(feedUrl) ? null : ssrfFilter(feedUrl), + httpsAgent: global.DisableSsrfRequestFilter?.(feedUrl) ? null : ssrfFilter(feedUrl) }) .then((response) => { // Validate content type diff --git a/server/utils/podcastUtils.js b/server/utils/podcastUtils.js index 627e24b2..26bd1733 100644 --- a/server/utils/podcastUtils.js +++ b/server/utils/podcastUtils.js @@ -244,8 +244,8 @@ module.exports.getPodcastFeed = (feedUrl, excludeEpisodeMetadata = false) => { Accept: 'application/rss+xml, application/xhtml+xml, application/xml, */*;q=0.8', 'User-Agent': userAgent }, - httpAgent: global.DisableSsrfRequestFilter ? null : ssrfFilter(feedUrl), - httpsAgent: global.DisableSsrfRequestFilter ? null : ssrfFilter(feedUrl) + httpAgent: global.DisableSsrfRequestFilter?.(feedUrl) ? null : ssrfFilter(feedUrl), + httpsAgent: global.DisableSsrfRequestFilter?.(feedUrl) ? null : ssrfFilter(feedUrl) }) .then(async (data) => { // Adding support for ios-8859-1 encoded RSS feeds. From 94fdd99ab5ce2481d7b2be75cb047d491c1bcf14 Mon Sep 17 00:00:00 2001 From: advplyr Date: Tue, 24 Dec 2024 15:07:11 -0600 Subject: [PATCH 08/10] Fix wrong url used for SSRF filter in fileUtils --- server/utils/fileUtils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/utils/fileUtils.js b/server/utils/fileUtils.js index 109cab5b..3725481f 100644 --- a/server/utils/fileUtils.js +++ b/server/utils/fileUtils.js @@ -277,8 +277,8 @@ module.exports.downloadFile = (url, filepath, contentTypeFilter = null) => { 'User-Agent': 'audiobookshelf (+https://audiobookshelf.org)' }, timeout: 30000, - httpAgent: global.DisableSsrfRequestFilter?.(feedUrl) ? null : ssrfFilter(feedUrl), - httpsAgent: global.DisableSsrfRequestFilter?.(feedUrl) ? null : ssrfFilter(feedUrl) + httpAgent: global.DisableSsrfRequestFilter?.(url) ? null : ssrfFilter(url), + httpsAgent: global.DisableSsrfRequestFilter?.(url) ? null : ssrfFilter(url) }) .then((response) => { // Validate content type From e1c41e4e5853aadee43fb1dd55aab7815c4319d7 Mon Sep 17 00:00:00 2001 From: advplyr Date: Wed, 25 Dec 2024 09:18:18 -0600 Subject: [PATCH 09/10] Accessibility update edit modal tabs --- client/components/modals/item/EditModal.vue | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/client/components/modals/item/EditModal.vue b/client/components/modals/item/EditModal.vue index d12a8a8f..c41e6b54 100644 --- a/client/components/modals/item/EditModal.vue +++ b/client/components/modals/item/EditModal.vue @@ -2,24 +2,24 @@ -
+
-
-
arrow_back_ios
-
-
-
arrow_forward_ios
+
+
-
- +
+ +
+
+
From 7073f17ccae4f8655ce9353e19f7e3ce92ec14d1 Mon Sep 17 00:00:00 2001 From: advplyr Date: Wed, 25 Dec 2024 09:40:16 -0600 Subject: [PATCH 10/10] Accessibility update for multi select inputs and edit series modal --- .../modals/EditSeriesInputInnerModal.vue | 6 +++--- client/components/ui/MultiSelect.vue | 15 +++++++++------ client/components/ui/MultiSelectQueryInput.vue | 17 ++++++++++------- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/client/components/modals/EditSeriesInputInnerModal.vue b/client/components/modals/EditSeriesInputInnerModal.vue index c70097a0..53225788 100644 --- a/client/components/modals/EditSeriesInputInnerModal.vue +++ b/client/components/modals/EditSeriesInputInnerModal.vue @@ -1,8 +1,8 @@