🗃️ Committing everything that changed 🗃️
All checks were successful
release-tag / release-image (push) Successful in 5m44s

rootfs/usr/local/etc/docker/init.d/03-tor-server.sh
rootfs/usr/local/etc/docker/init.d/zz-nginx.sh
This commit is contained in:
casjay 2025-06-11 17:14:00 -04:00
parent 83dde3d6b9
commit 9bd2e1f830
Signed by untrusted user who does not match committer: jason
GPG Key ID: 1AB309F42A764145
2 changed files with 7 additions and 2 deletions

View File

@ -383,6 +383,7 @@ __post_execute() {
echo "$name: $url"
touch "/run/tor/sites/$site"
echo '<a href="http://'$url'">'$name'</a><br />' >>"$WWW_ROOT_DIR/hostnames.html"
if [ "$name" = "default" ]; then echo "$site" >"$WWW_ROOT_DIR/default_host.txt"; fi
done
echo "End current hidden services"
fi

View File

@ -236,6 +236,7 @@ __run_pre_execute_checks() {
__update_conf_files() {
local exitCode=0 # default exit code
local sysname="${SERVER_NAME:-${FULL_DOMAIN_NAME:-$HOSTNAME}}" # set hostname
[ -f "$WWW_ROOT_DIR/default_host.txt" ] && default_host="$(<"$WWW_ROOT_DIR/default_host.txt")" && rm -Rf "$WWW_ROOT_DIR/default_host.txt"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# delete files
#__rm ""
@ -248,13 +249,16 @@ __update_conf_files() {
# __replace "" "" "$CONF_DIR/nginx.conf"
# replace variables recursively
# __find_replace "" "" "$CONF_DIR"
if [ -n "$default_host" ] && [ -f "$WWW_ROOT_DIR/index.html" ]; then
sed -i 's|imtulbcjer7mohs62lpycyod2c3pnil2x6xjirrojedbluh4d7z2g6ad|'$default_host'|g' "$WWW_ROOT_DIR/index.html"
fi
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# define actions
echo "waiting for tor to start"
while :; do
printf '\r%s' "waiting for tor to start"
[ -f "/tmp/init_tor_services" ] && sleep 30 || break
done
printf '\r%s\n' "The tor server seems to have started "
for site in "/run/tor/sites"/*; do
onion_site="$(basename -- $site)"
mkdir -p "/data/htdocs/onions/$onion_site"