Skip to content

Conversation

@ronnierap
Copy link

If you have custom servers that require multiple files you can now specify them as a zip package (which will extract contents to the /data dir)

@itzg
Copy link
Owner

itzg commented Aug 21, 2021

I seem to be missing docs for GENERIC_PACK, but your PR seems to be redundant with the intended combination of TYPE=CUSTOM and GENERIC_PACK where the custom server logic accounts for it here

elif [[ ${GENERIC_PACK} ]]; then
log "Using custom server jar from generic pack at ${CUSTOM_SERVER} ..."
export SERVER=${CUSTOM_SERVER}

and then the generic pack is processed here

if [[ "${GENERIC_PACK}" ]]; then
if isURL "${GENERIC_PACK}"; then
log "Downloading generic pack ..."
curl -fsSL -o /tmp/generic_pack.zip "${GENERIC_PACK}"
GENERIC_PACK=/tmp/generic_pack.zip
fi
sum_file=/data/.generic_pack.sum
if ! sha256sum -c ${sum_file} -s 2> /dev/null; then
base_dir=/tmp/generic_pack_base
mkdir -p ${base_dir}
isDebugging && ls -l "${GENERIC_PACK}"
unzip -q -d ${base_dir} "${GENERIC_PACK}"
if [ -f /data/manifest.txt ]; then
log "Manifest exists from older generic pack, cleaning up ..."
while read f; do
rm -rf "/data/${f}"
done < /data/manifest.txt
find /data/* -type d -exec rmdir --ignore-fail-on-non-empty {} +
rm -f /data/manifest.txt
fi
log "Writing generic pack manifest ... "
find ${base_dir} -type f -print0 | xargs -0 -I {} echo "{}" | sed "s#${base_dir}/##" > /data/manifest.txt
log "Applying generic pack ..."
IFS='
'
set -f
for d in $(find ${base_dir} -type d); do mkdir -p "$(sed "s#${base_dir}#/data#" <<< $d)"; done
for f in $(find ${base_dir} -type f); do cp -f "$f" "$(sed "s#${base_dir}#/data#" <<< $f)"; done
rm -rf ${base_dir}
sha256sum "${GENERIC_PACK}" > ${sum_file}
fi
fi

@itzg itzg mentioned this pull request Aug 21, 2021
@github-actions github-actions bot added the status/stale No recently activity has been seen and will be closed soon. label Oct 29, 2021
@github-actions github-actions bot closed this Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status/stale No recently activity has been seen and will be closed soon.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants