diff --git a/rootfs/usr/local/etc/docker/functions/entrypoint.sh b/rootfs/usr/local/etc/docker/functions/entrypoint.sh index 8629b44..b13fbf6 100644 --- a/rootfs/usr/local/etc/docker/functions/entrypoint.sh +++ b/rootfs/usr/local/etc/docker/functions/entrypoint.sh @@ -21,6 +21,7 @@ # shellcheck disable=SC2016 # shellcheck disable=SC2031 # shellcheck disable=SC2120 +# shellcheck disable=SC2153 # shellcheck disable=SC2155 # shellcheck disable=SC2199 # shellcheck disable=SC2317 @@ -191,7 +192,7 @@ __certbot() { } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - __init_config_etc() { - if __is_dir_empty "$CONF_DIR" || [ ! -d "$CONF_DIR" ]; then + if __is_dir_empty "${CONF_DIR}" || [ ! -d "$CONF_DIR" ]; then if [ -d "$ETC_DIR" ]; then mkdir -p "$CONF_DIR" __copy_templates "$ETC_DIR/." "$CONF_DIR/" diff --git a/rootfs/usr/local/etc/docker/init.d/05-dockerd.sh b/rootfs/usr/local/etc/docker/init.d/05-dockerd.sh index 36aafd8..c0035b1 100755 --- a/rootfs/usr/local/etc/docker/init.d/05-dockerd.sh +++ b/rootfs/usr/local/etc/docker/init.d/05-dockerd.sh @@ -174,6 +174,8 @@ __execute_prerun() { # Setup /config directories __init_config_etc + # Define other actions/commands + } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Run any pre-execution checks @@ -569,6 +571,9 @@ root_user_pass="$(eval echo "${ENV_ROOT_USER_PASS:-$root_user_pass}")" [ -d "$LOG_DIR" ] || mkdir -p "$LOG_DIR" [ -d "$RUN_DIR" ] || mkdir -p "$RUN_DIR" # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# pre-run function +__execute_prerun +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # create user if needed __create_service_user "$SERVICE_USER" "$SERVICE_GROUP" "${WORK_DIR:-/home/$SERVICE_USER}" "${SERVICE_UID:-}" "${SERVICE_GID:-}" # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -578,8 +583,6 @@ __set_user_group_id $SERVICE_USER ${SERVICE_UID:-} ${SERVICE_GID:-} # Create base directories __setup_directories # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__execute_prerun -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # set switch user command __switch_to_user # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/rootfs/usr/local/etc/docker/init.d/08-gitea.sh b/rootfs/usr/local/etc/docker/init.d/08-gitea.sh index b908dde..68c9574 100755 --- a/rootfs/usr/local/etc/docker/init.d/08-gitea.sh +++ b/rootfs/usr/local/etc/docker/init.d/08-gitea.sh @@ -194,6 +194,8 @@ __execute_prerun() { # Setup /config directories __init_config_etc + # Define other actions/commands + } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Run any pre-execution checks @@ -259,17 +261,22 @@ __update_conf_files() { # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # define actions + [ -d " /config/ssh" ] || mkdir -p " /config/ssh" + [ -d "$DATA_DIR/ssh" ] || mkdir -p "$DATA_DIR/ssh" if [ ! -f /config/ssh/ssh_host_ed25519_key ]; then echo "Generating /config/ssh/ssh_host_ed25519_key..." - ssh-keygen -t ed25519 -f /config/ssh/ssh_host_ed25519_key -N "" >/dev/null + ssh-keygen -t ed25519 -f /config/ssh/ssh_host_ed25519_key -N "" >/dev/null && + __symlink "/config/ssh/ssh_host_ed25519_key" "$DATA_DIR/ssh" fi if [ ! -f /config/ssh/ssh_host_rsa_key ]; then echo "Generating /config/ssh/ssh_host_rsa_key..." - ssh-keygen -t rsa -b 3072 -f /config/ssh/ssh_host_rsa_key -N "" >/dev/null + ssh-keygen -t rsa -b 3072 -f /config/ssh/ssh_host_rsa_key -N "" >/dev/null && + __symlink "/config/ssh/ssh_host_rsa_key" "$DATA_DIR/ssh" fi if [ ! -f /config/ssh/ssh_host_ecdsa_key ]; then echo "Generating /config/ssh/ssh_host_ecdsa_key..." - ssh-keygen -t ecdsa -b 256 -f /config/ssh/ssh_host_ecdsa_key -N "" >/dev/null + ssh-keygen -t ecdsa -b 256 -f /config/ssh/ssh_host_ecdsa_key -N "" >/dev/null && + __symlink "/config/ssh/ssh_host_ecdsa_key" "$DATA_DIR/ssh" fi chmod 0700 "$DATA_DIR/ssh" /config/ssh chmod 0600 "$DATA_DIR/ssh"/* /config/ssh/* @@ -562,6 +569,9 @@ root_user_pass="$(eval echo "${ENV_ROOT_USER_PASS:-$root_user_pass}")" [ -d "$LOG_DIR" ] || mkdir -p "$LOG_DIR" [ -d "$RUN_DIR" ] || mkdir -p "$RUN_DIR" # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# pre-run function +__execute_prerun +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # create user if needed __create_service_user "$SERVICE_USER" "$SERVICE_GROUP" "${WORK_DIR:-/home/$SERVICE_USER}" "${SERVICE_UID:-}" "${SERVICE_GID:-}" # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -571,8 +581,6 @@ __set_user_group_id $SERVICE_USER ${SERVICE_UID:-} ${SERVICE_GID:-} # Create base directories __setup_directories # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__execute_prerun -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # set switch user command __switch_to_user # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/rootfs/usr/local/etc/docker/init.d/09-nginx.sh b/rootfs/usr/local/etc/docker/init.d/09-nginx.sh index 50a6f83..18daeef 100755 --- a/rootfs/usr/local/etc/docker/init.d/09-nginx.sh +++ b/rootfs/usr/local/etc/docker/init.d/09-nginx.sh @@ -172,6 +172,8 @@ __execute_prerun() { # Setup /config directories __init_config_etc + # Define other actions/commands + } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Run any pre-execution checks @@ -508,6 +510,9 @@ root_user_pass="$(eval echo "${ENV_ROOT_USER_PASS:-$root_user_pass}")" [ -d "$LOG_DIR" ] || mkdir -p "$LOG_DIR" [ -d "$RUN_DIR" ] || mkdir -p "$RUN_DIR" # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# pre-run function +__execute_prerun +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # create user if needed __create_service_user "$SERVICE_USER" "$SERVICE_GROUP" "${WORK_DIR:-/home/$SERVICE_USER}" "${SERVICE_UID:-}" "${SERVICE_GID:-}" # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -517,8 +522,6 @@ __set_user_group_id $SERVICE_USER ${SERVICE_UID:-} ${SERVICE_GID:-} # Create base directories __setup_directories # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__execute_prerun -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # set switch user command __switch_to_user # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh b/rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh index d9b8f4c..ba3fe17 100755 --- a/rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh +++ b/rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh @@ -190,6 +190,8 @@ __execute_prerun() { # Setup /config directories __init_config_etc + # Define other actions/commands + } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Run any pre-execution checks @@ -639,6 +641,9 @@ root_user_pass="$(eval echo "${ENV_ROOT_USER_PASS:-$root_user_pass}")" [ -d "$LOG_DIR" ] || mkdir -p "$LOG_DIR" [ -d "$RUN_DIR" ] || mkdir -p "$RUN_DIR" # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# pre-run function +__execute_prerun +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # create user if needed __create_service_user "$SERVICE_USER" "$SERVICE_GROUP" "${WORK_DIR:-/home/$SERVICE_USER}" "${SERVICE_UID:-}" "${SERVICE_GID:-}" # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -648,8 +653,6 @@ __set_user_group_id $SERVICE_USER ${SERVICE_UID:-} ${SERVICE_GID:-} # Create base directories __setup_directories # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__execute_prerun -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # set switch user command __switch_to_user # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -