4
# On the client side, use 192.168.88.1:8118 as a proxy address,
5
# and have a persistent ssh session with DynamicForward 1080
7
if user_confirms_y Install VPN concentrator?; then
8
if package_is_installed pptd; then
9
echo VPN already installed
12
apt-get install pptpd privoxy
13
cp $etc/ppp/pptpd-options /etc/ppp/pptpd-options
15
# Configure privoxy to use ssh forwarding
16
if [ z$vpn_proxy_domain == z ]; then
17
echo No VPN proxy domain configuration required
18
elif file_contains $vpn_proxy_domain /etc/privoxy/config; then
19
echo privoxy config already set up
21
perl -pi~ -e 's{^listen-address .*}{
23
forward-socks5 *.$ENV{vpn_proxy_domain}/ 127.0.0.1:1080 .
24
forward-socks5 *.*.$ENV{vpn_proxy_domain}/ 127.0.0.1:1080 .
25
forward-socks5 *.*.*.$ENV{vpn_proxy_domain}/ 127.0.0.1:1080 .
26
forward-socks5 *.*.*.*.$ENV{vpn_proxy_domain}/ 127.0.0.1:1080 .
27
forward $ENV{vpn_proxy_domain}/ .
28
}' /etc/privoxy/config
31
# Fiddle privoxy so that video still works
32
if file_contains 'Fix video' /etc/privoxy/user.action; then
33
echo user.action already set up
35
(echo '# Fix video on iOS devices'
36
echo '{+client-header-tagger{range-requests}}'
39
echo '{-filter -deanimate-gifs}'
40
echo ' TAG:^RANGE-REQUEST$') >> /etc/privoxy/user.action
45
echo : Remember to initialize /etc/ppp/chap-secrets appropriately