Skip to content

Commit ffa43cc

Browse files
DOCSP-20089 Add documentation around HTTP Proxy support (#665)
* DOCSP-20089 Add documentation around HTTP Proxy support * DOCSP-20089 updates for copy review feedback * DOCSP-20089 updates for review feedback * DOCSP-20089 updates to add example * DOCSP-20089 updates for feedback
1 parent e19cd33 commit ffa43cc

File tree

2 files changed

+88
-3
lines changed

2 files changed

+88
-3
lines changed

source/configure.txt

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,45 @@ Configure the {+mcli+}
2222

2323
You can define the settings that the {+mcli+} uses to interact with
2424
MongoDB services like |service|, |cloud-short|, and |onprem| by using
25-
the :ref:`mongocli-auth-login` or :ref:`mongocli-config` commands.
26-
The first time you run one of these commands, the {+mcli+} creates a :ref:`configuration file
27-
<mcli-config-file>` called ``mongocli.toml`` to store your settings.
25+
the :ref:`mongocli-auth-login` or :ref:`mongocli-config` command. The
26+
first time you run one of these commands, the {+mcli+} creates a
27+
:ref:`configuration file <mcli-config-file>` called ``mongocli.toml``
28+
to store your settings.
29+
30+
Prerequisites
31+
-------------
32+
33+
To configure the {+mcli+}:
34+
35+
- Add your |ipaddr| or |cidr| block to the |api| whitelist for your
36+
MongoDB service.
37+
- Generate a |svc-api-key| if you don't already have one.
38+
39+
.. note::
40+
41+
|svc-api-key|\s are role-based. Different roles have different
42+
privileges and capabilities, and some {+mcli+} commands are available
43+
to some roles but not others. Be sure that the roles assigned to
44+
your |svc-api-key| are appropriate for the commands you intend to
45+
use.
46+
47+
To learn more about generating a |svc-api-key| for
48+
your MongoDB service, see the following documentation:
49+
50+
- :atlas:`Atlas API Access </configure-api-access>`
51+
- :cloudmgr:`Cloud Manager API Access </tutorial/configure-public-api-access>`
52+
- :opsmgr:`Ops Manager API Acess </tutorial/configure-public-api-access>`
53+
54+
- Set up the ``HTTP_PROXY`` or ``HTTPS_PROXY`` :ref:`environment
55+
variable <mcli-env-var>` if your {+mcli+} installation is behind a
56+
firewall and you want to use a proxy |url|. {+mcli+} supports
57+
``http``, ``https``, and ``socks5`` schemes. In addition, specify
58+
``cloud.mongodb.com/`` as the main target URL in the proxy service's
59+
access list. You must specify the username and password also if your
60+
proxy configuration enables authentication.
61+
62+
To learn more, see `Proxy server
63+
<https://en.wikipedia.org/wiki/Proxy_server>`__.
2864

2965
Procedure
3066
---------

source/configure/environment-variables.txt

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,52 @@ The {+mcli+} supports the following environment variables:
129129

130130
Setting ``MCLI_OPS_MANAGER_SKIP_VERIFY`` to ``yes`` is
131131
insecure and is not recommended in production environments.
132+
133+
* - ``HTTP_PROXY``, ``http_proxy``
134+
- The absolute |url| or the hostname and port in the
135+
``hostname[:port]`` format.
136+
137+
.. example::
138+
139+
The following example shows how to set up the environment
140+
variable if your proxy configuration doesn't require
141+
authentication.
142+
143+
.. code-block:: sh
144+
:copyable: false
145+
146+
HTTP_PROXY=<my.proxy.address>
147+
148+
The following example shows how to set up the environment
149+
variable if your proxy configuration requires authentication.
150+
151+
.. code-block:: sh
152+
:copyable: false
153+
154+
HTTP_PROXY=username:password@<my.proxy.address>
155+
156+
The following example shows how to set up the environment
157+
variable if the scheme is ``socks5``.
158+
159+
.. code-block:: sh
160+
:copyable: false
161+
162+
HTTP_PROXY=socks5://<my.proxy.address>
163+
164+
* - ``HTTPS_PROXY``, ``https_proxy``
165+
- The absolute |url|. If ``HTTP_PROXY`` is also set, this takes
166+
precedence over ``HTTP_PROXY`` for all requests.
167+
168+
.. example::
169+
170+
The following example shows how to set up the environment
171+
variable.
172+
173+
.. code-block:: sh
174+
:copyable: false
175+
176+
HTTPS_PROXY=https://<my.proxy.address>
177+
178+
* - ``NO_PROXY``, ``no_proxy``
179+
- Indicates no proxy for the |url| because proxy isn't configured
180+
for the |url|.

0 commit comments

Comments
 (0)