From f4670e50bfde4cc00775dd7363a6926cfec08f74 Mon Sep 17 00:00:00 2001 From: bktan8 Date: Wed, 20 May 2020 10:02:12 -0700 Subject: [PATCH] Update "Proxy Configuration" tutorial (#1165) Closes #1125 Signed-off-by: Bun K Tan --- source/guides/clear/autospec.rst | 3 +- source/guides/clear/mixer.rst | 3 + source/guides/network/proxy.rst | 116 ++++++++++++++++++++++++++++++ source/tutorials/proxy.rst | 118 ------------------------------- 4 files changed, 121 insertions(+), 119 deletions(-) create mode 100644 source/guides/network/proxy.rst delete mode 100644 source/tutorials/proxy.rst diff --git a/source/guides/clear/autospec.rst b/source/guides/clear/autospec.rst index 566241d6..0727392e 100644 --- a/source/guides/clear/autospec.rst +++ b/source/guides/clear/autospec.rst @@ -594,6 +594,7 @@ Related topics ************** * :ref:`Mixer tool ` +* :ref:`Proxy Configuration ` .. _contributing to an existing software package: https://github.com/clearlinux/distribution/blob/master/contributing.md#contributing-to-an-existing-software-package @@ -607,4 +608,4 @@ Related topics .. _RPM Packaging Guide: https://rpm-packaging-guide.github.io/ -.. TODO: Add link to how to submit a new package: https://github.com/clearlinux/distribution/blob/master/contributing.md#contributing-a-new-software-package \ No newline at end of file +.. TODO: Add link to how to submit a new package: https://github.com/clearlinux/distribution/blob/master/contributing.md#contributing-a-new-software-package diff --git a/source/guides/clear/mixer.rst b/source/guides/clear/mixer.rst index 03897532..b384dda9 100644 --- a/source/guides/clear/mixer.rst +++ b/source/guides/clear/mixer.rst @@ -52,6 +52,9 @@ Prerequisites Add the mixer tool by installing the :command:`mixer` bundle. Refer to :ref:`swupd-guide` for more information on installing bundles. +* If you're working behind a corporate proxy, configure proxy settings using + the :ref:`General proxy settings for many applications ` steps. + * Location to host the update content and images In order for :command:`swupd` to make use of your mix, the update content for your mix must be hosted on a web server. Your mix will be configured with an update location URL, which :command:`swupd` will use to pull down updates. diff --git a/source/guides/network/proxy.rst b/source/guides/network/proxy.rst new file mode 100644 index 00000000..b4c1f448 --- /dev/null +++ b/source/guides/network/proxy.rst @@ -0,0 +1,116 @@ +.. _proxy: + +Proxy Configuration +################### + +When working behind a corporate proxy server, one typically has to configure +proxy settings for applications to reach the Internet. |CL-ATTR| has +implemented an :ref:`autoproxy` feature to try and eliminate manual +configurations as much as possible. However, there are still some applications +that cannot take full advantage of the :ref:`autoproxy` feature due to their +own ways of configuring proxy settings. This guide shows you how to configure +proxy settings for some of the known applications manually. + +.. contents:: + :local: + :depth: 1 + +Prerequisites +************* + +* You have installed |CL| on your host system. + + For detailed instructions on installing |CL| on a bare metal system, visit + the :ref:`bare metal installation guide `. + +General proxy settings for many applications +============================================ + +#. First, apply these general proxy settings which should work for many + applications. If they do not work for a specific application, such as the + ones listed below, apply application-specific proxy settings as needed. + + Proxy settings: + + .. code-block:: none + + export http_proxy=http:// + export https_proxy=http:// + export ftp_proxy=http:// + export socks_proxy=http:// + export no_proxy=",localhost" + export HTTP_PROXY=$http_proxy + export HTTPS_PROXY=$https_proxy + export FTP_PROXY=$ftp_proxy + export SOCKS_PROXY=$socks_proxy + export NO_PROXY=$no_proxy + + * *User-specific*, put them in :file:`$HOME/.bashrc`. + + * *For all users*, put them in :file:`/etc/profile.d/proxy.conf`. + +#. For the proxies to take effect, either :command:`source` the file manually + or log out and log back in. + +Docker\* +======== + +Please refer the official Docker links on how to configure proxies: + +* `Docker client`_ +* `Docker daemon`_ + +git over SSH +============ + +Add the following to your :file:`~/.ssh/config` file: + +.. code-block:: none + + host github.com + port 22 + user git + ProxyCommand connect-proxy -S %h %p + +.. note:: + + Though :command:`netcat` is included with |CL|, it is not the BSD version, + which is the one usually used to enable git over SSH. + +autospec/mock +============= + +:ref:`autospec` uses mock to do builds. Configure mock's proxy settings with +these steps: + +#. Override the general mock configuration file with a custom one, otherwise + your settings will get overwritten each time autospec is updated. + + .. code-block:: bash + + sudo mkdir -p /etc/mock + sudo cp ~/clearlinux/projects/common/conf/clear.cfg /etc/mock/clear-custom.cfg + +#. :command:`sudoedit` :file:`/etc/mock/clear-custom.cfg` and add the highlighted + lines. + + .. code-block:: none + :emphasize-lines: 3-5 + + ... + config_opts['use_bootstrap_container'] = False + config_opts['http_proxy'] = ':' + config_opts['https_proxy'] = ':' + config_opts['no_proxy'] = ',192.168.0.0/16,localhost,127.0.0.0/8' + +Kubernetes +========== + +See :ref:`Setting proxy servers for Kubernetes `. + +.. _Docker client: + https://docs.docker.com/network/proxy/#configure-the-docker-client + +.. _Docker daemon: + https://docs.docker.com/config/daemon/systemd/#httphttps-proxy + diff --git a/source/tutorials/proxy.rst b/source/tutorials/proxy.rst deleted file mode 100644 index e1a52d24..00000000 --- a/source/tutorials/proxy.rst +++ /dev/null @@ -1,118 +0,0 @@ -.. _proxy: - -Proxy configuration -################### - -This tutorial shows you how to configure your system for use behind an -outbound proxy to access the Internet. - -|CL-ATTR| applications already benefit from the :ref:`autoproxy` -feature. - -.. contents:: - :local: - :depth: 1 - -Prerequisites -************* - -* You have installed |CL| on your host system. - - For detailed instructions on installing |CL| on a bare metal system, visit - the :ref:`bare metal installation guide `. - -Shells and programs in a desktop session -**************************************** - -Terminal -======== - -Add the following to your ~/.bashrc: - -.. code-block:: bash - - export http_proxy=http://your.http-proxy.url:port - export https_proxy=http://your.https-proxy.url:port - export ftp_proxy=http://your.ftp-proxy.url:port - export socks_proxy=http://your.socks-proxy.url:port - export no_proxy=".your-company-domain.com,localhost" - export HTTP_PROXY=$http_proxy - export HTTPS_PROXY=$https_proxy - export FTP_PROXY=$ftp_proxy - export SOCKS_PROXY=$socks_proxy - export NO_PROXY=$no_proxy - -wget -==== - -Run the following command to enable downloading from websites from the terminal: - -.. code-block:: bash - - echo >> ~/.wgetrc <