diff --git a/Dockerfile b/Dockerfile index 7428484..3dd16f4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ FROM casjaysdevdocker/nginx:latest as build ARG LICENSE=WTFPL \ IMAGE_NAME=tor \ TIMEZONE=America/New_York \ - PORT="8053 80 9090" + PORT="80 9053 9050 9080" ENV SHELL=/bin/bash \ TERM=xterm-256color \ diff --git a/bin/entrypoint-tor.sh b/bin/entrypoint-tor.sh index 400d4e5..e5ad610 100755 --- a/bin/entrypoint-tor.sh +++ b/bin/entrypoint-tor.sh @@ -9,11 +9,11 @@ # @@Copyright : Copyright: (c) 2022 Jason Hempstead, Casjays Developments # @@Created : Sunday, Oct 02, 2022 16:27 EDT # @@File : entrypoint-tor.sh -# @@Description : +# @@Description : # @@Changelog : New script # @@TODO : Better documentation -# @@Other : -# @@Resource : +# @@Other : +# @@Resource : # @@Terminal App : no # @@sudo/root : no # @@Template : other/docker-entrypoint @@ -94,7 +94,14 @@ fi [ -f "/etc/.env.sh" ] && rm -Rf "/etc/.env.sh" # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Additional commands - +[ -d "/data/tor" ] || mkdir -p "/data/tor" +[ -d "/config/tor" ] || mkdir -p "/config/tor" +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +if [ -f "/config/tor/torrc" ]; then +cp -Rf "/config/tor/torrc" "/etc/tor/torrc" +else + cp -Rf "/etc/tor/torrc" "/config/tor/torrc" +fi # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - case "$1" in --help) # Help message @@ -119,7 +126,7 @@ healthcheck) # Docker healthcheck *) # Execute primary command if [ $# -eq 0 ]; then - __exec_bash "/bin/bash" + tor -f /etc/tor/torrc else __exec_bash "/bin/bash" fi diff --git a/config/tor/torrc b/config/tor/torrc new file mode 100644 index 0000000..74a086a --- /dev/null +++ b/config/tor/torrc @@ -0,0 +1,39 @@ +##### Configuration file for a typical Tor user +RunAsDaemon 0 +ControlSocketsGroupWritable 1 +CookieAuthentication 1 +CookieAuthFileGroupReadable 1 +HashedControlPassword 16:C30604D1D90F341360A14D9A1048C1DF4A3CA2411444E52EE5B954C01F +##### directiories and files +ControlSocket /run/tor/control.sock +CookieAuthFile /run/tor/control.authcookie +DataDirectory /data/tor +##### logging +Log notice file /var/log/tor/notices.log +#Log debug file /var/log/tor/debug.log + +##### This section is just for location-hidden services +HiddenServiceDir /data/tor/hidden_service/default +HiddenServicePort 80 127.0.0.2:8082 + +##### Server +ControlPort 9051 +SOCKSPort 9050 +HTTPTunnelPort 9080 + +##### dns forwarder +DNSPort 9053 +AutomapHostsOnResolve 1 +AutomapHostsSuffixes .exit,.onion + +##### This section is just for relays +#Nickname whateveryouwant +#ContactInfo tor-admin@example.com +#ORPort 443 +#Exitpolicy reject *:* +#AccountingMax 100 GBytes +#AccountingStart month 1 00:00 +#RelayBandwidthRate 5120 KBytes +#RelayBandwidthBurst 10240 KBytes +#DisableDebuggerAttachment 0 +#HardwareAccel 1