Mobrovac has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/207467

Change subject: Allow the full configuration of domains which shouldn't be 
proxied
......................................................................

Allow the full configuration of domains which shouldn't be proxied

Previously, we had the zoteroUseProxy config directive to denote whether
calls to zotero should we proxied. This commit expands this notion to
allow a configurable list of domains for which no proxy should be used.

Bug: T97530
Change-Id: Ifd52579a176d0abae74910b19563d45625a0bad8
---
M app.js
M config.dev.yaml
2 files changed, 12 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/citoid 
refs/changes/67/207467/1

diff --git a/app.js b/app.js
index ebd1107..80430e1 100644
--- a/app.js
+++ b/app.js
@@ -41,9 +41,14 @@
        // set outgoing proxy
        if(app.conf.proxy) {
                process.env.HTTP_PROXY = app.conf.proxy;
-               if(!app.conf.zoteroUseProxy) {
-                       // don't use proxy for accessing Zotero unless 
specified in settings
-                       process.env.NO_PROXY = app.conf.zoteroInterface;
+               // if there is a list of domains which should
+               // not be proxied, set it
+               if(app.conf.no_proxy_list) {
+                       if(Array.isArray(app.conf.no_proxy_list)) {
+                               process.env.NO_PROXY = 
app.conf.no_proxy_list.join(',');
+                       } else {
+                               process.env.NO_PROXY = app.conf.no_proxy_list;
+                       }
                }
        }
 
diff --git a/config.dev.yaml b/config.dev.yaml
index 93e1437..00eedd2 100644
--- a/config.dev.yaml
+++ b/config.dev.yaml
@@ -40,13 +40,13 @@
       # cors: false
       # to restrict to a particular domain, use:
       # cors: restricted.domain.org
-      # URL of the outbound proxy to use (complete with protocol)
-      # proxy: http://127.0.0.0.1
       # User-Agent HTTP header to use for requests
       userAgent: null
       # URL where to contact Zotero
       zoteroInterface: 127.0.0.1
       # zotero's server port
       zoteroPort: 1969
-      # whether the proxy should be used to contact zotero
-      zoteroUseProxy: false
+      # URL of the outbound proxy to use (complete with protocol)
+      # proxy: http://127.0.0.0.1
+      # the list of domains for which not to use the proxy defined above
+      # no_proxy_list: 127.0.0.1

-- 
To view, visit https://gerrit.wikimedia.org/r/207467
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifd52579a176d0abae74910b19563d45625a0bad8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/citoid
Gerrit-Branch: master
Gerrit-Owner: Mobrovac <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to