From 5d55ce2b259d24ebdf7e43b8fcd23da48cd30c96 Mon Sep 17 00:00:00 2001 From: Jeremy White Date: Fri, 8 Feb 2019 08:11:01 -0500 Subject: [PATCH 1/7] feat(minecraft/entrypoint): download manifests --- minecraft-server/start-finalSetup02Modpack | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/minecraft-server/start-finalSetup02Modpack b/minecraft-server/start-finalSetup02Modpack index 3894a1bc..5bb5e034 100755 --- a/minecraft-server/start-finalSetup02Modpack +++ b/minecraft-server/start-finalSetup02Modpack @@ -1,5 +1,8 @@ #!/bin/bash +# CURSE_URL_BASE used in manifest downloads below +CURSE_URL_BASE=${CURSE_URL_BASE:-https://minecraft.curseforge.com/projects} + # Remove old mods/plugins if [ "$REMOVE_OLD_MODS" = "TRUE" ]; then if [ "$TYPE" = "SPIGOT" ]; then @@ -68,4 +71,23 @@ do done fi +if [[ "$MANIFEST" ]]; then +case "X$MANIFEST" in + X*.json) + if [ -f "${MANIFEST}" ]; then + jq --slurpfile m "${MANIFEST}" '$m.files | (.projectID|tostring) + " " + (.fileID|tostring)'| while read -r p f + do + url="${CURSE_URL_BASE}/${p}/files/${f}/download" + # Manifest usually doesn't have mod names. Using id should be fine, tho + curl -sSL -o /data/mods/${p}_${f}.jar + done + else + echo "Could not find manifest file, unsufficient privs, or malformed path." + fi + *) + echo "Invalid manifest file for modpack. Please make sure it is a .json file." + ;; +esac +fi + exec /start-finalSetup03Modconfig $@ From 22417858a3f483c3888d13c6637b333144c07d7b Mon Sep 17 00:00:00 2001 From: Jeremy White Date: Fri, 8 Feb 2019 08:18:18 -0500 Subject: [PATCH 2/7] fix(minecraft/entrypoint): correct typo in manifest load --- minecraft-server/start-finalSetup02Modpack | 1 + 1 file changed, 1 insertion(+) diff --git a/minecraft-server/start-finalSetup02Modpack b/minecraft-server/start-finalSetup02Modpack index 5bb5e034..efba7d21 100755 --- a/minecraft-server/start-finalSetup02Modpack +++ b/minecraft-server/start-finalSetup02Modpack @@ -84,6 +84,7 @@ case "X$MANIFEST" in else echo "Could not find manifest file, unsufficient privs, or malformed path." fi + ;; *) echo "Invalid manifest file for modpack. Please make sure it is a .json file." ;; From 301e33f22473121c037e34708d30156c3c82e22d Mon Sep 17 00:00:00 2001 From: Jeremy White Date: Fri, 8 Feb 2019 08:20:47 -0500 Subject: [PATCH 3/7] feat(minecraft/entrypoint): add diagnostic to manifest load --- minecraft-server/start-finalSetup02Modpack | 1 + 1 file changed, 1 insertion(+) diff --git a/minecraft-server/start-finalSetup02Modpack b/minecraft-server/start-finalSetup02Modpack index efba7d21..b7712485 100755 --- a/minecraft-server/start-finalSetup02Modpack +++ b/minecraft-server/start-finalSetup02Modpack @@ -78,6 +78,7 @@ case "X$MANIFEST" in jq --slurpfile m "${MANIFEST}" '$m.files | (.projectID|tostring) + " " + (.fileID|tostring)'| while read -r p f do url="${CURSE_URL_BASE}/${p}/files/${f}/download" + echo Downloading curseforge mod $url # Manifest usually doesn't have mod names. Using id should be fine, tho curl -sSL -o /data/mods/${p}_${f}.jar done From b38c00881b65f4e967269f3c613f1909d4502eab Mon Sep 17 00:00:00 2001 From: Jeremy White Date: Fri, 8 Feb 2019 11:31:40 -0500 Subject: [PATCH 4/7] fix(minecraft/entrypoint): several small defects with manifest loop --- minecraft-server/start-finalSetup02Modpack | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/minecraft-server/start-finalSetup02Modpack b/minecraft-server/start-finalSetup02Modpack index b7712485..29462159 100755 --- a/minecraft-server/start-finalSetup02Modpack +++ b/minecraft-server/start-finalSetup02Modpack @@ -75,12 +75,17 @@ if [[ "$MANIFEST" ]]; then case "X$MANIFEST" in X*.json) if [ -f "${MANIFEST}" ]; then - jq --slurpfile m "${MANIFEST}" '$m.files | (.projectID|tostring) + " " + (.fileID|tostring)'| while read -r p f + MOD_DIR=${FTB_BASE_DIR:-/data/mods} + echo "Starting manifest download..." + cat "${MANIFEST}" | jq -r '$.files[] | (.projectID|tostring) + " " + (.fileID|tostring)'| while read -r p f do - url="${CURSE_URL_BASE}/${p}/files/${f}/download" - echo Downloading curseforge mod $url - # Manifest usually doesn't have mod names. Using id should be fine, tho - curl -sSL -o /data/mods/${p}_${f}.jar + if [ ! -f $MOD_DIR/${p}_${f}.jar ] + then + url="${CURSE_URL_BASE}/${p}/files/${f}/download" + echo Downloading curseforge mod $url + # Manifest usually doesn't have mod names. Using id should be fine, tho + curl -sSL "${url}" -o $MOD_DIR/${p}_${f}.jar + fi done else echo "Could not find manifest file, unsufficient privs, or malformed path." From 6135feec569a90de67a1e8fc39eabbf7fbf1ffc3 Mon Sep 17 00:00:00 2001 From: Jeremy White Date: Fri, 8 Feb 2019 14:14:15 -0500 Subject: [PATCH 5/7] doc(minecraft): include manifest working docs --- minecraft-server/README.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/minecraft-server/README.md b/minecraft-server/README.md index c07df6f0..736c47d8 100644 --- a/minecraft-server/README.md +++ b/minecraft-server/README.md @@ -396,6 +396,42 @@ then you apply a workaround by adding this to the run invocation: -e FTB_LEGACYJAVAFIXER=true +### Using a client-made curseforge modpack + +If you use something like curseforge, you may end up creating/using modpacks that do not +contain server mod jars. Instead, the curseforge setup has `manifest.json` files, which +will show up under `/data/FeedTheBeast/manifest.json`. + +To use these packs you will need to: + +- Specify the manifest location with env var `MANIFEST=/data/FeedTheBeast/manifest` +- Pick a relevant ServerStart.sh and potentially settings.cfg and put them in `/data/FeedTheBeast` + +An example of the latter would be to use https://github.com/AllTheMods/Server-Scripts +There, you'll find that all you have to do is put ServerStart.sh and settings.cfg into +`/data/FeedTheBeast`, taking care to update settings.cfg to specify your desired version +of minecraft and forge. You can do this in the cli with something like: + +``` +$ wget https://raw.githubusercontent.com/AllTheMods/Server-Scripts/master/ServerStart.sh +$ wget https://raw.githubusercontent.com/AllTheMods/Server-Scripts/master/settings.cfg +$ vim settings.cfg #update the forge version to the one you want. Your manifest.json will have it +$ chmod +x ServerStart.sh +$ docker run -itd --name derpcraft \ + -e MANIFEST=/data/FeedTheBeast/manifest.json \ + -v $PWD/ServerStart.sh:/data/FeedTheBeast/ServerStart.sh \ + -v $PWD/settings.cfg:/data/FeedTheBeast/settings.cfg \ + -e VERSION=1.12.2\ + -e TYPE=CURSEFORGE\ + -e CF_SERVER_MOD=https://minecraft.curseforge.com/projects/your_amazing_modpack/files/2670435/download\ + -p 25565:25565\ + -e EULA=TRUE\ + --restart=always\ + itzg/minecraft-server +``` + +Note the `CF_SERVER_MOD` env var should match the url to download the modpack you are targeting. + ## Running a SpongeVanilla server Enable SpongeVanilla server mode by adding a `-e TYPE=SPONGEVANILLA` to your command-line. From 2b2ec512066810628742dfb929fb77e1b12f98bc Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Wed, 13 Feb 2019 07:39:00 -0500 Subject: [PATCH 6/7] ref(readme): formatting on serverstart details Co-Authored-By: dudymas --- minecraft-server/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/minecraft-server/README.md b/minecraft-server/README.md index 736c47d8..4ec6195d 100644 --- a/minecraft-server/README.md +++ b/minecraft-server/README.md @@ -408,7 +408,7 @@ To use these packs you will need to: - Pick a relevant ServerStart.sh and potentially settings.cfg and put them in `/data/FeedTheBeast` An example of the latter would be to use https://github.com/AllTheMods/Server-Scripts -There, you'll find that all you have to do is put ServerStart.sh and settings.cfg into +There, you'll find that all you have to do is put `ServerStart.sh` and `settings.cfg` into `/data/FeedTheBeast`, taking care to update settings.cfg to specify your desired version of minecraft and forge. You can do this in the cli with something like: From ae72f9ac703d0f6c204f89bb60807260617924fc Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Wed, 13 Feb 2019 07:39:41 -0500 Subject: [PATCH 7/7] ref(readme): formatting for settings.cfg notes Co-Authored-By: dudymas --- minecraft-server/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/minecraft-server/README.md b/minecraft-server/README.md index 4ec6195d..49f87f25 100644 --- a/minecraft-server/README.md +++ b/minecraft-server/README.md @@ -409,7 +409,7 @@ To use these packs you will need to: An example of the latter would be to use https://github.com/AllTheMods/Server-Scripts There, you'll find that all you have to do is put `ServerStart.sh` and `settings.cfg` into -`/data/FeedTheBeast`, taking care to update settings.cfg to specify your desired version +`/data/FeedTheBeast`, taking care to update `settings.cfg` to specify your desired version of minecraft and forge. You can do this in the cli with something like: ```