Update "Proxy Configuration" tutorial (#1165)

Closes #1125

Signed-off-by: Bun K Tan <bun.k.tan@intel.com>
This commit is contained in:
bktan8
2020-05-20 10:02:12 -07:00
committed by GitHub
parent 408f5965a7
commit f4670e50bf
4 changed files with 121 additions and 119 deletions
+2 -1
View File
@@ -594,6 +594,7 @@ Related topics
**************
* :ref:`Mixer tool <mixer>`
* :ref:`Proxy Configuration <proxy>`
.. _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
.. TODO: Add link to how to submit a new package: https://github.com/clearlinux/distribution/blob/master/contributing.md#contributing-a-new-software-package
+3
View File
@@ -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 <proxy>` 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.
+116
View File
@@ -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 <bare-metal-install-desktop>`.
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://<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-DOMAIN>,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 <YOUR.SSH-PROXY.URL:PORT> %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'] = '<YOUR.HTTP.PROXY.URL>:<PORT>'
config_opts['https_proxy'] = '<YOUR.HTTPS.PROXY.URL>:<PORT>'
config_opts['no_proxy'] = '<YOUR.DOMAIN>,192.168.0.0/16,localhost,127.0.0.0/8'
Kubernetes
==========
See :ref:`Setting proxy servers for Kubernetes <kubernetes>`.
.. _Docker client:
https://docs.docker.com/network/proxy/#configure-the-docker-client
.. _Docker daemon:
https://docs.docker.com/config/daemon/systemd/#httphttps-proxy
-118
View File
@@ -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 <bare-metal-install-desktop>`.
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 <<EOF
http_proxy = your.http-proxy.url:port
https_proxy = your.https-proxy.url:port
ftp_proxy = your.http-proxy.url:port
no_proxy = your-company-domain.com, localhost
EOF
System service (Docker\*)
=========================
For Docker (and other services that use systemd), follow these steps to
configure and check proxy settings.
.. note::
Use :command:`sudo`, as you will need elevated permissions.
#. Create the :file:`/etc/systemd/system/docker.service.d` directory to host
configuration information for the Docker service.
#. Create the :file:`/etc/systemd/system/docker.service.d/http-proxy.conf`
and add the following lines:
.. code-block:: bash
[Service]
Environment="HTTP_PROXY=http://your.http-proxy.url:port/"
Environment="HTTPS_PROXY=http://your.https-proxy.url:port/"
#. Load the changes and restart the service.
.. code-block:: bash
sudo systemctl daemon-reload
sudo systemctl restart docker
#. Verify that changes have loaded.
.. code-block:: bash
systemctl show --property=Environment docker
.. code-block:: console
Environment=HTTP_PROXY=http://your.http-proxy.url:port/ HTTPS_PROXY=http://your.https-proxy.url:port/
.. note::
This process enables the ability to successfully run ``docker pull``.
Containers themselves must be configured independently.
git over ssh
************
Add the following to your :file:`~/.ssh/config`:
.. code-block:: bash
host github.com
port 22
user git
ProxyCommand connect-proxy -S your.ssh-proxy.url:port %h %p
.. note::
Though netcat is included with |CL|, it is not the BSD version,
which is the one usually used to enable git over ssh.