diff --git a/Dockerfile b/Dockerfile index c5a8fb5..14ad200 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,87 +10,73 @@ ADD ./src ${CONFIG_PATH} RUN mkdir ${DATA_PATH} RUN mkdir ${CACHE_PATH} +# Add symlinks to data files -# Add symlinks to Minecraft Vanilla files -RUN mkdir ${DATA_PATH}/Vanilla && \ - touch ${DATA_PATH}/Vanilla/banned-ips.json && \ - ln -sf ${DATA_PATH}/Vanilla/banned-ips.json ${CONFIG_PATH} && \ - touch ${DATA_PATH}/Vanilla/banned-players.json && \ - ln -sf ${DATA_PATH}/Vanilla/banned-players.json ${CONFIG_PATH} && \ - mkdir ${DATA_PATH}/Vanilla/logs && \ - ln -sf ${DATA_PATH}/Vanilla/logs ${CONFIG_PATH} && \ - touch ${DATA_PATH}/Vanilla/ops.json && \ - ln -sf ${DATA_PATH}/Vanilla/ops.json ${CONFIG_PATH} && \ - touch ${DATA_PATH}/Vanilla/usercache.json && \ - ln -sf ${DATA_PATH}/Vanilla/usercache.json ${CONFIG_PATH} && \ - touch ${DATA_PATH}/Vanilla/whitelist.json && \ - ln -sf ${DATA_PATH}/Vanilla/whitelist.json ${CONFIG_PATH} && \ - mkdir ${DATA_PATH}/Vanilla/world && \ - ln -sf ${DATA_PATH}/Vanilla/world ${CONFIG_PATH} && \ - mkdir ${DATA_PATH}/Vanilla/world_nether && \ - ln -sf ${DATA_PATH}/Vanilla/world_nether ${CONFIG_PATH} && \ - mkdir ${DATA_PATH}/Vanilla/world_the_end && \ - ln -sf ${DATA_PATH}/Vanilla/world_the_end ${CONFIG_PATH} - -# Add symlinks to PlasmoVoice files -RUN mkdir ${DATA_PATH}/PlasmoVoice && \ - touch ${DATA_PATH}/PlasmoVoice/pv-voice_mutes.json && \ - ln -sf ${DATA_PATH}/PlasmoVoice/pv-voice_mutes.json \ +# Minecraft Vanilla +RUN ln -sf ${DATA_PATH}/Vanilla/banned-ips.json \ + ${CONFIG_PATH}/banned-ips.json && \ + ln -sf ${DATA_PATH}/Vanilla/banned-players.json \ + ${CONFIG_PATH}/banned-players.json && \ + ln -sf ${DATA_PATH}/Vanilla/logs \ + ${CONFIG_PATH}/logs && \ + ln -sf ${DATA_PATH}/Vanilla/ops.json \ + ${CONFIG_PATH}/ops.json && \ + ln -sf ${DATA_PATH}/Vanilla/usercache.json \ + ${CONFIG_PATH}/usercache.json && \ + ln -sf ${DATA_PATH}/Vanilla/whitelist.json \ + ${CONFIG_PATH}/whitelist.json && \ + ln -sf ${DATA_PATH}/Vanilla/world \ + ${CONFIG_PATH}/world && \ + ln -sf ${DATA_PATH}/Vanilla/world_nether \ + ${CONFIG_PATH}/world_nether && \ + ln -sf ${DATA_PATH}/Vanilla/world_the_end \ + ${CONFIG_PATH}/world_the_end +# PlasmoVoice files +RUN ln -sf ${DATA_PATH}/PlasmoVoice/pv-voice_mutes.json \ ${CONFIG_PATH}/plugins/PlasmoVoice/voice_mutes.json - -# Add symlinks to SuperVanish files -RUN mkdir -p ${DATA_PATH}/SuperVanish && \ - touch ${DATA_PATH}/SuperVanish/data.yml && \ - ln -sf ${DATA_PATH}/SuperVanish/data.yml \ +# SuperVanish +RUN ln -sf ${DATA_PATH}/SuperVanish/data.yml \ ${CONFIG_PATH}/plugins/SuperVanish/data.yml - -# Add symlinks to CarbonChat files -RUN mkdir -p ${DATA_PATH}/CarbonChat/users && \ - ln -sf ${DATA_PATH}/CarbonChat/users \ +# CarbonChat +RUN ln -sf ${DATA_PATH}/CarbonChat/users \ ${CONFIG_PATH}/plugins/CarbonChat/users - -# Add symlinks to ImageFrame files -RUN mkdir -p ${DATA_PATH}/ImageFrame/data && \ - ln -sf ${DATA_PATH}/ImageFrame/data/ \ +# ImageFrame +RUN ln -sf ${DATA_PATH}/ImageFrame/data/ \ ${CONFIG_PATH}/plugins/ImageFrame/data && \ - mkdir -p ${DATA_PATH}/ImageFrame/players && \ ln -sf ${DATA_PATH}/ImageFrame/players/ \ ${CONFIG_PATH}/plugins/ImageFrame/players && \ - mkdir -p ${DATA_PATH}/ImageFrame/upload && \ ln -sf ${DATA_PATH}/ImageFrame/upload/ \ ${CONFIG_PATH}/plugins/ImageFrame/upload - -# Add symlinks to CusttomPlayerModels files -RUN mkdir -p ${DATA_PATH}/CustomizablePlayerModels && \ - ln -sf ${DATA_PATH}/CustomizablePlayerModels/ \ +# CustomPlayerModels +RUN ln -sf ${DATA_PATH}/CustomizablePlayerModels/ \ ${CONFIG_PATH}/plugins/CustomizablePlayerModels - -# Add symlinks to BlueMap files -RUN mkdir -p ${DATA_PATH}/BlueMap/maps && \ - mkdir -p ${DATA_PATH}/BlueMap/logs && \ - ln -sf ${DATA_PATH}/BlueMap/maps \ +# BlueMap +RUN ln -sf ${DATA_PATH}/BlueMap/maps \ ${CONFIG_PATH}/plugins/BlueMap/data/web/maps && \ ln -sf ${DATA_PATH}/BlueMap/logs \ - ${CONFIG_PATH}/plugins/BlueMap/data/logs -RUN mkdir -p ${DATA_PATH}/BMMarker/data && \ + ${CONFIG_PATH}/plugins/BlueMap/data/logs && \ ln -sf ${DATA_PATH}/BMMarker/data \ ${CONFIG_PATH}/plugins/BMMarker/data - -# Add symlinks to Chunky files -RUN mkdir -p ${DATA_PATH}/Chunky/tasks && \ - ln -sf ${DATA_PATH}/Chunky/tasks \ +# Chunky +RUN ln -sf ${DATA_PATH}/Chunky/tasks \ ${CONFIG_PATH}/plugins/Chunky/tasks VOLUME ${DATA_PATH} # Add symlinks to cache files -RUN ln -sf ${CACHE_PATH}/cache ${CONFIG_PATH}/cache && \ - ln -sf ${CACHE_PATH}/libraries ${CONFIG_PATH}/libraries && \ - ln -sf ${CACHE_PATH}/versions ${CONFIG_PATH}/versions && \ - ln -sf ${CACHE_PATH}/plugins/.paper-remapped ${CONFIG_PATH}/plugins/.paper-remapped && \ - ln -sf ${CACHE_PATH}/plugins/LuckPerms/libs ${CONFIG_PATH}/plugins/LuckPerms/libs && \ - ln -sf ${CACHE_PATH}/orebfuscator_cache ${CONFIG_PATH}/orebfuscator_cache +RUN ln -sf ${CACHE_PATH}/cache \ + ${CONFIG_PATH}/cache && \ + ln -sf ${CACHE_PATH}/libraries \ + ${CONFIG_PATH}/libraries && \ + ln -sf ${CACHE_PATH}/versions \ + ${CONFIG_PATH}/versions && \ + ln -sf ${CACHE_PATH}/plugins/.paper-remapped \ + ${CONFIG_PATH}/plugins/.paper-remapped && \ + ln -sf ${CACHE_PATH}/plugins/LuckPerms/libs \ + ${CONFIG_PATH}/plugins/LuckPerms/libs && \ + ln -sf ${CACHE_PATH}/orebfuscator_cache \ + ${CONFIG_PATH}/orebfuscator_cache VOLUME ${CACHE_PATH} @@ -180,6 +166,86 @@ CMD \ useradd -M -g ${GID} -u ${UID} worker && \ chmod -R o-rwx ${WORKDIR_PATH} && \ + # Create data files + + # Minecraft Vanilla + if [ ! -e ${DATA_PATH}/Vanilla ]; \ + then mkdir ${DATA_PATH}/Vanilla; \ + fi && \ + if [ ! -e ${DATA_PATH}/Vanilla/banned-ips.json ]; \ + then touch ${DATA_PATH}/Vanilla/banned-ips.json; \ + fi && \ + if [ ! -e ${DATA_PATH}/Vanilla/banned-players.json ]; \ + then touch ${DATA_PATH}/Vanilla/banned-players.json; \ + fi && \ + if [ ! -e ${DATA_PATH}/Vanilla/logs ]; \ + then mkdir ${DATA_PATH}/Vanilla/logs; \ + fi && \ + if [ ! -e ${DATA_PATH}/Vanilla/ops.json ]; \ + then touch ${DATA_PATH}/Vanilla/ops.json; \ + fi && \ + if [ ! -e ${DATA_PATH}/Vanilla/usercache.json ]; \ + then touch ${DATA_PATH}/Vanilla/usercache.json; \ + fi && \ + if [ ! -e ${DATA_PATH}/Vanilla/whitelist.json ]; \ + then touch ${DATA_PATH}/Vanilla/whitelist.json; \ + fi && \ + if [ ! -e ${DATA_PATH}/Vanilla/world ]; \ + then mkdir ${DATA_PATH}/Vanilla/world; \ + fi && \ + if [ ! -e ${DATA_PATH}/Vanilla/world_nether ]; \ + then mkdir ${DATA_PATH}/Vanilla/world_nether; \ + fi && \ + if [ ! -e ${DATA_PATH}/Vanilla/world_the_end ]; \ + then mkdir ${DATA_PATH}/Vanilla/world_the_end; \ + fi && \ + # PlasmoVoice + if [ ! -e ${DATA_PATH}/PlasmoVoice ]; \ + then mkdir ${DATA_PATH}/PlasmoVoice; \ + fi && \ + if [ ! -e ${DATA_PATH}/PlasmoVoice/pv-voice_mutes.json ]; \ + then touch ${DATA_PATH}/PlasmoVoice/pv-voice_mutes.json; \ + fi && \ + # SuperVanish + if [ ! -e ${DATA_PATH}/SuperVanish ]; \ + then mkdir -p ${DATA_PATH}/SuperVanish; \ + fi && \ + if [ ! -e ${DATA_PATH}/SuperVanish/data.yml ]; \ + then touch ${DATA_PATH}/SuperVanish/data.yml; \ + fi && \ + # CarbonChat + if [ ! -e ${DATA_PATH}/CarbonChat/users ]; \ + then mkdir -p ${DATA_PATH}/CarbonChat/users; \ + fi && \ + # ImageFrame + if [ ! -e ${DATA_PATH}/ImageFrame/data ]; \ + then mkdir -p ${DATA_PATH}/ImageFrame/data; \ + fi && \ + if [ ! -e ${DATA_PATH}/ImageFrame/players ]; \ + then mkdir -p ${DATA_PATH}/ImageFrame/players; \ + fi && \ + if [ ! -e ${DATA_PATH}/ImageFrame/upload ]; \ + then mkdir -p ${DATA_PATH}/ImageFrame/upload; \ + fi && \ + # CusttomPlayerModels + if [ ! -e ${DATA_PATH}/CustomizablePlayerModels ]; \ + then mkdir -p ${DATA_PATH}/CustomizablePlayerModels; \ + fi && \ + # BlueMap + if [ ! -e ${DATA_PATH}/BlueMap/maps ]; \ + then mkdir -p ${DATA_PATH}/BlueMap/maps; \ + fi && \ + if [ ! -e ${DATA_PATH}/BlueMap/logs ]; \ + then mkdir -p ${DATA_PATH}/BlueMap/logs; \ + fi && \ + if [ ! -e ${DATA_PATH}/BMMarker/data ]; \ + then mkdir -p ${DATA_PATH}/BMMarker/data; \ + fi && \ + # Chunky + if [ ! -e ${DATA_PATH}/Chunky/tasks ]; \ + then mkdir -p ${DATA_PATH}/Chunky/tasks; \ + fi && \ + # Create cache files and folders if [ ! -e ${CACHE_PATH}/cache ]; \ then mkdir -p ${CACHE_PATH}/cache; \