mirror of
https://github.com/casjaysdevdocker/tor
synced 2025-01-31 00:34:22 -05:00
🗃️ Committing everything that changed 🗃️
Dockerfile rootfs/tmp/etc/tor/hidden/ rootfs/tmp/etc/tor/torrc rootfs/usr/local/etc/docker/init.d/tor.sh
This commit is contained in:
parent
42af54213f
commit
b777e968e0
@ -15,7 +15,7 @@ ARG USER="root"
|
|||||||
ARG SHELL_OPTS="set -e -o pipefail"
|
ARG SHELL_OPTS="set -e -o pipefail"
|
||||||
|
|
||||||
ARG SERVICE_PORT="80"
|
ARG SERVICE_PORT="80"
|
||||||
ARG EXPOSE_PORTS="80 8118 9053 9050 9080"
|
ARG EXPOSE_PORTS="80 8118 9040 9050 9053 9080"
|
||||||
ARG PHP_VERSION="system"
|
ARG PHP_VERSION="system"
|
||||||
ARG NODE_VERSION="system"
|
ARG NODE_VERSION="system"
|
||||||
ARG NODE_MANAGER="system"
|
ARG NODE_MANAGER="system"
|
||||||
|
0
rootfs/tmp/etc/tor/hidden/default.conf
Normal file
0
rootfs/tmp/etc/tor/hidden/default.conf
Normal file
@ -1,5 +1,6 @@
|
|||||||
##### Configuration file for a typical Tor user
|
##### Configuration file
|
||||||
RunAsDaemon 0
|
RunAsDaemon 0
|
||||||
|
HardwareAccel 1
|
||||||
ControlSocketsGroupWritable 1
|
ControlSocketsGroupWritable 1
|
||||||
CookieAuthentication 1
|
CookieAuthentication 1
|
||||||
CookieAuthFileGroupReadable 1
|
CookieAuthFileGroupReadable 1
|
||||||
@ -9,19 +10,26 @@ HashedControlPassword 16:C30604D1D90F341360A14D9A1048C1DF4A3CA2411444E52EE5B954C
|
|||||||
DataDirectory /data/tor
|
DataDirectory /data/tor
|
||||||
ControlSocket /run/tor/control.sock
|
ControlSocket /run/tor/control.sock
|
||||||
CookieAuthFile /run/tor/control.authcookie
|
CookieAuthFile /run/tor/control.authcookie
|
||||||
|
|
||||||
##### logging
|
##### logging
|
||||||
|
LogMessageDomains 1
|
||||||
Log notice file /data/logs/tor/notice.log
|
Log notice file /data/logs/tor/notice.log
|
||||||
|
|
||||||
##### This section is just for location-hidden services
|
|
||||||
HiddenServiceDir /data/tor/hidden_service/default
|
|
||||||
HiddenServicePort 80 127.0.0.1:80
|
|
||||||
|
|
||||||
##### Server
|
##### Server
|
||||||
ControlPort 9051
|
TransPort 9040
|
||||||
SOCKSPort 9050
|
SOCKSPort 9050
|
||||||
|
ControlPort 9051
|
||||||
HTTPTunnelPort 9080
|
HTTPTunnelPort 9080
|
||||||
|
|
||||||
|
##### socks option
|
||||||
|
SafeSocks 0
|
||||||
|
SocksTimeout 30
|
||||||
|
|
||||||
##### dns forwarder
|
##### dns forwarder
|
||||||
DNSPort 9053
|
%include /config/tor/conf.d/dns.conf
|
||||||
AutomapHostsOnResolve 1
|
|
||||||
AutomapHostsSuffixes .exit,.onion
|
##### hidden services
|
||||||
|
%include /config/tor/hidden/*.conf
|
||||||
|
|
||||||
|
##### relay and bridge
|
||||||
|
%include /config/tor/relay/*.conf
|
||||||
|
@ -168,6 +168,9 @@ CMD_ENV=""
|
|||||||
|
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
# Per Application Variables or imports
|
# Per Application Variables or imports
|
||||||
|
TOR_DNS="${TOR_DNS:-yes}"
|
||||||
|
TOR_HIDDEN="${TOR_HIDDEN:-yes}"
|
||||||
|
TOR_BRIDGE="${TOR_BRIDGE:-yes}"
|
||||||
RANDOM_NICK="$(head -n50 '/dev/random' | tr -dc 'a-zA-Z' | tr -d '[:space:]\042\047\134' | fold -w "32" | sed 's| ||g' | head -n 1)"
|
RANDOM_NICK="$(head -n50 '/dev/random' | tr -dc 'a-zA-Z' | tr -d '[:space:]\042\047\134' | fold -w "32" | sed 's| ||g' | head -n 1)"
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
# Custom commands to run before copying to /config
|
# Custom commands to run before copying to /config
|
||||||
@ -235,9 +238,27 @@ __update_conf_files() {
|
|||||||
|
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
# define actions
|
# define actions
|
||||||
if [ "$TOR_BRIDGE" = "enabled" ] && ! grep -sq 'BridgeRelay' '/config/tor/torrc'; then
|
if [ "$TOR_DNS" = "yes" ]; then
|
||||||
cat <<EOF >>/config/tor/torrc
|
mkdir -p "/config/tor/conf.d"
|
||||||
BridgeRelay 1
|
cat <<EOF >"/config/tor/conf.d/dns.conf"
|
||||||
|
DNSPort 9053
|
||||||
|
AutomapHostsOnResolve 1
|
||||||
|
AutomapHostsSuffixes .exit,.onion
|
||||||
|
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
if [ "$TOR_HIDDEN" = "yes" ]; then
|
||||||
|
mkdir -p "/config/tor/hidden"
|
||||||
|
cat <<EOF >"/config/tor/hidden/default.conf"
|
||||||
|
HiddenServiceDir /data/tor/hidden_service/default
|
||||||
|
HiddenServicePort 80 127.0.0.1:80
|
||||||
|
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
if [ "$TOR_BRIDGE" = "yes" ]; then
|
||||||
|
mkdir -p "/config/tor/relay"
|
||||||
|
cat <<EOF >"/config/tor/relay/default.conf"
|
||||||
|
BridgeRelay ${TOR_RELAY:-1}
|
||||||
ExtORPort auto
|
ExtORPort auto
|
||||||
Nickname ${TOR_NICK_NAME:-$RANDOM_NICK}
|
Nickname ${TOR_NICK_NAME:-$RANDOM_NICK}
|
||||||
ServerTransportPlugin obfs4 exec /usr/bin/lyrebird
|
ServerTransportPlugin obfs4 exec /usr/bin/lyrebird
|
||||||
@ -248,6 +269,7 @@ Exitpolicy accept *:*
|
|||||||
AccountingMax ${TOR_ACCOUNT_MAX:-1000} GBytes
|
AccountingMax ${TOR_ACCOUNT_MAX:-1000} GBytes
|
||||||
AccountingStart month 1 00:00
|
AccountingStart month 1 00:00
|
||||||
AddressDisableIPv6 0
|
AddressDisableIPv6 0
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
# allow custom functions
|
# allow custom functions
|
||||||
|
Loading…
x
Reference in New Issue
Block a user