Constrain GENERIC_PACK base detection depth (#1528)

This commit is contained in:
Geoff Bourne 2022-05-22 11:35:52 -05:00 committed by GitHub
parent f67d3948d2
commit 3e3abda71e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 22 additions and 20 deletions

View File

@ -1,27 +1,27 @@
version: '3.8'
services:
rlcraft:
mc:
image: itzg/minecraft-server:java8
container_name: rlcraft
volumes:
- rlcraft-modpack:/modpacks:ro
- rlcraft-data:/data
- data:/data
- ./modpacks:/modpacks:ro
environment:
EULA: "true"
TYPE: "FORGE"
VERSION: "1.12.2"
FORGEVERSION: "14.23.5.2855"
FORGEVERSION: "14.23.5.2860"
OVERRIDE_SERVER_PROPERTIES: "true"
DIFFICULTY: "hard"
MAX_TICK_TIME: "-1"
VIEW_DISTANCE: "6"
ALLOW_FLIGHT: "true"
ENABLE_COMMAND_BLOCK: "true"
VIEW_DISTANCE: "10"
MEMORY: "4G"
GENERIC_PACK: "/modpacks/RLCraft_Server_Pack_1.12.2_Beta_v2.8.2.zip"
# Download from https://www.curseforge.com/minecraft/modpacks/rlcraft and place in modpacks subdir
GENERIC_PACK: "/modpacks/RLCraft+Server+Pack+1.12.2+-+Release+v2.9.1c.zip"
ports:
- 25565:25565
restart: unless-stopped
volumes:
rlcraft-data:
rlcraft-modpack:
data:

View File

@ -8,7 +8,7 @@ isDebugging && set -x
get_installer() {
if [[ -z $FORGE_INSTALLER_URL ]]; then
log "Downloading $normForgeVersion"
log "Downloading Forge Installer $normForgeVersion"
forgeFileNames="
$shortForgeVersion/forge-$shortForgeVersion-installer.jar
@ -25,7 +25,7 @@ get_installer() {
log "Unable to locate usable URL for $normForgeVersion"
exit 2
else
log "Downloading $FORGE_INSTALLER_URL ..."
log "Downloading Forge Installer from $FORGE_INSTALLER_URL ..."
if ! get -o "$FORGE_INSTALLER" "$FORGE_INSTALLER_URL"; then
log "Failed to download from given location $FORGE_INSTALLER_URL"
exit 2

View File

@ -122,8 +122,8 @@ if [ -n "$JVM_DD_OPTS" ]; then
done
fi
if isTrue ${ENABLE_JMX}; then
: ${JMX_PORT:=7091}
if isTrue "${ENABLE_JMX}"; then
: "${JMX_PORT:=7091}"
JVM_OPTS="${JVM_OPTS}
-Dcom.sun.management.jmxremote.local.only=false
-Dcom.sun.management.jmxremote.port=${JMX_PORT}

View File

@ -216,18 +216,20 @@ if [[ "${GENERIC_PACKS}" ]]; then
elif isTrue "${FORCE_GENERIC_PACK_UPDATE}" || ! checkSum "${sum_file}"; then
log "Generic pack(s) are out of date. Re-applying..."
base_dir=/tmp/generic_pack_base
mkdir -p ${base_dir}
original_base_dir=/data/.tmp/generic_pack_base
base_dir=$original_base_dir
rm -rf "${base_dir}"
mkdir -p "${base_dir}"
for pack in "${packFiles[@]}"; do
isDebugging && ls -l "${pack}"
extract "${pack}" "${base_dir}"
done
# recalculate the actual base directory of content
base_dir=$(find "$base_dir" -type d \( -name mods -o -name plugins -o -name config \) -printf '%h' -quit)
base_dir=$(find "$base_dir" -maxdepth 3 -type d \( -name mods -o -name plugins -o -name config \) -printf '%h' -quit)
if [[ ! $base_dir ]]; then
log "ERROR: Unable to find content base of generic packs ${GENERIC_PACKS}. Directories:"
find /tmp/generic_pack_base -type d -printf ' - %P\n'
find $original_base_dir -maxdepth 3 -type d -printf ' - %P\n'
exit 1
fi
@ -246,7 +248,7 @@ if [[ "${GENERIC_PACKS}" ]]; then
log "Applying generic pack ..."
cp -R -f "${base_dir}"/* /data
rm -rf /tmp/generic_pack_base
rm -rf $original_base_dir
log "Saving generic pack(s) checksum"
sha1sum "${packFiles[@]}" > "${sum_file}"

View File

@ -5,7 +5,7 @@ services:
depends_on:
- mc
image: itzg/mc-monitor:${MC_MONITOR_VERSION:-0.10.4}
command: status --host mc --retry-interval 1s --timeout 1s --retry-limit 240
command: status --host mc --retry-interval 1s --timeout 1s --retry-limit 300
mc:
restart: "no"
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}