mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2024-06-07 19:40:43 +00:00
Constrain GENERIC_PACK base detection depth (#1528)
This commit is contained in:
parent
f67d3948d2
commit
3e3abda71e
@ -1,27 +1,27 @@
|
|||||||
version: '3.8'
|
version: '3.8'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
rlcraft:
|
mc:
|
||||||
image: itzg/minecraft-server:java8
|
image: itzg/minecraft-server:java8
|
||||||
container_name: rlcraft
|
|
||||||
volumes:
|
volumes:
|
||||||
- rlcraft-modpack:/modpacks:ro
|
- data:/data
|
||||||
- rlcraft-data:/data
|
- ./modpacks:/modpacks:ro
|
||||||
environment:
|
environment:
|
||||||
EULA: "true"
|
EULA: "true"
|
||||||
TYPE: "FORGE"
|
TYPE: "FORGE"
|
||||||
VERSION: "1.12.2"
|
VERSION: "1.12.2"
|
||||||
FORGEVERSION: "14.23.5.2855"
|
FORGEVERSION: "14.23.5.2860"
|
||||||
|
OVERRIDE_SERVER_PROPERTIES: "true"
|
||||||
DIFFICULTY: "hard"
|
DIFFICULTY: "hard"
|
||||||
MAX_TICK_TIME: "-1"
|
MAX_TICK_TIME: "-1"
|
||||||
VIEW_DISTANCE: "6"
|
|
||||||
ALLOW_FLIGHT: "true"
|
ALLOW_FLIGHT: "true"
|
||||||
|
ENABLE_COMMAND_BLOCK: "true"
|
||||||
|
VIEW_DISTANCE: "10"
|
||||||
MEMORY: "4G"
|
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:
|
ports:
|
||||||
- 25565:25565
|
- 25565:25565
|
||||||
restart: unless-stopped
|
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
rlcraft-data:
|
data:
|
||||||
rlcraft-modpack:
|
|
||||||
|
@ -8,7 +8,7 @@ isDebugging && set -x
|
|||||||
|
|
||||||
get_installer() {
|
get_installer() {
|
||||||
if [[ -z $FORGE_INSTALLER_URL ]]; then
|
if [[ -z $FORGE_INSTALLER_URL ]]; then
|
||||||
log "Downloading $normForgeVersion"
|
log "Downloading Forge Installer $normForgeVersion"
|
||||||
|
|
||||||
forgeFileNames="
|
forgeFileNames="
|
||||||
$shortForgeVersion/forge-$shortForgeVersion-installer.jar
|
$shortForgeVersion/forge-$shortForgeVersion-installer.jar
|
||||||
@ -25,7 +25,7 @@ get_installer() {
|
|||||||
log "Unable to locate usable URL for $normForgeVersion"
|
log "Unable to locate usable URL for $normForgeVersion"
|
||||||
exit 2
|
exit 2
|
||||||
else
|
else
|
||||||
log "Downloading $FORGE_INSTALLER_URL ..."
|
log "Downloading Forge Installer from $FORGE_INSTALLER_URL ..."
|
||||||
if ! get -o "$FORGE_INSTALLER" "$FORGE_INSTALLER_URL"; then
|
if ! get -o "$FORGE_INSTALLER" "$FORGE_INSTALLER_URL"; then
|
||||||
log "Failed to download from given location $FORGE_INSTALLER_URL"
|
log "Failed to download from given location $FORGE_INSTALLER_URL"
|
||||||
exit 2
|
exit 2
|
||||||
|
@ -122,8 +122,8 @@ if [ -n "$JVM_DD_OPTS" ]; then
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if isTrue ${ENABLE_JMX}; then
|
if isTrue "${ENABLE_JMX}"; then
|
||||||
: ${JMX_PORT:=7091}
|
: "${JMX_PORT:=7091}"
|
||||||
JVM_OPTS="${JVM_OPTS}
|
JVM_OPTS="${JVM_OPTS}
|
||||||
-Dcom.sun.management.jmxremote.local.only=false
|
-Dcom.sun.management.jmxremote.local.only=false
|
||||||
-Dcom.sun.management.jmxremote.port=${JMX_PORT}
|
-Dcom.sun.management.jmxremote.port=${JMX_PORT}
|
||||||
|
@ -216,18 +216,20 @@ if [[ "${GENERIC_PACKS}" ]]; then
|
|||||||
elif isTrue "${FORCE_GENERIC_PACK_UPDATE}" || ! checkSum "${sum_file}"; then
|
elif isTrue "${FORCE_GENERIC_PACK_UPDATE}" || ! checkSum "${sum_file}"; then
|
||||||
log "Generic pack(s) are out of date. Re-applying..."
|
log "Generic pack(s) are out of date. Re-applying..."
|
||||||
|
|
||||||
base_dir=/tmp/generic_pack_base
|
original_base_dir=/data/.tmp/generic_pack_base
|
||||||
mkdir -p ${base_dir}
|
base_dir=$original_base_dir
|
||||||
|
rm -rf "${base_dir}"
|
||||||
|
mkdir -p "${base_dir}"
|
||||||
for pack in "${packFiles[@]}"; do
|
for pack in "${packFiles[@]}"; do
|
||||||
isDebugging && ls -l "${pack}"
|
isDebugging && ls -l "${pack}"
|
||||||
extract "${pack}" "${base_dir}"
|
extract "${pack}" "${base_dir}"
|
||||||
done
|
done
|
||||||
|
|
||||||
# recalculate the actual base directory of content
|
# 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
|
if [[ ! $base_dir ]]; then
|
||||||
log "ERROR: Unable to find content base of generic packs ${GENERIC_PACKS}. Directories:"
|
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
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -246,7 +248,7 @@ if [[ "${GENERIC_PACKS}" ]]; then
|
|||||||
|
|
||||||
log "Applying generic pack ..."
|
log "Applying generic pack ..."
|
||||||
cp -R -f "${base_dir}"/* /data
|
cp -R -f "${base_dir}"/* /data
|
||||||
rm -rf /tmp/generic_pack_base
|
rm -rf $original_base_dir
|
||||||
|
|
||||||
log "Saving generic pack(s) checksum"
|
log "Saving generic pack(s) checksum"
|
||||||
sha1sum "${packFiles[@]}" > "${sum_file}"
|
sha1sum "${packFiles[@]}" > "${sum_file}"
|
||||||
|
@ -5,7 +5,7 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
- mc
|
- mc
|
||||||
image: itzg/mc-monitor:${MC_MONITOR_VERSION:-0.10.4}
|
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:
|
mc:
|
||||||
restart: "no"
|
restart: "no"
|
||||||
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
|
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
|
||||||
|
Loading…
Reference in New Issue
Block a user