refactor(pack): host custom jars from ./custom outside the pack root
Move pack/custom/ -> ./custom/ and bind-mount it into caddy at
/srv/pack/custom (served URL pack.${BASE_DOMAIN}/custom/ unchanged).
Keeping jars outside the packwiz pack root stops `packwiz refresh`
from indexing them as direct files on top of the mods/*.pw.toml
external refs (drops 9 bogus custom/*.jar entries from index.toml).
add-custom-mod.sh now writes jars to ./custom/. Trim the blessingskin
caddy override to just the conf swap (volumes merge by target).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -6,8 +6,9 @@
|
||||
# <slug>.pw.toml that points at a stable download URL + sha256, then refresh.
|
||||
#
|
||||
# Since the jars are local (no public URL), we HOST them on the caddy pack
|
||||
# server: each jar is copied under pack/custom/ — caddy serves pack/ at
|
||||
# http://pack.${BASE_DOMAIN}/ — so the metadata's download url is
|
||||
# server: each jar is copied to the top-level ./custom/ dir (OUTSIDE ./pack, so
|
||||
# packwiz refresh won't index it as a direct file). Caddy bind-mounts ./custom
|
||||
# at /srv/pack/custom, so it is served at
|
||||
# http://pack.${BASE_DOMAIN}/custom/<filename>
|
||||
# which is exactly what minecraft fetches via PACKWIZ_URL on install.
|
||||
#
|
||||
@@ -73,7 +74,7 @@ else
|
||||
JARS=("$TARGET")
|
||||
fi
|
||||
|
||||
mkdir -p pack/custom pack/mods
|
||||
mkdir -p custom pack/mods
|
||||
|
||||
# ---- per-jar processing (no refresh; refresh once at the end) --------------
|
||||
add_one() { # $1 = jar path. Uses NAME (single-jar only), SIDE, FORCE, BASE_DOMAIN.
|
||||
@@ -88,7 +89,7 @@ add_one() { # $1 = jar path. Uses NAME (single-jar only), SIDE, FORCE, BASE_DOM
|
||||
[ -n "$slug" ] || die "could not derive a slug from name '$name'"
|
||||
|
||||
meta="pack/mods/${slug}.pw.toml"
|
||||
dest="pack/custom/${filename}"
|
||||
dest="custom/${filename}"
|
||||
url="http://pack.${BASE_DOMAIN}/custom/${filename}"
|
||||
|
||||
if [ "$FORCE" -ne 1 ]; then
|
||||
@@ -119,4 +120,4 @@ for j in "${JARS[@]}"; do add_one "$j"; done
|
||||
# .pw.toml files are picked up. Must run inside the pack dir.
|
||||
( cd pack && packwiz refresh )
|
||||
log "packwiz refresh done — ${#JARS[@]} mod(s) added to the pack"
|
||||
echo " commit pack/custom/*.jar, pack/mods/*.pw.toml, pack/index.toml, pack/pack.toml"
|
||||
echo " commit custom/*.jar, pack/mods/*.pw.toml, pack/index.toml, pack/pack.toml"
|
||||
|
||||
Reference in New Issue
Block a user