Browse Source

privoxy: bump to version 3.0.24

* upstream to Privoxy 3.0.24
* add facility to set compile options
* add file list to be saved on sysupgrade
* fixed PKG_MAINTAINER string
* add port 8118 used by privoxy to /etc/services
* new "boot_delay" option (default 10 seconds) to wait for interfaces to come up before hotplug restarts are enabled

Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>
Christian Schoenebeck 9 years ago
parent
commit
ba929dd1f7

+ 115
- 0
net/privoxy/Config.in View File

@@ -0,0 +1,115 @@
1
+if PACKAGE_privoxy
2
+
3
+	comment "Shared libraries settings"
4
+
5
+	config PRIVOXY_disable-pthread
6
+		bool "Don't use POSIX libpthread (-5489b)"
7
+		default n
8
+
9
+	config PRIVOXY_disable-dynamic-pcre
10
+		bool "Use the built-in, static pcre, even if libpcre is available (+25669b)"
11
+		default n
12
+
13
+	config PRIVOXY_disable-zlib
14
+		bool "Don't use zlib to decompress data before filtering. (-1336b)"
15
+		default n
16
+
17
+	comment "Config options. Overwrites/ignore configuration file settings"
18
+
19
+	config PRIVOXY_disable-toggle
20
+		bool "Don't support temporary disable (+2797b)"
21
+		default n
22
+
23
+	config PRIVOXY_disable-force
24
+		bool "Don't allow single-page disable (-434b)"
25
+		default n
26
+
27
+	config PRIVOXY_disable-fast-redirects
28
+		bool "Don't support fast redirects (-1393b)"
29
+		default n
30
+
31
+	config PRIVOXY_disable-stats
32
+		bool "Don't keep statistics (+2870b)"
33
+		default n
34
+
35
+	config PRIVOXY_enable-ie-images
36
+		bool "Enable MS IE image handling. !Read help! (+2694b)"
37
+		help
38
+			Enable a quick but not always reliable auto-detect whether
39
+			requests from MS Internet Explorer are for an image or not.
40
+		default n
41
+
42
+	config PRIVOXY_disable-image-blocking
43
+		bool "Don't check for image request - assume HTML (-655b)"
44
+		help
45
+			Don't try to figure out whether a request is
46
+			for an image or HTML - assume HTML.
47
+		default n
48
+
49
+	config PRIVOXY_disable-acl-support
50
+		bool "Disable ACL access control (-3496b)"
51
+		help
52
+			Prevents the use of ACLs to control access to Privoxy by IP address.
53
+		default n
54
+
55
+	config PRIVOXY_disable-trust-files
56
+		bool "Prevents the use of trust files. (-1302b)"
57
+		default n
58
+
59
+	config PRIVOXY_disable-editor
60
+		bool "Disable web-based editor. !Read help! (-44979b)"
61
+		help
62
+			Prevents the use of the web-based actions file
63
+			editor and web-based temporary disable setting.
64
+		default n
65
+
66
+	config PRIVOXY_enable-no-gifs
67
+		bool "Use politically correct PNG format. !Read help! (+112b)"
68
+		help
69
+			Use politically correct PNG format instead of GIF
70
+			for built-in images. May not work with all browsers.
71
+		default n
72
+
73
+	config PRIVOXY_enable-graceful-termination
74
+		bool "Allow to shutdown Privoxy through the webinterface. (+1685b)"
75
+		default n
76
+
77
+	config PRIVOXY_enable-extended-host-patterns
78
+		bool "Enable and require PCRE syntax in host patterns. !Read help! (-1329b)"
79
+		help
80
+			Enable and require PCRE syntax in host patterns. This feature hasn't
81
+			been announced yet and it's not clear if it's a good idea. It's expected
82
+			to work, but undocumented. You should only enable it if you know what
83
+			PCRE is and are sure that you need it for your host patterns. You can
84
+			use tools/url-pattern-translator.pl to convert existing action files to
85
+			use PCRE host patterns. Please don't enable this option when creating
86
+			packages for others that may not be expecting it.
87
+		default n
88
+
89
+	config PRIVOXY_enable-external-filters
90
+		bool "Allow to filter content with scripts and programs. Experimental. (+4821b)"
91
+		default n
92
+
93
+	config PRIVOXY_enable-accept-filter
94
+		bool "Try to use accf_http(9) if supported. (+-0b)"
95
+		default n
96
+
97
+	config PRIVOXY_enable-strptime-sanity-checks
98
+		bool "Only trust strptime() results if ... !Read help! (+407b)"
99
+		help
100
+			Only trust strptime() results if an additional strftime()/strptime()
101
+			conversion doesn't change the result. Can be useful if strptime() is
102
+			known or suspected to be broken.
103
+		default n
104
+
105
+	config PRIVOXY_enable-compression
106
+		bool "Allow Privoxy to compress buffered content. (+1275b)"
107
+		help
108
+			Allow Privoxy to compress buffered content 
109
+			if the client supports it. Requires zlib support.
110
+		depends on !PRIVOXY_no_zlib
111
+		default n
112
+
113
+
114
+endif
115
+                

+ 75
- 20
net/privoxy/Makefile View File

@@ -1,5 +1,5 @@
1 1
 #
2
-# Copyright (C) 2006-2015 OpenWrt.org
2
+# Copyright (C) 2006-2016 OpenWrt.org
3 3
 #
4 4
 # This is free software, licensed under the GNU General Public License v2.
5 5
 # See /LICENSE for more information.
@@ -8,12 +8,12 @@
8 8
 include $(TOPDIR)/rules.mk
9 9
 
10 10
 PKG_NAME:=privoxy
11
-PKG_VERSION:=3.0.23
12
-PKG_RELEASE:=4
11
+PKG_VERSION:=3.0.24
12
+PKG_RELEASE:=1
13 13
 
14 14
 PKG_SOURCE:=privoxy-$(PKG_VERSION)-stable-src.tar.gz
15 15
 PKG_SOURCE_URL:=@SF/ijbswa
16
-PKG_MD5SUM:=bbe47d5ff1a54d9f9fc93a160532697f
16
+PKG_MD5SUM:=44a47d1a5000db8cccd61ace0e25e7f7
17 17
 PKG_BUILD_DIR:=$(BUILD_DIR)/privoxy-$(PKG_VERSION)-stable
18 18
 PKG_FIXUP:=autoreconf
19 19
 PKG_INSTALL:=1
@@ -21,7 +21,31 @@ PKG_INSTALL:=1
21 21
 PKG_LICENSE:=GPL-2.0
22 22
 PKG_LICENSE_FILES:=LICENSE
23 23
 
24
-PKG_MAINTAINER:=christian.schoenebeck@gmail.com
24
+PKG_MAINTAINER:=Christian Schoenebeck <christian.schoenebeck@gmail.com>
25
+
26
+PKG_CONFIG_DEPENDS:= \
27
+  CONFIG_IPV6 \
28
+  \
29
+  CONFIG_PRIVOXY_disable-pthread \
30
+  CONFIG_PRIVOXY_disable-dynamic-pcre \
31
+  CONFIG_PRIVOXY_disable-zlib \
32
+  \
33
+  CONFIG_PRIVOXY_disable-toggle \
34
+  CONFIG_PRIVOXY_disable-force \
35
+  CONFIG_PRIVOXY_disable-fast-redirects \
36
+  CONFIG_PRIVOXY_disable-stats \
37
+  CONFIG_PRIVOXY_enable-ie-images \
38
+  CONFIG_PRIVOXY_disable-image-blocking \
39
+  CONFIG_PRIVOXY_disable-acl-support \
40
+  CONFIG_PRIVOXY_disable-trust-files \
41
+  CONFIG_PRIVOXY_disable-editor \
42
+  CONFIG_PRIVOXY_enable-no-gifs \
43
+  CONFIG_PRIVOXY_enable-graceful-termination \
44
+  CONFIG_PRIVOXY_enable-extended-host-patterns \
45
+  CONFIG_PRIVOXY_enable-external-filters \
46
+  CONFIG_PRIVOXY_enable-accept-filter \
47
+  CONFIG_PRIVOXY_enable-strptime-sanity-checks \
48
+  CONFIG_PRIVOXY_enable-compression
25 49
 
26 50
 include $(INCLUDE_DIR)/package.mk
27 51
 
@@ -29,10 +53,11 @@ define Package/$(PKG_NAME)
29 53
   SECTION:=net
30 54
   CATEGORY:=Network
31 55
   SUBMENU:=Web Servers/Proxies
32
-  DEPENDS:=+libpcre +libpthread +zlib
33 56
   TITLE:=Privoxy WEB Proxy
34 57
   URL:=http://www.privoxy.org/
35 58
   USERID:=privoxy=8118:privoxy=8118
59
+  MENU:=1
60
+  DEPENDS:=+!PRIVOXY_no_pcre:libpcre +!PRIVOXY_no_pthread:libpthread +!PRIVOXY_no_zlib:zlib
36 61
 endef
37 62
 
38 63
 # shown in LuCI package description
@@ -42,23 +67,45 @@ endef
42 67
 
43 68
 # shown in make menuconfig <Help>
44 69
 define Package/$(PKG_NAME)/config
45
-help
46
-	Privoxy is a web proxy with advanced filtering capabilities for protecting
47
-	privacy, modifying web page content, managing cookies, controlling access,
48
-	and removing ads, banners, pop-ups and other obnoxious Internet junk. 
49
-	Privoxy has a very flexible configuration and can be customized to suit
50
-	individual needs and tastes. 
51
-	Privoxy has application for both stand-alone systems and multi-user networks.
52
-
53
-	Run as : $(USERID)
54
-	Version: $(PKG_VERSION)-$(PKG_RELEASE)
55
-	Home   : $(URL)
56
-
57
-	$(PKG_MAINTAINER)
70
+	help
71
+		Privoxy is a web proxy with advanced filtering capabilities for protecting
72
+		privacy, modifying web page content, managing cookies, controlling access,
73
+		and removing ads, banners, pop-ups and other obnoxious Internet junk. 
74
+		Privoxy has a very flexible configuration and can be customized to suit
75
+		individual needs and tastes. 
76
+		Privoxy has application for both stand-alone systems and multi-user networks.
77
+		Run as : $(USERID)
78
+		Version: $(PKG_VERSION)-$(PKG_RELEASE)
79
+		Home   : $(URL)
80
+		$(PKG_MAINTAINER)
81
+
82
+	source "$(SOURCE)/Config.in"
58 83
 endef
59 84
 
60 85
 CONFIGURE_ARGS += \
61
-	--sysconfdir=/etc/privoxy
86
+	--sysconfdir=/etc/privoxy \
87
+	$(if $(CONFIG_IPV6),,--disable-ipv6-support) \
88
+	\
89
+	$(if $(CONFIG_PRIVOXY_disable-pthread),--disable-pthread) \
90
+	$(if $(CONFIG_PRIVOXY_disable-dynamic-pcre),--disable-dynamic-pcre) \
91
+	$(if $(CONFIG_PRIVOXY_disable-zlib),--disable-zlib) \
92
+	\
93
+	$(if $(CONFIG_PRIVOXY_disable-toggle),--disable-toggle) \
94
+	$(if $(CONFIG_PRIVOXY_disable-force),--disable-force) \
95
+	$(if $(CONFIG_PRIVOXY_disable-fast-redirects),--disable-fast-redirects) \
96
+	$(if $(CONFIG_PRIVOXY_disable-stats),--disable-stats) \
97
+	$(if $(CONFIG_PRIVOXY_enable-ie-images),--enable-ie-images) \
98
+	$(if $(CONFIG_PRIVOXY_disable-image-blocking),--disable-image-blocking) \
99
+	$(if $(CONFIG_PRIVOXY_disable-acl-support),--disable-acl-support) \
100
+	$(if $(CONFIG_PRIVOXY_disable-trust-files),--disable-trust-files) \
101
+	$(if $(CONFIG_PRIVOXY_disable-editor),--disable-editor) \
102
+	$(if $(CONFIG_PRIVOXY_enable-no-gifs),--enable-no-gifs) \
103
+	$(if $(CONFIG_PRIVOXY_enable-graceful-termination),--enable-graceful-termination) \
104
+	$(if $(CONFIG_PRIVOXY_enable-extended-host-patterns),--enable-extended-host-patterns) \
105
+	$(if $(CONFIG_PRIVOXY_enable-external-filters),--enable-external-filters) \
106
+	$(if $(CONFIG_PRIVOXY_enable-accept-filter),--enable-accept-filter) \
107
+	$(if $(CONFIG_PRIVOXY_enable-strptime-sanity-checks),--enable-strptime-sanity-checks) \
108
+	$(if $(CONFIG_PRIVOXY_enable-compression),--enable-compression)
62 109
 
63 110
 # needed otherwise errors during compile
64 111
 MAKE_FLAGS:=
@@ -98,12 +145,20 @@ define Package/$(PKG_NAME)/install
98 145
 		-exec install -m0664 -t $(1)/etc/privoxy {} \;
99 146
 
100 147
 	$(INSTALL_DIR) \
148
+		$(1)/lib/upgrade/keep.d \
101 149
 		$(1)/etc/init.d \
102 150
 		$(1)/etc/hotplug.d/iface \
103 151
 		$(1)/etc/config
152
+	$(INSTALL_DATA) ./files/privoxy.upgrade $(1)/lib/upgrade/keep.d/privoxy
104 153
 	$(INSTALL_BIN)  ./files/privoxy.init $(1)/etc/init.d/privoxy
105 154
 	$(INSTALL_BIN)  ./files/privoxy.hotplug $(1)/etc/hotplug.d/iface/80-privoxy
106 155
 	$(INSTALL_CONF) ./files/privoxy.config $(1)/etc/config/privoxy
107 156
 endef
108 157
 
158
+define Package/$(PKG_NAME)/postinst
159
+	#!/bin/sh
160
+	grep -i privoxy $${IPKG_INSTROOT}/etc/services >/dev/null 2>&1 || \
161
+		echo -e "privoxy\t8118" >> $${IPKG_INSTROOT}/etc/services
162
+endef
163
+
109 164
 $(eval $(call BuildPackage,$(PKG_NAME)))

+ 2
- 0
net/privoxy/files/privoxy.hotplug View File

@@ -2,6 +2,8 @@
2 2
 
3 3
 # only (re-)start on ifup
4 4
 [ "$ACTION" = "ifup" ] || exit 0
5
+# only start if boot_delay is done
6
+[ -f /tmp/privoxy.hotplug ] || exit 0
5 7
 
6 8
 PIDFILE=/var/run/privoxy.pid
7 9
 

+ 33
- 14
net/privoxy/files/privoxy.init View File

@@ -50,6 +50,17 @@ _uci2conf() {
50 50
 	echo '### SEE /etc/config/privoxy INSTEAD' >> $CFGTEMP
51 51
 	echo ''					   >> $CFGTEMP
52 52
 
53
+	# logdir and logfile
54
+	# privoxy needs read/write access
55
+	_LOGDIR=$(uci -q get privoxy.privoxy.logdir)   || _LOGDIR="/var/log"
56
+	_LOGFILE=$(uci -q get privoxy.privoxy.logfile) || _LOGFILE="privoxy.log"
57
+	mkdir -m0755 -p $_LOGDIR
58
+	touch $_LOGDIR/$_LOGFILE
59
+	chmod 664 $_LOGDIR/$_LOGFILE
60
+	chown privoxy:privoxy $_LOGDIR/$_LOGFILE
61
+	echo -e "logdir\t$_LOGDIR" >> $CFGTEMP
62
+	echo -e "logfile\t$_LOGFILE" >> $CFGTEMP
63
+
53 64
 	# confdir
54 65
 	# privoxy needs read access (possibly write access)
55 66
 	_CONFDIR=$(uci -q get privoxy.privoxy.confdir) || _CONFDIR="/etc/privoxy"
@@ -72,17 +83,6 @@ _uci2conf() {
72 83
 		echo -e "templdir\t$_TEMPLDIR" >> $CFGTEMP
73 84
 	fi
74 85
 
75
-	# logdir and logfile
76
-	# privoxy needs read/write access
77
-	_LOGDIR=$(uci -q get privoxy.privoxy.logdir)   || _LOGDIR="/var/log"
78
-	_LOGFILE=$(uci -q get privoxy.privoxy.logfile) || _LOGFILE="privoxy.log"
79
-	mkdir -m0755 -p $_LOGDIR
80
-	touch $_LOGDIR/$_LOGFILE
81
-	chmod 664 $_LOGDIR/$_LOGFILE
82
-	chown privoxy:privoxy $_LOGDIR/$_LOGFILE
83
-	echo -e "logdir\t$_LOGDIR" >> $CFGTEMP
84
-	echo -e "logfile\t$_LOGFILE" >> $CFGTEMP
85
-
86 86
 	# temporary-directory
87 87
 	# privoxy needs read/write access
88 88
 	_TMP_DIR=$(uci -q get privoxy.privoxy.temporary_directory)	# no default needed
@@ -100,7 +100,25 @@ _uci2conf() {
100 100
 }
101 101
 
102 102
 boot() {
103
-	return 0	# will be started by "iface" hotplug events
103
+	# wait a given time (default 10 seconds) before startup
104
+	# to wait for interfaces to come up / not using hotplug events during boot
105
+	_start() {
106
+		[ $1 -gt 0 ] && {
107
+			logger -p daemon.info -t "privoxy[]" "Scheduled startup in $1 seconds"
108
+			sleep $1
109
+		}
110
+		start
111
+	}
112
+
113
+	local _DELAY
114
+	_DELAY=$(uci_get "privoxy" "system" "boot_delay" "10")
115
+	_start $_DELAY &
116
+	return 0
117
+}
118
+
119
+shutdown() {
120
+	rm -f /tmp/privoxy.hotplug
121
+	stop
104 122
 }
105 123
 
106 124
 start() {
@@ -110,6 +128,7 @@ start() {
110 128
 
111 129
 	_uci2conf
112 130
 	/usr/sbin/privoxy --pidfile $PIDFILE --user privoxy.privoxy $CFGFILE
131
+	touch /tmp/privoxy.hotplug
113 132
 
114 133
 	# verify startup
115 134
 	_PID=$(cat $PIDFILE 2>/dev/null)
@@ -117,7 +136,7 @@ start() {
117 136
 	local _ERR=$?
118 137
 	[ $_ERR -eq 0 ] \
119 138
 		&& logger -p daemon.notice -t "privoxy[$_PID]" "Started successfully"\
120
-		|| logger -p daemon.warn -t "privoxy[-----]" "Failed to start"
139
+		|| logger -p daemon.warn -t "privoxy[]" "Failed to start"
121 140
 	return $_ERR
122 141
 }
123 142
 
@@ -144,7 +163,7 @@ stop() {
144 163
 		logger -p daemon.notice -t "privoxy[$_PID]" "Shutdown successfully"
145 164
 	else
146 165
 		kill -9 $_tmp	# Normally never come here
147
-		logger -p daemon.warn -t "privoxy[-----]" "Shutdown forced by KILL"
166
+		logger -p daemon.warn -t "privoxy[$_tmp]" "Shutdown forced by KILL"
148 167
 	fi
149 168
 	return 0
150 169
 }

+ 4
- 0
net/privoxy/files/privoxy.upgrade View File

@@ -0,0 +1,4 @@
1
+/etc/config/privoxy
2
+/etc/privoxy/user.action
3
+/etc/privoxy/user.filter
4
+/etc/privoxy/user.trust