🗃️ Fixed the entrypoint scripts 🗃️
Some checks failed
release-tag / release-image (push) Failing after 26s

rootfs/usr/local/bin/entrypoint.sh
rootfs/usr/local/etc/docker/functions/entrypoint.sh
rootfs/usr/local/share/template-files/config/env/default.sample
This commit is contained in:
casjay
2025-11-29 12:36:52 -05:00
parent 3df1f4656a
commit 4295561b19
3 changed files with 1098 additions and 1033 deletions

View File

@@ -1,21 +1,21 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# shellcheck shell=bash # shellcheck shell=bash
# - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -
##@Version : GEN_SCRIPT_REPLACE_VERSION ##@Version : 202511291230-git
# @@Author : GEN_SCRIPT_REPLACE_AUTHOR # @@Author : Jason Hempstead
# @@Contact : GEN_SCRIPT_REPLACE_EMAIL # @@Contact : jason@casjaysdev.pro
# @@License : GEN_SCRIPT_REPLACE_LICENSE # @@License : WTFPL
# @@ReadME : entrypoint.sh --help # @@ReadME : entrypoint.sh --help
# @@Copyright : GEN_SCRIPT_REPLACE_COPYRIGHT # @@Copyright : Copyright: (c) 2025 Jason Hempstead, Casjays Developments
# @@Created : GEN_SCRIPT_REPLACE_DATE # @@Created : Saturday, Nov 29, 2025 12:30 EST
# @@File : entrypoint.sh # @@File : entrypoint.sh
# @@Description : Entrypoint file for GEN_SCRIPT_REPLACE_APPNAME # @@Description : Entrypoint file for lighttpd
# @@Changelog : GEN_SCRIPT_REPLACE_CHANGELOG # @@Changelog : New script
# @@TODO : GEN_SCRIPT_REPLACE_TODO # @@TODO : Better documentation
# @@Other : GEN_SCRIPT_REPLACE_OTHER # @@Other :
# @@Resource : GEN_SCRIPT_REPLACE_RES # @@Resource :
# @@Terminal App : GEN_SCRIPT_REPLACE_TERMINAL # @@Terminal App : no
# @@sudo/root : GEN_SCRIPT_REPLACE_SUDO # @@sudo/root : no
# @@Template : other/docker-entrypoint # @@Template : other/docker-entrypoint
# - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -
# shellcheck disable=SC1001,SC1003,SC2001,SC2003,SC2016,SC2031,SC2090,SC2115,SC2120,SC2155,SC2199,SC2229,SC2317,SC2329 # shellcheck disable=SC1001,SC1003,SC2001,SC2003,SC2016,SC2031,SC2090,SC2115,SC2120,SC2155,SC2199,SC2229,SC2317,SC2329
@@ -31,7 +31,7 @@ PATH="/usr/local/etc/docker/bin:/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin"
# - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -
# Set bash options # Set bash options
SCRIPT_FILE="$0" SCRIPT_FILE="$0"
CONTAINER_NAME="GEN_SCRIPT_REPLACE_APPNAME" CONTAINER_NAME="lighttpd"
SCRIPT_NAME="$(basename -- "$SCRIPT_FILE" 2>/dev/null)" SCRIPT_NAME="$(basename -- "$SCRIPT_FILE" 2>/dev/null)"
CONTAINER_NAME="${ENV_CONTAINER_NAME:-$CONTAINER_NAME}" CONTAINER_NAME="${ENV_CONTAINER_NAME:-$CONTAINER_NAME}"
# - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -84,8 +84,8 @@ SERVICE_UID="${SERVICE_UID:-0}" # set the user id
SERVICE_GID="${SERVICE_GID:-0}" # set the group id SERVICE_GID="${SERVICE_GID:-0}" # set the group id
# - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -
# User and group in which the service switches to - IE: nginx,apache,mysql,postgres # User and group in which the service switches to - IE: nginx,apache,mysql,postgres
SERVICE_USER="${SERVICE_USER:-GEN_SCRIPT_REPLACE_APPNAME}" # execute command as another user #SERVICE_USER="${SERVICE_USER:-lighttpd}" # execute command as another user
SERVICE_GROUP="${SERVICE_GROUP:-GEN_SCRIPT_REPLACE_APPNAME}" # Set the service group #SERVICE_GROUP="${SERVICE_GROUP:-lighttpd}" # Set the service group
# - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -
# Secondary ports # Secondary ports
SERVER_PORTS="" # specifiy other ports SERVER_PORTS="" # specifiy other ports
@@ -258,7 +258,7 @@ fi
if [ "$ENTRYPOINT_FIRST_RUN" != "no" ]; then if [ "$ENTRYPOINT_FIRST_RUN" != "no" ]; then
# Show start message # Show start message
if [ "$CONFIG_DIR_INITIALIZED" = "no" ] || [ "$DATA_DIR_INITIALIZED" = "no" ]; then if [ "$CONFIG_DIR_INITIALIZED" = "no" ] || [ "$DATA_DIR_INITIALIZED" = "no" ]; then
[ "$ENTRYPOINT_MESSAGE" = "yes" ] && echo "Executing entrypoint script for GEN_SCRIPT_REPLACE_APPNAME" [ "$ENTRYPOINT_MESSAGE" = "yes" ] && echo "Executing entrypoint script for lighttpd"
fi fi
# - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -
# Set reusable variables # Set reusable variables

View File

@@ -628,6 +628,8 @@ __set_user_group_id() {
# - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -
__create_service_user() { __create_service_user() {
local exitStatus=0 local exitStatus=0
local max_attempts=100
local attempt=0
local create_user="${1:-$SERVICE_USER}" local create_user="${1:-$SERVICE_USER}"
local create_group="${2:-${SERVICE_GROUP:-$create_user}}" local create_group="${2:-${SERVICE_GROUP:-$create_user}}"
local create_home_dir="${3:-$WORK_DIR}" local create_home_dir="${3:-$WORK_DIR}"
@@ -635,55 +637,118 @@ __create_service_user() {
local create_gid="${5:-${SERVICE_GID:-$USER_GID}}" local create_gid="${5:-${SERVICE_GID:-$USER_GID}}"
local random_id="$(__generate_random_uids)" local random_id="$(__generate_random_uids)"
local create_home_dir="${create_home_dir:-/home/$create_user}" local create_home_dir="${create_home_dir:-/home/$create_user}"
grep -shq "^$create_user:" "/etc/passwd" && grep -shq "^$create_group:" "/etc/group" && return local log_file="/data/logs/init.txt"
# Ensure log directory exists
[ -d "$(dirname "$log_file")" ] || mkdir -p "$(dirname "$log_file")" 2>/dev/null
# Validate that we have at least a user or group to create
if [ -z "$create_user" ] && [ -z "$create_group" ]; then
echo "Error: No user or group specified to create" >&2
return 1
fi
# Validate user/group name format (alphanumeric, underscore, hyphen; must start with letter or underscore)
if [ -n "$create_user" ] && ! echo "$create_user" | grep -qE '^[a-z_][a-z0-9_-]*$'; then
echo "Error: Invalid username format '$create_user' - must start with letter/underscore, contain only lowercase alphanumeric, underscore, or hyphen" >&2
return 1
fi
if [ -n "$create_group" ] && ! echo "$create_group" | grep -qE '^[a-z_][a-z0-9_-]*$'; then
echo "Error: Invalid group name format '$create_group' - must start with letter/underscore, contain only lowercase alphanumeric, underscore, or hyphen" >&2
return 1
fi
# Check if user and group already exist
if grep -shq "^$create_user:" "/etc/passwd" && grep -shq "^$create_group:" "/etc/group"; then
return 0
fi
# Root user/group - nothing to create
if [ "$create_user" = "root" ] && [ "$create_group" = "root" ]; then if [ "$create_user" = "root" ] && [ "$create_group" = "root" ]; then
return 0 return 0
fi fi
if [ "$RUNAS_USER" != "root" ] && [ "$RUNAS_USER" != "" ]; then # Override with RUNAS_USER if specified and not root
if [ -n "$RUNAS_USER" ] && [ "$RUNAS_USER" != "root" ]; then
create_user="$RUNAS_USER" create_user="$RUNAS_USER"
create_group="$RUNAS_USER" create_group="$RUNAS_USER"
create_uid="${create_uid:-1000}" create_uid="${create_uid:-1000}"
create_gid="${create_gid:-1000}" create_gid="${create_gid:-1000}"
fi fi
create_uid="$(__get_uid "$create_user" || echo "$create_uid")" # Get existing UID/GID or use provided values
create_gid="$(__get_gid "$create_user" || echo "$create_gid")" create_uid="$(__get_uid "$create_user" 2>/dev/null || echo "$create_uid")"
[ -n "$create_uid" ] && [ "$create_uid" != "0" ] || create_uid="$random_id" create_gid="$(__get_gid "$create_user" 2>/dev/null || echo "$create_gid")"
[ -n "$create_gid" ] && [ "$create_gid" != "0" ] || create_gid="$random_id" # Ensure we have valid non-root UID/GID
while :; do if [ -z "$create_uid" ] || [ "$create_uid" = "0" ]; then
if __check_for_uid "$create_uid" && __check_for_guid "$create_gid"; then create_uid="$random_id"
create_uid=$(($random_id + 1))
create_gid="$create_uid"
else
break
fi fi
if [ -z "$create_gid" ] || [ "$create_gid" = "0" ]; then
create_gid="$random_id"
fi
# Validate UID/GID are numeric and within valid range
if ! echo "$create_uid" | grep -qE '^[0-9]+$' || [ "$create_uid" -lt 1 ] || [ "$create_uid" -gt 65534 ]; then
echo "Error: Invalid UID '$create_uid' - must be a number between 1 and 65534" >&2
return 1
fi
if ! echo "$create_gid" | grep -qE '^[0-9]+$' || [ "$create_gid" -lt 1 ] || [ "$create_gid" -gt 65534 ]; then
echo "Error: Invalid GID '$create_gid' - must be a number between 1 and 65534" >&2
return 1
fi
# Find available UID/GID if current ones are taken (with loop protection)
while __check_for_uid "$create_uid" || __check_for_guid "$create_gid"; do
attempt=$((attempt + 1))
if [ $attempt -ge $max_attempts ]; then
echo "Error: Could not find available UID/GID after $max_attempts attempts" >&2
return 1
fi
random_id=$((random_id + 1))
create_uid="$random_id"
create_gid="$random_id"
done done
# Create group if needed
if [ -n "$create_group" ] && ! __check_for_group "$create_group"; then if [ -n "$create_group" ] && ! __check_for_group "$create_group"; then
echo "creating system group $create_group" echo "Creating system group '$create_group' with GID $create_gid"
groupadd --force --system -g $create_gid $create_group 2>/dev/stderr | tee -a "/data/logs/init.txt" >/dev/null if ! groupadd --force --system -g "$create_gid" "$create_group" 2>&1 | tee -a "$log_file"; then
grep -shq "$create_group" "/etc/group" || exitStatus=$((exitStatus + 1)) echo "Error: Failed to create group '$create_group'" >&2
exitStatus=$((exitStatus + 1))
elif ! grep -shq "^$create_group:" "/etc/group"; then
echo "Error: Group '$create_group' not found in /etc/group after creation" >&2
exitStatus=$((exitStatus + 1))
fi fi
if [ -n "$create_user" ] && ! __check_for_user "$create_user"; then
echo "creating system user $create_user"
useradd --system --uid $create_uid --gid $create_group --comment "Account for $create_user" --home-dir "$create_home_dir" --shell /bin/false $create_user 2>/dev/stderr | tee -a "/data/logs/init.txt" >/dev/null
grep -shq "$create_user" "/etc/passwd" || exitStatus=$((exitStatus + 1))
fi fi
# Create user if needed (only if group creation succeeded)
if [ $exitStatus -eq 0 ] && [ -n "$create_user" ] && ! __check_for_user "$create_user"; then
echo "Creating system user '$create_user' with UID $create_uid"
if ! useradd --system --uid "$create_uid" --gid "$create_group" --comment "Account for $create_user" --home-dir "$create_home_dir" --shell /bin/false "$create_user" 2>&1 | tee -a "$log_file"; then
echo "Error: Failed to create user '$create_user'" >&2
exitStatus=$((exitStatus + 1))
elif ! grep -shq "^$create_user:" "/etc/passwd"; then
echo "Error: User '$create_user' not found in /etc/passwd after creation" >&2
exitStatus=$((exitStatus + 1))
fi
fi
# Setup user environment if creation succeeded
if [ $exitStatus -eq 0 ] && [ -n "$create_group" ] && [ -n "$create_user" ]; then if [ $exitStatus -eq 0 ] && [ -n "$create_group" ] && [ -n "$create_user" ]; then
export WORK_DIR="${create_home_dir:-}" export WORK_DIR="${create_home_dir:-}"
if [ -n "$WORK_DIR" ]; then if [ -n "$WORK_DIR" ]; then
[ -d "$WORK_DIR" ] || mkdir -p "$WORK_DIR" if [ ! -d "$WORK_DIR" ]; then
[ -d "/etc/.skel" ] && cp -Rf /etc/.skel/. "$WORK_DIR/" if ! mkdir -p "$WORK_DIR" 2>/dev/null; then
echo "Warning: Failed to create home directory '$WORK_DIR'" >&2
fi fi
if [ -d "/etc/sudoers.d" ] && [ ! -f "/etc/sudoers.d/$create_user" ]; then
echo "$create_user ALL=(ALL) NOPASSWD: ALL" >"/etc/sudoers.d/$create_user"
elif [ -f "/etc/sudoers" ] && ! grep -qs "$create_user" "/etc/sudoers"; then
echo "$create_user ALL=(ALL) NOPASSWD: ALL" ? >>"/etc/sudoers"
fi fi
exitStatus=0 if [ -d "/etc/.skel" ] && [ -d "$WORK_DIR" ]; then
cp -Rf /etc/.skel/. "$WORK_DIR/" 2>/dev/null || echo "Warning: Failed to copy skeleton files to '$WORK_DIR'" >&2
fi
fi
# Setup sudo access
if [ -d "/etc/sudoers.d" ]; then
if [ ! -f "/etc/sudoers.d/$create_user" ]; then
echo "$create_user ALL=(ALL) NOPASSWD: ALL" >"/etc/sudoers.d/$create_user" 2>/dev/null || echo "Warning: Failed to create sudoers file for '$create_user'" >&2
chmod 0440 "/etc/sudoers.d/$create_user" 2>/dev/null
fi
elif [ -f "/etc/sudoers" ] && ! grep -qs "^$create_user " "/etc/sudoers"; then
echo "$create_user ALL=(ALL) NOPASSWD: ALL" >>"/etc/sudoers" 2>/dev/null || echo "Warning: Failed to add '$create_user' to sudoers" >&2
fi
SERVICE_UID="$create_uid" SERVICE_UID="$create_uid"
SERVICE_GID="$create_gid" SERVICE_GID="$create_gid"
SERVICE_USER="$create_user" SERVICE_USER="$create_user"
SERVICE_GROUP="$create_group" SERVICE_GROUP="$create_group"
else else
echo "Warning: Falling back to root user due to creation errors" >&2
SERVICE_UID=0 SERVICE_UID=0
SERVICE_GID=0 SERVICE_GID=0
SERVICE_USER=root SERVICE_USER=root

View File

@@ -1,17 +1,17 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -
# Set bash options # Set bash options
[ "$DEBUGGER" = "on" ] && echo "Enabling debugging" && set -o pipefail -x$DEBUGGER_OPTIONS || set -o pipefail [ "$DEBUGGER" = "on" ] && echo "Enabling debugging" && set -o pipefail -x$DEBUGGER_OPTIONS || set -o pipefail
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -
# import the functions file # import the functions file
[ -f "/usr/local/etc/docker/functions/entrypoint.sh" ] && . "/usr/local/etc/docker/functions/entrypoint.sh" [ -f "/usr/local/etc/docker/functions/entrypoint.sh" ] && . "/usr/local/etc/docker/functions/entrypoint.sh"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -
# GLOBAL enviroment variables # GLOBAL enviroment variables
#USER="${USER:-root}" #USER="${USER:-root}"
#LANG="${LANG:-C.UTF-8}" #LANG="${LANG:-C.UTF-8}"
#TZ="${TZ:-America/New_York}" #TZ="${TZ:-America/New_York}"
#SERVICE_USER="${SERVICE_USER:-root}" #SERVICE_USER="${SERVICE_USER:-root}"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -
# directory settings # directory settings
#BACKUP_DIR="${BACKUP_DIR:-/data/backups}" #BACKUP_DIR="${BACKUP_DIR:-/data/backups}"
#WWW_ROOT_DIR="${WWW_ROOT_DIR:-/usr/local/share/httpd/default}" #WWW_ROOT_DIR="${WWW_ROOT_DIR:-/usr/local/share/httpd/default}"
@@ -21,39 +21,39 @@
#DEFAULT_CONF_DIR="${DEFAULT_CONF_DIR:-/usr/local/share/template-files/config}" #DEFAULT_CONF_DIR="${DEFAULT_CONF_DIR:-/usr/local/share/template-files/config}"
#DEFAULT_TEMPLATE_DIR="${DEFAULT_TEMPLATE_DIR:-/usr/local/share/template-files/defaults}" #DEFAULT_TEMPLATE_DIR="${DEFAULT_TEMPLATE_DIR:-/usr/local/share/template-files/defaults}"
#DBTYPE="sqlite" #DBTYPE="sqlite"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -
# healthcheck # healthcheck
#HEALTH_ENABLED="${HEALTH_ENABLED:-$ENV_HEALTH_ENABLED}" #HEALTH_ENABLED="${HEALTH_ENABLED:-$ENV_HEALTH_ENABLED}"
#HEALTH_URL="${HEALTH_URL:-}" #HEALTH_URL="${HEALTH_URL:-}"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -
# php settings # php settings
#PHP_VERSION="${PHP_VERSION//php/}" #PHP_VERSION="${PHP_VERSION//php/}"
#PHP_INI_DIR="${PHP_INI_DIR:-$(__find_php_ini)}" #PHP_INI_DIR="${PHP_INI_DIR:-$(__find_php_ini)}"
#PHP_BIN_DIR="${PHP_BIN_DIR:-$(__find_php_bin)}" #PHP_BIN_DIR="${PHP_BIN_DIR:-$(__find_php_bin)}"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -
# services/ports # services/ports
#ENV_PORTS="${ENV_PORTS:-}" #ENV_PORTS="${ENV_PORTS:-}"
#SERVICE_PORT="${SERVICE_PORT:-$PORT}" #SERVICE_PORT="${SERVICE_PORT:-$PORT}"
#WEB_SERVER_PORTS="${WEB_SERVER_PORTS:-$ENV_WEB_SERVER_PORTS}" #WEB_SERVER_PORTS="${WEB_SERVER_PORTS:-$ENV_WEB_SERVER_PORTS}"
#SERVICES_LIST="${PROCS_LIST:-$SERVICES_LIST} " #SERVICES_LIST="${PROCS_LIST:-$SERVICES_LIST} "
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -
# networing info # networing info
DOMAINNAME="${DOMAINNAME:-}" DOMAINNAME="${DOMAINNAME:-}"
HOSTNAME="${HOSTNAME:-casjaysdev-GEN_SCRIPT_REPLACE_APPNAME}" HOSTNAME="${HOSTNAME:-casjaysdev-GEN_SCRIPT_REPLACE_APPNAME}"
FULL_DOMAIN_NAME="${FULL_DOMAIN_NAME:-${DOMAINNAME:-$HOSTNAME}}" FULL_DOMAIN_NAME="${FULL_DOMAIN_NAME:-${DOMAINNAME:-$HOSTNAME}}"
SERVER_ADMIN="${SERVER_ADMIN:-root@${EMAIL_DOMAIN:-${DOMAINNAME:-$FULL_DOMAIN_NAME}}}" SERVER_ADMIN="${SERVER_ADMIN:-root@${EMAIL_DOMAIN:-${DOMAINNAME:-$FULL_DOMAIN_NAME}}}"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -
EMAIL_RELAY="${EMAIL_RELAY:-}" EMAIL_RELAY="${EMAIL_RELAY:-}"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -
# get ip addresses # get ip addresses
CONTAINER_IP4_ADDRESS="${CONTAINER_IP4_ADDRESS:-$(__get_ip4)}" CONTAINER_IP4_ADDRESS="${CONTAINER_IP4_ADDRESS:-$(__get_ip4)}"
CONTAINER_IP6_ADDRESS="${CONTAINER_IP6_ADDRESS:-$(__get_ip6)}" CONTAINER_IP6_ADDRESS="${CONTAINER_IP6_ADDRESS:-$(__get_ip6)}"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -
# cerbot # cerbot
#CERT_BOT_MAIL="${CERT_BOT_MAIL:-}" #CERT_BOT_MAIL="${CERT_BOT_MAIL:-}"
#CERTBOT_DOMAINS="${CERTBOT_DOMAINS:-}" #CERTBOT_DOMAINS="${CERTBOT_DOMAINS:-}"
#CERT_BOT_ENABLED="${CERT_BOT_ENABLED:-false}" #CERT_BOT_ENABLED="${CERT_BOT_ENABLED:-false}"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -
# ssl server settings # ssl server settings
#SSL_ENABLED="${SSL_ENABLED:-false}" #SSL_ENABLED="${SSL_ENABLED:-false}"
#SSL_DIR="${SSL_DIR:-/config/ssl}" #SSL_DIR="${SSL_DIR:-/config/ssl}"
@@ -69,22 +69,22 @@ CONTAINER_IP6_ADDRESS="${CONTAINER_IP6_ADDRESS:-$(__get_ip6)}"
#DAYS_VALID="${DAYS_VALID:-3650}" #DAYS_VALID="${DAYS_VALID:-3650}"
#RSA="${RSA:-4096}" #RSA="${RSA:-4096}"
#CN="${CN:-$FULL_DOMAIN_NAME}" #CN="${CN:-$FULL_DOMAIN_NAME}"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -
# web server configs # web server configs
HTTPD_CONFIG_FILE="${HTTPD_CONFIG_FILE:-$(__find_httpd_conf)}" HTTPD_CONFIG_FILE="${HTTPD_CONFIG_FILE:-$(__find_httpd_conf)}"
NGINX_CONFIG_FILE="${NGINX_CONFIG_FILE:-$(__find_nginx_conf)}" NGINX_CONFIG_FILE="${NGINX_CONFIG_FILE:-$(__find_nginx_conf)}"
LIGHTTPD_CONFIG_FILE="${LIGHTTPD_CONFIG_FILE:-$(__find_lighttpd_conf)}" LIGHTTPD_CONFIG_FILE="${LIGHTTPD_CONFIG_FILE:-$(__find_lighttpd_conf)}"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -
# redis env # redis env
DATABASE_DIR_REDIS="${DATABASE_DIR_REDIS:-$DATABASE_BASE_DIR/redis}" DATABASE_DIR_REDIS="${DATABASE_DIR_REDIS:-$DATABASE_BASE_DIR/redis}"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -
# postgresql env # postgresql env
DATABASE_DIR_PGSQL="${DATABASE_DIR_PGSQL:-$PGDATA}" DATABASE_DIR_PGSQL="${DATABASE_DIR_PGSQL:-$PGDATA}"
PGDATA="${DATABASE_DIR_PGSQL:-$DATABASE_BASE_DIR/postgres}" PGDATA="${DATABASE_DIR_PGSQL:-$DATABASE_BASE_DIR/postgres}"
POSTGRES_USER="${DATABASE_USER_ROOT:-$POSTGRES_USER}" POSTGRES_USER="${DATABASE_USER_ROOT:-$POSTGRES_USER}"
POSTGRES_PASSWORD="${DATABASE_PASS_ROOT:-$POSTGRES_PASSWORD}" POSTGRES_PASSWORD="${DATABASE_PASS_ROOT:-$POSTGRES_PASSWORD}"
POSTGRES_CONFIG_FILE="${POSTGRES_CONFIG_FILE:-$(__find_pgsql_conf)}" POSTGRES_CONFIG_FILE="${POSTGRES_CONFIG_FILE:-$(__find_pgsql_conf)}"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -
# mariadb env # mariadb env
MARIADB_ROOT_HOST="${MARIADB_ROOT_HOST:-%}" MARIADB_ROOT_HOST="${MARIADB_ROOT_HOST:-%}"
MARIADB_AUTO_UPGRADE="${MARIADB_AUTO_UPGRADE:-yes}" MARIADB_AUTO_UPGRADE="${MARIADB_AUTO_UPGRADE:-yes}"
@@ -97,30 +97,30 @@ MARIADB_ALLOW_EMPTY_ROOT_PASSWORD="${MARIADB_ALLOW_EMPTY_ROOT_PASSWORD:-}"
MARIADB_INITDB_SKIP_TZINFO="${MARIADB_INITDB_SKIP_TZINFO}:-" MARIADB_INITDB_SKIP_TZINFO="${MARIADB_INITDB_SKIP_TZINFO}:-"
MARIADB_RANDOM_ROOT_PASSWORD="${MARIADB_RANDOM_ROOT_PASSWORD:-}" MARIADB_RANDOM_ROOT_PASSWORD="${MARIADB_RANDOM_ROOT_PASSWORD:-}"
MARIADB_CONFIG_FILE="${MARIADB_CONFIG_FILE:-$(__find_mysql_conf)}" MARIADB_CONFIG_FILE="${MARIADB_CONFIG_FILE:-$(__find_mysql_conf)}"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -
# mongodb env # mongodb env
INITDB_ROOT_USERNAME="${DATABASE_USER_ROOT:-$INITDB_ROOT_USERNAME}" INITDB_ROOT_USERNAME="${DATABASE_USER_ROOT:-$INITDB_ROOT_USERNAME}"
DATABASE_DIR_MONGODB="${DATABASE_DIR_MONGODB:-$DATABASE_BASE_DIR/mongodb}" DATABASE_DIR_MONGODB="${DATABASE_DIR_MONGODB:-$DATABASE_BASE_DIR/mongodb}"
MONGO_INITDB_ROOT_PASSWORD="${DATABASE_PASS_ROOT:-$MONGO_INITDB_ROOT_PASSWORD}" MONGO_INITDB_ROOT_PASSWORD="${DATABASE_PASS_ROOT:-$MONGO_INITDB_ROOT_PASSWORD}"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -
# couchdb env # couchdb env
NODENAME="${NODENAME:-}" NODENAME="${NODENAME:-}"
COUCHDB_USER="${DATABASE_USER_ROOT:-$COUCHDB_USER}" COUCHDB_USER="${DATABASE_USER_ROOT:-$COUCHDB_USER}"
COUCHDB_PASSWORD="${DATABASE_PASS_ROOT:-$COUCHDB_PASSWORD}" COUCHDB_PASSWORD="${DATABASE_PASS_ROOT:-$COUCHDB_PASSWORD}"
DATABASE_DIR_COUCHDB="${DATABASE_DIR_COUCHDB:-$DATABASE_BASE_DIR/couchdb}" DATABASE_DIR_COUCHDB="${DATABASE_DIR_COUCHDB:-$DATABASE_BASE_DIR/couchdb}"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -
# Supabase # Supabase
DATABASE_DIR_SUPABASE="${DATABASE_DIR_SUPABASE:-$DATABASE_BASE_DIR/supabase}" DATABASE_DIR_SUPABASE="${DATABASE_DIR_SUPABASE:-$DATABASE_BASE_DIR/supabase}"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -
# docker env # docker env
DOCKER_HOST="unix:///run/docker.sock" DOCKER_HOST="unix://var/run/docker.sock"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -
# File locations # File locations
ENTRYPOINT_PID_FILE="${ENTRYPOINT_PID_FILE:-/run/init.d/entrypoint.pid}" ENTRYPOINT_PID_FILE="${ENTRYPOINT_PID_FILE:-/run/init.d/entrypoint.pid}"
ENTRYPOINT_INIT_FILE="${ENTRYPOINT_INIT_FILE:-/config/.entrypoint.done}" ENTRYPOINT_INIT_FILE="${ENTRYPOINT_INIT_FILE:-/config/.entrypoint.done}"
ENTRYPOINT_DATA_INIT_FILE="${ENTRYPOINT_DATA_INIT_FILE:-/data/.docker_has_run}" ENTRYPOINT_DATA_INIT_FILE="${ENTRYPOINT_DATA_INIT_FILE:-/data/.docker_has_run}"
ENTRYPOINT_CONFIG_INIT_FILE="${ENTRYPOINT_CONFIG_INIT_FILE:-/config/.docker_has_run}" ENTRYPOINT_CONFIG_INIT_FILE="${ENTRYPOINT_CONFIG_INIT_FILE:-/config/.docker_has_run}"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -
# Startup variables # Startup variables
INIT_DATE="${INIT_DATE:-$(date)}" INIT_DATE="${INIT_DATE:-$(date)}"
START_SERVICES="${START_SERVICES:-yes}" START_SERVICES="${START_SERVICES:-yes}"
@@ -128,8 +128,8 @@ ENTRYPOINT_MESSAGE="${ENTRYPOINT_MESSAGE:-yes}"
ENTRYPOINT_FIRST_RUN="${ENTRYPOINT_FIRST_RUN:-yes}" ENTRYPOINT_FIRST_RUN="${ENTRYPOINT_FIRST_RUN:-yes}"
DATA_DIR_INITIALIZED="${DATA_DIR_INITIALIZED:-false}" DATA_DIR_INITIALIZED="${DATA_DIR_INITIALIZED:-false}"
CONFIG_DIR_INITIALIZED="${CONFIG_DIR_INITIALIZED:-false}" CONFIG_DIR_INITIALIZED="${CONFIG_DIR_INITIALIZED:-false}"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -
if [ -f "$ENTRYPOINT_PID_FILE" ] || [ -f "$ENTRYPOINT_INIT_FILE" ]; then if [ -f "$ENTRYPOINT_PID_FILE" ] || [ -f "$ENTRYPOINT_INIT_FILE" ]; then
START_SERVICES="no" ENTRYPOINT_MESSAGE="no" ENTRYPOINT_FIRST_RUN="no" START_SERVICES="no" ENTRYPOINT_MESSAGE="no" ENTRYPOINT_FIRST_RUN="no"
fi fi
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -