ports/contrib (3.6): polipo: initial commit, v1.1.1
commit deb05904c4fbd9b98501dfeea1b28430f54a3fba Author: Alexandr Savca <alexandr.savca89@gmail.com> Date: Fri Dec 18 14:12:05 2020 +0200 polipo: initial commit, v1.1.1 diff --git a/polipo/.footprint b/polipo/.footprint new file mode 100644 index 000000000..54ea6c871 --- /dev/null +++ b/polipo/.footprint @@ -0,0 +1,18 @@ +drwxr-xr-x root/root etc/ +drwxr-xr-x root/root etc/polipo/ +-rwxr-xr-x root/root etc/polipo/config +drwxr-xr-x root/root etc/rc.d/ +-rwxr-xr-x root/root etc/rc.d/polipo +drwxr-xr-x root/root usr/ +drwxr-xr-x root/root usr/bin/ +-rwxr-xr-x root/root usr/bin/polipo +drwxr-xr-x root/root usr/share/ +drwxr-xr-x root/root usr/share/man/ +drwxr-xr-x root/root usr/share/man/man1/ +-rw-r--r-- root/root usr/share/man/man1/polipo.1.gz +drwxr-xr-x root/root var/ +drwxr-xr-x root/root var/cache/ +drwxr-xr-x polipo/polipo var/cache/polipo/ +drwxr-xr-x root/root var/www/ +drwxr-xr-x root/root var/www/polipo/ +-rw-r--r-- root/root var/www/polipo/index.html diff --git a/polipo/.signature b/polipo/.signature new file mode 100644 index 000000000..4291eaf8e --- /dev/null +++ b/polipo/.signature @@ -0,0 +1,7 @@ +untrusted comment: verify with /etc/ports/contrib.pub +RWSagIOpLGJF3+q9uTq56uMzbV/FyNCySgbOPdTTGcI59iYJGRu58m+8ve/nRtiicwooHo2NeF1VWtHlkhMxX4yOqT2lI1xTIw0= +SHA256 (Pkgfile) = d22852694622609b69aef6914e802ee1603f7a4d602875130d17953538690504 +SHA256 (.footprint) = 7db110ba2f2a4f07da512ddc5b09e2a8fb9960c98548de96f232acf3a7b206c8 +SHA256 (polipo-1.1.1.tar.gz) = a259750793ab79c491d05fcee5a917faf7d9030fb5d15e05b3704e9c9e4ee015 +SHA256 (rc.polipo) = 099a2dae8198246ceaee637ca587a2682478caa6d0d58bf530d05d34b8579b57 +SHA256 (config.patch) = 2c9e9a3dfd8e9a7d21c1685f031e218feb0c8870f833daeb2185686a6aa42530 diff --git a/polipo/Pkgfile b/polipo/Pkgfile new file mode 100644 index 000000000..fb7b7f3a9 --- /dev/null +++ b/polipo/Pkgfile @@ -0,0 +1,29 @@ +# Description: Web caching proxy +# URL: http://www.pps.jussieu.fr/~jch/software/polipo/ +# Maintainer: Alexandr Savca, alexandrsavca89 at gmail dot com + +name=polipo +version=1.1.1 +release=1 +source=(http://www.pps.univ-paris-diderot.fr/~jch/software/files/$name/$name-$versio... + rc.polipo + config.patch) + +build() { + cd $name-$version + + patch -p0 -i $SRC/config.patch + + make polipo \ + CDEBUGFLAGS="$CFLAGS" \ + PREFIX=/usr \ + LOCAL_ROOT=/var/www/$name + + install -d -o polipo -g polipo $PKG/var/cache/$name + + install -Dm0755 $name $PKG/usr/bin/$name + install -Dm644 $name.man $PKG/usr/share/man/man1/$name.1 + install -Dm0755 config.sample $PKG/etc/$name/config + install -Dm0755 $SRC/rc.$name $PKG/etc/rc.d/$name + install -Dm0644 localindex.html $PKG/var/www/$name/index.html +} diff --git a/polipo/README b/polipo/README new file mode 100644 index 000000000..3974264dd --- /dev/null +++ b/polipo/README @@ -0,0 +1,15 @@ +README for polipo + +NOTES + + Using tor with polipo + --------------------- + + /etc/polipo/config: + + logFile = /var/log/polipo.log + socksParentProxy = "127.0.0.1:9050" + socksProxyType = socks5 + proxyAddress = 127.0.0.1 + proxyPort = 8123 + allowedClients = 127.0.0.1 diff --git a/polipo/config.patch b/polipo/config.patch new file mode 100644 index 000000000..54772d094 --- /dev/null +++ b/polipo/config.patch @@ -0,0 +1,32 @@ +--- config.sample 2020-12-18 12:37:38.582739862 +0200 ++++ config.sample 2020-12-18 13:12:16.728777317 +0200 +@@ -1,8 +1,9 @@ +-# Sample configuration file for Polipo. -*-sh-*- ++# ++# /etc/polipo/config: polipo web proxy configuration ++# + +-# You should not need to use a configuration file; all configuration +-# variables have reasonable defaults. If you want to use one, you +-# can copy this to /etc/polipo/config or to ~/.polipo and modify. ++# You should not need to edit this configuration file; all configuration ++# variables have reasonable defaults. + + # This file only contains some of the configuration variables; see the + # list given by ``polipo -v'' and the manual for more. +@@ -17,11 +18,11 @@ + # proxyAddress = "::0" # both IPv4 and IPv6 + # proxyAddress = "0.0.0.0" # IPv4 only + +-# If you do that, you'll want to restrict the set of hosts allowed to +-# connect: ++# If you are enabling 'proxyAddress' above, then you want to enable the ++# 'allowedClients' variable to the address of your network, e.g. ++# allowedClients = 127.0.0.1, 192.168.42.0/24 + +-# allowedClients = 127.0.0.1, 134.157.168.57 +-# allowedClients = 127.0.0.1, 134.157.168.0/24 ++# allowedClients = 127.0.0.1 + + # Uncomment this if you want your Polipo to identify itself by + # something else than the host name: diff --git a/polipo/pre-install b/polipo/pre-install new file mode 100755 index 000000000..e3d55107e --- /dev/null +++ b/polipo/pre-install @@ -0,0 +1,11 @@ +#!/bin/sh + +# add user:group +getent group polipo || /usr/sbin/groupadd -r polipo +getent passwd polipo || /usr/sbin/useradd -g polipo -d /var/empty -s /bin/sh polipo +/usr/bin/passwd -l polipo + +# create the log file and change the owner +touch /var/log/polipo.log +chown polipo:polipo /var/log/polipo.log +chmod 644 /var/log/polipo.log diff --git a/polipo/rc.polipo b/polipo/rc.polipo new file mode 100644 index 000000000..423f66fdc --- /dev/null +++ b/polipo/rc.polipo @@ -0,0 +1,51 @@ +#!/bin/sh +# +# /etc/rc.d/polipo: start/stop polipo daemon +# + +SSD=/sbin/start-stop-daemon +PROG=/usr/bin/polipo +PID=/var/run/polipo.pid +OPTS="" + +# Check for configuration files +[ -f /etc/polipo/config ] || exit 1 + +case $1 in + start) + $SSD --start --make-pidfile --pidfile $PID \ + --chuid polipo:polipo --exec $PROG \ + --background -- $OPTS + ;; + stop) + $SSD --stop --retry 10 --pidfile $PID --remove-pidfile + ;; + fast-reload) + # write out all in-memory objects to disk and reload + # the forbidden URLs file + $SSD --stop --signal USR1 --pidfile $PID + ;; + reload) + # write out all in-memory objects to disk, discard all + # in-memory objects, and reload the forbidden URLs file + $SSD --stop --signal USR2 --pidfile $PID + ;; + restart) + $0 stop + $0 start + ;; + status) + $SSD --status --pidfile $PID + case $? in + 0) echo "$PROG is running with pid $(cat $PID)" ;; + 1) echo "$PROG is not running but the pid file $PID exists" ;; + 3) echo "$PROG is not running" ;; + 4) echo "Unable to determine the program status" ;; + esac + ;; + *) + echo "Usage: $0 [start|stop|restart|status]" + ;; +esac + +# End of file
participants (1)
-
crux@crux.nu