From b863686c61cca679b96785436c89e6c16198f06f Mon Sep 17 00:00:00 2001 From: casjay Date: Thu, 1 May 2025 13:57:22 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=83=EF=B8=8F=20Committing=20everything?= =?UTF-8?q?=20that=20changed=20=F0=9F=97=83=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rootfs/usr/local/etc/docker/init.d/zz-nginx.sh --- rootfs/usr/local/etc/docker/init.d/zz-nginx.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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 7fac356..8935592 100755 --- a/rootfs/usr/local/etc/docker/init.d/zz-nginx.sh +++ b/rootfs/usr/local/etc/docker/init.d/zz-nginx.sh @@ -177,7 +177,12 @@ __run_precopy() { # Define actions/commands if [ ! -d "$WWW_ROOT_DIR" ] || __is_dir_empty "$WWW_ROOT_DIR"; then mkdir -p "$WWW_ROOT_DIR" - cp -Rf "/usr/local/share/httpd/default"/* "$WWW_ROOT_DIR/" + if [ -d "/usr/share/httpd/default" ]; then + cp -Rf "/usr/share/httpd/default/." "$WWW_ROOT_DIR/" + [ -f "$WWW_ROOT_DIR/hidden_service.html" ] && rm -Rf "$WWW_ROOT_DIR/hidden_service.html" + else + echo "Welcome" >"$WWW_ROOT_DIR/index.php" + fi fi if [ -d "$WWW_ROOT_DIR/.git" ]; then rm -Rf "$WWW_ROOT_DIR/.git" @@ -254,7 +259,11 @@ __update_conf_files() { onion_site="$(basename -- $site)" mkdir -p "/data/htdocs/onions/$onion_site" if [ "$(ls -A "/data/htdocs/onions/$onion_site" | wc -l)" -eq 0 ]; then - cp -Rf "/usr/share/httpd/default/hidden_service.html" "/data/htdocs/onions/$onion_site/index.html" + if [ -f "/usr/share/httpd/default/hidden_service.html" ]; then + cp -Rf "/usr/share/httpd/default/hidden_service.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 "/etc/nginx/vhosts.d/$onion_site.onion.conf" ]; then cp -Rf "/etc/nginx/vhosts.d/template" "/etc/nginx/vhosts.d/$onion_site.onion.conf"