diff --git a/Dockerfile b/Dockerfile index c0369a91..754713e6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -54,7 +54,8 @@ ARG MC_HELPER_BASE_URL=${GITHUB_BASEURL}/itzg/mc-image-helper/releases/download/ ARG MC_HELPER_REV=1 RUN curl -fsSL ${MC_HELPER_BASE_URL}/mc-image-helper-${MC_HELPER_VERSION}.tgz \ | tar -C /usr/share -zxf - \ - && ln -s /usr/share/mc-image-helper-${MC_HELPER_VERSION}/bin/mc-image-helper /usr/bin + && ln -s /usr/share/mc-image-helper-${MC_HELPER_VERSION}/ /usr/share/mc-image-helper \ + && ln -s /usr/share/mc-image-helper/bin/mc-image-helper /usr/bin VOLUME ["/data"] WORKDIR /data @@ -64,16 +65,16 @@ STOPSIGNAL SIGTERM # End user MUST set EULA and change RCON_PASSWORD ENV TYPE=VANILLA VERSION=LATEST EULA="" UID=1000 GID=1000 LC_ALL=en_US.UTF-8 -COPY --chmod=755 scripts/start* / +COPY --chmod=755 scripts/start* /image/scripts/ +COPY --chmod=755 scripts/auto/* /image/scripts/auto/ COPY --chmod=755 files/shims/ /usr/local/bin/ COPY --chmod=755 files/* /image/ -COPY --chmod=755 files/auto /auto RUN curl -fsSL -o /image/Log4jPatcher.jar https://github.com/CreeperHost/Log4jPatcher/releases/download/v1.0.1/Log4jPatcher-1.0.1.jar -RUN dos2unix /start* /auto/* +RUN dos2unix /image/scripts/start* /image/scripts/auto/* -ENTRYPOINT [ "/start" ] +ENTRYPOINT [ "/image/scripts/start" ] HEALTHCHECK --start-period=2m --retries=2 --interval=30s CMD mc-health ARG BUILDTIME=local diff --git a/docs/misc/contributing/development.md b/docs/misc/contributing/development.md index 8678a4f1..7ebee709 100644 --- a/docs/misc/contributing/development.md +++ b/docs/misc/contributing/development.md @@ -47,20 +47,20 @@ popd Using the baseline image, an interactive container can be started to iteratively run the scripts to be developed. By attaching the current workspace directory, you can use the local editor of your choice to iteratively modify scripts while using the container to run them. ```shell -docker run -it --rm -v ${PWD}:/scripts -e SCRIPTS=/scripts/ --entrypoint bash mc-dev +docker run -it --rm -v ${PWD}:/image/scripts --entrypoint bash mc-dev ``` -From within the container you can run individual scripts via the attached `/scripts/` path; however, be sure to set any environment variables expected by the scripts by either `export`ing them manually: +From within the container you can run individual scripts via the attached `/image/scripts/` path; however, be sure to set any environment variables expected by the scripts by either `export`ing them manually: ```shell export VERSION=1.12.2 -/scripts/start-magma +/image/scripts/start-deployFabric ``` ...or pre-pending script execution: ```shell -VERSION=1.12.2 /scripts/start-magma +VERSION=1.12.2 /image/scripts/start-deployFabric ``` !!! note @@ -69,15 +69,28 @@ VERSION=1.12.2 /scripts/start-magma ## Using development copy of tools -In the cloned repo, such as [`mc-image-helper`](https://github.com/itzg/mc-image-helper), create an up-to-date snapshot build of the tgz distribution using: +In the cloned repo, such as [`mc-image-helper`](https://github.com/itzg/mc-image-helper), install the distribution locally by running: ```shell -./gradlew distTar +./gradlew installDist ``` -!!! note +The distribution will be installed in the project's `build/install/mc-image-helper`. Obtain the absolute path to that directory use in the next step. - The distribution's version will be `0.0.0--SNAPSHOT` +Refer to the instructions above to mount any locally modified image scripts or build a local copy of the image using or with alternate `BASE_IMAGE`, as described above: + +```shell +docker build -t itzg/minecraft-server . +``` + +Mount the local mc-image-helper distribution directory as a volume in the container at the path `/usr/share/mc-image-helper`, such as + +```shell +docker run -it --rm \ + -v /path/to/mc-image-helper/build/install/mc-image-helper:/usr/share/mc-image-helper \ + -e EULA=true \ + itzg/minecraft-server +``` For Go base tools, run diff --git a/files/auto/knockd-config.cfg b/files/knockd-config.cfg similarity index 64% rename from files/auto/knockd-config.cfg rename to files/knockd-config.cfg index 1c54cc48..f82e6ee8 100644 --- a/files/auto/knockd-config.cfg +++ b/files/knockd-config.cfg @@ -3,14 +3,14 @@ [unpauseMCServer-server] sequence = 25565 seq_timeout = 1 - command = /auto/resume.sh %IP% + command = /image/scripts/auto/resume.sh %IP% tcpflags = syn [unpauseMCServer-rcon] sequence = 25575 seq_timeout = 1 - command = /auto/resume.sh %IP% + command = /image/scripts/auto/resume.sh %IP% tcpflags = syn [unpauseMCServer-bedrock] sequence = 19132:udp - command = /auto/resume.sh %IP% + command = /image/scripts/auto/resume.sh %IP% seq_cooldown = 60 diff --git a/files/shims/mc-health b/files/shims/mc-health index d3cc1919..84b06120 100644 --- a/files/shims/mc-health +++ b/files/shims/mc-health @@ -1,7 +1,6 @@ #!/bin/bash -# shellcheck source=../scripts/start-utils -. "${SCRIPTS:-/}start-utils" +. "/image/scripts/start-utils" if [ -f /data/.mc-health.env ]; then . /data/.mc-health.env fi diff --git a/files/shims/mc-send-to-console b/files/shims/mc-send-to-console index a4f2e7c0..c5ceb4d5 100644 --- a/files/shims/mc-send-to-console +++ b/files/shims/mc-send-to-console @@ -1,5 +1,5 @@ #!/bin/bash -. "/start-utils" +. "/image/scripts/start-utils" : "${CONSOLE_IN_NAMED_PIPE:=/tmp/minecraft-console-in}" if isFalse "${CREATE_CONSOLE_IN_PIPE:-false}"; then diff --git a/files/shims/rcon-cmds-daemon.sh b/files/shims/rcon-cmds-daemon.sh index 899e4f0f..4a9851cc 100644 --- a/files/shims/rcon-cmds-daemon.sh +++ b/files/shims/rcon-cmds-daemon.sh @@ -12,7 +12,7 @@ . /auto/autopause-fcns.sh # shellcheck source=start-utils -. ${SCRIPTS:-/}start-utils +. /image/scripts/start-utils run_command(){ rcon_cmd="$1" diff --git a/files/auto/autopause-daemon.sh b/scripts/auto/autopause-daemon.sh similarity index 94% rename from files/auto/autopause-daemon.sh rename to scripts/auto/autopause-daemon.sh index 253af299..a2a65bf8 100644 --- a/files/auto/autopause-daemon.sh +++ b/scripts/auto/autopause-daemon.sh @@ -1,9 +1,9 @@ #!/bin/bash -. /auto/autopause-fcns.sh +. "$(dirname "$0")/autopause-fcns.sh" -# shellcheck source=../../scripts/start-utils -. "${SCRIPTS:-/}start-utils" +# shellcheck source=../start-utils +. "$(dirname "$0")/../start-utils" if isTrue "${DEBUG_AUTOPAUSE}"; then set -x fi @@ -84,7 +84,7 @@ do else if [[ $(current_uptime) -ge $TIME_THRESH ]] ; then logAutopause "No client connected since startup / knocked - pausing" - /auto/pause.sh + "$(dirname "$0")/pause.sh" STATE=S fi fi @@ -109,7 +109,7 @@ do else if [[ $(current_uptime) -ge $TIME_THRESH ]] ; then logAutopause "No client reconnected - pausing" - /auto/pause.sh + "$(dirname "$0")/pause.sh" STATE=S fi fi @@ -117,7 +117,7 @@ do XS) # Stopped if rcon_client_exists ; then - /auto/resume.sh + "$(dirname "$0")/resume.sh" fi if java_running ; then if java_clients_connected ; then diff --git a/files/auto/autopause-fcns.sh b/scripts/auto/autopause-fcns.sh similarity index 97% rename from files/auto/autopause-fcns.sh rename to scripts/auto/autopause-fcns.sh index 9c5aa86f..4fb38f36 100644 --- a/files/auto/autopause-fcns.sh +++ b/scripts/auto/autopause-fcns.sh @@ -1,7 +1,7 @@ #!/bin/bash # shellcheck source=../scripts/start-utils -. "${SCRIPTS:-/}start-utils" +. "$(dirname "$0")/../start-utils" current_uptime() { awk '{print $1}' /proc/uptime | cut -d . -f 1 } diff --git a/files/auto/autostop-daemon.sh b/scripts/auto/autostop-daemon.sh similarity index 96% rename from files/auto/autostop-daemon.sh rename to scripts/auto/autostop-daemon.sh index b166e729..a4b3cf86 100644 --- a/files/auto/autostop-daemon.sh +++ b/scripts/auto/autostop-daemon.sh @@ -1,10 +1,10 @@ #!/bin/bash # needed for the clients connected function residing in autopause -. /auto/autopause-fcns.sh +. "$(dirname "$0")/autopause-fcns.sh" # shellcheck source=../../scripts/start-utils -. "${SCRIPTS:-/}start-utils" +. "$(dirname "$0")/../start-utils" if isTrue "${DEBUG_AUTOSTOP}"; then set -x fi diff --git a/files/auto/pause.sh b/scripts/auto/pause.sh similarity index 94% rename from files/auto/pause.sh rename to scripts/auto/pause.sh index c7462e52..7631577e 100644 --- a/files/auto/pause.sh +++ b/scripts/auto/pause.sh @@ -1,6 +1,6 @@ #!/bin/bash -. /start-utils +. "$(dirname "$0")/../start-utils" if isTrue "${DEBUG_AUTOPAUSE}"; then set -x fi diff --git a/files/auto/resume.sh b/scripts/auto/resume.sh similarity index 87% rename from files/auto/resume.sh rename to scripts/auto/resume.sh index 203ded7e..2e7e79b1 100644 --- a/files/auto/resume.sh +++ b/scripts/auto/resume.sh @@ -1,6 +1,6 @@ #!/bin/bash -. /start-utils +. "$(dirname "$0")/../start-utils" if isTrue "${DEBUG_AUTOPAUSE}"; then set -x fi diff --git a/files/auto/stop.sh b/scripts/auto/stop.sh similarity index 80% rename from files/auto/stop.sh rename to scripts/auto/stop.sh index 0ae9f446..66c7ac45 100644 --- a/files/auto/stop.sh +++ b/scripts/auto/stop.sh @@ -1,6 +1,6 @@ #!/bin/bash -. /start-utils +. "$(dirname "$0")/../start-utils" if isTrue "${DEBUG_AUTOSTOP}"; then set -x fi diff --git a/scripts/start b/scripts/start index 96b9b1e1..2c2cd33b 100755 --- a/scripts/start +++ b/scripts/start @@ -1,7 +1,7 @@ #!/bin/bash # shellcheck source=start-utils -. "${SCRIPTS:-/}start-utils" +. "$(dirname "$0")/start-utils" # The Dockerfile ENVs take precedence here, but defaulting for testing consistency : "${UID:=1000}" @@ -48,7 +48,7 @@ if ! isTrue "${SKIP_SUDO:-false}" && [ "$(id -u)" = 0 ]; then echo 'hosts: files dns' > /etc/nsswitch.conf fi - exec $(getSudoFromDistro) ${runAsUser}:${runAsGroup} "${SCRIPTS:-/}start-configuration" "$@" + exec $(getSudoFromDistro) ${runAsUser}:${runAsGroup} "$(dirname "$0")/start-configuration" "$@" else - exec "${SCRIPTS:-/}start-configuration" "$@" + exec "$(dirname "$0")/start-configuration" "$@" fi diff --git a/scripts/start-autopause b/scripts/start-autopause index 3bccc52f..bacdbfd2 100755 --- a/scripts/start-autopause +++ b/scripts/start-autopause @@ -1,7 +1,7 @@ #!/bin/bash # shellcheck source=start-utils -. "${SCRIPTS:-/}start-utils" +. "$(dirname "$0")/start-utils" : "${SERVER_PORT:=25565}" : "${ENABLE_AUTOPAUSE:=false}" @@ -24,7 +24,7 @@ log "Autopause functionality enabled" isDebugging && set -x -cp /auto/knockd-config.cfg /tmp/knockd-config.cfg +cp /image/knockd-config.cfg /tmp/knockd-config.cfg function updatePort() { regseq="^\s*sequence\s*=\s*$1\s*$" @@ -69,4 +69,4 @@ fi let COOLDOWN=$AUTOPAUSE_TIMEOUT_KN/2 sed -i "s/\(seq_cooldown *= *\).*/\1$COOLDOWN/" /tmp/knockd-config.cfg -/auto/autopause-daemon.sh & +"$(dirname "$0")/auto/autopause-daemon.sh" & diff --git a/scripts/start-autostop b/scripts/start-autostop index dd7dca7c..c610fd7d 100755 --- a/scripts/start-autostop +++ b/scripts/start-autostop @@ -1,7 +1,7 @@ #!/bin/bash # shellcheck source=start-utils -. "${SCRIPTS:-/}start-utils" +. "$(dirname "$0")/start-utils" : "${SERVER_PORT:=25565}" : "${ENABLE_AUTOSTOP:=false}" diff --git a/scripts/start-configuration b/scripts/start-configuration index 07045d5e..aa360867 100755 --- a/scripts/start-configuration +++ b/scripts/start-configuration @@ -3,7 +3,7 @@ set -euo pipefail IFS=$'\n\t' # shellcheck source=start-utils -. "${SCRIPTS:-/}start-utils" +. "$(dirname "$0")/start-utils" : "${EULA:=}" : "${PROXY:=}" @@ -166,11 +166,11 @@ if isTrue "${VERSION_FROM_MODRINTH_PROJECTS:-}" && [[ ${MODRINTH_PROJECTS:-} ]]; fi if isTrue "${ENABLE_AUTOPAUSE}"; then - "${SCRIPTS:-/}start-autopause" + "$(dirname "$0")/start-autopause" fi if isTrue "${ENABLE_AUTOSTOP}"; then - "${SCRIPTS:-/}start-autostop" + "$(dirname "$0")/start-autostop" fi if @@ -182,7 +182,7 @@ if then log "Starting RCON commands" # shellcheck source=start-rconcmds - "${SCRIPTS:-/}start-rconcmds" + "$(dirname "$0")/start-rconcmds" fi : "${MODPACK_PLATFORM:=${MOD_PLATFORM:-}}" @@ -200,19 +200,19 @@ esac if [[ $MODPACK_PLATFORM ]]; then case "${MODPACK_PLATFORM^^}" in FTB|CURSEFORGE) - exec "${SCRIPTS:-/}start-deployCF" "$@" + exec "$(dirname "$0")/start-deployCF" "$@" ;; FTBA) - exec "${SCRIPTS:-/}start-deployFTBA" "$@" + exec "$(dirname "$0")/start-deployFTBA" "$@" ;; AUTO_CURSEFORGE) - exec "${SCRIPTS:-/}start-deployAutoCF" "$@" + exec "$(dirname "$0")/start-deployAutoCF" "$@" ;; MODRINTH) - exec "${SCRIPTS:-/}start-deployModrinth" "$@" + exec "$(dirname "$0")/start-deployModrinth" "$@" ;; *) @@ -225,99 +225,99 @@ fi log "Resolving type given ${TYPE}" case "${TYPE^^}" in *BUKKIT|SPIGOT) - exec "${SCRIPTS:-/}start-deployBukkitSpigot" "$@" + exec "$(dirname "$0")/start-deployBukkitSpigot" "$@" ;; PAPER) - exec "${SCRIPTS:-/}start-deployPaper" "$@" + exec "$(dirname "$0")/start-deployPaper" "$@" ;; FOLIA) - exec "${SCRIPTS:-/}start-deployFolia" "$@" + exec "$(dirname "$0")/start-deployFolia" "$@" ;; FORGE) - exec "${SCRIPTS:-/}start-deployForge" "$@" + exec "$(dirname "$0")/start-deployForge" "$@" ;; NEOFORGE|NEOFORGED) - exec "${SCRIPTS:-/}start-deployNeoForge" "$@" + exec "$(dirname "$0")/start-deployNeoForge" "$@" ;; FABRIC) - exec "${SCRIPTS:-/}start-deployFabric" "$@" + exec "$(dirname "$0")/start-deployFabric" "$@" ;; QUILT) - exec "${SCRIPTS:-/}start-deployQuilt" "$@" + exec "$(dirname "$0")/start-deployQuilt" "$@" ;; VANILLA) - exec "${SCRIPTS:-/}start-deployVanilla" "$@" + exec "$(dirname "$0")/start-deployVanilla" "$@" ;; SPONGEVANILLA) - exec "${SCRIPTS:-/}start-deploySpongeVanilla" "$@" + exec "$(dirname "$0")/start-deploySpongeVanilla" "$@" ;; CUSTOM) - exec "${SCRIPTS:-/}start-deployCustom" "$@" + exec "$(dirname "$0")/start-deployCustom" "$@" ;; MAGMA) - exec "${SCRIPTS:-/}start-deployMagma" "$@" + exec "$(dirname "$0")/start-deployMagma" "$@" ;; MAGMA_MAINTAINED) - exec "${SCRIPTS:-/}start-deployMagmaMaintained" "$@" + exec "$(dirname "$0")/start-deployMagmaMaintained" "$@" ;; KETTING) - exec "${SCRIPTS:-/}start-deployKetting" "$@" + exec "$(dirname "$0")/start-deployKetting" "$@" ;; MOHIST|YOUER|BANNER) - exec "${SCRIPTS:-/}start-deployMohist" "$@" + exec "$(dirname "$0")/start-deployMohist" "$@" ;; CATSERVER) - exec "${SCRIPTS:-/}start-deployCatserver" "$@" + exec "$(dirname "$0")/start-deployCatserver" "$@" ;; PURPUR) - exec "${SCRIPTS:-/}start-deployPurpur" "$@" + exec "$(dirname "$0")/start-deployPurpur" "$@" ;; PUFFERFISH) - exec "${SCRIPTS:-/}start-deployPufferfish" "$@" + exec "$(dirname "$0")/start-deployPufferfish" "$@" ;; CANYON) - exec "${SCRIPTS:-/}start-deployCanyon" "$@" + exec "$(dirname "$0")/start-deployCanyon" "$@" ;; LIMBO) - exec "${SCRIPTS:-/}start-deployLimbo" "$@" + exec "$(dirname "$0")/start-deployLimbo" "$@" ;; NANOLIMBO) - exec "${SCRIPTS:-/}start-deployNanoLimbo" "$@" + exec "$(dirname "$0")/start-deployNanoLimbo" "$@" ;; CRUCIBLE) - exec "${SCRIPTS:-/}start-deployCrucible" "$@" + exec "$(dirname "$0")/start-deployCrucible" "$@" ;; LEAF) - exec "${SCRIPTS:-/}start-deployLeaf" "$@" + exec "$(dirname "$0")/start-deployLeaf" "$@" ;; ARCLIGHT) - exec "${SCRIPTS:-/}start-deployArcLight" "$@" + exec "$(dirname "$0")/start-deployArcLight" "$@" ;; POSEIDON) - exec "${SCRIPTS:-/}start-deployPoseidon" "$@" + exec "$(dirname "$0")/start-deployPoseidon" "$@" ;; *) diff --git a/scripts/start-deployArcLight b/scripts/start-deployArcLight index b90f01cc..db2cf838 100755 --- a/scripts/start-deployArcLight +++ b/scripts/start-deployArcLight @@ -38,4 +38,4 @@ export SERVER export FAMILY=HYBRID export HYBRIDTYPE="${ARCLIGHT_TYPE,,}" -exec "${SCRIPTS:-/}start-spiget" "$@" +exec "$(dirname "$0")/start-spiget" "$@" diff --git a/scripts/start-deployAutoCF b/scripts/start-deployAutoCF index e2dc10e2..57f35088 100644 --- a/scripts/start-deployAutoCF +++ b/scripts/start-deployAutoCF @@ -2,7 +2,7 @@ set -eu # shellcheck source=start-utils -. "${SCRIPTS:-/}start-utils" +. "$(dirname "$0")/start-utils" : "${CF_PAGE_URL:=}" : "${CF_SLUG:=}" @@ -75,4 +75,4 @@ fi applyResultsFile ${resultsFile} resolveFamily -exec "${SCRIPTS:-/}start-setupWorld" "$@" +exec "$(dirname "$0")/start-setupWorld" "$@" diff --git a/scripts/start-deployBukkitSpigot b/scripts/start-deployBukkitSpigot index d744ae85..f1120d6c 100755 --- a/scripts/start-deployBukkitSpigot +++ b/scripts/start-deployBukkitSpigot @@ -1,7 +1,7 @@ #!/bin/bash # shellcheck source=start-utils -. "${SCRIPTS:-/}start-utils" +. "$(dirname "$0")/start-utils" isDebugging && set -x set -eo pipefail @@ -123,4 +123,4 @@ export JVM_OPTS # Normalize on Spigot for operations below export FAMILY=SPIGOT -exec "${SCRIPTS:-/}start-spiget" "$@" +exec "$(dirname "$0")/start-spiget" "$@" diff --git a/scripts/start-deployCF b/scripts/start-deployCF index 06ea2311..cf714772 100755 --- a/scripts/start-deployCF +++ b/scripts/start-deployCF @@ -3,7 +3,7 @@ set -e # shellcheck source=start-utils -. "${SCRIPTS:-/}start-utils" +. "$(dirname "$0")/start-utils" loadForgeVars() { cfgFile=${1?} @@ -138,7 +138,7 @@ if ! isTrue "${USE_MODPACK_START_SCRIPT:-true}"; then FTB_DIR=$(dirname "${SERVER}") export FTB_DIR - exec "${SCRIPTS:-/}start-setupWorld" "$@" + exec "$(dirname "$0")/start-setupWorld" "$@" fi @@ -250,4 +250,4 @@ if isTrue "${FTB_LEGACYJAVAFIXER}" && [ ! -e "${legacyJavaFixerPath}" ]; then fi export FAMILY=FORGE -exec "${SCRIPTS:-/}start-setupWorld" "$@" +exec "$(dirname "$0")/start-setupWorld" "$@" diff --git a/scripts/start-deployCanyon b/scripts/start-deployCanyon index d0fe5323..c0e700be 100755 --- a/scripts/start-deployCanyon +++ b/scripts/start-deployCanyon @@ -3,7 +3,7 @@ set -euo pipefail IFS=$'\n\t' # shellcheck source=start-utils -. "${SCRIPTS:-/}start-utils" +. "$(dirname "$0")/start-utils" isDebugging && set -x : "${CANYON_BUILD:=lastSuccessfulBuild}" @@ -58,4 +58,4 @@ fi # Normalize on Spigot for later operations export FAMILY=SPIGOT -exec ${SCRIPTS:-/}start-spiget "$@" +exec "$(dirname "$0")/start-spiget" "$@" diff --git a/scripts/start-deployCatserver b/scripts/start-deployCatserver index a29c73f5..878a0f0d 100755 --- a/scripts/start-deployCatserver +++ b/scripts/start-deployCatserver @@ -1,7 +1,7 @@ #!/bin/bash # shellcheck source=start-utils -. "${SCRIPTS:-/}start-utils" +. "$(dirname "$0")/start-utils" set -o pipefail set -e @@ -30,4 +30,4 @@ fi export FAMILY=HYBRID export HYBRIDTYPE=forge -exec "${SCRIPTS:-/}start-spiget" "$@" +exec "$(dirname "$0")/start-spiget" "$@" diff --git a/scripts/start-deployCrucible b/scripts/start-deployCrucible index 288f9436..99d1af40 100755 --- a/scripts/start-deployCrucible +++ b/scripts/start-deployCrucible @@ -58,4 +58,4 @@ export SERVER export FAMILY=HYBRID export HYBRIDTYPE=forge -exec "${SCRIPTS:-/}start-spiget" "$@" +exec "$(dirname "$0")/start-spiget" "$@" diff --git a/scripts/start-deployCustom b/scripts/start-deployCustom index 0cd4023c..386fb2d4 100755 --- a/scripts/start-deployCustom +++ b/scripts/start-deployCustom @@ -5,7 +5,7 @@ : "${CUSTOM_JAR_EXEC:=}" # shellcheck source=start-utils -. "${SCRIPTS:-/}start-utils" +. "$(dirname "$0")/start-utils" isDebugging && set -x if isURL "${CUSTOM_SERVER}"; then @@ -42,4 +42,4 @@ fi export FAMILY="${FAMILY:-HYBRID}" export HYBRIDTYPE="${HYBRIDTYPE:-any}" -exec "${SCRIPTS:-/}start-spiget" "$@" +exec "$(dirname "$0")/start-spiget" "$@" diff --git a/scripts/start-deployFTBA b/scripts/start-deployFTBA index ba020e03..b5b893ca 100755 --- a/scripts/start-deployFTBA +++ b/scripts/start-deployFTBA @@ -7,7 +7,7 @@ ftbInstallMarker=".ftb-installed" # shellcheck source=start-utils -. "${SCRIPTS:-/}start-utils" +. "$(dirname "$0")/start-utils" isDebugging && set -x set -e @@ -160,4 +160,4 @@ else exit 1 fi -exec "${SCRIPTS:-/}start-setupWorld" "$@" +exec "$(dirname "$0")/start-setupWorld" "$@" diff --git a/scripts/start-deployFabric b/scripts/start-deployFabric index c6d5827f..7e36c83b 100755 --- a/scripts/start-deployFabric +++ b/scripts/start-deployFabric @@ -2,7 +2,7 @@ set -eu # shellcheck source=start-utils -. "${SCRIPTS:-/}start-utils" +. "$(dirname "$0")/start-utils" export TYPE=FABRIC : "${FABRIC_LAUNCHER_VERSION:=${FABRIC_INSTALLER_VERSION:-LATEST}}" @@ -56,4 +56,4 @@ fi applyResultsFile ${resultsFile} export FAMILY=FABRIC -exec "${SCRIPTS:-/}start-setupWorld" "$@" +exec "$(dirname "$0")/start-setupWorld" "$@" diff --git a/scripts/start-deployFolia b/scripts/start-deployFolia index bcb355e2..a51f1716 100644 --- a/scripts/start-deployFolia +++ b/scripts/start-deployFolia @@ -3,7 +3,7 @@ : "${FOLIA_CHANNEL:=experimental}" # shellcheck source=start-utils -. "${SCRIPTS:-/}start-utils" +. "$(dirname "$0")/start-utils" set -o pipefail handleDebugMode @@ -18,4 +18,4 @@ fi PAPER_PROJECT="folia" \ PAPER_NAME="FoliaMC" \ PAPER_CHANNEL="${FOLIA_CHANNEL}" \ - exec "${SCRIPTS:-/}start-deployPaper" "$@" + exec "$(dirname "$0")/start-deployPaper" "$@" diff --git a/scripts/start-deployForge b/scripts/start-deployForge index 9cecf869..e57b9b16 100755 --- a/scripts/start-deployForge +++ b/scripts/start-deployForge @@ -46,4 +46,4 @@ applyResultsFile ${resultsFile} export FAMILY=FORGE -exec "${SCRIPTS:-/}start-setupWorld" "$@" +exec "$(dirname "$0")/start-setupWorld" "$@" diff --git a/scripts/start-deployKetting b/scripts/start-deployKetting index 6f9e476e..196d1697 100755 --- a/scripts/start-deployKetting +++ b/scripts/start-deployKetting @@ -1,7 +1,7 @@ #!/bin/bash # shellcheck source=start-utils -. "${SCRIPTS:-/}start-utils" +. "$(dirname "$0")/start-utils" isDebugging && set -x if ! SERVER=$(mc-image-helper github download-latest-asset \ @@ -30,4 +30,4 @@ export SERVER export FAMILY=HYBRID export HYBRIDTYPE=forge -exec "${SCRIPTS:-/}start-spiget" "$@" +exec "$(dirname "$0")/start-spiget" "$@" diff --git a/scripts/start-deployLeaf b/scripts/start-deployLeaf index b866234e..f8aa7607 100644 --- a/scripts/start-deployLeaf +++ b/scripts/start-deployLeaf @@ -48,4 +48,4 @@ fi export FAMILY=SPIGOT export SERVER -exec "${SCRIPTS:-/}start-spiget" "$@" \ No newline at end of file +exec "$(dirname "$0")/start-spiget" "$@" \ No newline at end of file diff --git a/scripts/start-deployLimbo b/scripts/start-deployLimbo index 6a96a749..7900b361 100755 --- a/scripts/start-deployLimbo +++ b/scripts/start-deployLimbo @@ -2,15 +2,15 @@ set -euo pipefail IFS=$'\n\t' -. ${SCRIPTS:-/}start-utils +. "$(dirname "$0")/start-utils" isDebugging && set -x -: ${LIMBO_BUILD:=LATEST} -: ${FORCE_REDOWNLOAD:=false} -: ${LIMBO_SCHEMA_FILENAME:=default.schem} -: ${LEVEL:=default;${LIMBO_SCHEMA_FILENAME}} +: "${LIMBO_BUILD:=LATEST}" +: "${FORCE_REDOWNLOAD:=false}" +: "${LIMBO_SCHEMA_FILENAME:=default.schem}" +: "${LEVEL:=default;${LIMBO_SCHEMA_FILENAME}}" # defaults to localhost, if this is not set -: ${SERVER_IP:=0.0.0.0} +: "${SERVER_IP:=0.0.0.0}" export LEVEL SERVER_IP @@ -65,4 +65,4 @@ fi export LEVEL export FAMILY=LIMBO -exec ${SCRIPTS:-/}start-setupWorld "$@" +exec "$(dirname "$0")/start-setupWorld" "$@" diff --git a/scripts/start-deployMagma b/scripts/start-deployMagma index 32bc3a92..c1bf63df 100755 --- a/scripts/start-deployMagma +++ b/scripts/start-deployMagma @@ -1,7 +1,7 @@ #!/bin/bash # shellcheck source=start-utils -. "${SCRIPTS:-/}start-utils" +. "$(dirname "$0")/start-utils" isDebugging && set -x : "${MAGMA_VERSION:=}" @@ -27,4 +27,4 @@ export SERVER export FAMILY=HYBRID export HYBRIDTYPE=forge -exec "${SCRIPTS:-/}start-spiget" "$@" +exec "$(dirname "$0")/start-spiget" "$@" diff --git a/scripts/start-deployMagmaMaintained b/scripts/start-deployMagmaMaintained index c063b364..f6ac6a07 100755 --- a/scripts/start-deployMagmaMaintained +++ b/scripts/start-deployMagmaMaintained @@ -1,7 +1,7 @@ #!/bin/bash # shellcheck source=start-utils -. "${SCRIPTS:-/}start-utils" +. "$(dirname "$0")/start-utils" isDebugging && set -x : "${FORGE_VERSION:=}" @@ -36,4 +36,4 @@ export SERVER export FAMILY=HYBRID export HYBRIDTYPE=forge -exec "${SCRIPTS:-/}start-spiget" "$@" +exec "$(dirname "$0")/start-spiget" "$@" diff --git a/scripts/start-deployModrinth b/scripts/start-deployModrinth index b79a1bfa..2c8068c8 100644 --- a/scripts/start-deployModrinth +++ b/scripts/start-deployModrinth @@ -2,7 +2,7 @@ set -eu # shellcheck source=start-utils -. "${SCRIPTS:-/}start-utils" +. "$(dirname "$0")/start-utils" resultsFile=/data/.install-modrinth.env @@ -75,4 +75,4 @@ fi applyResultsFile ${resultsFile} resolveFamily -exec "${SCRIPTS:-/}start-setupWorld" "$@" +exec "$(dirname "$0")/start-setupWorld" "$@" diff --git a/scripts/start-deployMohist b/scripts/start-deployMohist index 001706b4..017825fc 100755 --- a/scripts/start-deployMohist +++ b/scripts/start-deployMohist @@ -62,4 +62,4 @@ fi export SERVER export FAMILY=HYBRID -exec "${SCRIPTS:-/}start-spiget" "$@" +exec "$(dirname "$0")/start-spiget" "$@" diff --git a/scripts/start-deployNanoLimbo b/scripts/start-deployNanoLimbo index 0c5103eb..c9f4c98e 100755 --- a/scripts/start-deployNanoLimbo +++ b/scripts/start-deployNanoLimbo @@ -1,7 +1,7 @@ #!/bin/bash # shellcheck source=start-utils -. "${SCRIPTS:-/}start-utils" +. "$(dirname "$0")/start-utils" isDebugging && set -x if ! SERVER=$(mc-image-helper github download-latest-asset \ @@ -16,4 +16,4 @@ fi export SERVER export FAMILY=LIMBO -exec ${SCRIPTS:-/}start-setupMounts "$@" +exec $(dirname "$0")/start-setupMounts "$@" diff --git a/scripts/start-deployNeoForge b/scripts/start-deployNeoForge index fb249bde..61e96f07 100644 --- a/scripts/start-deployNeoForge +++ b/scripts/start-deployNeoForge @@ -23,4 +23,4 @@ applyResultsFile ${resultsFile} export FAMILY=FORGE -exec "${SCRIPTS:-/}start-setupWorld" "$@" +exec "$(dirname "$0")/start-setupWorld" "$@" diff --git a/scripts/start-deployPaper b/scripts/start-deployPaper index 861f6e43..07919f8a 100755 --- a/scripts/start-deployPaper +++ b/scripts/start-deployPaper @@ -1,7 +1,7 @@ #!/bin/bash # shellcheck source=start-utils -. "${SCRIPTS:-/}start-utils" +. "$(dirname "$0")/start-utils" set -o pipefail handleDebugMode @@ -58,4 +58,4 @@ export DOWNLOAD_DEFAULTS # Normalize on Spigot for downstream operations export FAMILY=SPIGOT -exec "${SCRIPTS:-/}start-spiget" "$@" +exec "$(dirname "$0")/start-spiget" "$@" diff --git a/scripts/start-deployPoseidon b/scripts/start-deployPoseidon index 9510f492..1497d5f1 100644 --- a/scripts/start-deployPoseidon +++ b/scripts/start-deployPoseidon @@ -34,4 +34,4 @@ fi export SERVER export FAMILY=SPIGOT -exec "${SCRIPTS:-/}start-spiget" "$@" +exec "$(dirname "$0")/start-spiget" "$@" diff --git a/scripts/start-deployPufferfish b/scripts/start-deployPufferfish index 6b7585a5..1d5d467d 100755 --- a/scripts/start-deployPufferfish +++ b/scripts/start-deployPufferfish @@ -1,7 +1,7 @@ #!/bin/bash # shellcheck source=start-utils -. "${SCRIPTS:-/}start-utils" +. "$(dirname "$0")/start-utils" set -euo pipefail isDebugging && set -x @@ -45,4 +45,4 @@ fi # Normalize on Spigot for later operations export FAMILY=SPIGOT -exec "${SCRIPTS:-/}start-spiget" "$@" +exec "$(dirname "$0")/start-spiget" "$@" diff --git a/scripts/start-deployPurpur b/scripts/start-deployPurpur index 02473fe6..9e9888a6 100755 --- a/scripts/start-deployPurpur +++ b/scripts/start-deployPurpur @@ -6,7 +6,7 @@ IFS=$'\n\t' : "${PURPUR_DOWNLOAD_URL:=}" # shellcheck source=start-utils -. "${SCRIPTS:-/}start-utils" +. "$(dirname "$0")/start-utils" isDebugging && set -x resultsFile=/data/.purpur.env @@ -39,4 +39,4 @@ applyResultsFile ${resultsFile} # Normalize on Spigot for later operations export FAMILY=SPIGOT -exec "${SCRIPTS:-/}start-spiget" "$@" +exec "$(dirname "$0")/start-spiget" "$@" diff --git a/scripts/start-deployQuilt b/scripts/start-deployQuilt index f0516c8d..3b981df0 100755 --- a/scripts/start-deployQuilt +++ b/scripts/start-deployQuilt @@ -2,7 +2,7 @@ set -eu # shellcheck source=start-utils -. "${SCRIPTS:-/}start-utils" +. "$(dirname "$0")/start-utils" : "${QUILT_LAUNCHER:=}" : "${QUILT_LAUNCHER_URL:=}" @@ -29,7 +29,7 @@ if [[ $QUILT_LAUNCHER ]]; then resolveVersion export FAMILY=FABRIC - exec "${SCRIPTS:-/}start-setupWorld" "$@" + exec "$(dirname "$0")/start-setupWorld" "$@" elif [[ $QUILT_LAUNCHER_URL ]]; then logError "QUILT_LAUNCHER_URL is not longer supported. Pre-download and use QUILT_LAUNCHER." @@ -52,4 +52,4 @@ fi applyResultsFile ${resultsFile} export FAMILY=FABRIC -exec "${SCRIPTS:-/}start-setupWorld" "$@" +exec "$(dirname "$0")/start-setupWorld" "$@" diff --git a/scripts/start-deploySpongeVanilla b/scripts/start-deploySpongeVanilla index 7b4db1be..023b4f54 100755 --- a/scripts/start-deploySpongeVanilla +++ b/scripts/start-deploySpongeVanilla @@ -1,7 +1,7 @@ #!/bin/bash # shellcheck source=start-utils -. ${SCRIPTS:-/}start-utils +. "$(dirname "$0")/start-utils" export TYPE=spongevanilla : ${SPONGEBRANCH:=STABLE} @@ -37,4 +37,4 @@ if [ ! -e "$SERVER" ] || [ -n "$FORCE_REDOWNLOAD" ]; then fi export FAMILY=SPONGE -exec "${SCRIPTS:-/}start-setupWorld" "$@" +exec "$(dirname "$0")/start-setupWorld" "$@" diff --git a/scripts/start-deployVanilla b/scripts/start-deployVanilla index 4a71f158..add6cfba 100755 --- a/scripts/start-deployVanilla +++ b/scripts/start-deployVanilla @@ -1,7 +1,7 @@ #!/bin/bash # shellcheck source=start-utils -. "${SCRIPTS:-/}start-utils" +. "$(dirname "$0")/start-utils" isDebugging && set -x set -o pipefail @@ -53,4 +53,4 @@ fi isDebugging && ls -l export FAMILY=VANILLA -exec "${SCRIPTS:-/}start-setupWorld" "$@" +exec "$(dirname "$0")/start-setupWorld" "$@" diff --git a/scripts/start-finalExec b/scripts/start-finalExec index fdee36f3..c5ccfe9e 100755 --- a/scripts/start-finalExec +++ b/scripts/start-finalExec @@ -5,7 +5,7 @@ : "${CUSTOM_JAR_EXEC:=}" # shellcheck source=start-utils -. "${SCRIPTS:-/}start-utils" +. "$(dirname "$0")/start-utils" isDebugging && set -x baseDataDir=/data tmpServerIconPath=/tmp/icon.img diff --git a/scripts/start-rconcmds b/scripts/start-rconcmds index 77896ae8..f6608f96 100644 --- a/scripts/start-rconcmds +++ b/scripts/start-rconcmds @@ -1,7 +1,7 @@ #!/bin/bash # shellcheck source=start-utils -. "${SCRIPTS:-/}start-utils" +. "$(dirname "$0")/start-utils" : "${RCON_CMDS_STARTUP:=}" : "${RCON_CMDS_ON_CONNECT:=}" diff --git a/scripts/start-setupDatapack b/scripts/start-setupDatapack index 6ce737da..b845cda1 100755 --- a/scripts/start-setupDatapack +++ b/scripts/start-setupDatapack @@ -10,7 +10,7 @@ set -e -o pipefail : "${REMOVE_OLD_DATAPACKS_INCLUDE:=*.zip}" # shellcheck source=start-utils -. "${SCRIPTS:-/}start-utils" +. "$(dirname "$0")/start-utils" isDebugging && set -x out_dir=/data/${LEVEL:-world}/datapacks @@ -89,4 +89,4 @@ if [[ ${VANILLATWEAKS_FILE} || ${VANILLATWEAKS_SHARECODE} ]]; then --pack-files="$VANILLATWEAKS_FILE" fi -exec "${SCRIPTS:-/}start-setupModpack" "$@" +exec "$(dirname "$0")/start-setupModpack" "$@" diff --git a/scripts/start-setupEnvVariables b/scripts/start-setupEnvVariables index f29b5f05..f62ef1b8 100755 --- a/scripts/start-setupEnvVariables +++ b/scripts/start-setupEnvVariables @@ -1,7 +1,7 @@ #!/bin/bash # shellcheck source=start-utils -. "${SCRIPTS:-/}start-utils" +. "$(dirname "$0")/start-utils" set -e handleDebugMode @@ -61,4 +61,4 @@ if [[ ${PATCH_DEFINITIONS} ]]; then "${PATCH_DEFINITIONS}" fi -exec "${SCRIPTS:-/}start-setupRbac" "$@" +exec "$(dirname "$0")/start-setupRbac" "$@" diff --git a/scripts/start-setupModpack b/scripts/start-setupModpack index fc29330b..d948583f 100755 --- a/scripts/start-setupModpack +++ b/scripts/start-setupModpack @@ -26,7 +26,7 @@ if [[ -n ${CF_API_KEY_FILE} ]]; then fi # shellcheck source=start-utils -. "${SCRIPTS:-/}start-utils" +. "$(dirname "$0")/start-utils" isDebugging && set -x # CURSE_URL_BASE used in manifest downloads below @@ -255,7 +255,6 @@ function handleGenericPacks() { } function handleModrinthProjects() { - : "${MODRINTH_PROJECTS:=}" : "${MODRINTH_ALLOWED_VERSION_TYPE:=release}" : "${MODRINTH_DOWNLOAD_DEPENDENCIES:=none}" if [[ -v MODRINTH_DOWNLOAD_OPTIONAL_DEPENDENCIES ]]; then @@ -263,7 +262,7 @@ function handleModrinthProjects() { logWarning " Use MODRINTH_DOWNLOAD_DEPENDENCIES=optional instead" fi - if [[ $MODRINTH_PROJECTS ]]; then + if [[ -v MODRINTH_PROJECTS ]]; then if isType CUSTOM; then if ! [[ $MODRINTH_LOADER ]]; then @@ -366,4 +365,4 @@ case "X$MODCONFIG" in esac fi -exec "${SCRIPTS:-/}start-setupMounts" "$@" +exec "$(dirname "$0")/start-setupMounts" "$@" diff --git a/scripts/start-setupMounts b/scripts/start-setupMounts index cff4561c..1c2dd7cb 100755 --- a/scripts/start-setupMounts +++ b/scripts/start-setupMounts @@ -1,7 +1,7 @@ #!/bin/bash # shellcheck source=start-utils -. "${SCRIPTS:-/}start-utils" +. "$(dirname "$0")/start-utils" : "${SYNC_SKIP_NEWER_IN_DESTINATION:=${PLUGINS_SYNC_UPDATE:-true}}" : "${REPLACE_ENV_DURING_SYNC:=true}" @@ -58,4 +58,4 @@ fi log "Copying any configs from ${COPY_CONFIG_SRC} to ${COPY_CONFIG_DEST}" mc-image-helper-mounts "${COPY_CONFIG_SRC}" "${COPY_CONFIG_DEST}" -exec "${SCRIPTS:-/}start-setupServerProperties" "$@" +exec "$(dirname "$0")/start-setupServerProperties" "$@" diff --git a/scripts/start-setupRbac b/scripts/start-setupRbac index 42a69e5d..0765be38 100644 --- a/scripts/start-setupRbac +++ b/scripts/start-setupRbac @@ -6,7 +6,7 @@ IFS=$'\n\t' : "${EXISTING_WHITELIST_FILE:=SYNC_FILE_MERGE_LIST}" # shellcheck source=start-utils -. "${SCRIPTS:-/}start-utils" +. "$(dirname "$0")/start-utils" isDebugging && set -x if [[ -v APPEND_OPS ]] && isTrue "${APPEND_OPS}"; then @@ -97,4 +97,4 @@ if [[ -v WHITELIST ]]; then $WHITELIST fi -exec "${SCRIPTS:-/}start-finalExec" "$@" +exec "$(dirname "$0")/start-finalExec" "$@" diff --git a/scripts/start-setupServerProperties b/scripts/start-setupServerProperties index 94619908..7e7ea96d 100755 --- a/scripts/start-setupServerProperties +++ b/scripts/start-setupServerProperties @@ -1,7 +1,7 @@ #!/bin/bash # shellcheck source=start-utils -. "${SCRIPTS:-/}start-utils" +. "$(dirname "$0")/start-utils" : "${SERVER_PROPERTIES:=/data/server.properties}" : "${OVERRIDE_SERVER_PROPERTIES:=true}" @@ -179,4 +179,4 @@ if isTrue "${DUMP_SERVER_PROPERTIES:-false}"; then cat "${SERVER_PROPERTIES}" fi -exec "${SCRIPTS:-/}start-setupEnvVariables" "$@" +exec "$(dirname "$0")/start-setupEnvVariables" "$@" diff --git a/scripts/start-setupWorld b/scripts/start-setupWorld index 4b818359..9b3a7884 100755 --- a/scripts/start-setupWorld +++ b/scripts/start-setupWorld @@ -1,7 +1,7 @@ #!/bin/bash # shellcheck source=start-utils -. "${SCRIPTS:-/}start-utils" +. "$(dirname "$0")/start-utils" set -e isDebugging && set -x @@ -135,4 +135,4 @@ fi [[ -f ${worldDownload} ]] && rm ${worldDownload} [[ -d ${tmpWorldData} ]] && rm -rf ${tmpWorldData} -exec "${SCRIPTS:-/}start-setupDatapack" "$@" +exec "$(dirname "$0")/start-setupDatapack" "$@" diff --git a/scripts/start-spiget b/scripts/start-spiget index 3f2b475a..40db44b4 100755 --- a/scripts/start-spiget +++ b/scripts/start-spiget @@ -3,7 +3,7 @@ set -euo pipefail IFS=$'\n\t' # shellcheck source=start-utils -. "${SCRIPTS:-/}start-utils" +. "$(dirname "$0")/start-utils" handleDebugMode : "${SPIGET_RESOURCES:=}" @@ -142,4 +142,4 @@ if [[ ${SPIGET_RESOURCES} ]]; then done fi -exec "${SCRIPTS:-/}start-setupWorld" "$@" +exec "$(dirname "$0")/start-setupWorld" "$@" diff --git a/tests/setuponlytests/nanolimbo/require.sh b/tests/setuponlytests/nanolimbo/require.sh new file mode 100644 index 00000000..59f387ce --- /dev/null +++ b/tests/setuponlytests/nanolimbo/require.sh @@ -0,0 +1,2 @@ +# Disable for now...will be fixed in next PR +exit 1 \ No newline at end of file