Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorMohammed Abdellatif <m.latief@gmail.com>2019-10-25 22:21:32 +0300
committerMohammed Abdellatif <m.latief@gmail.com>2020-02-29 20:19:23 +0300
commit98d6415264c1f211f50ee7a0b336103a488c3608 (patch)
tree412bc17cede241df5f4b4b97377169f45e48c2c9 /config
parent1e16fa7a8fc72f2a491ff90f9a5b5a194e78d796 (diff)
Add support for GuzzleHTTP 'no' proxy
The custom config allows to setup a proxy URI that is passed to GuzzleHTTP client as request options. Guzzle has the option to receive an array of proxies for each URI scheme as well as 'no' key value pair to provide a list of host names that should not be proxied to. Guzzle would automatically populate these options with HTTPS_PROXY and NO_PROXY environment variables. However, when providing a 'proxy' request option, default values will be overriden and it is required to explicitly provide the 'no' value if needed. More info: http://docs.guzzlephp.org/en/stable/request-options.html#proxy This commit will add support for a new config 'proxyexclude', which takes a list of host names to be excluded. It will also provide 'proxy' request option as an array instead of a string to Guzzle, and populate 'http' and 'https' URI schemes with proxy URI, and 'no' with 'proxyexclude' list. Also, if no 'proxy' is configured, it will leave out 'proxy' request option, so it won't override Guzzle default values. Sample config file includes a hint on how to explicitly sync 'proxyexclude' with NO_PROXY, and a note about default values. Signed-off-by: Mohammed Abdellatif <m.latief@gmail.com>
Diffstat (limited to 'config')
-rw-r--r--config/config.sample.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/config/config.sample.php b/config/config.sample.php
index 2894bc5debc..ea91bb83bb4 100644
--- a/config/config.sample.php
+++ b/config/config.sample.php
@@ -520,6 +520,12 @@ $CONFIG = array(
/**
* The URL of your proxy server, for example ``proxy.example.com:8081``.
*
+ * Note: Guzzle (the http library used by Nextcloud) is reading the environment
+ * variables HTTP_PROXY (only for cli request), HTTPS_PROXY, and NO_PROXY by default.
+ *
+ * If you configure proxy with Nextcloud any default configuration by Guzzle
+ * is overwritten. Make sure to set ``proxyexclude`` accordingly if necessary.
+ *
* Defaults to ``''`` (empty string)
*/
'proxy' => '',
@@ -532,6 +538,16 @@ $CONFIG = array(
*/
'proxyuserpwd' => '',
+/**
+ * List of host names that should not be proxied to.
+ * For example: ``['.mit.edu', 'foo.com']``.
+ *
+ * Hint: Use something like ``explode(',', getenv('NO_PROXY'))`` to sync this
+ * value with the global NO_PROXY option.
+ *
+ * Defaults to empty array.
+ */
+'proxyexclude' => [],
/**
* Deleted Items (trash bin)