Proxy Configuration

When working behind a corporate proxy server, one typically has to configure proxy settings for applications to reach the Internet. Clear Linux* OS has implemented an 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 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.

Prerequisites

  • You have installed Clear Linux OS on your host system.

    For detailed instructions on installing Clear Linux OS on a bare metal system, visit the bare metal installation guide.

General proxy settings for many applications

  1. 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:

    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 $HOME/.bashrc.

    • For all users, put them in /etc/profile.d/proxy.conf.

  2. For the proxies to take effect, either source the file manually or log out and log back in.

Docker*

Please refer the official Docker links on how to configure proxies:

git over SSH

Add the following to your ~/.ssh/config file:

host github.com
     port 22
     user git
     ProxyCommand connect-proxy -S <YOUR.SSH-PROXY.URL:PORT> %h %p

Note

Though netcat is included with Clear Linux OS, it is not the BSD version, which is the one usually used to enable git over SSH.

autospec/mock

autospec uses mock to do builds. Configure mock’s proxy settings with these steps:

  1. Override the general mock configuration file with a custom one, otherwise your settings will get overwritten each time autospec is updated.

    sudo mkdir -p /etc/mock
    sudo cp ~/clearlinux/projects/common/conf/clear.cfg /etc/mock/clear-custom.cfg
    
  2. sudoedit /etc/mock/clear-custom.cfg and add the highlighted lines.

    ...
    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'