mirror of
https://github.com/casjaysdevdocker/tor
synced 2025-10-30 14:02:32 -04:00
🗃️ Update codebase 🗃️
rootfs/usr/local/etc/docker/functions/entrypoint.sh 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 rootfs/usr/local/etc/docker/init.d/zz-nginx.sh rootfs/usr/share/httpd/default/hidden_service.html rootfs/usr/share/httpd/default/hidden_services.html Dockerfile rootfs/usr/local/etc/docker/init.d/zz-nginx.sh
This commit is contained in:
@@ -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 9053 9050 9080"
|
ARG EXPOSE_PORTS="80 8118 9050 9053 9080 9053/udp"
|
||||||
ARG PHP_VERSION="84"
|
ARG PHP_VERSION="84"
|
||||||
ARG NODE_VERSION="system"
|
ARG NODE_VERSION="system"
|
||||||
ARG NODE_MANAGER="system"
|
ARG NODE_MANAGER="system"
|
||||||
|
|||||||
@@ -275,8 +275,13 @@ __update_conf_files() {
|
|||||||
# __replace "" "" "$CONF_DIR/nginx.conf"
|
# __replace "" "" "$CONF_DIR/nginx.conf"
|
||||||
# replace variables recursively
|
# replace variables recursively
|
||||||
# __find_replace "" "" "$CONF_DIR"
|
# __find_replace "" "" "$CONF_DIR"
|
||||||
if [ -n "$default_host" ] && [ -f "$WWW_ROOT_DIR/index.html" ]; then
|
if [ -f "$WWW_ROOT_DIR/index.html" ]; then
|
||||||
sed -i 's|REPLACE_DEFAULT_TOR_ADDRESS|'$default_host'|g' "$WWW_ROOT_DIR/index.html"
|
sed -i 's|REPLACE_ONION_WWW_DIR|'$WWW_ROOT_DIR'|g' "/data/htdocs/www/index.html"
|
||||||
|
[ -n "$default_host" ] && sed -i 's|REPLACE_DEFAULT_TOR_ADDRESS|'$default_host.onion'|g' "$WWW_ROOT_DIR/index.html" || sed -i '/REPLACE_DEFAULT_TOR_ADDRESS/d' "$WWW_ROOT_DIR/index.html"
|
||||||
|
fi
|
||||||
|
if [ -f "/data/htdocs/www/index.html" ]; then
|
||||||
|
sed -i 's|REPLACE_ONION_WWW_DIR|/data/htdocs/www|g' "/data/htdocs/www/index.html"
|
||||||
|
[ -n "$default_host" ] && sed -i 's|REPLACE_DEFAULT_TOR_ADDRESS|'$default_host.onion'|g' "/data/htdocs/www/index.html" || sed -i '/REPLACE_DEFAULT_TOR_ADDRESS/d' "/data/htdocs/www/index.html"
|
||||||
fi
|
fi
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
# define actions
|
# define actions
|
||||||
@@ -294,10 +299,8 @@ __update_conf_files() {
|
|||||||
onion_site="$(basename -- $site)"
|
onion_site="$(basename -- $site)"
|
||||||
__onion_site_dir_is_empty "$onion_site" && NEW_SITE="yes"
|
__onion_site_dir_is_empty "$onion_site" && NEW_SITE="yes"
|
||||||
[ -d "/data/htdocs/onions/$onion_site" ] || mkdir -p "/data/htdocs/onions/$onion_site"
|
[ -d "/data/htdocs/onions/$onion_site" ] || mkdir -p "/data/htdocs/onions/$onion_site"
|
||||||
if [ "$default_host" = "$onion_site" ]; then
|
if [ "$default_host" = "$onion_site" ] && __onion_site_dir_is_empty "$onion_site"; then
|
||||||
if __onion_site_dir_is_empty "$onion_site"; then
|
cp -Rfa "$WWW_ROOT_DIR/." "/data/htdocs/onions/$onion_site/"
|
||||||
cp -Rfa "$WWW_ROOT_DIR/." "/data/htdocs/onions/$onion_site/"
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
if [ "$NEW_SITE" = "yes" ]; then
|
if [ "$NEW_SITE" = "yes" ]; then
|
||||||
if [ -f "/usr/share/httpd/default/hidden_services.html" ]; then
|
if [ -f "/usr/share/httpd/default/hidden_services.html" ]; then
|
||||||
@@ -309,11 +312,16 @@ __update_conf_files() {
|
|||||||
fi
|
fi
|
||||||
if [ ! -f "/config/nginx/vhosts.d/$onion_site.onion.conf" ]; then
|
if [ ! -f "/config/nginx/vhosts.d/$onion_site.onion.conf" ]; then
|
||||||
cp -Rf "/config/nginx/vhosts.d/template" "/config/nginx/vhosts.d/$onion_site.onion.conf"
|
cp -Rf "/config/nginx/vhosts.d/template" "/config/nginx/vhosts.d/$onion_site.onion.conf"
|
||||||
|
fi
|
||||||
|
if [ -f "/config/nginx/vhosts.d/$onion_site.onion.conf" ]; then
|
||||||
sed -i 's|REPLACE_ONION_PORT|'$SERVICE_PORT'|g' "/config/nginx/vhosts.d/$onion_site.onion.conf"
|
sed -i 's|REPLACE_ONION_PORT|'$SERVICE_PORT'|g' "/config/nginx/vhosts.d/$onion_site.onion.conf"
|
||||||
sed -i 's|REPLACE_ONION_SITE|'$onion_site.onion'|g' "/config/nginx/vhosts.d/$onion_site.onion.conf"
|
sed -i 's|REPLACE_ONION_SITE|'$onion_site.onion'|g' "/config/nginx/vhosts.d/$onion_site.onion.conf"
|
||||||
sed -i 's|REPLACE_ONION_WWW_DIR|/data/htdocs/onions/'$onion_site'|g' "/config/nginx/vhosts.d/$onion_site.onion.conf"
|
sed -i 's|REPLACE_ONION_WWW_DIR|/data/htdocs/onions/'$onion_site'|g' "/config/nginx/vhosts.d/$onion_site.onion.conf"
|
||||||
sed -i 's|REPLACE_ONION_WWW_DIR|/data/htdocs/onions/'$onion_site'|g' "/data/htdocs/onions/$onion_site/index.html"
|
fi
|
||||||
|
if [ -f "/data/htdocs/onions/$onion_site/index.html" ]; then
|
||||||
|
sed -i 's|REPLACE_ONION_ADDRESS|'$onion_site.onion'|g' "/data/htdocs/onions/$onion_site/index.html"
|
||||||
sed -i 's|REPLACE_DEFAULT_TOR_ADDRESS|'$onion_site'|g' "/data/htdocs/onions/$onion_site/index.html"
|
sed -i 's|REPLACE_DEFAULT_TOR_ADDRESS|'$onion_site'|g' "/data/htdocs/onions/$onion_site/index.html"
|
||||||
|
sed -i 's|REPLACE_ONION_WWW_DIR|/data/htdocs/onions/'$onion_site'|g' "/data/htdocs/onions/$onion_site/index.html"
|
||||||
fi
|
fi
|
||||||
unset NEW_SITE
|
unset NEW_SITE
|
||||||
echo "Created $onion_site.onion in /data/htdocs/onions/$onion_site"
|
echo "Created $onion_site.onion in /data/htdocs/onions/$onion_site"
|
||||||
|
|||||||
Reference in New Issue
Block a user