support https_proxy for use with duplicity -> s3
I've got backupninja marshalling remote backups to an Amazon S3 busket using duplicity. I'd like to be able to get this to go via an https proxy (i.e. using HTTP CONNECT method).
I've tried setting https_proxy=https://proxy.host:3128 in /the cron file before running backupninja. It gets ignored.
I've also tried setting http_proxy=https://proxy.host:3128, also in the cron file. I get the following trasceback:
Debug: duplicity --volsize 500 --s3-use-new-style --no-print-statistics --ssh-options '' --full-if-older-than 30D --extra-clean --archive-dir /var/cache/backupninja/duplicity --exclude '**/rdiff-backup-data' --include '/etc' --include '/var/backups' --exclude '**' / s3+http://ag-backup-002
Error: Traceback (most recent call last):
Error: File "/usr/bin/duplicity", line 1404, in <module>
Error: with_tempdir(main)
Error: File "/usr/bin/duplicity", line 1397, in with_tempdir
Error: fn()
Error: File "/usr/bin/duplicity", line 1248, in main
Error: action = commandline.ProcessCommandLine(sys.argv[1:])
Error: File "/usr/lib/python2.7/dist-packages/duplicity/commandline.py", line 1007, in ProcessCommandLine
Error: backup, local_pathname = set_backend(args[0], args[1])
Error: File "/usr/lib/python2.7/dist-packages/duplicity/commandline.py", line 900, in set_backend
Error: globals.backend = backend.get_backend(bend)
Error: File "/usr/lib/python2.7/dist-packages/duplicity/backend.py", line 158, in get_backend
Error: return _backends[pu.scheme](pu)
Error: File "/usr/lib/python2.7/dist-packages/duplicity/backends/_boto_single.py", line 77, in __init__
Error: self.resetConnection()
Error: File "/usr/lib/python2.7/dist-packages/duplicity/backends/_boto_single.py", line 144, in resetConnection
Error: self.conn = S3Connection(is_secure=(not globals.s3_unencrypted_connection))
Error: File "/usr/lib/python2.7/dist-packages/boto/s3/connection.py", line 155, in __init__
Error: suppress_consec_slashes=suppress_consec_slashes)
Error: File "/usr/lib/python2.7/dist-packages/boto/connection.py", line 430, in __init__
Error: self.handle_proxy(proxy, proxy_port, proxy_user, proxy_pass)
Error: File "/usr/lib/python2.7/dist-packages/boto/connection.py", line 588, in handle_proxy
Error: self.proxy_port = self.port
Error: AttributeError: 'S3Connection' object has no attribute 'port'
Error: http_proxy environment variable does not specify a port, using default
Fatal: Duplicity failed.
Fatal: <<<< finished action /etc/backup.d/95-duplicity-s3.dup: FAILED
I'm running current distribution versions of everything on a debain wheezy host. backupninja: 1.0.1-2 python-boto: 2.3.0-1
(from redmine: created on 2015-02-14)
Edited by Guillaume Subiron