Personal tools
     DOCUMENTATION

Conary:Web Proxy

From rPath Wiki

Jump to: navigation, search

Contents

The Conary package manager may be configured to use a HTTP or HTTPS proxies with or without authentication. Conary version 1.1.24 introduced the HTTP Proxy setting and Conary version 1.1.27 brought the ability to use a proxy with authentication. Settings for individual proxies are placed inside system wide conaryrc (/etc/conaryrc) or inside individual directory ~/.conaryrc files.

Default Conary Setting

The default Conary setting for proxies is "None". This means that Conary will not use a proxy until a setting is provided for it manually.

Changing Proxy Settings

Change this setting for Conary by placing a proxy line inside of /etc/conaryrc or ~/.conaryrc:

proxy http://hostname.com:port

Place this line at the top of your conaryrc file. Placing this setting inside the context labels in conaryrc will result in the proxy only being used for that individual context where the setting appears. Placing the proxy setting outside of context labels in conaryrc will set the proxy globally for all contexts.

Checking the Conary Configuration

Check the Conary setting for proxy using conary config and grep:

#> conary config | grep proxy
proxy                     http                      http://example.com
proxy                     https                     https://example.com

Removing Proxy Settings

Remove the proxy line from your /etc/conaryrc or ~/.conaryrc file (depending on where you have set it). After removing the entry, conary config proxy entry is not displayed:

#> conary config | grep proxy
#>

Secure Proxy using HTTP

Setting the proxy line in conaryrc will default Conary to using the same hostname and port number for HTTP Secure. Override this by adding a second proxy line in conaryrc and differentiating the two settings from one another by adding in http and https for each respective proxy:

proxy http http://example.com:port
proxy https https://secure.example.com:port

These settings can also be placed on individual context labels for granular control.

Image:Bulbgraph.png   You are not required to add http or https to the conaryrc settings unless you need to differentiate between them. Conary assumes that both secure and standard proxies are of the same address unless through setting each line separately, Conary is told otherwise. Thus, setting proxy http://example.com:port is the exact same as setting proxy http http://example.com:port. rPath recommends only differentiating Conary proxy settings if there is a need to do so.

Authenticated Proxy Setting

Proxies that require authentication must be dealt with differently using the aforementioned information. Inside conaryrc, change the proxy line to match the following:

proxy http://user:pass@hostname:port


Where user:pass is your username and password and hostname:port is the hostname and port of the proxy which you are trying to authenticate with.


Special Characters in Passwords

Using special characters in a password like #, %, and @ require special consideration for Conary and proxies to recognize. Use the following command shown in the example below to allow Conary and a proxy to use a password with special characters accordingly:

#>  python -c "import urllib; print urllib.quote('#p@$$w0rd&')"
  • Replace #p@$$w0rd& with your password containing special characters
  • Upon pressing enter, the command will display the password in a form conducive to Conary and proxy interaction
  • Input the returned password into your conaryrc as show in the Authenticated Proxy Setting section above

Limitations

When configuring a Conary client, HTTP proxies cannot be used in conjunction with Conary proxies. If both an HTTP proxy and a Conary proxy is set in conaryrc, then the Conary proxy will take precedence over the HTTP proxy.