🗃️ Update codebase 🗃️
All checks were successful
release-tag / release-image (push) Successful in 6m57s

rootfs/root/docker/setup/03-files.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
This commit is contained in:
casjay
2025-11-21 06:36:58 -05:00
parent 939b16c57d
commit b65539178c
4 changed files with 58 additions and 42 deletions

View File

@@ -29,60 +29,65 @@ exitCode=0
# - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -
# Predefined actions # Predefined actions
if [ -d "/tmp/bin" ]; then if [ -d "/tmp/bin" ]; then
mkdir -p "/usr/local/bin" mkdir -p "/usr/local/bin"
for bin in "/tmp/bin"/*; do for bin in "/tmp/bin"/*; do
name="$(basename -- "$bin")" name="$(basename -- "$bin")"
echo "Installing $name to /usr/local/bin/$name" echo "Installing $name to /usr/local/bin/$name"
copy "$bin" "/usr/local/bin/$name" copy "$bin" "/usr/local/bin/$name"
chmod -f +x "/usr/local/bin/$name" chmod -f +x "/usr/local/bin/$name"
done done
fi fi
unset bin unset bin
if [ -d "/tmp/var" ]; then if [ -d "/tmp/var" ]; then
for var in "/tmp/var"/*; do for var in "/tmp/var"/*; do
name="$(basename -- "$var")" name="$(basename -- "$var")"
echo "Installing $var to /var/$name" echo "Installing $var to /var/$name"
if [ -d "$var" ]; then if [ -d "$var" ]; then
mkdir -p "/var/$name" mkdir -p "/var/$name"
copy "$var/." "/var/$name/" copy "$var/." "/var/$name/"
else else
copy "$var" "/var/$name" copy "$var" "/var/$name"
fi fi
done done
fi fi
unset var unset var
if [ -d "/tmp/etc" ]; then if [ -d "/tmp/etc" ]; then
for config in "/tmp/etc"/*; do for config in "/tmp/etc"/*; do
name="$(basename -- "$config")" name="$(basename -- "$config")"
echo "Installing $config to /etc/$name" echo "Installing $config to /etc/$name"
if [ -d "$config" ]; then if [ -d "$config" ]; then
mkdir -p "/etc/$name" mkdir -p "/etc/$name"
copy "$config/." "/etc/$name/" copy "$config/." "/etc/$name/"
mkdir -p "/usr/local/share/template-files/config/$name" mkdir -p "/usr/local/share/template-files/config/$name"
copy "$config/." "/usr/local/share/template-files/config/$name/" copy "$config/." "/usr/local/share/template-files/config/$name/"
else else
copy "$config" "/etc/$name" copy "$config" "/etc/$name"
copy "$config" "/usr/local/share/template-files/config/$name" copy "$config" "/usr/local/share/template-files/config/$name"
fi fi
done done
fi fi
unset config unset config
if [ -d "/tmp/data" ]; then if [ -d "/tmp/data" ]; then
for data in "/tmp/data"/*; do for data in "/tmp/data"/*; do
name="$(basename -- "$data")" name="$(basename -- "$data")"
echo "Installing $data to /usr/local/share/template-files/data" echo "Installing $data to /usr/local/share/template-files/data"
if [ -d "$data" ]; then if [ -d "$data" ]; then
mkdir -p "/usr/local/share/template-files/data/$name" mkdir -p "/usr/local/share/template-files/data/$name"
copy "$data/." "/usr/local/share/template-files/data/$name/" copy "$data/." "/usr/local/share/template-files/data/$name/"
else else
copy "$data" "/usr/local/share/template-files/data/$name" copy "$data" "/usr/local/share/template-files/data/$name"
fi fi
done done
fi fi
unset data unset data
# - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -
# Main script # Main script
for tor_bin in relay bridge server; do
if [ ! -f "/usr/local/bin/tor-$tor_bin" ]; then
cp -Rf "$(type -P tor 2>/dev/null)" "/usr/local/bin/tor-$tor_bin"
chmod +x "/usr/local/bin/tor-$tor_bin"
fi
done
# - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -
# Set the exit code # Set the exit code
#exitCode=$? #exitCode=$?

View File

@@ -200,9 +200,12 @@ RANDOM_NICK="$(head -n50 '/dev/random' | tr -dc 'a-zA-Z' | tr -d '[:space:]\042\
__run_precopy() { __run_precopy() {
# Define environment # Define environment
local hostname=${HOSTNAME} local hostname=${HOSTNAME}
local tor_bin="$(type -P "tor" 2>/dev/null)"
local server_bin="$(type -P "tor-bridge" 2>/dev/null)"
# Define actions/commands # Define actions/commands
[ -d "$DATA_DIR" ] || mkdir -p "$DATA_DIR" [ -d "$DATA_DIR" ] || mkdir -p "$DATA_DIR"
[ -n "$tor_bin" ] && [ -z "$server_bin" ] && cp -Rf "$tor_bin" "/usr/local/bin/tor-bridge"
chmod +x "/usr/local/bin/tor-bridge"
# allow custom functions # allow custom functions
if builtin type -t __run_precopy_local | grep -q 'function'; then __run_precopy_local; fi if builtin type -t __run_precopy_local | grep -q 'function'; then __run_precopy_local; fi
} }

View File

@@ -200,8 +200,12 @@ RANDOM_NICK="$(head -n50 '/dev/random' | tr -dc 'a-zA-Z' | tr -d '[:space:]\042\
__run_precopy() { __run_precopy() {
# Define environment # Define environment
local hostname=${HOSTNAME} local hostname=${HOSTNAME}
local tor_bin="$(type -P "tor" 2>/dev/null)"
local server_bin="$(type -P "tor-relay" 2>/dev/null)"
# Define actions/commands # Define actions/commands
[ -d "$DATA_DIR" ] || mkdir -p "$DATA_DIR" [ -d "$DATA_DIR" ] || mkdir -p "$DATA_DIR"
[ -n "$tor_bin" ] && [ -z "$server_bin" ] && cp -Rf "$tor_bin" "/usr/local/bin/tor-relay"
chmod +x "/usr/local/bin/tor-relay"
# allow custom functions # allow custom functions
if builtin type -t __run_precopy_local | grep -q 'function'; then __run_precopy_local; fi if builtin type -t __run_precopy_local | grep -q 'function'; then __run_precopy_local; fi

View File

@@ -200,8 +200,12 @@ RANDOM_NICK="$(head -n50 '/dev/random' | tr -dc 'a-zA-Z' | tr -d '[:space:]\042\
__run_precopy() { __run_precopy() {
# Define environment # Define environment
local hostname=${HOSTNAME} local hostname=${HOSTNAME}
local tor_bin="$(type -P "tor" 2>/dev/null)"
local server_bin="$(type -P "tor-server" 2>/dev/null)"
# Define actions/commands # Define actions/commands
[ -d "$DATA_DIR" ] || mkdir -p "$DATA_DIR" [ -d "$DATA_DIR" ] || mkdir -p "$DATA_DIR"
[ -n "$tor_bin" ] && [ -z "$server_bin" ] && cp -Rf "$tor_bin" "/usr/local/bin/tor-server"
chmod +x "/usr/local/bin/tor-server"
# allow custom functions # allow custom functions
if builtin type -t __run_precopy_local | grep -q 'function'; then __run_precopy_local; fi if builtin type -t __run_precopy_local | grep -q 'function'; then __run_precopy_local; fi