Awesomeness of docker + docker-registry fully replaced the need of this project.
I am tired of waiting for file downloading again and again while learning and trying chef, vagrant etc. It is even worse when you living in a country with slow internet connection :).
Very simple, we can't cache files as a proxy, then we have to do it on client. Peach contains two sides, server & client. The server side provides an endpoint any client can use it to download files. The client side are some scripts which overrides default wget, curl etc, to make them peach aware.
####Server The server can download and cache files, it provides a minimalist api: http://host:port/download?url=url. Then the file will be cached on disk, all future download can be streamed directly.
####Client A thin wrapper on wget, which aware the Peach server and can download from it directly. When the Env PEACH_SERVER setted, the wrapper will replace url to http://peach_server?file_url=<original_url>, all other params will be passed through to underlying command without any change.
After the installation, wget is super charged:
vagrant@vagrant-ubuntu-trusty-64:~$ wget https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/13.04/x86_64/chef_12.0.3-1_amd64.deb
...
100%[=====================...===============================>] 43,799,970 17.4MB/s in 2.4s
...
###Server
#####Vagrant
git clone the project
vagrant up
#####Start from code
git clone the project
pip install -r requirements.txt
python app.py
###Client
For vagrant users, just use vagrant-peach plugin.
vagrant plugin install vagrant-peach
Then you can try to login and download a file twice to see the download speed boost
vagrant ssh
wget https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/13.04/x86_64/chef_12.0.3-1_amd64.deb -O chef.deb
wget https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/13.04/x86_64/chef_12.0.3-1_amd64.deb -O chef.deb
Add chef-peach to berks file
cookbook "chef-peach", git: "https://github.com/shuoli84/chef-peach"
Then
berks upload
knife node edit node-name
Add chef-peach::default, chef-peach::configure to run list.
###Server proxy support Edit app.py
proxies = {
"http": "http://<proxyserver>:<port>",
"https": "http://<proxyserver>:<port>",
}
Any pull request is welcomed. Or just star the project.
- wget(done)
- Curl(done)
- vagrant, chef etc framework support(done)
- Basic auth
- Server side, other ways to download files, e.g, btsync