Skip to content

Commit a9ef27d

Browse files
author
David Personette
committed
Dockerfile torproxy.sh fix excess logging, fix #51
1 parent 941c6db commit a9ef27d

File tree

4 files changed

+25
-22
lines changed

4 files changed

+25
-22
lines changed

Dockerfile

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,22 @@ RUN apk --no-cache --no-progress upgrade && \
3232
sed -i '/^forward 10\.\*\.\*\.\*\//a forward 192.168.*.*/ .' $file && \
3333
sed -i '/^forward 192\.168\.\*\.\*\//a forward 127.*.*.*/ .' $file && \
3434
sed -i '/^forward 127\.\*\.\*\.\*\//a forward localhost/ .' $file && \
35+
echo 'AutomapHostsOnResolve 1' >>/etc/tor/torrc && \
36+
echo 'ControlPort 9051' >>/etc/tor/torrc && \
3537
echo 'ControlSocket /etc/tor/run/control' >>/etc/tor/torrc && \
3638
echo 'ControlSocketsGroupWritable 1' >>/etc/tor/torrc && \
37-
echo 'ControlPort 9051' >>/etc/tor/torrc && \
3839
echo 'CookieAuthentication 1' >>/etc/tor/torrc && \
39-
echo 'CookieAuthFileGroupReadable 1' >>/etc/tor/torrc && \
4040
echo 'CookieAuthFile /etc/tor/run/control.authcookie' >>/etc/tor/torrc && \
41+
echo 'CookieAuthFileGroupReadable 1' >>/etc/tor/torrc && \
42+
echo 'DNSPort 5353' >>/etc/tor/torrc && \
4143
echo 'DataDirectory /var/lib/tor' >>/etc/tor/torrc && \
42-
echo 'RunAsDaemon 0' >>/etc/tor/torrc && \
43-
echo 'User tor' >>/etc/tor/torrc && \
44-
echo 'AutomapHostsOnResolve 1' >>/etc/tor/torrc && \
4544
echo 'ExitPolicy reject *:*' >>/etc/tor/torrc && \
46-
echo 'VirtualAddrNetworkIPv4 10.192.0.0/10' >>/etc/tor/torrc && \
47-
echo 'DNSPort 5353' >>/etc/tor/torrc && \
45+
echo 'Log notice stderr' >>/etc/tor/torrc && \
46+
echo 'RunAsDaemon 0' >>/etc/tor/torrc && \
4847
echo 'SocksPort 0.0.0.0:9050 IsolateDestAddr' >>/etc/tor/torrc && \
4948
echo 'TransPort 0.0.0.0:9040' >>/etc/tor/torrc && \
49+
echo 'User tor' >>/etc/tor/torrc && \
50+
echo 'VirtualAddrNetworkIPv4 10.192.0.0/10' >>/etc/tor/torrc && \
5051
mkdir -p /etc/tor/run && \
5152
chown -Rh tor. /var/lib/tor /etc/tor/run && \
5253
chmod 0750 /etc/tor/run && \

Dockerfile.aarch64

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,22 @@ RUN apk --no-cache --no-progress upgrade && \
3333
sed -i '/^forward 10\.\*\.\*\.\*\//a forward 192.168.*.*/ .' $file && \
3434
sed -i '/^forward 192\.168\.\*\.\*\//a forward 127.*.*.*/ .' $file && \
3535
sed -i '/^forward 127\.\*\.\*\.\*\//a forward localhost/ .' $file && \
36+
echo 'AutomapHostsOnResolve 1' >>/etc/tor/torrc && \
37+
echo 'ControlPort 9051' >>/etc/tor/torrc && \
3638
echo 'ControlSocket /etc/tor/run/control' >>/etc/tor/torrc && \
3739
echo 'ControlSocketsGroupWritable 1' >>/etc/tor/torrc && \
38-
echo 'ControlPort 9051' >>/etc/tor/torrc && \
3940
echo 'CookieAuthentication 1' >>/etc/tor/torrc && \
40-
echo 'CookieAuthFileGroupReadable 1' >>/etc/tor/torrc && \
4141
echo 'CookieAuthFile /etc/tor/run/control.authcookie' >>/etc/tor/torrc && \
42+
echo 'CookieAuthFileGroupReadable 1' >>/etc/tor/torrc && \
43+
echo 'DNSPort 5353' >>/etc/tor/torrc && \
4244
echo 'DataDirectory /var/lib/tor' >>/etc/tor/torrc && \
43-
echo 'RunAsDaemon 0' >>/etc/tor/torrc && \
44-
echo 'User tor' >>/etc/tor/torrc && \
45-
echo 'AutomapHostsOnResolve 1' >>/etc/tor/torrc && \
4645
echo 'ExitPolicy reject *:*' >>/etc/tor/torrc && \
47-
echo 'VirtualAddrNetworkIPv4 10.192.0.0/10' >>/etc/tor/torrc && \
48-
echo 'DNSPort 5353' >>/etc/tor/torrc && \
46+
echo 'Log notice stderr' >>/etc/tor/torrc && \
47+
echo 'RunAsDaemon 0' >>/etc/tor/torrc && \
4948
echo 'SocksPort 0.0.0.0:9050 IsolateDestAddr' >>/etc/tor/torrc && \
5049
echo 'TransPort 0.0.0.0:9040' >>/etc/tor/torrc && \
50+
echo 'User tor' >>/etc/tor/torrc && \
51+
echo 'VirtualAddrNetworkIPv4 10.192.0.0/10' >>/etc/tor/torrc && \
5152
mkdir -p /etc/tor/run && \
5253
chown -Rh tor. /var/lib/tor /etc/tor/run && \
5354
chmod 0750 /etc/tor/run && \

Dockerfile.armhf

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,22 @@ RUN apk --no-cache --no-progress upgrade && \
3333
sed -i '/^forward 10\.\*\.\*\.\*\//a forward 192.168.*.*/ .' $file && \
3434
sed -i '/^forward 192\.168\.\*\.\*\//a forward 127.*.*.*/ .' $file && \
3535
sed -i '/^forward 127\.\*\.\*\.\*\//a forward localhost/ .' $file && \
36+
echo 'AutomapHostsOnResolve 1' >>/etc/tor/torrc && \
37+
echo 'ControlPort 9051' >>/etc/tor/torrc && \
3638
echo 'ControlSocket /etc/tor/run/control' >>/etc/tor/torrc && \
3739
echo 'ControlSocketsGroupWritable 1' >>/etc/tor/torrc && \
38-
echo 'ControlPort 9051' >>/etc/tor/torrc && \
3940
echo 'CookieAuthentication 1' >>/etc/tor/torrc && \
40-
echo 'CookieAuthFileGroupReadable 1' >>/etc/tor/torrc && \
4141
echo 'CookieAuthFile /etc/tor/run/control.authcookie' >>/etc/tor/torrc && \
42+
echo 'CookieAuthFileGroupReadable 1' >>/etc/tor/torrc && \
43+
echo 'DNSPort 5353' >>/etc/tor/torrc && \
4244
echo 'DataDirectory /var/lib/tor' >>/etc/tor/torrc && \
43-
echo 'RunAsDaemon 0' >>/etc/tor/torrc && \
44-
echo 'User tor' >>/etc/tor/torrc && \
45-
echo 'AutomapHostsOnResolve 1' >>/etc/tor/torrc && \
4645
echo 'ExitPolicy reject *:*' >>/etc/tor/torrc && \
47-
echo 'VirtualAddrNetworkIPv4 10.192.0.0/10' >>/etc/tor/torrc && \
48-
echo 'DNSPort 5353' >>/etc/tor/torrc && \
46+
echo 'Log notice stderr' >>/etc/tor/torrc && \
47+
echo 'RunAsDaemon 0' >>/etc/tor/torrc && \
4948
echo 'SocksPort 0.0.0.0:9050 IsolateDestAddr' >>/etc/tor/torrc && \
5049
echo 'TransPort 0.0.0.0:9040' >>/etc/tor/torrc && \
50+
echo 'User tor' >>/etc/tor/torrc && \
51+
echo 'VirtualAddrNetworkIPv4 10.192.0.0/10' >>/etc/tor/torrc && \
5152
mkdir -p /etc/tor/run && \
5253
chown -Rh tor. /var/lib/tor /etc/tor/run && \
5354
chmod 0750 /etc/tor/run && \

torproxy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ password() { local passwd="$1" file=/etc/tor/torrc
7676
sed -i '/^HashedControlPassword/d' $file
7777
sed -i '/^ControlPort/s/ 9051/ 0.0.0.0:9051/' $file
7878
echo "HashedControlPassword $(su - tor -s/bin/bash -c \
79-
"tor --hash-password '$passwd'")" >>$file
79+
"tor --hash-password '$passwd' |tail -n 1")" >>$file 2>/dev/null
8080
}
8181

8282
### usage: Help

0 commit comments

Comments
 (0)