mirror of
				https://github.com/casjaysdevdocker/tor
				synced 2025-11-04 01:02:49 -05:00 
			
		
		
		
	🗃️ Committing everything that changed 🗃️
Dockerfile rootfs/usr/local/bin/entrypoint.sh rootfs/usr/local/etc/docker/init.d/php.sh rootfs/usr/local/etc/docker/init.d/tor.sh
This commit is contained in:
		@@ -12,8 +12,8 @@
 | 
			
		||||
# @@Description      :  Entrypoint file for tor
 | 
			
		||||
# @@Changelog        :  New script
 | 
			
		||||
# @@TODO             :  Better documentation
 | 
			
		||||
# @@Other            :  
 | 
			
		||||
# @@Resource         :  
 | 
			
		||||
# @@Other            :
 | 
			
		||||
# @@Resource         :
 | 
			
		||||
# @@Terminal App     :  no
 | 
			
		||||
# @@sudo/root        :  no
 | 
			
		||||
# @@Template         :  other/docker-entrypoint
 | 
			
		||||
@@ -73,23 +73,23 @@ unset set_env
 | 
			
		||||
RUNAS_USER="root" # normally root
 | 
			
		||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 | 
			
		||||
# User and group in which the service switches to - IE: nginx,apache,mysql,postgres
 | 
			
		||||
SERVICE_USER="tor"  # execute command as another user
 | 
			
		||||
SERVICE_GROUP="tor" # Set the service group
 | 
			
		||||
SERVICE_USER=""  # execute command as another user
 | 
			
		||||
SERVICE_GROUP="" # Set the service group
 | 
			
		||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 | 
			
		||||
# Set user and group ID
 | 
			
		||||
SERVICE_UID="0" # set the user id
 | 
			
		||||
SERVICE_GID="0" # set the group id
 | 
			
		||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 | 
			
		||||
# Primary server port- will be added to server ports
 | 
			
		||||
WEB_SERVER_PORT="" # port : 80,443
 | 
			
		||||
WEB_SERVER_PORT="$PORT" # port : 80,443
 | 
			
		||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 | 
			
		||||
# Secondary ports
 | 
			
		||||
SERVER_PORTS="" # specifiy other ports
 | 
			
		||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 | 
			
		||||
# Healthcheck variables
 | 
			
		||||
HEALTH_ENABLED="yes" # enable healthcheck [yes/no]
 | 
			
		||||
SERVICES_LIST="tini" # comma seperated list of processes for the healthcheck
 | 
			
		||||
HEALTH_ENDPOINTS=""  # url endpoints: [http://localhost/health,http://localhost/test]
 | 
			
		||||
HEALTH_ENABLED="yes"                           # enable healthcheck [yes/no]
 | 
			
		||||
SERVICES_LIST="tini,php,tor"                   # comma seperated list of processes for the healthcheck
 | 
			
		||||
HEALTH_ENDPOINTS="http://127.0.0.1/health/txt" # url endpoints: [http://localhost/health,http://localhost/test]
 | 
			
		||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 | 
			
		||||
# Update path var
 | 
			
		||||
export PATH RUNAS_USER SERVICE_USER SERVICE_GROUP SERVICE_UID SERVICE_GID WWW_ROOT_DIR DATABASE_DIR
 | 
			
		||||
 
 | 
			
		||||
@@ -177,7 +177,15 @@ __run_precopy() {
 | 
			
		||||
  # Define actions/commands
 | 
			
		||||
  if [ ! -d "$WWW_ROOT_DIR" ] || __is_dir_empty "$WWW_ROOT_DIR"; then
 | 
			
		||||
    mkdir -p "$WWW_ROOT_DIR"
 | 
			
		||||
    cp -Rfv "/usr/local/share/template-files/data/htdocs/www"/* "$WWW_ROOT_DIR/"
 | 
			
		||||
    cp -Rfv "/usr/share/httpd/default"/* "$WWW_ROOT_DIR/"
 | 
			
		||||
  fi
 | 
			
		||||
  if [ -d "$WWW_ROOT_DIR/.git" ]; then
 | 
			
		||||
    rm -Rf "$WWW_ROOT_DIR/.git"
 | 
			
		||||
  fi
 | 
			
		||||
  if [ ! -d "$WWW_ROOT_DIR/health" ]; then
 | 
			
		||||
    mkdir -p "$WWW_ROOT_DIR/health"
 | 
			
		||||
    echo "200" >"$WWW_ROOT_DIR/health/txt"
 | 
			
		||||
    echo '{"message":"ok"}' >"$WWW_ROOT_DIR/health/json"
 | 
			
		||||
  fi
 | 
			
		||||
  # allow custom functions
 | 
			
		||||
  if builtin type -t __run_precopy_local | grep -q 'function'; then __run_precopy_local; fi
 | 
			
		||||
 
 | 
			
		||||
@@ -175,7 +175,7 @@ __run_precopy() {
 | 
			
		||||
  # Define environment
 | 
			
		||||
  local hostname=${HOSTNAME}
 | 
			
		||||
  # Define actions/commands
 | 
			
		||||
 | 
			
		||||
  [ -f "/etc/tor/torrc.sample" ] && rm -Rf "/etc/tor"/*.sample
 | 
			
		||||
  # allow custom functions
 | 
			
		||||
  if builtin type -t __run_precopy_local | grep -q 'function'; then __run_precopy_local; fi
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user