You are here

How to use bazaar through a HTTP Proxy

Not so frequently asked questions and stuff: 

Bazaar Logo

How to use bazaar through a HTTP Proxy

This will quickly explain how to use bzr trough a HTTP proxy with authentication. We want to branch AND push. This requires the plugin bzr-plugins.

Windows

Download and install the plugin

Download the plugin:

>set http_proxy = http://user:pass@proxy:port
>set https_proxy = http://user:pass@proxy:port
>bzr branch lp:bzr-webdav
You have not informed bzr of your Launchpad ID, and you must do this to
write to Launchpad or access private data.  See "bzr help launchpad-login".
Branched 73 revision(s).

Copy it to C:\Program Files (x86)\Bazaar\plugins or wherever you installed bazaar, and rename it to webdav.

>move bzr-webdav webdav
        1 dir(s) moved.

>copy webdav "c:\Program Files (x86)\Bazaar\plugins"
webdav\COPYING.txt
webdav\info.py
webdav\NOTES
webdav\setup.py
webdav\TODO
webdav\webdav.py
webdav\__init__.py
        7 file(s) copied.

Install the plugin:

>cd "c:\Program Files (x86)\Bazaar\plugins\webdav"

>python.exe setup.py install
running install
running build
running build_py
copying .\info.py -> build\lib\bzrlib\plugins\webdav
copying .\webdav.py -> build\lib\bzrlib\plugins\webdav
copying .\__init__.py -> build\lib\bzrlib\plugins\webdav
copying tests\dav_server.py -> build\lib\bzrlib\plugins\webdav\tests
copying tests\test_webdav.py -> build\lib\bzrlib\plugins\webdav\tests
copying tests\__init__.py -> build\lib\bzrlib\plugins\webdav\tests
running install_lib
running install_egg_info
Removing c:\Python27\Lib\site-packages\bzr_webdav-1.12.3-py2.7.egg-info
Writing c:\Python27\Lib\site-packages\bzr_webdav-1.12.3-py2.7.egg-info

>bzr plugins
...
webdav 1.12.3dev
  An http transport, using webdav to allow pushing.
...

Use the plugin

>set http_proxy = http://user:pass@proxy:port
>bzr push http+webdav://bzr.example.org
HTTP bzr.example.org, Realm: 'SOMEREALM' username: test
HTTP test@bzr.example.org, Realm: 'SOMEREALM' password:
Pushed up to revision 7.

Ubuntu

Download and install the plugin

Configure apt to use the proxy (if necessary):

#export http_proxy = http://user:pass@proxy:port

Add the following lines to your source.list file:

deb http://ppa.launchpad.net/bzr/daily/ubuntu lucid main 
deb-src http://ppa.launchpad.net/bzr/daily/ubuntu lucid main 

Follow the link at https://launchpad.net/~bzr/+archive/daily to get the signing key: http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xD702BF6B8C6C1EFD and save it to a file.

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: SKS 1.0.10

mI0ESXSSBgEEAKqURmlbPIQuqZJ6Gip/Y4hElzJzW8po0k3cQkT+xc7pqqa9QVKi2W2L5XzU
1gXKpzF+dZ+JcVlNQUNLFWeLhLF/Viw5zZTGW4evsEO1Vilp5VHS2YPmJBkibIlZ5UJ+qhaM
lOkf66mFglogG5GZqktPStO9shZfx2MqUK/t6RFBABEBAAG0I0xhdW5jaHBhZCBQUEEgZm9y
IEJhemFhciBEZXZlbG9wZXJziEYEEBECAAYFAkl3aasACgkQ/vSRAed+jpjzngCgu79TtIck
IwSTAuYbrrziZH7oFjwAoKrTHhu41jQKgFhiW7t88JA6LCUMiEYEEBECAAYFAknOwVsACgkQ
9rPTxuzZSv1+IACfVS9KKRtFUF4eS8tLvpVahzkSJsEAoMP3/ASzUP5sHa9pf/UMyzpoaC9H
iEYEEBECAAYFAknS5Z0ACgkQrZORep7Yx+rC1gCglr4g4riENgChBciGIenDAOFgpdUAn3FI
ghBiV+VuBYIE3UlNkc3aRUf5iEYEEBECAAYFAkp/uc0ACgkQuL+o2Md08jv3ogCglVdsjTpj
IVgZJuss2J/oNqAlqIoAoIDctdsxd0iX3tBodkz00+ZpOn/5iLYEEwECACAFAkl0kgYCGwMG
CwkIBwMCBBUCCAMEFgIDAQIeAQIXgAAKCRDXAr9rjGwe/U17A/9DhXbxAzX2czO+KypV3OSz
/p5CjdnOIUbf6LHDOoH7Bxq4a3MUBve5jPe764cjmPPqYElbrtzky9byLjatUO5gSFo2M20I
LajoYUW57is5Fu+m1Y7IHRfLonC44od9XWPvpwROQ00/fqPGHmri5/mPJiaW0N3dniYu7a23
vdaVuQ==
=6i6T
-----END PGP PUBLIC KEY BLOCK-----

Import said key:

#gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /etc/apt/secring.gpg --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --import somekey 
gpg: clé 8C6C1EFD: « Launchpad PPA for Bazaar Developers » une nouvelle signature
gpg: Quantité totale traitée: 1
gpg:         nouvelles signatures: 1
gpg: aucune clé de confiance ultime n'a été trouvée

Install bzr-webdav using the new repository (this will also fetch the latest version of bzr and bzrlib).

#apt-get update
#apt-get install bzr-webdav

Check that bzr-webdav is installed and loaded

#bzr plugins
...
webdav 1.12.2
  An http transport, using webdav to allow pushing.
...

Use bzr-webdav

# bzr branch http://bzr.example.org
HTTP bzr.example.org, Realm: 'SOMEREALM' username: test
HTTP test@bzr.example.org, Realm: 'SOMEREALM' password: 
Branched 8 revisions.                    

# #Commit something

# bzr push http+webdav://bzr.example.org
HTTP bzr.example.org, Realm: 'SOMEREALM' username: test                            
HTTP test@bzr.example.org, Realm: 'SOMEREALM' password: 
Pushed up to revision 9.   

If your proxy configuration is system wide, you can even use the explorer:
Bazaar explorer pushing trough a proxy to a webdav repository

Remember the credentials

authentication.conf:

[EXAMPLE]
scheme=http
host=bzr.example.org
path=/
user=webdav_test
password=webdav_password

Sources: