From 1eb0ca8b3636fcf02ed647ba7e6b6fbb229e3b30 Mon Sep 17 00:00:00 2001 From: casjay Date: Wed, 22 Oct 2025 15:06:50 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=83=EF=B8=8F=20Update=20codebase=20?= =?UTF-8?q?=F0=9F=97=83=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rootfs/root/docker/setup/06-post.sh rootfs/usr/local/etc/docker/init.d/zz-nginx.sh rootfs/usr/local/etc/docker/init.d/03-tor-server.sh rootfs/usr/local/etc/docker/init.d/zz-nginx.sh --- .../local/etc/docker/init.d/03-tor-server.sh | 2 +- .../usr/local/etc/docker/init.d/zz-nginx.sh | 24 +++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/rootfs/usr/local/etc/docker/init.d/03-tor-server.sh b/rootfs/usr/local/etc/docker/init.d/03-tor-server.sh index 36043d2..b30d2e2 100755 --- a/rootfs/usr/local/etc/docker/init.d/03-tor-server.sh +++ b/rootfs/usr/local/etc/docker/init.d/03-tor-server.sh @@ -417,7 +417,7 @@ __post_execute() { echo "$name: $url" touch "/run/tor/sites/$site" echo ''$name'
' >>"$WWW_ROOT_DIR/hostnames.html" - if [ "$name" = "default" ]; then echo "$site" >"$WWW_ROOT_DIR/default_host.txt"; fi + if [ "$name" = "default" ]; then echo "$site" >"$WWW_ROOT_DIR/defaultOnion.txt"; fi done echo "End current hidden services" fi diff --git a/rootfs/usr/local/etc/docker/init.d/zz-nginx.sh b/rootfs/usr/local/etc/docker/init.d/zz-nginx.sh index 5be2be0..0b70a62 100755 --- a/rootfs/usr/local/etc/docker/init.d/zz-nginx.sh +++ b/rootfs/usr/local/etc/docker/init.d/zz-nginx.sh @@ -266,9 +266,9 @@ __update_conf_files() { # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # custom commands - if [ -f "$WWW_ROOT_DIR/default_host.txt" ]; then - default_host="${default_host:-$(<"$WWW_ROOT_DIR/default_host.txt")}" - rm -Rf "$WWW_ROOT_DIR/default_host.txt" + if [ -f "$WWW_ROOT_DIR/defaultOnion.txt" ]; then + default_host="${default_host:-$(<"$WWW_ROOT_DIR/defaultOnion.txt")}" + rm -Rf "$WWW_ROOT_DIR/defaultOnion.txt" fi # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # replace variables @@ -292,15 +292,15 @@ __update_conf_files() { onion_site="$(basename -- $site)" __onion_site_dir_is_empty "$onion_site" && NEW_SITE="yes" || NEW_SITE="no" [ -d "/data/htdocs/onions/$onion_site" ] || mkdir -p "/data/htdocs/onions/$onion_site" - if [ "$default_host" = "$onion_site" ] && __onion_site_dir_is_empty "$onion_site"; then - cp -Rfa "$WWW_ROOT_DIR/." "/data/htdocs/onions/$onion_site/" - else - if [ "$NEW_SITE" = "yes" ]; then - if [ -f "/usr/share/httpd/default/hidden_services.html" ]; then - cp -Rf "/usr/share/httpd/default/hidden_services.html" "/data/htdocs/onions/$onion_site/index.html" - else - echo '
HTML Document Root: /data/htdocs/onions/'$onion_site'

' >"/data/htdocs/onions/$onion_site/index.html" - fi + if [ "$default_host" = "$onion_site" ]; then + if [ "$NEW_SITE" != "no" ]; then + cp -Rfa "$WWW_ROOT_DIR/." "/data/htdocs/onions/$onion_site/" + fi + elif [ "$NEW_SITE" = "yes" ]; then + if [ -f "/usr/share/httpd/default/hidden_services.html" ]; then + cp -Rf "/usr/share/httpd/default/hidden_services.html" "/data/htdocs/onions/$onion_site/index.html" + else + echo '
HTML Document Root: /data/htdocs/onions/'$onion_site'

' >"/data/htdocs/onions/$onion_site/index.html" fi fi if [ ! -f "/config/nginx/vhosts.d/$onion_site.onion.conf" ]; then