fix(mc): mount only kubejs source subdirs ro, keep kubejs root writable
Mounting the whole kubejs dir read-only made KubeJS's BaseProperties.save() throw NPE on boot (it writes config/cache/generated/logs under kubejs/), so KubeJS never initialised. Bind only the source subdirs (server_scripts, startup_scripts, data, assets) read-only and let the kubejs root live writable in mc_data. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -95,12 +95,16 @@ services:
|
|||||||
- mc_data:/data
|
- mc_data:/data
|
||||||
- ./runtime:/extras:ro # authlib-injector.jar lives here
|
- ./runtime:/extras:ro # authlib-injector.jar lives here
|
||||||
- ./server-mods:/mods:ro # itzg auto-syncs /mods → /data/mods
|
- ./server-mods:/mods:ro # itzg auto-syncs /mods → /data/mods
|
||||||
# Distribution client-override files the server also needs. kubejs holds
|
# Distribution client-override files the server also needs, from the live
|
||||||
# server_scripts/data/startup_scripts (server-side); CustomSkinLoader by
|
# distribution (DISTRIBUTION_WEB_ROOT), same source as caddy. Only the kubejs
|
||||||
# request. Mounted from the live distribution (DISTRIBUTION_WEB_ROOT), same
|
# *source* subdirs are bind-mounted ro — kubejs itself writes config/, cache/,
|
||||||
# source as the caddy distribution. mode ro so the server can't pollute the
|
# generated/, logs/ at boot, so the kubejs ROOT must stay writable (lives in
|
||||||
# client distribution with kubejs-generated files.
|
# mc_data). Mounting the whole kubejs dir ro makes BaseProperties.save() NPE
|
||||||
- ${DISTRIBUTION_WEB_ROOT:?DISTRIBUTION_WEB_ROOT unset in .env}/servers/ulicraft-1.21.1/files/kubejs:/data/kubejs:ro
|
# and kubejs never initialises. CustomSkinLoader is ro (read-only json).
|
||||||
|
- ${DISTRIBUTION_WEB_ROOT:?DISTRIBUTION_WEB_ROOT unset in .env}/servers/ulicraft-1.21.1/files/kubejs/server_scripts:/data/kubejs/server_scripts:ro
|
||||||
|
- ${DISTRIBUTION_WEB_ROOT}/servers/ulicraft-1.21.1/files/kubejs/startup_scripts:/data/kubejs/startup_scripts:ro
|
||||||
|
- ${DISTRIBUTION_WEB_ROOT}/servers/ulicraft-1.21.1/files/kubejs/data:/data/kubejs/data:ro
|
||||||
|
- ${DISTRIBUTION_WEB_ROOT}/servers/ulicraft-1.21.1/files/kubejs/assets:/data/kubejs/assets:ro
|
||||||
- ${DISTRIBUTION_WEB_ROOT}/servers/ulicraft-1.21.1/files/CustomSkinLoader:/data/CustomSkinLoader:ro
|
- ${DISTRIBUTION_WEB_ROOT}/servers/ulicraft-1.21.1/files/CustomSkinLoader:/data/CustomSkinLoader:ro
|
||||||
depends_on:
|
depends_on:
|
||||||
- drasl # authlib (auth.) must resolve at boot
|
- drasl # authlib (auth.) must resolve at boot
|
||||||
|
|||||||
Reference in New Issue
Block a user