Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polipo caching web proxy support #551

Merged
merged 3 commits into from
May 23, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions plans/polipo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This plan builds and configures the [polipo](https://www.irif.univ-paris-diderot.fr/~jch/software/polipo/) caching web proxy. After you deploy a dockerized polipo, you can use it as a caching proxy for Habitat by exporting it in your shell.

http_proxy=http://192.168.142.180:8123; export http_proxy

It appears that not every Habitat command utilizes the `http_proxy` environment variable yet, but those that do produce decidedly faster builds.
6 changes: 6 additions & 0 deletions plans/polipo/config/polipo.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
disableIndexing = false
disableServersList = false
diskCacheRoot = "{{pkg.svc_path}}/cache/"
dnsNameServer = "8.8.8.8"
proxyAddress = "::0"
proxyPort = {{cfg.port}}
2 changes: 2 additions & 0 deletions plans/polipo/default.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# The port number that is listening for requests.
port=8123
4 changes: 4 additions & 0 deletions plans/polipo/hooks/init
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
#

mkdir {{pkg.svc_path}}/cache/
5 changes: 5 additions & 0 deletions plans/polipo/hooks/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
#

cd {{pkg.svc_path}}
polipo -c {{pkg.svc_path}}/config/polipo.config
24 changes: 24 additions & 0 deletions plans/polipo/plan.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
pkg_name=polipo
pkg_origin=core
pkg_version=1.1.1
pkg_maintainer="The Habitat Maintainers <[email protected]>"
pkg_license=('mit')
pkg_source=https://github.com/jech/polipo/archive/${pkg_name}-${pkg_version}.tar.gz
pkg_shasum=de0afeeaa47df776420e59b69e9a78f68e8a7bc4a46b739772e1d91119ed2405
pkg_deps=(core/glibc)
pkg_build_deps=(core/gcc core/make)
pkg_bin_dirs=(bin)
pkg_include_dirs=(include)
pkg_lib_dirs=(lib)
pkg_expose=(8123)

pkg_dirname="${pkg_name}-${pkg_name}-${pkg_version}"

do_build() {
make
}

do_install() {
mkdir $pkg_prefix/bin/
cp polipo $pkg_prefix/bin/
}