diff --git a/apps/iframely/2.4.3/config/config.local.js b/apps/iframely/2.4.3/config/config.local.js index a98f7a9e..cc3ff0c0 100644 --- a/apps/iframely/2.4.3/config/config.local.js +++ b/apps/iframely/2.4.3/config/config.local.js @@ -88,38 +88,28 @@ export default { } }], - - ENABLED_PROXY: process.env.ENABLED_PROXY === 'true', - PROXY_URL: process.env.PROXY_URL, + /* PROXY: [{ - re: [ - /^https?:\/\/([a-zA-Z0-9-]+\.)*google\.com/, - /^https?:\/\/([a-zA-Z0-9-]+\.)*facebook\.com/, - /^https?:\/\/([a-zA-Z0-9-]+\.)*twitter\.com/, - /^https?:\/\/([a-zA-Z0-9-]+\.)*youtube\.com/, - /^https?:\/\/([a-zA-Z0-9-]+\.)*instagram\.com/, - /^https?:\/\/([a-zA-Z0-9-]+\.)*whatsapp\.com/, - /^https?:\/\/([a-zA-Z0-9-]+\.)*snapchat\.com/, - /^https?:\/\/([a-zA-Z0-9-]+\.)*tumblr\.com/, - /^https?:\/\/([a-zA-Z0-9-]+\.)*reddit\.com/, - /^https?:\/\/([a-zA-Z0-9-]+\.)*pinterest\.com/, - /^https?:\/\/([a-zA-Z0-9-]+\.)*flickr\.com/, - /^https?:\/\/([a-zA-Z0-9-]+\.)*blogspot\.com/, - /^https?:\/\/([a-zA-Z0-9-]+\.)*wordpress\.com/, - /^https?:\/\/([a-zA-Z0-9-]+\.)*wikipedia\.org/, - /^https?:\/\/([a-zA-Z0-9-]+\.)*imdb\.com/, - /^https?:\/\/([a-zA-Z0-9-]+\.)*vimeo\.com/, - /^https?:\/\/([a-zA-Z0-9-]+\.)*soundcloud\.com/, - /^https?:\/\/([a-zA-Z0-9-]+\.)*spotify\.com/, - /^https?:\/\/([a-zA-Z0-9-]+\.)*linkedin\.com/ - ], - proxy: process.env.ENABLED_PROXY === 'true', - proxy_url: process.env.PROXY_URL, - user_agent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3', - headers: {}, - cache_ttl: 3600 + re: [/^https?:\/\/www\.domain\.com/], + + // Either `proxy`, or `proxy_url`, or none. + proxy: true, // Will fetch URL via echo service configured as PROXY_URL. See below. + // proxy_url: 'http://1.2.3.4:8080?url={url}', // Will fetch URL via this exact echo service, see below. + + user_agent: 'CHANGE YOUR AGENT', + headers: { + // HTTP headers + // Overrides previous params if overlapped. + }, + cache_ttl: 3600 // in seconds, cache response for 1 hour. }], + // Proxy now requires an echo service endpoint. + // See #354 and example code at + // https://gist.github.com/nleush/7916ee89f7b8d6f0cd478d7335702139 + PROXY_URL: 'http://1.2.3.4:8080?url={url}', // Iframely will add `?url=...` to this endpoint + */ + providerOptions: { locale: "en_US", "twitter": { diff --git a/apps/iframely/2.4.3/data.yml b/apps/iframely/2.4.3/data.yml index 75b8ff3a..0e70fadc 100644 --- a/apps/iframely/2.4.3/data.yml +++ b/apps/iframely/2.4.3/data.yml @@ -8,23 +8,11 @@ additionalProperties: required: true rule: paramPort type: number - - default: "false" - edit: true - envKey: ENABLED_PROXY - labelZh: 是否开启代理 - labelEn: Enable Proxy - required: true - type: select - values: - - label: 开启 - value: "true" - - label: 关闭 - value: "false" - default: "" edit: true - envKey: PROXY_URL - labelZh: 代理地址 - labelEn: Proxy URL + envKey: HTTP_PROXY + labelZh: HTTP 代理 + labelEn: HTTP Proxy required: false type: text - default: 4 diff --git a/apps/iframely/2.4.3/docker-compose.yml b/apps/iframely/2.4.3/docker-compose.yml index d991f1d5..3b3a053f 100644 --- a/apps/iframely/2.4.3/docker-compose.yml +++ b/apps/iframely/2.4.3/docker-compose.yml @@ -24,3 +24,4 @@ services: - NODE_ENV=production - PORT=8061 - HOST=0.0.0.0 + - HTTPS_PROXY=${HTTP_PROXY} diff --git a/apps/iframely/README.md b/apps/iframely/README.md index bf54e9f7..5c1c5a7f 100644 --- a/apps/iframely/README.md +++ b/apps/iframely/README.md @@ -22,14 +22,6 @@ iframely 了解来自 1900 多家出版商的富媒体,并且还在不断增 > > Debugger UI: '/debug' -### 代理配置 - -基本格式:`{protocol}://{host}:{port}` - -+ `protocol` - 代理服务器的协议 -+ `host` - 代理服务器的主机名 -+ `port` - 代理服务器的端口号 - ### 其他配置 自行修改 `config/config.local.js` 配置文件,重启生效