mirror of
https://github.com/casjaysdevdocker/tor
synced 2025-01-18 00:34:29 -05:00
🗃️ Committing everything that changed 🗃️
rootfs/usr/local/etc/docker/init.d/01-tor-bridge.sh rootfs/usr/local/etc/docker/init.d/02-tor-relay.sh rootfs/usr/local/etc/docker/init.d/03-tor-server.sh
This commit is contained in:
parent
bb88fff470
commit
91973a95ea
@ -259,6 +259,7 @@ SocksTimeout ${TOR_SOCKS_TIMEOUT:-10}
|
|||||||
#### bridge
|
#### bridge
|
||||||
LogMessageDomains 1
|
LogMessageDomains 1
|
||||||
Log notice file $LOG_DIR/tor-bridge.log
|
Log notice file $LOG_DIR/tor-bridge.log
|
||||||
|
#Log debug file $LOG_DIR/debug.log
|
||||||
|
|
||||||
SOCKSPort 0
|
SOCKSPort 0
|
||||||
|
|
||||||
@ -284,7 +285,9 @@ EOF
|
|||||||
else
|
else
|
||||||
unset EXEC_CMD_BIN EXEC_CMD_ARGS
|
unset EXEC_CMD_BIN EXEC_CMD_ARGS
|
||||||
fi
|
fi
|
||||||
|
if [ "$TOR_DEBUG" = "yes" ]; then
|
||||||
|
sed -i 's|#Log debug|Log debug|g' "$CONF_DIR/bridge.conf"
|
||||||
|
fi
|
||||||
# allow custom functions
|
# allow custom functions
|
||||||
if builtin type -t __update_conf_files_local | grep -q 'function'; then __update_conf_files_local; fi
|
if builtin type -t __update_conf_files_local | grep -q 'function'; then __update_conf_files_local; fi
|
||||||
# exit function
|
# exit function
|
||||||
|
@ -65,7 +65,7 @@ RESET_ENV="yes"
|
|||||||
WWW_ROOT_DIR="/usr/share/httpd/default"
|
WWW_ROOT_DIR="/usr/share/httpd/default"
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
# Default predefined variables
|
# Default predefined variables
|
||||||
DATA_DIR="/data/tor/relay" # set data directory
|
DATA_DIR="/data/tor/relay" # set data directory
|
||||||
CONF_DIR="/config/tor/relay" # set config directory
|
CONF_DIR="/config/tor/relay" # set config directory
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
# set the containers etc directory
|
# set the containers etc directory
|
||||||
@ -75,7 +75,7 @@ ETC_DIR="/etc/tor/relay"
|
|||||||
VAR_DIR=""
|
VAR_DIR=""
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
TMP_DIR="/tmp/tor" # set the temp dir
|
TMP_DIR="/tmp/tor" # set the temp dir
|
||||||
RUN_DIR="/run/tor/relay" # set scripts pid dir
|
RUN_DIR="/run/tor/relay" # set scripts pid dir
|
||||||
LOG_DIR="/data/logs/tor" # set log directory
|
LOG_DIR="/data/logs/tor" # set log directory
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
# Set the working dir
|
# Set the working dir
|
||||||
@ -259,6 +259,7 @@ SocksTimeout ${TOR_SOCKS_TIMEOUT:-10}
|
|||||||
##### relay
|
##### relay
|
||||||
LogMessageDomains 1
|
LogMessageDomains 1
|
||||||
Log notice file $LOG_DIR/tor-relay.log
|
Log notice file $LOG_DIR/tor-relay.log
|
||||||
|
#Log debug file $LOG_DIR/debug.log
|
||||||
|
|
||||||
SOCKSPort 0
|
SOCKSPort 0
|
||||||
|
|
||||||
@ -282,6 +283,9 @@ EOF
|
|||||||
else
|
else
|
||||||
unset EXEC_CMD_BIN EXEC_CMD_ARGS
|
unset EXEC_CMD_BIN EXEC_CMD_ARGS
|
||||||
fi
|
fi
|
||||||
|
if [ "$TOR_DEBUG" = "yes" ]; then
|
||||||
|
sed -i 's|#Log debug|Log debug|g' "$CONF_DIR/relay.conf"
|
||||||
|
fi
|
||||||
|
|
||||||
# allow custom functions
|
# allow custom functions
|
||||||
if builtin type -t __update_conf_files_local | grep -q 'function'; then __update_conf_files_local; fi
|
if builtin type -t __update_conf_files_local | grep -q 'function'; then __update_conf_files_local; fi
|
||||||
|
@ -265,6 +265,7 @@ SOCKSPort 0.0.0.0:9050
|
|||||||
##### logging
|
##### logging
|
||||||
LogMessageDomains 1
|
LogMessageDomains 1
|
||||||
Log notice file $LOG_DIR/tor-server.log
|
Log notice file $LOG_DIR/tor-server.log
|
||||||
|
#Log debug file $LOG_DIR/debug.log
|
||||||
|
|
||||||
##### port mappings
|
##### port mappings
|
||||||
TransPort 0.0.0.0:9040
|
TransPort 0.0.0.0:9040
|
||||||
@ -281,7 +282,6 @@ EOF
|
|||||||
mkdir -p "$CONF_DIR/conf.d"
|
mkdir -p "$CONF_DIR/conf.d"
|
||||||
cat <<EOF >>"$CONF_DIR/server.conf"
|
cat <<EOF >>"$CONF_DIR/server.conf"
|
||||||
#### dns forwarder
|
#### dns forwarder
|
||||||
LogMessageDomains 1
|
|
||||||
Log notice file $LOG_DIR/tor-dns.log
|
Log notice file $LOG_DIR/tor-dns.log
|
||||||
|
|
||||||
DNSPort 8053
|
DNSPort 8053
|
||||||
@ -303,20 +303,23 @@ HiddenServicePort 80 127.0.0.1:80
|
|||||||
|
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
# if [ -n "$TOR_HIDDEN_SERVERS" ]; then
|
# if [ -n "$TOR_HIDDEN_SERVERS" ]; then
|
||||||
# for hidden_server in $TOR_HIDDEN_SERVERS: do
|
# for hidden_server in $TOR_HIDDEN_SERVERS: do
|
||||||
# name="$(echo "$hidden_server"|awk -F: '{print $1}')"
|
# name="$(echo "$hidden_server"|awk -F: '{print $1}')"
|
||||||
# port="$(echo "$hidden_server"|awk -F: '{print $2}')"
|
# port="$(echo "$hidden_server"|awk -F: '{print $2}')"
|
||||||
# host="$(echo "$hidden_server"|awk -F: '{print $3":"$4}')"
|
# host="$(echo "$hidden_server"|awk -F: '{print $3":"$4}')"
|
||||||
# echo ""
|
# echo ""
|
||||||
# done
|
# done
|
||||||
# fi
|
# fi
|
||||||
|
|
||||||
cat <<EOF >>"$CONF_DIR/server.conf"
|
cat <<EOF >>"$CONF_DIR/server.conf"
|
||||||
##### include configurations
|
##### include configurations
|
||||||
%include $CONF_DIR/conf.d/*.conf
|
%include $CONF_DIR/conf.d/*.conf
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
if [ "$TOR_DEBUG" = "yes" ]; then
|
||||||
|
sed -i 's|#Log debug|Log debug|g' "$CONF_DIR/server.conf"
|
||||||
|
fi
|
||||||
|
|
||||||
# allow custom functions
|
# allow custom functions
|
||||||
if builtin type -t __update_conf_files_local | grep -q 'function'; then __update_conf_files_local; fi
|
if builtin type -t __update_conf_files_local | grep -q 'function'; then __update_conf_files_local; fi
|
||||||
@ -358,7 +361,7 @@ __post_execute() {
|
|||||||
(
|
(
|
||||||
# commands to execute
|
# commands to execute
|
||||||
while :; do
|
while :; do
|
||||||
if pgrep unbound >/dev/null 2>&1;then
|
if pgrep unbound >/dev/null 2>&1; then
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
sleep 30
|
sleep 30
|
||||||
@ -371,13 +374,11 @@ __post_execute() {
|
|||||||
fi
|
fi
|
||||||
if [ -d "$DATA_DIR/services" ]; then
|
if [ -d "$DATA_DIR/services" ]; then
|
||||||
[ -f "$WWW_ROOT_DIR/hostnames.html" ] && rm -f "$WWW_ROOT_DIR/hostnames.html"
|
[ -f "$WWW_ROOT_DIR/hostnames.html" ] && rm -f "$WWW_ROOT_DIR/hostnames.html"
|
||||||
for d in "$DATA_DIR/services"/*;do
|
for host in "$DATA_DIR/services"/*/hostname; do
|
||||||
for host in "$d"/hostname; do
|
name="$(basename "$d")"
|
||||||
name="$(basename "$d")"
|
url="$(<"$host")"
|
||||||
url="$(<"$host")"
|
echo "$name: $url"
|
||||||
echo "$name: $url"
|
echo '<a href="http://'$url'">'$name'</a><br />' >>"$WWW_ROOT_DIR/hostnames.html"
|
||||||
echo '<a href="http://'$url'">'$name'</a><br />' >>"$WWW_ROOT_DIR/hostnames.html"
|
|
||||||
done
|
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
# show exit message
|
# show exit message
|
||||||
|
Loading…
x
Reference in New Issue
Block a user