mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-14 21:31:43 +00:00
fix: http_proxy is not supported.
This commit is contained in:
parent
3a99cc56b7
commit
0669338ede
6 changed files with 20 additions and 12 deletions
1
index.js
1
index.js
|
|
@ -22,6 +22,7 @@ const UID = process.env.AUDIOBOOKSHELF_UID
|
||||||
const GID = process.env.AUDIOBOOKSHELF_GID
|
const GID = process.env.AUDIOBOOKSHELF_GID
|
||||||
const SOURCE = process.env.SOURCE || 'docker'
|
const SOURCE = process.env.SOURCE || 'docker'
|
||||||
const ROUTER_BASE_PATH = process.env.ROUTER_BASE_PATH || ''
|
const ROUTER_BASE_PATH = process.env.ROUTER_BASE_PATH || ''
|
||||||
|
const DISABLE_SSRF = process.env.DISABLE_SSRF || false
|
||||||
|
|
||||||
console.log('Config', CONFIG_PATH, METADATA_PATH)
|
console.log('Config', CONFIG_PATH, METADATA_PATH)
|
||||||
|
|
||||||
|
|
|
||||||
18
package-lock.json
generated
18
package-lock.json
generated
|
|
@ -9,7 +9,7 @@
|
||||||
"version": "2.8.0",
|
"version": "2.8.0",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^0.27.2",
|
"axios": "^1.6.7",
|
||||||
"cookie-parser": "^1.4.6",
|
"cookie-parser": "^1.4.6",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"express-session": "^1.17.3",
|
"express-session": "^1.17.3",
|
||||||
|
|
@ -1134,12 +1134,13 @@
|
||||||
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
|
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
|
||||||
},
|
},
|
||||||
"node_modules/axios": {
|
"node_modules/axios": {
|
||||||
"version": "0.27.2",
|
"version": "1.6.7",
|
||||||
"resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz",
|
"resolved": "https://registry.npmjs.org/axios/-/axios-1.6.7.tgz",
|
||||||
"integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==",
|
"integrity": "sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"follow-redirects": "^1.14.9",
|
"follow-redirects": "^1.15.4",
|
||||||
"form-data": "^4.0.0"
|
"form-data": "^4.0.0",
|
||||||
|
"proxy-from-env": "^1.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/balanced-match": {
|
"node_modules/balanced-match": {
|
||||||
|
|
@ -4276,6 +4277,11 @@
|
||||||
"node": ">= 0.10"
|
"node": ">= 0.10"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/proxy-from-env": {
|
||||||
|
"version": "1.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
|
||||||
|
"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
|
||||||
|
},
|
||||||
"node_modules/pstree.remy": {
|
"node_modules/pstree.remy": {
|
||||||
"version": "1.1.8",
|
"version": "1.1.8",
|
||||||
"resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz",
|
"resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz",
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@
|
||||||
"author": "advplyr",
|
"author": "advplyr",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^0.27.2",
|
"axios": "^1.6.7",
|
||||||
"cookie-parser": "^1.4.6",
|
"cookie-parser": "^1.4.6",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"express-session": "^1.17.3",
|
"express-session": "^1.17.3",
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,7 @@ class Server {
|
||||||
global.MetadataPath = fileUtils.filePathToPOSIX(Path.normalize(METADATA_PATH))
|
global.MetadataPath = fileUtils.filePathToPOSIX(Path.normalize(METADATA_PATH))
|
||||||
global.RouterBasePath = ROUTER_BASE_PATH
|
global.RouterBasePath = ROUTER_BASE_PATH
|
||||||
global.XAccel = process.env.USE_X_ACCEL
|
global.XAccel = process.env.USE_X_ACCEL
|
||||||
|
global.DisableSSRF = process.env.DISABLE_SSRF
|
||||||
|
|
||||||
if (!fs.pathExistsSync(global.ConfigPath)) {
|
if (!fs.pathExistsSync(global.ConfigPath)) {
|
||||||
fs.mkdirSync(global.ConfigPath)
|
fs.mkdirSync(global.ConfigPath)
|
||||||
|
|
|
||||||
|
|
@ -251,8 +251,8 @@ module.exports.downloadFile = (url, filepath, contentTypeFilter = null) => {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
responseType: 'stream',
|
responseType: 'stream',
|
||||||
timeout: 30000,
|
timeout: 30000,
|
||||||
httpAgent: ssrfFilter(url),
|
httpAgent: !global.DisableSSRF ? ssrfFilter(url) : undefined,
|
||||||
httpsAgent: ssrfFilter(url)
|
httpsAgent: !global.DisableSSRF ? ssrfFilter(url) : undefined
|
||||||
}).then((response) => {
|
}).then((response) => {
|
||||||
// Validate content type
|
// Validate content type
|
||||||
if (contentTypeFilter && !contentTypeFilter?.(response.headers?.['content-type'])) {
|
if (contentTypeFilter && !contentTypeFilter?.(response.headers?.['content-type'])) {
|
||||||
|
|
|
||||||
|
|
@ -234,8 +234,8 @@ module.exports.getPodcastFeed = (feedUrl, excludeEpisodeMetadata = false) => {
|
||||||
timeout: 12000,
|
timeout: 12000,
|
||||||
responseType: 'arraybuffer',
|
responseType: 'arraybuffer',
|
||||||
headers: { Accept: 'application/rss+xml, application/xhtml+xml, application/xml, */*;q=0.8' },
|
headers: { Accept: 'application/rss+xml, application/xhtml+xml, application/xml, */*;q=0.8' },
|
||||||
httpAgent: ssrfFilter(feedUrl),
|
httpAgent: !global.DisableSSRF ? ssrfFilter(feedUrl) : undefined,
|
||||||
httpsAgent: ssrfFilter(feedUrl)
|
httpsAgent: !global.DisableSSRF ? ssrfFilter(feedUrl) : undefined
|
||||||
}).then(async (data) => {
|
}).then(async (data) => {
|
||||||
|
|
||||||
// Adding support for ios-8859-1 encoded RSS feeds.
|
// Adding support for ios-8859-1 encoded RSS feeds.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue