Compare commits

..

736 Commits

Author SHA1 Message Date
Geoff Bourne
cd337f34da Auto-merging via docker-versions-create 2021-10-15 18:46:01 -05:00
Geoff Bourne
63b919f1a9 Used json-path of image helper get for vanilla lookup 2021-10-11 15:53:09 -05:00
Geoff Bourne
57d9da96a1 Converted vanilla downloads to image helper get
#1031
2021-10-10 12:05:37 -05:00
Geoff Bourne
7a9aa760a2 Auto-merging via docker-versions-create 2021-10-10 09:55:28 -05:00
Geoff Bourne
ec97c67aca Propagated debug flag to image helper get
#1031
2021-10-10 09:53:52 -05:00
Geoff Bourne
e5e9b0d928 Using image helper to download MODS
#1031
2021-10-10 09:33:17 -05:00
Geoff Bourne
2fd405ec5b Auto-merging via docker-versions-create 2021-10-09 15:24:22 -05:00
Geoff Bourne
2e37c16b2c Fabric deployment no longer uses curl
#1031
2021-10-09 15:22:42 -05:00
Geoff Bourne
cbfe9a069c Merged latest from master 2021-10-09 12:02:02 -05:00
itzg
bcdab80f41 docs: Auto update markdown TOC 2021-10-09 16:34:52 +00:00
Geoff Bourne
c3cf892e40 Added mc-send-to-console as rcon/attach alternative
#1071
2021-10-09 11:34:37 -05:00
Geoff Bourne
2db61fd72f Auto-merging via docker-versions-create 2021-10-02 19:21:27 -05:00
Geoff Bourne
1d41593a84 Verify forge server from marker file exists
#1067
2021-10-02 19:20:08 -05:00
itzg
52452020dd docs: Auto update markdown TOC 2021-09-30 21:55:07 +00:00
Geoff Bourne
65f2562d52 Added property mapping for simulation-distance
#1065
2021-09-30 16:54:44 -05:00
Geoff Bourne
3482944ac8 For autopause, added use of mc-monitor to detect players connected (#1059) 2021-09-30 16:51:51 -05:00
Geoff Bourne
9d03a1dc13 Upgraded mc-monitor to handle packet read timeout 2021-09-29 21:09:30 -05:00
Geoff Bourne
6e2073fda5 Auto-merging via docker-versions-create 2021-09-29 10:26:44 -05:00
Geoff Bourne
012d3e7b65 Upgraded rcon-cli to support format code processing 2021-09-29 10:26:15 -05:00
Geoff Bourne
ae48a8710e Auto-merging via docker-versions-create 2021-09-27 20:40:23 -05:00
avionix-g
10d254bbbc Fix 'curl: unknown --write-out variable' for .zip modpacks (#1060) 2021-09-27 06:53:56 -05:00
itzg
8acb3f8a90 docs: Auto update markdown TOC 2021-09-25 14:39:20 +00:00
Geoff Bourne
1b00a8692b docs: noted whitelist importance 2021-09-25 09:38:47 -05:00
Geoff Bourne
3b54a9fd67 Auto-merging via docker-versions-create 2021-09-20 12:29:36 -05:00
itzg
814559bef8 docs: Auto update markdown TOC 2021-09-20 02:33:20 +00:00
Geoff Bourne
8bac02bbcf Added JSON-patching support
#1051
2021-09-19 21:32:59 -05:00
itzg
7ef031e244 docs: Auto update markdown TOC 2021-09-19 14:46:55 +00:00
Jawa_Juice
250d32e3dc Remove Yatopia support as discontinued (#1049) 2021-09-19 09:46:40 -05:00
Geoff Bourne
bdeab5bb9c Upgraded mc-image-helper to 1.2.1
#1048
2021-09-16 22:11:45 -05:00
itzg
764e1e9363 docs: Auto update markdown TOC 2021-09-16 16:26:22 +00:00
Mufin
72461546b8 Remove tuinity section from README.md (#1045) 2021-09-16 11:26:05 -05:00
Geoff Bourne
98ad3b0f4a misc: fixed execute bit on scripts 2021-09-15 21:37:10 -05:00
Geoff Bourne
a66efb1a4f Auto-merging via docker-versions-create 2021-09-15 21:30:00 -05:00
itzg
7afd2adacf docs: Auto update markdown TOC 2021-09-16 02:28:03 +00:00
Geoff Bourne
4c52d0ec42 Replace/interpolate variables in files sync'ed from mounts (#1039) 2021-09-15 21:27:48 -05:00
Geoff Bourne
9f66622472 Added bedrock port to allow for waking from pause
#1046
2021-09-15 21:23:38 -05:00
Geoff Bourne
83938d8989 Auto-merging via docker-versions-create 2021-09-15 21:05:30 -05:00
Geoff Bourne
1f2f33d6c0 Merge branch 'master' of github.com:itzg/docker-minecraft-server 2021-09-15 21:02:05 -05:00
Geoff Bourne
8335b81bd8 Merged latest from master 2021-09-15 21:01:21 -05:00
Geoff Bourne
1a3c454d7f Added ping
#891 #1041
2021-09-15 20:53:44 -05:00
itzg
fa11d313fb docs: Auto update markdown TOC 2021-09-16 01:45:45 +00:00
Geoff Bourne
20bc2a97d9 docs: fixed java version example 2021-09-15 20:45:27 -05:00
Geoff Bourne
b9c379ec6c Auto-merging via docker-versions-create 2021-09-15 20:35:51 -05:00
dependabot[bot]
0cd49c4c81 build(deps): bump stefanzweifel/git-auto-commit-action (#1042) 2021-09-13 06:55:47 -05:00
Geoff Bourne
6c1cd2537d misc: created FUNDING.yml 2021-09-12 21:02:13 -05:00
brutalgg
cf31f24752 docs: Add RLCraft example (#1036) 2021-09-10 10:26:19 -05:00
itzg
27523a1c45 docs: Auto update markdown TOC 2021-09-06 15:53:03 +00:00
Geoff Bourne
e1d0fe6b92 docs: added world data diagram to README 2021-09-06 10:52:44 -05:00
itzg
d3f4a4991e docs: Auto update markdown TOC 2021-09-05 19:11:45 +00:00
Geoff Bourne
296ddbdec5 docs: described unicode conversion for MOTD 2021-09-05 14:11:26 -05:00
Geoff Bourne
f7cd34b8d8 Added unicode conversion for MOTD
#1025
2021-09-04 19:46:18 -05:00
itzg
7bafffbd06 docs: Auto update markdown TOC 2021-09-04 16:04:43 +00:00
Geoff Bourne
201ec3be5a docs: added SETUP_ONLY 2021-09-04 11:04:23 -05:00
itzg
7d1d5af097 docs: Auto update markdown TOC 2021-09-03 21:51:18 +00:00
Geoff Bourne
f9ce5bce4d docs: fixed heading level of timezone config 2021-09-03 16:51:00 -05:00
itzg
748768c771 docs: Auto update markdown TOC 2021-09-02 02:21:29 +00:00
Ross Holmberg
f307077636 Typo (#1027) 2021-09-01 21:21:11 -05:00
Geoff Bourne
b9ecbf7497 Auto-merging via docker-versions-create 2021-08-30 21:36:02 -05:00
Geoff Bourne
179cd878a9 Added error check on download of GENERIC_PACK
#1017
2021-08-30 21:31:06 -05:00
Geoff Bourne
788548d1f4 misc: upgraded mc-server-runner to 1.7.0 2021-08-30 21:17:48 -05:00
Geoff Bourne
0ae15c2b3c Fixed binding address of Limbo server
#994
2021-08-29 17:11:29 -05:00
itzg
b5b4257032 docs: Auto update markdown TOC 2021-08-29 21:26:47 +00:00
Daniel Ramp
657db124b2 docs: generator_settings json for 1.13+ (#1020) 2021-08-29 16:26:35 -05:00
dependabot[bot]
f5ea43b3d3 build(deps): bump docker/build-push-action from 2.6.1 to 2.7.0 (#1011) 2021-08-23 07:27:58 -05:00
itzg
01747510d5 docs: Auto update markdown TOC 2021-08-21 18:52:25 +00:00
Geoff Bourne
ff8b160a2b docs: added troubleshooting section 2021-08-21 13:52:25 -05:00
itzg
28b7afda15 docs: Auto update markdown TOC 2021-08-15 17:44:45 +00:00
Geoff Bourne
ecd253dd3e Added support for TYPE=LIMBO (#994) 2021-08-15 12:44:31 -05:00
Geoff Bourne
eca00e88bf Auto-merging via docker-versions-create 2021-08-10 12:55:04 -05:00
Chris Fowles
8d0dbcd50e Detect and download FTB ARM installer (#995)
Co-authored-by: Chris Fowles <chris.fowles@plenti.com.au>
2021-08-10 12:53:01 -05:00
Geoff Bourne
2a3169344d Auto-merging via docker-versions-create 2021-08-01 12:11:15 -05:00
itzg
327f21f1bb docs: Auto update markdown TOC 2021-08-01 17:09:37 +00:00
Geoff Bourne
c96d6b2958 Added support for STOP_SERVER_ANNOUNCE_DELAY 2021-08-01 12:09:18 -05:00
Geoff Bourne
8ec4f0d244 Auto-merging via docker-versions-create 2021-07-31 09:26:17 -05:00
itzg
da8fb37317 docs: Auto update markdown TOC 2021-07-31 14:24:59 +00:00
Geoff Bourne
4d7e29cb3a Corrected support for Magma dev channel forge-based installer 2021-07-31 09:24:38 -05:00
Geoff Bourne
d45250ebf2 Auto-merging via docker-versions-create 2021-07-26 19:34:15 -05:00
itzg
17099320e9 docs: Auto update markdown TOC 2021-07-27 00:33:11 +00:00
Geoff Bourne
f3dbb4dd2d Added support for Magma dev channel downloads 2021-07-26 19:32:26 -05:00
Geoff Bourne
03110aef99 Merged latest from master 2021-07-25 09:58:03 -05:00
Geoff Bourne
b3b3cdde08 Don't warn about Forge on Java 8 for 1.17+ 2021-07-25 09:50:40 -05:00
Geoff Bourne
f344e7e823 Auto-merging via docker-versions-create 2021-07-25 09:35:30 -05:00
itzg
b8cd510a0e docs: Auto update markdown TOC 2021-07-24 21:26:28 +00:00
Geoff Bourne
0d5eb2ea9e docs: fixed heading depth
#988
2021-07-24 16:26:09 -05:00
Geoff Bourne
c7fcaf1ec6 Auto-merging via docker-versions-create 2021-07-23 21:26:32 -05:00
Geoff Bourne
2b0fd2e5c0 Added support for Forge 1.17's run.sh mechanism
#986
2021-07-23 21:17:05 -05:00
Jawa_Juice
4168821ec4 Reflect different jar names for airplane/airplanepurpur (#985) 2021-07-21 10:16:05 -05:00
itzg
6353488db7 docs: Auto update markdown TOC 2021-07-18 21:20:49 +00:00
Geoff Bourne
b446d4cc3f docs: added recommendation of management layer 2021-07-18 16:19:57 -05:00
Geoff Bourne
9d700041a7 Auto-merging via docker-versions-create 2021-07-17 21:13:39 -05:00
Geoff Bourne
16b2762025 Removed extra quotes in spiget log when resource already new enough 2021-07-17 21:11:21 -05:00
Geoff Bourne
4af4ed69a5 Auto-merging via docker-versions-create 2021-07-17 20:56:25 -05:00
Daniel Ramp
c5a3e2e376 Cache spiget version resolution (#978) 2021-07-17 18:44:18 -05:00
Geoff Bourne
d215c14996 Auto-merging via docker-versions-create 2021-07-17 18:02:29 -05:00
Geoff Bourne
5018298c81 Fixed log for existing spiget resource
#981
2021-07-17 17:57:15 -05:00
Geoff Bourne
37b81aa0be Fixed issue with unset FORCE_REDOWNLOAD with TYPE=AIRPLANE
#979
2021-07-16 07:26:49 -05:00
Jawa_Juice
6a3a0465a4 Move to Pl3x DL API V2 (#977) 2021-07-15 16:51:18 -05:00
itzg
34d67d6018 docs: Auto update markdown TOC 2021-07-15 13:34:00 +00:00
Geoff Bourne
9c4403d7ff docs: corrected compose snippets within README 2021-07-15 08:33:43 -05:00
Geoff Bourne
4716254b5b Auto-merging via docker-versions-create 2021-07-14 18:43:03 -05:00
Daniel Ramp
3c0566cb87 fix: SPIGET_RESOURCES not always download (#975)
implemented to only re-download SPIGET resources with REMOVE_OLD_MODS enabled

fixes #974 partially
2021-07-14 18:42:34 -05:00
Geoff Bourne
3c2b7f0718 Auto-merging via docker-versions-create 2021-07-12 19:08:38 -05:00
itzg
4357066cdf docs: Auto update markdown TOC 2021-07-13 00:03:34 +00:00
Jawa_Juice
67ca9a7fc4 Update Airplane branches for 1.17 release (#968)
* Update branches for official 1.17/1.17.1 releases

* Reflect Airplane 1.17 release
2021-07-12 19:03:17 -05:00
itzg
9c9c295a79 docs: Auto update markdown TOC 2021-07-12 14:24:37 +00:00
silence_eternal
daa3292000 docs: Update README with watchdog disable for autopause (#967) 2021-07-12 09:24:20 -05:00
itzg
2da5e2b2ec docs: Auto update markdown TOC 2021-07-11 18:28:34 +00:00
Geoff Bourne
c5119ad27b docs: Clarified docker attach usage with interactive, color console 2021-07-11 13:28:17 -05:00
Geoff Bourne
4808507da8 Simplified and improved multi-version handling for Fabric
#964
2021-07-10 14:56:10 -05:00
Geoff Bourne
0fd43f5a05 Auto-merging via docker-versions-create 2021-07-09 19:57:21 -05:00
Geoff Bourne
11a286fe26 Bukkit/Spigot download URL switched by VERSION
#962
2021-07-09 19:55:46 -05:00
Geoff Bourne
fae6479453 Auto-merging via docker-versions-create 2021-07-08 17:58:19 -05:00
Bram Ceulemans
ca80b4730f Update start-deployAirplane (#960) 2021-07-08 17:56:06 -05:00
Geoff Bourne
d9df5bf773 Auto-merging via docker-versions-create 2021-07-08 08:02:40 -05:00
Geoff Bourne
80a8ce8a46 ci: removed merge-variants workflow since GHA won't trigger branch builds 2021-07-08 08:01:43 -05:00
itzg
13d7248c38 Auto-merging via docker-versions-create 2021-07-08 12:55:55 +00:00
Geoff Bourne
d804323cab Updated getbukkit download URL
#958
2021-07-08 07:55:31 -05:00
Geoff Bourne
3c54954057 Auto merge branch with master 2021-07-08 07:37:23 -05:00
itzg
84823a559d Auto-merging via docker-versions-create 2021-07-07 14:56:34 +00:00
Pascal Sthamer
cbaef446ac fix: don't echo double-double-quotes to server.properties (#954)
Using `sed`, we need to escape double quotes, but with `echo` we can just use the variable as-is.
Closes #949
2021-07-07 09:56:16 -05:00
itzg
d543df768b Auto-merging via docker-versions-create 2021-07-06 12:22:19 +00:00
NyCode
8aa1312ae2 Fix typo: tunity -> tuinity (#951) 2021-07-06 07:22:01 -05:00
itzg
74968389a2 Auto-merging via docker-versions-create 2021-07-05 12:10:23 +00:00
dependabot[bot]
7ec09fcfe9 build(deps): bump docker/build-push-action from 2.5.0 to 2.6.1 (#950) 2021-07-05 07:09:06 -05:00
itzg
1701718515 Auto-merging via docker-versions-create 2021-07-04 19:53:56 +00:00
itzg
c090095e08 docs: Auto update markdown TOC 2021-07-04 19:53:56 +00:00
Geoff Bourne
f24bc00eb9 docs: link to data directory section from level / world save name section 2021-07-04 14:53:36 -05:00
Geoff Bourne
ed6937654c Auto-merging from master 2021-07-03 14:22:14 -05:00
Geoff Bourne
f91ee5d245 ci: fixed publishing of latest image for master branch only
#946
2021-07-03 14:16:10 -05:00
Geoff Bourne
73eb6e2e45 Auto-merge from master 2021-07-02 15:52:08 -05:00
Geoff Bourne
dd6700e659 ci: removed branch name qualifier in gha caching 2021-07-02 15:46:40 -05:00
itzg
8b982472a4 Auto-merging via docker-versions-create 2021-07-02 16:55:49 +00:00
Austin Keller
ca8a27babe Fix unquoted COPY_MODS_DEST and COPY_CONFIG_DEST variables (#942) 2021-07-02 11:55:34 -05:00
itzg
19cc894662 docs: Auto update markdown TOC 2021-06-28 12:13:58 +00:00
itzg
ab406727d6 Auto-merging via docker-versions-create 2021-06-28 12:13:57 +00:00
Audition-CSBlock
15320f0eb2 improve readme (#939) 2021-06-28 07:13:40 -05:00
itzg
5fc74a45f7 Auto-merging via docker-versions-create 2021-06-27 13:13:05 +00:00
itzg
af758af51a docs: Auto update markdown TOC 2021-06-27 13:13:05 +00:00
Pascal Sthamer
9d231801da Allow to enable the whitelist without modifying the whitelist file (#937) 2021-06-27 08:12:51 -05:00
itzg
33c2154a98 docs: Auto update markdown TOC 2021-06-24 12:47:02 +00:00
itzg
17ecd48cd8 Auto-merging via docker-versions-create 2021-06-24 12:46:59 +00:00
Jawa_Juice
f890b316da Correct AirplanePurpur branch name (#936) 2021-06-24 07:46:40 -05:00
Geoff Bourne
4732ce27a6 Auto-merging via docker-versions-create 2021-06-23 22:32:34 -05:00
itzg
2e4cf0b731 docs: Auto update markdown TOC 2021-06-24 03:30:11 +00:00
Jawa_Juice
f5a319b0b3 Move to new Airplane download system (#933)
Co-authored-by: Jawa-Juice <Jawa-Juice@users.noreply.github.com>
2021-06-23 22:29:58 -05:00
Geoff Bourne
2533d2c694 ci: merge-variants: revert previous change 2021-06-23 22:29:24 -05:00
Geoff Bourne
b1fed81821 ci: merge-variants: skip any workflow changes 2021-06-23 22:24:12 -05:00
Geoff Bourne
0064c0357f ci: merge-variants: fetch all history and batch mode 2021-06-23 22:11:41 -05:00
Geoff Bourne
20cd8cce1d ci: fixed typo in calling docker-versions-create.sh 2021-06-23 22:07:32 -05:00
Geoff Bourne
bc8af2784f ci: added merge-variants workflow 2021-06-23 21:57:32 -05:00
Geoff Bourne
e300810a16 ci: fixed repo name in workflows conditional 2021-06-23 21:20:37 -05:00
Geoff Bourne
33b48a8a4b ci: used ${{ }} syntax in job conditional 2021-06-23 21:09:20 -05:00
Geoff Bourne
6f2f1174e6 ci: limited build-multiarch workflow to itzg's 2021-06-23 21:07:22 -05:00
Geoff Bourne
adbe75ae7e ci: limits generate-toc workflow to itzg's 2021-06-23 21:06:29 -05:00
itzg
dae2add713 docs: Auto update markdown TOC 2021-06-22 23:39:21 +00:00
Christoph Mittermaier
38946fd294 fixed typo in readme (#932) 2021-06-22 18:39:05 -05:00
Geoff Bourne
6e10768e7f ci: test java8 with VERSION=1.16.5 2021-06-20 13:49:02 -05:00
Geoff Bourne
bb47a3705d Auto merge branch with master 2021-06-20 12:46:28 -05:00
Geoff Bourne
c3e1e92547 Auto-merging via docker-versions-create 2021-06-20 12:46:25 -05:00
Duncan X Simpson
047ef107ae Modify start-deployFTBA to allow Fabric FTB packs (#926)
Fixes #912

Co-authored-by: Duncan X Simpson <duncan@k7dxs.net>
2021-06-20 12:27:18 -05:00
basisbit
1bb2f92f5b Workaround: Change default RELEASE of Yatopia (#922) 2021-06-16 07:34:38 -05:00
itzg
727a1f29d1 docs: Auto update markdown TOC 2021-06-09 12:35:19 +00:00
Jawa_Juice
012bd3a307 Support Java versions above 11 for Airplane (#917) 2021-06-09 07:35:00 -05:00
itzg
ae5b19b0aa docs: Auto update markdown TOC 2021-06-07 01:38:43 +00:00
Jawa_Juice
81d9c55eee Reflect Pupur's removal of Airplane patches (#910) 2021-06-06 20:38:29 -05:00
Geoff Bourne
9ddd768f44 Auto-merging via docker-versions-create 2021-06-05 17:49:30 -05:00
Erik Selberg
90cfe0e151 fix bad find statement in CurseForge handling (#901)
Co-authored-by: Erik Selberg <erik.selberg@grabtaxi.com>
Co-authored-by: Geoff Bourne <itzgeoff@gmail.com>
2021-06-05 17:46:59 -05:00
dependabot[bot]
491800280c build(deps): bump docker/build-push-action from 2.4.0 to 2.5.0 (#904) 2021-06-01 12:33:42 -05:00
dependabot[bot]
d60c2e0815 build(deps): bump actions/cache from 2.1.5 to 2.1.6 (#903) 2021-05-31 08:03:12 -05:00
dependabot[bot]
fb0babe261 build(deps): bump docker/setup-qemu-action from 1.1.0 to 1.2.0 (#902) 2021-05-31 08:02:39 -05:00
Geoff Bourne
62e1ff8ffa Restored correct ps usage for autopause in Alpine
#897
2021-05-27 08:22:17 -05:00
Niek Candaele
e6bc8abdc1 fix: update Sky Factory version link (#898) 2021-05-27 07:41:05 -05:00
Geoff Bourne
5f95d135f5 Auto-merging via docker-versions-create 2021-05-24 20:49:44 -05:00
tonymmm1
fbee644b4e Fix Forge download (#890) 2021-05-24 20:47:51 -05:00
Geoff Bourne
aaf327b308 Added SETUP_ONLY option
#878
2021-05-23 12:39:21 -05:00
itzg
d404e0f50e docs: Auto update markdown TOC 2021-05-23 17:29:03 +00:00
Geoff Bourne
c5bb83c6d0 ci: deprecated java15 since java16 is now primary 2021-05-23 12:28:42 -05:00
Geoff Bourne
8e32d26b0f Merge branch 'master' into java8 2021-05-23 12:26:33 -05:00
Geoff Bourne
8bf3b64831 ci: changed build flavor latest=true 2021-05-23 12:24:13 -05:00
Geoff Bourne
573f064970 Merge from master 2021-05-22 12:58:53 -05:00
Geoff Bourne
9ff04f8637 ci: auto 'latest' tag on master 2021-05-22 10:48:44 -05:00
itzg
dd7953ab4c docs: Auto update markdown TOC 2021-05-22 13:59:05 +00:00
Geoff Bourne
23fde3387a docs: group related mods and worlds sections 2021-05-22 08:58:42 -05:00
Geoff Bourne
0bc6f4075b Auto-merging via docker-versions-create 2021-05-21 23:01:07 -05:00
Geoff Bourne
ecbdb2b18d ci: use flavor config in docker meta 2021-05-21 23:00:27 -05:00
Geoff Bourne
4ebcc0ef48 Auto-merging via docker-versions-create 2021-05-21 22:47:21 -05:00
itzg
373921777a docs: Auto update markdown TOC 2021-05-22 03:44:27 +00:00
Geoff Bourne
2f489b04ae docs: replaced openj9-11 with java11-openj9 2021-05-21 22:40:29 -05:00
Geoff Bourne
a2c393ccc5 docs: added java8-openj9 in place of openj9 image tag 2021-05-21 22:34:45 -05:00
itzg
73a11c91d2 docs: Auto update markdown TOC 2021-05-22 03:28:50 +00:00
Geoff Bourne
8673f919fd docs: adjusted image version mentioned for RaspberryPi 2021-05-21 22:28:32 -05:00
Geoff Bourne
1e32161652 ci: fixed pr test builds for buildkit 2021-05-21 22:24:31 -05:00
Geoff Bourne
57720cf394 Merge branch 'master' into java8 2021-05-21 22:15:35 -05:00
itzg
38eb769c1b docs: Auto update markdown TOC 2021-05-22 03:12:47 +00:00
Geoff Bourne
5e372ed9f4 docs: added java11 tag to README 2021-05-21 22:12:29 -05:00
Geoff Bourne
e027a81317 ci: add java11 to build/merge 2021-05-21 22:05:59 -05:00
itzg
0a51713bd7 docs: Auto update markdown TOC 2021-05-22 03:05:38 +00:00
FW
d5cde03db1 Update Mohist URLs (#887) 2021-05-21 22:05:22 -05:00
Geoff Bourne
449f2bfa09 ci: adjusted multiarch build for java8-multiarch 2021-05-21 17:28:25 -05:00
Geoff Bourne
c9815e2ccb ci: use CACHE_NAME in main.yml 2021-05-21 17:20:35 -05:00
Geoff Bourne
64b2783f19 ci: restored changes for java8 2021-05-21 17:18:57 -05:00
Geoff Bourne
1dbdd7628a Merge branch 'master' into java8 2021-05-21 17:04:24 -05:00
Geoff Bourne
4252ec710f ci: use CACHE_NAME in main.yml 2021-05-21 17:04:11 -05:00
Geoff Bourne
11d455c284 Merge branch 'master' into java8
# Conflicts:
#	Dockerfile
2021-05-21 17:02:17 -05:00
itzg
9bd6bc64b0 docs: Auto update markdown TOC 2021-05-21 22:01:17 +00:00
Geoff Bourne
a5fe016854 docs: added edge tag to image versions section 2021-05-21 17:00:58 -05:00
itzg
93cd299c77 docs: Auto update markdown TOC 2021-05-21 21:59:13 +00:00
Geoff Bourne
e8f8d8b4d4 ci: introduced CACHE_NAME 2021-05-21 16:58:52 -05:00
Geoff Bourne
b806ea6871 docs: adoptopenjdk:16-openj9 is only available on amd64
#885
2021-05-21 16:53:22 -05:00
Geoff Bourne
cb17180dea ci: updated build action for java16-openj9
#885
2021-05-21 16:45:33 -05:00
Geoff Bourne
78ec4ba2a7 ci: multiarch build reference master branch 2021-05-21 07:59:04 -05:00
Geoff Bourne
317104de30 ci: fixed multiarch 'master' branch trigger 2021-05-21 07:46:58 -05:00
itzg
63412975c3 docs: Auto update markdown TOC 2021-05-21 12:45:51 +00:00
Geoff Bourne
9c87f8749d docs: updated README for latest=16 2021-05-21 07:40:46 -05:00
Geoff Bourne
5fc36516f4 ci: switch 'latest/master' build to multiarch 2021-05-21 07:39:59 -05:00
Geoff Bourne
c608c8a57e Merge branch 'master' into java16 2021-05-21 07:31:12 -05:00
Geoff Bourne
853a9884d7 ci: force apk update 2021-05-21 06:57:19 -05:00
Geoff Bourne
ecafaf4ea1 ci: force rebuild of latest 2021-05-21 06:51:17 -05:00
Geoff Bourne
eb490e92c3 ci: force rebuild of latest 2021-05-21 06:50:04 -05:00
Geoff Bourne
98c7e43927 ci: prefixed TOC commit message 2021-05-19 20:47:48 -05:00
Geoff Bourne
d8786d4785 Auto-merging via docker-versions-create 2021-05-19 20:31:17 -05:00
Geoff Bourne
08bc419dc8 Auto-merging via docker-versions-create 2021-05-19 20:27:11 -05:00
Geoff Bourne
02181021ce ci: avoid mix of tags and tags-ignore 2021-05-19 20:26:28 -05:00
Geoff Bourne
67c23017d0 Auto-merging via docker-versions-create 2021-05-19 20:24:31 -05:00
Geoff Bourne
fa60f8c16e ci: exclude java8 from multiarch builds 2021-05-19 20:23:12 -05:00
Geoff Bourne
6e1ba3667c Auto-merging via docker-versions-create 2021-05-19 20:18:57 -05:00
itzg
3084a2f409 Auto update markdown TOC 2021-05-20 01:17:12 +00:00
Stealthii
f473cfc6f2 Add support for Canyon server for b1.7.3 (#879) 2021-05-19 20:16:57 -05:00
Geoff Bourne
8a34aa5c45 Auto-merging via docker-versions-create 2021-05-15 12:43:57 -05:00
Geoff Bourne
0c2f8b903b Auto-merging via docker-versions-create 2021-05-15 12:40:56 -05:00
Geoff Bourne
cc204c297f Fixed REMOVE_OLD_MODS with SPIGET_RESOURCES
#834
2021-05-15 12:39:48 -05:00
Geoff Bourne
bb210ff59e Merge branch 'multiarch' into java16
# Conflicts:
#	.github/workflows/build-multiarch.yml
#	Dockerfile
2021-05-14 18:04:56 -05:00
Geoff Bourne
671e84bec9 ci: use docker/metadata-action 2021-05-14 17:48:17 -05:00
Geoff Bourne
fc2ba2df32 Merge branch 'master' into multiarch 2021-05-14 17:37:30 -05:00
dependabot[bot]
e5bee8e79b build(deps): bump docker/build-push-action from 2 to 2.4.0 (#866)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 2 to 2.4.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v2...v2.4.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-14 17:18:58 -05:00
Geoff Bourne
1b13ddcf32 Added start-server.sh as detected CurseForge entry script 2021-05-14 17:17:07 -05:00
itzg
de707049d4 Auto update markdown TOC 2021-05-14 13:06:27 +00:00
Giles Knap
e95ae2dbbb fix helm chart links (#873) 2021-05-14 08:06:08 -05:00
itzg
4606c27cdc Auto update markdown TOC 2021-05-14 03:52:02 +00:00
W4ff1e
ba88bf72ce Updated examples to version 3.8 (#872) 2021-05-13 22:51:47 -05:00
dependabot[bot]
75967cec02 build(deps): bump actions/cache from 2 to 2.1.5 (#870) 2021-05-14 01:47:19 +00:00
dependabot[bot]
0a35f661bd build(deps): bump actions/checkout from 2.2.0 to 2.3.4 (#869) 2021-05-14 01:45:43 +00:00
dependabot[bot]
f141806fb4 build(deps): bump stefanzweifel/git-auto-commit-action from 4 to 4.11.0 (#868) 2021-05-14 01:39:04 +00:00
dependabot[bot]
d80f40075c build(deps): bump docker/setup-qemu-action from 1 to 1.1.0 (#867) 2021-05-13 02:10:17 +00:00
itzg
44dbe80096 Auto update markdown TOC 2021-05-13 01:59:18 +00:00
Geoff Bourne
c7546ef08a docs: Clarified the default type and version of Minecraft server
#863
2021-05-12 20:59:02 -05:00
itzg
6fe5bb4aa8 Auto update markdown TOC 2021-05-13 01:41:49 +00:00
Geoff Bourne
589a9aa3db Added support for directories in MODS
#871
2021-05-12 20:41:28 -05:00
Geoff Bourne
2c8d1a9255 Merge branch 'master' into java16 2021-05-12 11:33:39 -05:00
Geoff Bourne
a8c11c0cdb Add java16 branch/image-tag
#864
2021-05-12 11:32:40 -05:00
itzg
34ae93f379 Auto update markdown TOC 2021-05-12 16:29:05 +00:00
Geoff Bourne
bd57d291c1 ci: Preparing for java16 image tag
#864
2021-05-12 11:28:44 -05:00
Geoff Bourne
7310daf51d Auto-merging via docker-versions-create 2021-05-06 20:17:59 -05:00
Geoff Bourne
78d9d888db Auto-merging via docker-versions-create 2021-05-06 20:16:34 -05:00
Geoff Bourne
b9335d9cd6 Auto-merging via docker-versions-create 2021-05-06 20:12:25 -05:00
itzg
bccdc7f5e8 Auto update markdown TOC 2021-05-06 21:27:45 +00:00
picapi
3854526389 Support local paths for modpacks / mods (#858) 2021-05-06 16:27:30 -05:00
Geoff Bourne
74072847ca docs: Added world-copy-compose-project diagram 2021-05-02 18:31:08 -05:00
Geoff Bourne
c5857bfc0b ci: ignore md files for regular build trigger 2021-05-01 17:39:35 -05:00
Geoff Bourne
8b380894f9 ci: gitignore the gh-md-toc script 2021-05-01 17:36:53 -05:00
itzg
b090737162 Auto update markdown TOC 2021-05-01 22:34:32 +00:00
Geoff Bourne
476abc9dad docs: Added table of contents
#845
2021-05-01 17:34:12 -05:00
Geoff Bourne
a2cbf07b6d Auto-merging via docker-versions-create 2021-04-30 14:30:52 -05:00
Geoff Bourne
2a67344b93 Auto-merging via docker-versions-create 2021-04-30 14:29:57 -05:00
Geoff Bourne
0d92092b90 Auto-merging via docker-versions-create 2021-04-30 14:27:40 -05:00
Tyler Heucke
9ecb617d2e allow mods with "forge" in name for cf modpacks (#853) 2021-04-30 14:26:05 -05:00
Geoff Bourne
9381776345 Auto-merging via docker-versions-create 2021-04-30 11:14:59 -05:00
Geoff Bourne
5a47bb11ba Auto-merging via docker-versions-create 2021-04-30 11:13:53 -05:00
Geoff Bourne
e653a41b3f Auto-merging via docker-versions-create 2021-04-30 11:11:19 -05:00
Tyler Heucke
4be4fc4808 Corrected locating of CF modpack server jar when not using server script (#852) 2021-04-30 11:05:56 -05:00
Geoff Bourne
d939be28e6 Auto-merging via docker-versions-create 2021-04-28 16:55:54 -05:00
Geoff Bourne
bb8c7756c7 Auto-merging via docker-versions-create 2021-04-28 16:54:26 -05:00
Geoff Bourne
82e63c54c4 Auto-merging via docker-versions-create 2021-04-28 16:50:55 -05:00
Krzysztof Zdulski
3261fbd7e9 Support FTP servers for file downloads (#850) 2021-04-28 16:44:39 -05:00
Geoff Bourne
7164d2b885 Fixed REMOVE_OLD_MODS when directories not present
#851
2021-04-28 16:29:47 -05:00
Geoff Bourne
185fccf712 Auto-merging via docker-versions-create 2021-04-26 08:23:48 -05:00
Geoff Bourne
0c860ade12 Auto-merging via docker-versions-create 2021-04-26 08:22:56 -05:00
Geoff Bourne
f9c573f598 Auto-merging via docker-versions-create 2021-04-26 08:20:41 -05:00
Geoff Bourne
cfb2739cd9 Normalized on TYPE=CURSEFORGE for server properties logic, etc
#843
2021-04-26 08:19:50 -05:00
Geoff Bourne
b1bb3f38f3 Allowed combining of REMOVE_OLD_MODS and SPIGET_RESOURCES with /plugins mount
#834
2021-04-24 14:06:31 -05:00
Geoff Bourne
0f0017b02d Auto-merging via docker-versions-create 2021-04-24 13:45:24 -05:00
Geoff Bourne
a99f7a494b Auto-merging via docker-versions-create 2021-04-24 13:44:29 -05:00
Geoff Bourne
bf8b9cf20d Auto-merging via docker-versions-create 2021-04-24 13:42:07 -05:00
Geoff Bourne
65b3997e72 Fixed locating of CF modpack server jar when not using server script
#842
2021-04-24 13:41:18 -05:00
Geoff Bourne
5e8f947ce5 Auto-merging via docker-versions-create 2021-04-23 21:06:22 -05:00
Geoff Bourne
3e9308d315 Auto-merging via docker-versions-create 2021-04-23 21:05:23 -05:00
Geoff Bourne
0dd5a412d9 Auto-merging via docker-versions-create 2021-04-23 21:02:46 -05:00
Geoff Bourne
5f48a4e5e5 Update FTB/CF handling of SERVER_PROPERTIES to allow spaces
#843
2021-04-23 21:01:50 -05:00
Geoff Bourne
e593ca4bda Auto-merging via docker-versions-create 2021-04-18 13:33:22 -05:00
Geoff Bourne
b731eaaffb Auto-merging via docker-versions-create 2021-04-18 13:32:03 -05:00
Geoff Bourne
b389561091 Auto-merging via docker-versions-create 2021-04-18 13:29:12 -05:00
Bartosz Stefańczyk
75f5a430e4 Replace env variables in *.hjson and *.json (#833) 2021-04-18 13:26:33 -05:00
Geoff Bourne
e0c721585e docs: documented COPY_CONFIG_DEST 2021-04-17 19:12:43 -05:00
Jakob Sjælland
da21c2e0a7 Added COPY_MODS_DEST env variable (#831) 2021-04-12 20:24:12 -05:00
Geoff Bourne
2b989e4c39 Added Spiget support for Purpur, Tuinity, Airplane
#824
2021-04-12 20:21:53 -05:00
Geoff Bourne
6ee055761d Merge branch 'master' into java8 2021-04-11 10:41:32 -05:00
Geoff Bourne
7d6c80b941 Added support for CF modpacks with install.sh
#829
2021-04-11 10:36:17 -05:00
Geoff Bourne
a3039eea12 Auto-merging via docker-versions-create 2021-04-11 10:12:35 -05:00
Geoff Bourne
cbf9577a24 Auto-merging via docker-versions-create 2021-04-11 10:11:28 -05:00
Geoff Bourne
49f9ff645e Auto-merging via docker-versions-create 2021-04-11 10:08:47 -05:00
Jawa_Juice
70ea32e89d Add option for Flare flags (#827) 2021-04-09 12:25:51 -05:00
Geoff Bourne
10a3037ab3 Merged latest from master 2021-04-08 19:32:07 -05:00
Geoff Bourne
9ccfca5061 Merged latest from master 2021-04-08 19:24:14 -05:00
Geoff Bourne
004cbdb9f7 Auto-merging via docker-versions-create 2021-04-08 19:12:56 -05:00
Jawa_Juice
52cbf1fb64 Add support for Airplane servers (#826) 2021-04-08 18:50:06 -05:00
Geoff Bourne
190e401452 Added EXEC_DIRECTLY, ENABLE_ROLLING_LOGS, and SKIP_SUDO options
#820
2021-04-02 18:23:05 -05:00
Geoff Bourne
b881a27c8d docs: added openj9 specific options 2021-04-01 22:08:36 -05:00
Geoff Bourne
6fab527eed Auto-merging via docker-versions-create 2021-04-01 16:40:48 -05:00
Geoff Bourne
9690832247 Auto-merging via docker-versions-create 2021-04-01 16:39:46 -05:00
Geoff Bourne
45856a1a81 Auto-merging via docker-versions-create 2021-04-01 16:30:55 -05:00
Geoff Bourne
60a68963a8 Added git
#819
2021-04-01 16:28:50 -05:00
Geoff Bourne
e5948081a7 Added git
#819
2021-04-01 16:27:50 -05:00
Geoff Bourne
7aa47e2a60 Remove existing world data when FORCE_WORLD_COPY (#816) 2021-03-29 21:14:21 -05:00
Geoff Bourne
327538a98f docs: shifted timezone info later 2021-03-27 18:49:58 -05:00
Geoff Bourne
f6c71e27d8 docs: described converting anonymous data volume 2021-03-27 18:47:42 -05:00
Geoff Bourne
4628da7ea2 docs: Fixed alternate exposed port example 2021-03-27 18:39:22 -05:00
Geoff Bourne
02ba96c421 docs: Added -it to initial examples 2021-03-27 18:38:43 -05:00
Geoff Bourne
87f6fe6b20 Fixed $LEVEL path in directory structure diagram 2021-03-26 19:11:38 -05:00
Geoff Bourne
8049bd5b80 docs: Lots of cleanup about /data path and management of mods and plugins related to that 2021-03-21 15:35:12 -05:00
Geoff Bourne
5225ba06c8 Added support for spiget to download Spigot/Bukkit/Paper plugins
#808
2021-03-21 11:43:21 -05:00
Geoff Bourne
d695fc3fbc Disable whitelist server property when WHITELIST empty and overriding
#806
2021-03-21 10:12:35 -05:00
Geoff Bourne
a2132292ac Separated OVERRIDE_OPS|WHITELIST from OPS|WHITELIST logic
#806
2021-03-18 20:00:30 -05:00
Geoff Bourne
1e615e76e8 Merge branch 'master' into java8
# Conflicts:
#	start-configuration
#	start-deployCF
2021-03-18 19:58:16 -05:00
Geoff Bourne
c31b191b96 Removed "dot output" when running forge installer for CF modpacks
#800
2021-03-18 19:56:40 -05:00
Geoff Bourne
c4b573f608 docs: Clarified disabling of max tick watchdog for autopause
#555
2021-03-14 16:18:43 -05:00
Geoff Bourne
28810fcba3 Added support for CF modpacks using settings.cfg
#772 #800
2021-03-14 15:03:27 -05:00
Geoff Bourne
1c85a685de Added support for CF modpacks using settings.cfg
#772 #800
2021-03-14 15:02:40 -05:00
Geoff Bourne
8d1989a595 docs: Added more info about getbukkit's weird 1.8 file naming
#103
2021-03-13 16:55:50 -06:00
Geoff Bourne
7cd207f40b docs: Added more info about getbukkit's weird 1.8 file naming
#103
2021-03-13 16:54:56 -06:00
miki164
d022956e24 Fix typo in example docker-compose (#803) 2021-03-13 06:52:14 -06:00
Geoff Bourne
2bdaa4dc4e Updated java8 warning message for ClassCastException
#775
2021-03-12 17:22:54 -06:00
Geoff Bourne
46bfbaada1 Upgraded mc-monitor to 0.7.1 to fix ProtocolSupport response
#796
2021-03-12 09:27:44 -06:00
Geoff Bourne
140a8aa90c Merge branch 'master' into java8 2021-03-11 19:40:26 -06:00
Geoff Bourne
e659343821 Improved locating of forge server jar created by installer
#799
2021-03-11 19:40:11 -06:00
Geoff Bourne
76dcff9d18 Merge branch 'master' into java8 2021-03-11 17:23:48 -06:00
Geoff Bourne
44138564b0 Added debug output for deployCustom
#799
2021-03-11 16:29:21 -06:00
Geoff Bourne
3c77abbbab Added debug output for deployForge and minecraftFinalSetup
#799
2021-03-11 16:21:59 -06:00
Geoff Bourne
209c6e6dab Added explicit -dir for Fabric installer
#797
2021-03-11 15:36:34 -06:00
Geoff Bourne
6fa827e9a1 Fixed usage of EXTRA_ARGS
#798
2021-03-11 15:08:26 -06:00
Geoff Bourne
cd3ea7fd2e Upgraded mc-monitor to 0.7.0
#795
2021-03-09 22:13:33 -06:00
Geoff Bourne
d3bd697cb2 Fixed warning reported when no paper jars to remove 2021-03-09 22:05:21 -06:00
Geoff Bourne
6c6bf030c5 docs: Added troubleshooting info for rpi
#795
2021-03-07 13:06:45 -06:00
Geoff Bourne
6e2b3ae0c7 docs: Added java15-openj9 2021-03-06 17:31:16 -06:00
Geoff Bourne
9915929340 ci: Added java15-openj9 2021-03-06 16:53:46 -06:00
Geoff Bourne
298bf5fb0a Merge branch 'master' into multiarch 2021-03-06 16:27:57 -06:00
Geoff Bourne
6ae431b2f0 Merge branch 'master' into java15 2021-03-06 16:25:21 -06:00
Geoff Bourne
a9a86d249b Merge branch 'master' into java8
# Conflicts:
#	start-configuration
2021-03-06 16:23:07 -06:00
Geoff Bourne
44769b6001 Shifted PATH-fix earlier in startup 2021-03-06 16:06:43 -06:00
Geoff Bourne
ebabfeb669 Shifted PATH-fix earlier in startup 2021-03-06 16:05:01 -06:00
Geoff Bourne
595760d301 Shifted PATH-fix earlier in startup 2021-03-06 16:04:06 -06:00
Geoff Bourne
5c1f176848 Shifted PATH-fix earlier in startup 2021-03-06 16:03:37 -06:00
Geoff Bourne
4186cfd91c Auto-merging via docker-versions-create 2021-02-27 20:56:01 -06:00
Geoff Bourne
457e9b53c7 Auto-merging via docker-versions-create 2021-02-27 20:55:30 -06:00
Geoff Bourne
6d3f194ce3 Merge from master 2021-02-27 20:47:00 -06:00
Geoff Bourne
861aec6bd6 Added option for MOHIST_BUILD
#781
2021-02-27 20:37:59 -06:00
Geoff Bourne
21572d3547 Ensure FTBA version.json is readable
#784
2021-02-27 17:03:37 -06:00
Geoff Bourne
89afba7437 Ensure FTBA version.json is readable
#784
2021-02-27 17:03:09 -06:00
Geoff Bourne
53f5fbb77f docs: Fixed examples of quoting SEED and MOTD
#782
2021-02-27 11:05:16 -06:00
Geoff Bourne
9299f00d20 Pre-process special characters in REPLACE_ENV_VARIABLES
#718
2021-02-25 19:07:16 -06:00
Geoff Bourne
e5e97a3560 Use file to speed up removal of old PaperMC server jars
#779
2021-02-23 20:04:34 -06:00
Geoff Bourne
32bc0382d6 Only show skipped properties when debugging 2021-02-21 14:36:03 -06:00
Geoff Bourne
fa53abdfb7 Add missing server.properties when needed
#776
2021-02-21 14:32:41 -06:00
Geoff Bourne
0cbfb81b4c misc: Removed debug 2021-02-20 17:35:26 -06:00
Geoff Bourne
d47c801b18 Separated JMX_BINDING from JMX_HOST in ENABLE_JMX usage 2021-02-20 17:34:00 -06:00
Geoff Bourne
c056b9d2dd Improved handling of ENV_VARIABLE_PREFIX
#718
2021-02-20 17:30:50 -06:00
Geoff Bourne
92a15ea85d Updated forge examples to use java8 image
#770
2021-02-15 10:21:42 -06:00
Fersandi Pratama
6fe022ccc8 Fix README: volume should be in list (#767) 2021-02-13 12:24:58 -06:00
Geoff Bourne
21c1620f0c misc: java is actually found in /usr/bin by default 2021-02-11 15:05:45 -06:00
Geoff Bourne
f397dd71a9 Fix PATH to include java when needed 2021-02-11 14:52:51 -06:00
Geoff Bourne
b71eb666a7 Fix PATH to include java when needed
#749
2021-02-10 15:11:07 -06:00
Geoff Bourne
02e0a47a52 Merge branch master 2021-02-10 14:58:33 -06:00
Geoff Bourne
b176be942d Fix PATH to include java when needed 2021-02-10 14:52:16 -06:00
Geoff Bourne
e78e5af96d Fix PATH to include java when needed 2021-02-10 14:49:13 -06:00
Geoff Bourne
a2ab0d75ed Fix PATH to include java when needed 2021-02-10 14:46:09 -06:00
Geoff Bourne
60809fe5ad Merge from master
CONFLICT (content): Merge conflict in start-configuration
2021-02-10 14:08:21 -06:00
Geoff Bourne
51c5902db0 Merge from master
CONFLICT (content): Merge conflict in start-configuration
2021-02-10 14:06:10 -06:00
Geoff Bourne
0fb9700fc7 Auto-merging via docker-versions-create 2021-02-10 14:01:35 -06:00
Geoff Bourne
c48f6c31ce Missing EULA failed without proper log message
#749
2021-02-10 13:57:14 -06:00
Geoff Bourne
b2d23edf6d ci: Added pull:true to multiarch build 2021-02-08 21:27:25 -06:00
Geoff Bourne
18925ef32c Merged latest from master 2021-02-08 21:16:50 -06:00
Geoff Bourne
31f25cfd1b Added java8 recommendation to CURSEFORGE / FTB 2021-02-08 21:15:28 -06:00
Geoff Bourne
7d4e4c167e Added support for Yatopia
#704
2021-02-08 20:42:54 -06:00
Geoff Bourne
4a8e416fe1 Auto-merging via docker-versions-create
CONFLICT (content): Merge conflict in Dockerfile
2021-02-07 18:22:16 -06:00
Geoff Bourne
090e624ebc Auto-merging via docker-versions-create
CONFLICT (content): Merge conflict in Dockerfile
2021-02-07 18:20:35 -06:00
Geoff Bourne
f06b990f8a Auto-merging via docker-versions-create 2021-02-07 18:03:40 -06:00
LichLord91
eb12030975 Update Invalid Server Type Logging Message (#758)
Includes Tuinity and Purpur

Co-authored-by: lichlord91 <lichlord91@users.noreply.github.com>
2021-02-07 18:00:53 -06:00
Geoff Bourne
e46af9d54c Fixed vanilla version lookup to fail early
#756
2021-02-07 17:58:50 -06:00
Geoff Bourne
861faaa285 Trimmed back some ENV defaults from Dockerfile 2021-02-07 17:52:42 -06:00
Geoff Bourne
8312233a93 Added support for Purpur servers
#746
2021-02-07 11:22:08 -06:00
Geoff Bourne
75844ae81a Fix java8 base image to actually be Java 8
#753
2021-02-07 11:10:38 -06:00
Geoff Bourne
959bf73485 Limit depth when finding old PaperMC server jars
Fixes #750
2021-02-07 09:26:37 -06:00
Geoff Bourne
ce4efd0b70 Auto-merging docker-versions-create.sh
CONFLICT (content): Merge conflict in Dockerfile
2021-02-07 09:16:33 -06:00
Geoff Bourne
c8dc751b82 Auto-merging docker-versions-create.sh
CONFLICT (content): Merge conflict in Dockerfile
2021-02-07 09:15:01 -06:00
Geoff Bourne
6bb2323c46 Auto-merging docker-versions-create.sh
CONFLICT (content): Merge conflict in docker-versions-create.sh
Auto-merging README.md
CONFLICT (content): Merge conflict in README.md
Automatic merge failed; fix conflicts and then commit the result.
2021-02-07 09:07:30 -06:00
Geoff Bourne
beeaf1a996 ci: Added java8-multiarch to build and docs 2021-02-06 15:48:27 -06:00
Geoff Bourne
f856276d71 Upgraded multiarch to Java 11 2021-02-06 15:22:15 -06:00
Geoff Bourne
0300854c46 Merge branch 'master' into multiarch 2021-02-06 15:21:53 -06:00
Geoff Bourne
96aa1054dc Upgraded mainline/latest to Java 11 2021-02-06 15:21:20 -06:00
Geoff Bourne
7c862df92a Merge branch 'master' into java15 2021-02-06 15:12:45 -06:00
Geoff Bourne
e7937206af ci: Added java15 to multiarch build 2021-02-06 15:12:34 -06:00
Geoff Bourne
e49c1c2f01 Merge branch 'master' into java15 2021-02-06 15:11:34 -06:00
Geoff Bourne
081b2c11e4 ci: Introduced java15 branch
ci: Deprecated adopt13, adopt14, openj9-nightly
2021-02-06 15:11:03 -06:00
Geoff Bourne
f342f4aa98 ci: Introduced java15 branch
ci: Deprecated adopt13, adopt14, openj9-nightly
2021-02-06 15:07:42 -06:00
Geoff Bourne
57390b02ca Merge branch 'master' into java15 2021-02-06 14:53:02 -06:00
Geoff Bourne
f06e9f5ede Merge branch 'master' into multiarch 2021-02-06 14:52:35 -06:00
Geoff Bourne
4e73e69342 ci: Added build-multiarch.yml to align merges 2021-02-06 14:52:20 -06:00
Geoff Bourne
a698248dff ci: Based on adoptopenjdk:15-jre 2021-02-06 14:50:43 -06:00
Geoff Bourne
c6ff80b71c docs: Clarify MEMORY limits vs overall container memory
Related to #691
2021-02-01 21:15:33 -06:00
M*C*O
37cad3f255 docs: Document LEVEL_TYPE: BIOMESOP (#741) 2021-02-01 12:39:55 -06:00
Geoff Bourne
7814ca21b5 Merge branch 'master' into java8
# Conflicts:
#	README.md
#	start-configuration
2021-01-30 18:56:33 -06:00
Geoff Bourne
5700f36a6f Renamed forge branch to java8 2021-01-30 18:49:46 -06:00
Geoff Bourne
b8806629ec Merged latest from master 2021-01-30 16:48:11 -06:00
Geoff Bourne
4a7f838a0f Upgraded mainline/latest to Java 11 2021-01-30 16:16:36 -06:00
Geoff Bourne
34f800d815 ci: Added forge branch to builds 2021-01-30 16:02:15 -06:00
Geoff Bourne
2d07dee4df Prepared forge branch's Dockerfile 2021-01-30 15:58:03 -06:00
Geoff Bourne
b8ef6eba3f Auto-merging via docker-versions-create 2021-01-29 21:07:29 -06:00
Geoff Bourne
8d3ca813ed Auto-merging via docker-versions-create 2021-01-29 21:07:00 -06:00
Geoff Bourne
ffec50141a Fixed MODS provides from github release URLs
For #731
2021-01-28 20:55:08 -06:00
Geoff Bourne
54027049d3 docs: Added compose example to data attaching section 2021-01-24 12:31:56 -06:00
Geoff Bourne
4c2829e3d2 docs: Added a simple docker compose example 2021-01-21 13:36:41 -06:00
Geoff Bourne
69e308d420 Split eula header into two lines of comments
#728
- Found that https://github.com/Yoosk/ServerStarter hard coded expectation that eula property was on third line
2021-01-19 21:36:21 -06:00
Geoff Bourne
ad46f10b55 Added option to override whitelist and ops files
#726
2021-01-17 10:09:41 -06:00
Eugene
cd0fdfc95b Add an option to override the icon which already has been set. (#723) 2021-01-13 16:47:15 -06:00
Geoff Bourne
d95abfce82 ci: Added openj9-11 tags pattern 2021-01-12 17:33:03 -06:00
Geoff Bourne
942a125e04 ci: Added non-versioned cache as restore-key fallback 2021-01-12 17:30:58 -06:00
Geoff Bourne
cc5fe0859a Auto-merging via docker-versions-create 2021-01-12 17:28:33 -06:00
Geoff Bourne
e97a00e61d Auto-merging via docker-versions-create 2021-01-12 17:28:11 -06:00
Geoff Bourne
a3677d5aa8 ci: Enabled pull in build step 2021-01-12 17:20:57 -06:00
Geoff Bourne
f927933c46 Added openj9 JDK11 variant
For #721
2021-01-12 17:18:08 -06:00
Geoff Bourne
8f15aac6fc Merge branch 'multiarch' into multiarch-latest 2021-01-12 17:06:00 -06:00
Michael Kirsch
b519c43e16 fix multiarch autopause daemon (#722) 2021-01-12 16:05:12 -06:00
Geoff Bourne
5ab83bcb21 ci: Switched build to docker/build-push-action@v2 2021-01-09 14:13:18 -06:00
Geoff Bourne
84ce3b4b47 Merge branch 'multiarch' into multiarch-latest 2021-01-09 14:07:31 -06:00
Geoff Bourne
02c8393bc6 ci: Added opencontainers labels 2021-01-09 14:07:05 -06:00
Geoff Bourne
b07c43a32f Merge branch 'multiarch' into multiarch-latest 2021-01-09 12:31:20 -06:00
Geoff Bourne
9469291731 ci: Switched multiarch build caching to github actions 2021-01-09 12:28:27 -06:00
Geoff Bourne
ce1b337f7f Auto-merging via docker-versions-create 2021-01-09 11:25:38 -06:00
Geoff Bourne
c29baf446d Auto-merging via docker-versions-create 2021-01-09 11:24:53 -06:00
Dubhar
fdf5fb46bc fix/681 (#719)
* [shellcheck] prevent globbing

* fix/681 remove old PaperMC before downloading new

Fixes #681 

Co-authored-by: Dubhar <thorsten.jerosch@gmail.com>
2021-01-09 11:03:21 -06:00
Geoff Bourne
8c6ca5e999 Restored the ability for PAPERBUILD to be used with TYPE=PAPER
For #715
2021-01-07 20:03:42 -06:00
Geoff Bourne
bb2b9eeea9 docs: Changed FORGEVERSION example to use a valid combination
For #716
2021-01-07 11:02:19 -06:00
Geoff Bourne
d1cbce3f89 docs: Clarified usage of VERSION with FORGE type
For #716
2021-01-06 22:49:22 -06:00
Geoff Bourne
55b5f6821f Fixed ops and white-list setup for CurseForge modpacks named with spaces
For #717
2021-01-06 22:38:18 -06:00
Geoff Bourne
ee8e1b9322 Merged latest from master 2021-01-06 22:16:40 -06:00
Geoff Bourne
f9b8db0715 Merged master 2021-01-06 22:14:46 -06:00
Michael Kirsch
2fb01b4adf Autopause update: allow network interface selection (#711)
* Cherry-pick: Fixing AUTOPAUSE on Raspberry Pi 4s (#708)

* implement autopause interface selection

* concentrate ps calls in function file

* wording and add note about PAPER's etc watchdogs
2021-01-02 11:27:03 -06:00
Geoff Bourne
02bce8c3a8 docs: Documented adopt15 and multiarch-latest tags 2021-01-02 11:12:07 -06:00
Nathanial L. McConnell
468671a3fa Update README.md (#712)
Change "Please" to "Place"
2021-01-01 15:23:04 -06:00
Geoff Bourne
20bd5c4c36 Merge branch 'multiarch' into multiarch-latest 2020-12-31 13:19:34 -06:00
ErstBlack
ffb50cfe28 Fixing AUTOPAUSE on Raspberry Pi 4s (#708)
* Replacing killall with pkill and ps -a to ps -ax

* Adding net-tools and removing -q from pkill

* Missed the resume.sh

* Christ there's a lot of ps calls

* Adding -x to health.sh, replacing killall with pkill in sudoers-mv, and replacing su-exec with gosu in knockd-config.cfg

Co-authored-by: sean.sullivan.ctr@progeny.net <sean.sullivan.ctr@progeny.net>
2020-12-31 13:15:44 -06:00
Geoff Bourne
8ee650f38d Allowed CF_BASE_DIR/FTB_BASE_DIR to be configured
For #518
2020-12-31 13:11:37 -06:00
Geoff Bourne
3de2bf88df Escaped backslashes when setting server property value (#706)
* Escaped backslashes when setting server property value
For #446

* Fixed pattern substitution to "replace all"
2020-12-30 09:42:29 -06:00
Geoff Bourne
1fcbd8410f Allow CUSTOM_SERVER to reference not-yet-existing file from GENERIC_PACK
For #703
2020-12-29 10:56:05 -06:00
Geoff Bourne
de082d0fb2 Merge branch 'multiarch' into multiarch-latest 2020-12-28 11:44:41 -06:00
Geoff Bourne
51e6d5dfbd Added install of sudo
For #699
2020-12-28 11:42:54 -06:00
Geoff Bourne
3cc5cdbc06 Auto-merging via docker-versions-create 2020-12-27 22:08:29 -06:00
Geoff Bourne
842c69fd80 Auto-merging via docker-versions-create 2020-12-27 22:08:02 -06:00
Gabriel Fontes
d40bbdc3a5 Envvars in files from /config and /mods now replaced as expected (#701)
Envvars in files from `/config` and `/mods` now replaced as expected (#701)
2020-12-27 22:01:03 -06:00
Andrew Lambeth
c458823014 ignore duplicate entries in the targets array of version.json (#698) 2020-12-26 14:44:37 -06:00
aspro-at
61c291ae4e Fixed REMOVE_OLD_MODS with missing /data/mods or /data/plugins #667 (#697) 2020-12-23 13:25:14 -06:00
Geoff Bourne
b69ec47b18 Auto-merging via docker-versions-create 2020-12-19 08:26:49 -06:00
Geoff Bourne
32abf1614f Auto-merging via docker-versions-create 2020-12-19 08:26:24 -06:00
Geoff Bourne
f613228619 Restored support for PAPER_DOWNLOAD_URL
Fixes #687
2020-12-15 20:40:00 -06:00
Geoff Bourne
51fc8e824d Auto-merging via docker-versions-create 2020-12-15 14:00:33 -06:00
Geoff Bourne
a916cc8320 Auto-merging via docker-versions-create 2020-12-15 14:00:27 -06:00
Silthus
ca9f883352 feat: add COPY_CONFIG_DEST option (#689) 2020-12-15 13:31:51 -06:00
Silthus
9d68fa3b88 feat: improvde REMOVE_OLD_MODS option (#688) 2020-12-13 20:00:06 -06:00
Geoff Bourne
d3a5885d95 Fixed handling of query parameters in MODS url
For #684
2020-12-12 15:22:07 -06:00
Geoff Bourne
c1db13c1f6 Fixed dirname handling in find for SPIGOT WORLD handling
For #685
2020-12-12 11:10:13 -06:00
Mike Wilson
31b0f711b8 Fixing some spigot world import issues (#683)
* Fixing adding an existing spigot world and removing incorrectly identifying spigot worlds as multiple worlds

* Update start-finalSetupWorld

Co-authored-by: Geoff Bourne <itzgeoff@gmail.com>

Co-authored-by: Geoff Bourne <itzgeoff@gmail.com>
2020-12-12 08:26:32 -06:00
Geoff Bourne
59ca1ce3a6 Improved URL handling for GENERIC_PACK
For #684
2020-12-11 21:12:44 -06:00
Geoff Bourne
0f7bd5f4fd ci: Added adopt15 branch releases 2020-12-07 10:54:36 -06:00
Geoff Bourne
aff9031284 Merge branch 'multiarch' into multiarch-latest 2020-11-26 08:46:26 -06:00
Geoff Bourne
01130757d6 Reverting FTBA debug change 2020-11-26 08:45:51 -06:00
Geoff Bourne
397d080da2 Merge branch 'multiarch' into multiarch-latest 2020-11-25 21:36:48 -06:00
Geoff Bourne
f97b3bf82e Added error handling of FTB installer download
For #645
2020-11-25 21:36:22 -06:00
Geoff Bourne
cb5d052829 Merge branch 'multiarch' into multiarch-latest
# Conflicts:
#	.github/workflows/build-multiarch.yml
2020-11-25 16:09:23 -06:00
Geoff Bourne
b7bcd252d3 ci: Fixed tag extraction 2020-11-25 16:06:01 -06:00
Geoff Bourne
0908d21bed Merged from master 2020-11-25 16:01:42 -06:00
Geoff Bourne
aa43926da2 Merged from master 2020-11-25 15:59:43 -06:00
Geoff Bourne
a368f4cf57 misc: Added multiarch-latest to versions to release 2020-11-25 15:52:07 -06:00
Geoff Bourne
08a4bde6c1 Switched to PaperMC v2 API
Fixes #670
2020-11-25 15:42:27 -06:00
Geoff Bourne
f68e979229 docs: Improved appearance of Discord badge
For #481
2020-11-06 14:47:04 -06:00
Geoff Bourne
544b1f243d Removed invalid spigot/bukkit download along with debug of content
For #655
2020-11-04 17:04:57 -06:00
Geoff Bourne
391e807c78 Added debug logging of bukkit/spigot curl download
For #655
2020-11-03 16:49:38 -06:00
Geoff Bourne
4099cde737 Revert "Improved handling of bad spigot/bukkit downloads via temp file For #655"
This reverts commit e56a74dc
2020-11-03 16:47:46 -06:00
Marc Doughty
4d878985d4 Remove distro-provided JRE (#659)
We don't need Java 8 from Ubuntu, we have 15 from AdoptOpenJDK.
2020-11-03 06:33:19 -06:00
Geoff Bourne
e56a74dc81 Improved handling of bad spigot/bukkit downloads via temp file
For #655
2020-11-02 20:31:01 -06:00
Geoff Bourne
34c45ec883 Switched to latest Docker buildx github action 2020-10-31 14:59:28 -05:00
Geoff Bourne
72d7d4a65e Switched to latest Docker buildx github action 2020-10-31 14:48:51 -05:00
Geoff Bourne
cb0add3b90 Added github action match for multiarch-latest branch 2020-10-31 13:38:44 -05:00
Marc Doughty
71a48ce10f Convert to AdoptOpenJDK (#658) 2020-10-31 13:36:47 -05:00
Geoff Bourne
31b8535854 Added debug output for bukkit/sigot type
For #655
2020-10-30 17:03:13 -05:00
stevoh6
ed1bb73c22 Update deprecated LegacyJavaFixer path. (#648) 2020-10-14 21:21:40 -05:00
Paul1365972
b7ac28e902 IPv6 support for autopause (#646) 2020-10-11 13:27:59 -05:00
vatertime
3cb72797b6 Added AWS blurb to readme (#644)
* Added AWS blurb to readme

* moved section in readme

Co-authored-by: Chris Vater <chris.vater@johnsonfit.com>
2020-10-07 13:35:07 -05:00
Geoff Bourne
6f1f8d7806 Added use of REMOVE_OLD_MODS to /mods processing 2020-10-03 14:34:02 -05:00
Geoff Bourne
b06f1115d4 Added pruning of 'config' to CF modpack upgrade
Fixes #626
2020-09-27 10:27:46 -05:00
Geoff Bourne
777ad31de0 Resolve latest bukkit/spigot directly from getbukkit
Fixes #629 #631
2020-09-27 10:21:49 -05:00
Geoff Bourne
8b977f8786 Added adopt14 variant 2020-09-27 10:21:49 -05:00
Geoff Bourne
7c3139226c Changed Paper update process to check FORCE_REDOWNLOAD first
For #634
2020-09-16 17:09:16 -05:00
Geoff Bourne
0ddabf3089 Corrected Fabric installer variables in README 2020-09-10 16:25:29 -05:00
Geoff Bourne
6cfc7e45ef ci: prepared for adopt14 variant 2020-08-27 18:49:24 -05:00
Geoff Bourne
9ea675bc89 Improved handling of latest PaperMC version
Fixes #563
2020-08-25 21:44:36 -05:00
Geoff Bourne
42f90c8806 Added variable to configure stop duration
Fixes #617
2020-08-25 19:10:55 -05:00
Geoff Bourne
c8b6eac8fe Updated FTBA modpack ID instructions
Fixes #612
2020-08-23 20:40:47 -05:00
Bartosz Stefańczyk
d78272c1fa PaperSpigot is now known as Paper (#614) 2020-08-23 09:16:04 -05:00
Geoff Bourne
48ccdf128f Fixed CF_SERVER_MOD to handle spaces in the given filename
Updated USE_MODPACK_START_SCRIPT=false to support forge provided by pack
For #608
2020-08-18 20:44:11 -05:00
Geoff Bourne
2322dffd49 misc: Improved error log for missing Paper versions 2020-08-15 10:06:49 -05:00
Geoff Bourne
8a5e5bf01e Improved handling of missing Paper server version downloads
Fixes #607
2020-08-15 10:02:45 -05:00
Geoff Bourne
99ed83022e misc: added EOL config to .editorconfig 2020-08-12 20:47:52 -05:00
Geoff Bourne
07185534fb Upgraded to mc-server-runner 1.5.0 2020-08-09 13:28:36 -05:00
Geoff Bourne
9bacaa11d8 Auto-merging via docker-versions-create 2020-08-09 13:07:53 -05:00
Stephen Owen
4fe55b5a28 Added note on tweaking settings and using own map (#602) 2020-08-07 17:15:13 -05:00
Stephen Owen
bd503f224d Adds EULA to the 'quickstart' command in readme (#600)
* Adds EULA to the 'quickstart' command in readme

most people will start with the quickstart command, which won't work anymore now that EULA is required.  Modified the sample quickstart to include the new minimum params.

* Update README.md

Co-authored-by: Geoff Bourne <itzgeoff@gmail.com>

* Update README.md

Co-authored-by: Geoff Bourne <itzgeoff@gmail.com>

Co-authored-by: Geoff Bourne <itzgeoff@gmail.com>
2020-08-04 20:06:00 -05:00
Geoff Bourne
b5c91647ca Added testdata to dockerignore 2020-08-02 19:57:47 -05:00
Geoff Bourne
c359a0f2ac Changed MODPACK and MODS to only resolve effective URL when needed
For #592
2020-08-02 19:57:12 -05:00
Geoff Bourne
c7c4c7497a docs: Added test multiarch build instruction 2020-07-26 13:51:16 -05:00
Geoff Bourne
e442baab31 Added writing of eula file after FTBA modpack is installed (#550) 2020-07-26 13:50:57 -05:00
Geoff Bourne
8101c8b51c Merge branch 'master' into multiarch
Renamed to start-deployFTBA

# Conflicts:
#	start-configuration
#	start-deployCF
2020-07-26 13:47:17 -05:00
Geoff Bourne
49d9f4a89d Separated autopause config file location to keep scripts read-only 2020-07-26 13:22:07 -05:00
Geoff Bourne
aebe35c9d4 misc: Refactor writeEula 2020-07-26 13:19:45 -05:00
Geoff Bourne
a26361c79f misc: Renamed start-deployCF to align with multiarch branch 2020-07-26 13:07:30 -05:00
Geoff Bourne
eba1ef6ab9 Auto-merging via docker-versions-create
# Conflicts:
#	start-deployFTB
#	start-minecraftFinalSetup
2020-07-26 08:35:13 -05:00
Paul Zühlcke
a486458a08 Fixed "REPLACE_ENV_VARIABLES_EXCLUDE_PATHS" breaking cfg replacer when set. (#598) 2020-07-26 08:20:11 -05:00
nrgbistro
82b8401414 More filenames for modpack start scripts (#596) 2020-07-23 14:29:39 -05:00
Geoff Bourne
8b6ee91ec1 Added support for upgrading with USE_MODPACK_START_SCRIPT=false 2020-07-19 18:10:16 -05:00
Geoff Bourne
06cffd9e15 Ensured eula and other files brought over when not using CF start script (#591) 2020-07-19 16:29:41 -05:00
Geoff Bourne
beaccbcf3b Added option to set USE_MODPACK_START_SCRIPT=false for CF modpacks (#591) 2020-07-19 15:01:19 -05:00
Geoff Bourne
21ee5e2401 Changed handling of unrecognized VERSION and detect absent server in meta json
For #590
2020-07-19 12:22:15 -05:00
Geoff Bourne
6462e1580c Removed improperly merged apk call 2020-07-18 19:29:49 -05:00
Geoff Bourne
8b5552bb62 Auto-merging via docker-versions-create 2020-07-18 18:41:10 -05:00
Paul Zühlcke
747c188824 Use -prune for "REPLACE_ENV_VARIABLES_EXCLUDE_PATHS" feature. (#588) 2020-07-18 18:31:29 -05:00
Geoff Bourne
692087dd25 Ensured ops.txt and white-list.txt are always provided for CURSEFORGE/FTB type (#584) 2020-07-18 13:49:40 -05:00
Geoff Bourne
6fe13e8654 Clarified "invalid type" message for FTBA on multiarch 2020-07-18 13:09:58 -05:00
Geoff Bourne
3b2b98b9fe Upgrade base image packages
For #586
2020-07-14 21:07:57 -05:00
Code Monad
796f2fe14a Add support for rcon password from file (#585) 2020-07-13 21:00:46 -05:00
Geoff Bourne
4fef391b64 misc: Switched maintainer label to opencontainers schema 2020-07-12 11:36:31 -05:00
Geoff Bourne
83f6cebd0b Merge pull request #581 from itzg/dev/add-ci-tests
Added CI tests
2020-07-11 14:29:59 -05:00
Geoff Bourne
90183ae823 ci: Don't restart failed container during test 2020-07-11 14:26:47 -05:00
Geoff Bourne
3c9df03584 ci: Only output server logs when failed 2020-07-11 14:13:51 -05:00
Geoff Bourne
367c6cfd92 ci: Added testing step to github actions 2020-07-11 14:09:08 -05:00
Geoff Bourne
5e75410e7c Confirm latest Paper jar is always downloaded 2020-07-11 13:30:39 -05:00
Geoff Bourne
38028f7d0c Confirm latest Spigot jar is always downloaded 2020-07-11 13:17:28 -05:00
Geoff Bourne
3ca514f2b2 Auto-merging via docker-versions-create 2020-07-11 13:14:10 -05:00
Geoff Bourne
a07ae685e2 Fixed attempted rsync when WORLD not set 2020-07-11 13:09:48 -05:00
Geoff Bourne
c07f899870 Auto-merging via docker-versions-create
# Conflicts:
#	start-deployFTB
2020-07-10 17:13:05 -05:00
Paul Zühlcke
092b530537 Added 'FORCE_WORLD_COPY' environment variable (#580) 2020-07-10 17:06:47 -05:00
Geoff Bourne
cf691499a1 docs: Moved section for DISABLE_HEALTHCHECK to existing healthcheck section 2020-07-09 21:07:26 -05:00
Geoff Bourne
0bb9cccdc6 Added REPLACE_ENV_VARIABLES_EXCLUDE_PATHS
For #575
2020-07-09 21:05:17 -05:00
Geoff Bourne
4cb12f6cae Added DISABLE_HEALTHCHECK 2020-07-09 20:54:34 -05:00
Geoff Bourne
ecbdeb2096 Added option to disable PLUGINS_SYNC_UPDATE
For #576
2020-07-08 19:07:53 -05:00
Geoff Bourne
9a7a532f7b Changed order of /plugins rsync to be before processing env vars
For #577
2020-07-06 17:16:51 -05:00
Geoff Bourne
825833c859 Added REPLACE_ENV_VARIABLES_EXCLUDES
for #575
2020-07-06 16:41:56 -05:00
Geoff Bourne
c4c3613874 misc: added docs to release notes exclusion 2020-07-04 15:02:32 -05:00
Geoff Bourne
e527fd9551 Auto-merging via docker-versions-create 2020-07-04 14:58:40 -05:00
Geoff Bourne
3a03156cb3 ci: Adjust pr workflow name 2020-07-04 14:55:45 -05:00
orblazer
b3780186f8 Add some missing properties in env variables (#574) 2020-07-04 14:52:35 -05:00
Kamaroth92
c4654e44d8 Move server-icon.png to FTB_DIR if exists (#573)
Co-authored-by: Tane Barriball <tanebarriball@gmail.com>
2020-07-04 09:08:37 -05:00
Kamaroth92
9c6047e3fc Updated worldDest to use FTB_DIR in order to deal with nested FTB modpacks (#571)
Co-authored-by: Tane Barriball <tanebarriball@gmail.com>
2020-07-01 18:48:41 -05:00
Geoff Bourne
260cc7d180 docs: added recommendation against using SERVER_PORT 2020-06-30 08:40:33 -05:00
Geoff Bourne
bbe930e552 ci: changed gh actions to avoid image push on PR 2020-06-28 12:22:00 -05:00
Geoff Bourne
a655fe860e docs: removed github readme link since Docker Hub docs are manual now 2020-06-28 12:17:07 -05:00
Geoff Bourne
ddf36aa879 docs: updated example compose file for paper to use proper CONSOLE setting 2020-06-28 09:37:55 -05:00
Geoff Bourne
34c31c561d docs: removed most mentions of noconsole since it only applies pre-1.14 2020-06-28 09:36:31 -05:00
Geoff Bourne
3cc7d00d71 docs: added example compose file for autopause
For #569
2020-06-28 09:34:26 -05:00
Geoff Bourne
ed214b1382 docs: updated image tag for running on RaspberryPi 2020-06-28 09:19:38 -05:00
Geoff Bourne
f8405e298c ci: removed tagging image with git SHA since it seemed like too many 2020-06-26 17:17:41 -05:00
Geoff Bourne
539159ba50 docs: simplified top-level example compose file
related to #518
2020-06-25 14:10:21 -05:00
Geoff Bourne
f2c9d2f905 Updated TYPE feedback when invalid choice given
For #561
2020-06-23 17:27:21 -05:00
Geoff Bourne
1b11331881 misc: added github action badge 2020-06-20 16:06:28 -05:00
Geoff Bourne
b71afff29f misc: removed unused multiarch scripts 2020-06-20 16:05:46 -05:00
Geoff Bourne
b4c6950f95 ci: simplified main github action name 2020-06-20 16:01:27 -05:00
Geoff Bourne
047a477f7b Auto-merging via docker-versions-create 2020-06-20 15:45:29 -05:00
Geoff Bourne
ec0329efb1 ci: added option to sign git tags 2020-06-20 15:42:45 -05:00
Geoff Bourne
477caa12c3 ci: switched image push to use Gitub Actions 2020-06-20 15:35:37 -05:00
Geoff Bourne
8f82ff9b1d Added support for Catserver type 2020-06-20 15:28:30 -05:00
Geoff Bourne
7d97fdcbec Clarified setting VERSION for unavailable Mohist builds 2020-06-20 09:07:38 -05:00
Geoff Bourne
5ee0150154 docs: added development note about generating release notes 2020-06-19 16:09:09 -05:00
Geoff Bourne
1bcacfc474 docs: added a bunch more development notes 2020-06-19 15:34:56 -05:00
Geoff Bourne
34603184a4 Activated useSystemProxies java property when proxy config set
Fixes #415
2020-06-19 15:33:33 -05:00
Geoff Bourne
78cb05adda ci: added multiarch tags to triggers 2020-06-19 15:03:29 -05:00
Geoff Bourne
8493252645 Auto-merging via docker-versions-create
# Conflicts:
#	Dockerfile
#	README.md
#	start
#	start-configuration
#	start-deployFTB
2020-06-19 15:01:28 -05:00
Geoff Bourne
2ee5a25c91 ci: adjusted main github action name 2020-06-19 13:23:05 -05:00
Geoff Bourne
60ef1b8867 ci: fixed github action tags matching 2020-06-19 13:15:23 -05:00
Geoff Bourne
3eaf756aa2 ci: adjusted github actions to build non-multiarch branches/tags 2020-06-19 11:41:53 -05:00
Geoff Bourne
bc318fa185 Added support for Mohist servers 2020-06-19 11:31:56 -05:00
Geoff Bourne
f93c42a23f Added support for tagging during docker-versions-create.sh 2020-06-19 11:31:41 -05:00
Geoff Bourne
f5dde77efe Enabled iterative development with SCRIPTS var 2020-06-19 11:05:32 -05:00
Toboshii Nakama
2b7f923865 Add ttf-dejavu to package list (#556) 2020-06-14 11:20:37 -05:00
Geoff Bourne
80099ad63d Added debug option to dump managed server.properties 2020-06-14 11:14:11 -05:00
Geoff Bourne
b273bf2947 Removed cirleci config 2020-06-10 18:50:40 -05:00
Geoff Bourne
2241ba8819 Added build image action 2020-06-10 18:43:07 -05:00
Luis Marroquin
3cf58e3caf Fixed docker-compose-proxied.yml link (#554) 2020-06-10 06:56:07 -05:00
Geoff Bourne
450442a916 Enhanced WORLD to support path to zip file 2020-06-06 20:41:09 -05:00
Geoff Bourne
8c866bd17d Un-flipped forge and FTBA examples compose files 2020-05-31 18:46:17 -05:00
Geoff Bourne
8deaf1850b Fixed TYPE=FTBA in example compose file 2020-05-31 18:43:40 -05:00
Geoff Bourne
6da2aca975 Updated examples for FTBA support 2020-05-31 18:40:13 -05:00
Geoff Bourne
11989d17e3 Updated README for FTBA server type support
For #524
2020-05-31 18:34:21 -05:00
Geoff Bourne
aa42633ab2 Added support for FTB application modpacks via modpacks.ch
For #524
2020-05-31 18:18:54 -05:00
Geoff Bourne
5aa6e5c2a9 Refactored autopause setup into its own start-file (#545) 2020-05-25 10:20:14 -05:00
Kevin Klinemeier
825398f4d4 removed version entries except for the version section (#541)
Co-authored-by: BuildTools <unconfigured@null.spigotmc.org>
2020-05-23 17:57:11 -05:00
Geoff Bourne
ccac249c01 Added server-start.sh support for CF modpacks
Fixes #540
2020-05-23 09:55:38 -05:00
Michael Kirsch
f2806d9335 Autopause logs (#539) 2020-05-23 09:15:10 -05:00
Geoff Bourne
b11806e341 Consolidated armv7 branch into multiarch 2020-05-21 20:59:13 -05:00
Geoff Bourne
9ec336283f Updated to support multiarch/BuiltKit builds 2020-05-21 20:48:54 -05:00
Michael Kirsch
71a7afab17 Autopause functionality (#531) 2020-05-20 08:17:58 -05:00
Geoff Bourne
bbdb2c9b36 Auto-merging via docker-versions-create 2020-05-20 08:15:50 -05:00
Mitchell Skaggs
ede58d9159 Update flags as of 5/2/2020 (#534) 2020-05-18 19:55:32 -05:00
Geoff Bourne
48e09f42fc Changed base ubuntu to 18.04 2020-05-14 20:09:12 -05:00
Geoff Bourne
ec7d182d38 Avoid touch since rpi mounts default to noatime 2020-05-14 15:21:51 -05:00
Geoff Bourne
b271b529ea Improved handling of building bukkit vs spigot 2020-05-11 20:14:01 -05:00
Geoff Bourne
d24690ab8c Used versionLessThan to simplify buildSpigotFromSource check 2020-05-11 18:54:28 -05:00
hejamu
89fa3ff8fe Short hotfix until version helper function is done (#520) 2020-05-11 18:53:29 -05:00
Geoff Bourne
5c0a3a64ab Upgraded mc-server-runner to 1.4.3 to fix curse instance mod cleanup 2020-05-08 18:01:37 -05:00
Geoff Bourne
b66629b951 Added helper script for building multiarch image 2020-05-06 16:08:05 -05:00
Sharif Nassar
de866a322f Add resource-pack-sha1 to server.properties (#519) 2020-05-03 16:30:12 -05:00
Geoff Bourne
9c7c95cf4f Pinned Java version at 11 2020-05-03 11:51:56 -05:00
Geoff Bourne
e32ffd1819 Auto-merging via docker-versions-create 2020-05-02 09:34:58 -05:00
orblazer
79ac19937f Add possibility to use secrets in environment variables (#512) 2020-04-28 19:07:45 -05:00
Gabriel Oliveira
08e8fcdc7c Add explanation for timezone config on README (#510) 2020-04-28 18:57:55 -05:00
Geoff Bourne
6941e63a2c Added skipping of log4j config for Paper
For #476
2020-04-28 07:27:33 -05:00
Geoff Bourne
c68997936a Added units description for DEBUG_MEMORY option 2020-04-27 08:04:11 -05:00
Geoff Bourne
40547439b2 Added DEBUG_MEMORY option 2020-04-27 07:55:38 -05:00
Geoff Bourne
095c6ad099 Auto-merging via docker-versions-create 2020-04-25 12:11:39 -05:00
Geoff Bourne
691fe638e4 Fixed spelling of Tuinity 2020-04-24 19:13:51 -05:00
Geoff Bourne
fbdee6a7a7 Added support for Tunity server type 2020-04-24 18:56:15 -05:00
Geoff Bourne
664f3d7eaa Fixed latest Paper build to be "latest" 2020-04-22 17:08:07 -05:00
orblazer
c2846fc586 Allow specify paper build and don't use legacy gamemode and difficulty (#503) 2020-04-22 07:06:57 -05:00
Geoff Bourne
e9b1332119 Added support for Magma servers
For #497
2020-04-21 18:30:48 -05:00
Geoff Bourne
757a5146a1 Added forge example compose file 2020-04-19 13:47:14 -05:00
Geoff Bourne
f9defda106 Fixed wording of CF/FTB pre-downloads 2020-04-19 13:42:39 -05:00
Geoff Bourne
e6a3ca0a1f Added JVM property to skip Spigot update check
For #417
2020-04-18 18:42:55 -05:00
Geoff Bourne
14342c9632 Auto-merging via docker-versions-create
# Conflicts:
#	Dockerfile
2020-04-17 21:32:03 -05:00
Geoff Bourne
1cf478f5b3 Removed pre-creating /mods /config /plugins 2020-04-17 21:16:04 -05:00
Geoff Bourne
9ff94f9bd5 Fixed versionLessThan comparison for snapshots 2020-04-17 21:15:44 -05:00
Geoff Bourne
9842a52820 Added env var mapping for player-idle-timeout 2020-04-16 11:40:49 -05:00
Geoff Bourne
dbca9c30b0 Removed empty ENV declarations since they complicate QNAP, etc 2020-04-15 09:00:24 -05:00
Matthieu Berthomé
220f2fbd79 add some /data prefixes in missing places (#493)
Co-authored-by: rienafairefr <rienafairefr@gmail.com>
2020-04-15 08:20:11 -05:00
Geoff Bourne
8dbbdd8cd2 Added logic to skip --noconsole on newer versions
Fixes #452
2020-04-13 18:29:44 -05:00
Geoff Bourne
1c2a0c506c Added support for TYPE=CURSE_INSTANCE 2020-04-12 14:31:19 -05:00
Chip Wolf ‮
90a6707280 Enable upgrades with GENERIC_PACK (#491) 2020-04-12 09:39:28 -05:00
Geoff Bourne
e7cc54092a Fixing health check description to reference mc-monitor
For #426
2020-04-11 10:51:30 -05:00
Geoff Bourne
cd70cbcbea Enhanced Aikar's flag logic to adjust for >12GB memory
For #483
2020-04-11 10:41:20 -05:00
Geoff Bourne
f6df4d6694 Auto-merging via docker-versions-create
# Conflicts:
#	.circleci/config.yml
2020-04-11 08:56:29 -05:00
Geoff Bourne
7910005086 Added option to use Aikar's flags 2020-04-11 08:43:17 -05:00
Geoff Bourne
b8ace17b7c ci: ignore non-amd64 branches 2020-04-10 15:33:16 -05:00
Geoff Bourne
0406e89c2a Auto-merging via docker-versions-create 2020-04-10 11:09:12 -05:00
Geoff Bourne
f70814d6b6 Updated paper build example to use stdin/tty 2020-04-10 11:00:22 -05:00
Geoff Bourne
8440e57118 Fixed support for modpacks that has multiple forge jars
HR New Beginnings was one such modpack
2020-04-10 10:59:30 -05:00
Julien Bérubé
29eda3530c fixed the link to curseforge mod list (#487) 2020-04-07 19:15:49 -05:00
Geoff Bourne
558544f1e4 Fixed WORLD cloning when path has spaces 2020-04-06 18:59:26 -05:00
Geoff Bourne
56c2f0b466 Disabled log4j config when TYPE=SPIGOT
Helps #482
2020-04-05 17:32:26 -05:00
Geoff Bourne
4bbc7d142f Fixed /plugins support for Paper servers 2020-04-04 10:13:51 -05:00
Geoff Bourne
26cc3943ce Removed ToF buildtools section since that was moved downstream 2020-04-04 09:34:21 -05:00
Geoff Bourne
5ef21e1ddf Auto-merging via docker-versions-create 2020-04-03 13:31:53 -05:00
Geoff Bourne
6521f45f0b Added adopt13 to docker-versions-create.sh 2020-04-03 13:30:57 -05:00
Geoff Bourne
414d5bd8ac Auto-merging via docker-versions-create 2020-04-03 13:29:03 -05:00
Geoff Bourne
d62c2ffb42 Added ENABLE_JMX option 2020-04-03 12:32:46 -05:00
Geoff Bourne
15ccf03b28 Auto-merging via docker-versions-create 2020-04-02 17:47:52 -05:00
Geoff Bourne
d131941b62 Revert "Checking health of the container using SERVER_IP variable (#473)"
This reverts commit 6465bca6
2020-04-02 10:14:22 -05:00
Geoff Bourne
98f0b36cfc Changed FTB exec to always use shell
For #469
2020-04-01 18:50:07 -05:00
Alexei
6465bca640 Checking health of the container using SERVER_IP variable (#473) 2020-04-01 09:49:21 -05:00
Geoff Bourne
828a48998f Auto-merging via docker-versions-create 2020-03-30 08:32:11 -05:00
Geoff Bourne
4ad447ba6c Used shell when FTB server script missing shebang line
For #467
2020-03-29 11:43:26 -05:00
Geoff Bourne
736979c20b Removed description of FTB/CF URL option 2020-03-29 09:48:50 -05:00
Geoff Bourne
0c34a61332 Upgraded mc-server-runner to 1.3.5
Related to #467
2020-03-29 09:30:46 -05:00
Geoff Bourne
67d58678a3 Added grep in FTB logic to avoid re-adding queryResult flag
Fixes #468
2020-03-29 08:55:53 -05:00
Geoff Bourne
fb92a74084 Added README section about running on raspberrypi 2020-03-28 14:05:16 -05:00
Geoff Bourne
8b5430ca44 Added textual link to full docs
Fixes #448
2020-03-28 14:01:57 -05:00
Geoff Bourne
f24827f558 Removed forced creation of /mods and /config volumes
Related to #464
2020-03-28 14:00:22 -05:00
Geoff Bourne
f49b967d5a Added logging of given VERSION and TYPE 2020-03-28 13:56:48 -05:00
Geoff Bourne
111ca85c4f Upgraded mc-server-runner to 1.3.4 2020-03-28 13:48:47 -05:00
Geoff Bourne
4b590e03ff Auto-merging via docker-versions-create 2020-03-26 20:54:25 -05:00
Geoff Bourne
c73bedc63c Removed logging change from docker-versions-create.sh 2020-03-26 20:53:10 -05:00
Geoff Bourne
6f67f76eef Upgraded easy-add to 0.7.1 2020-03-26 20:50:13 -05:00
Geoff Bourne
002ed4bc77 Added armv7 to docker-versions-create.sh 2020-03-26 09:41:55 -05:00
Geoff Bourne
0db8780ad9 Changed base image to arm32v7/adoptopenjdk 2020-03-25 21:05:16 -05:00
Geoff Bourne
9d48e79c64 Added multiarch to docker-versions-create.sh 2020-03-25 20:13:05 -05:00
Geoff Bourne
5b744176df Merge remote-tracking branch 'origin/master' into multiarch 2020-03-25 20:08:47 -05:00
Geoff Bourne
ba7db26157 Added README section for Helm charts and examples (#461) 2020-03-25 11:24:19 -05:00
Timo Meijer
fc6129261b Add customized log file with 7 day retention (#455) 2020-03-20 16:29:52 -05:00
Pascal Sthamer
7702d98766 Allow to modify server-ip in server.properties (#454)
Needed when your machine has multiple ip adresses assigned and you want to host your server on another ip than the default one.
2020-03-20 09:56:50 -05:00
Alexei
04ed016175 Running Minecraft on a different Java version (#450)
Co-authored-by: Geoff Bourne <itzgeoff@gmail.com>
2020-03-16 10:06:35 -05:00
Geoff Bourne
1aaaf95950 Upgraded easy-add to 0.7.0 2020-03-14 15:42:28 -05:00
Malcolm Nihlén
1e334ca7d5 Added log prefixes (#444) 2020-03-06 09:52:17 -06:00
Geoff Bourne
20b15e0330 Merge remote-tracking branch 'origin/master' into multiarch
# Conflicts:
#	Dockerfile
2020-02-06 16:59:59 -06:00
Geoff Bourne
74df4b6a9c Unified easy-add usage with multiarch and common 'file' template 2020-02-06 15:34:14 -06:00
Geoff Bourne
f63463e654 Removed mcadmin.jq since it was no longer used 2020-02-06 15:33:21 -06:00
Geoff Bourne
818539e3de Switched base image to adoptopenjdk (debian) 2020-02-05 21:33:08 -06:00
Geoff Bourne
f48741f65c Try BuildKit via regular setup_remote_docker 2020-02-05 08:21:52 -06:00
Geoff Bourne
e9e5af849f Use docker executor 2020-02-04 20:14:32 -06:00
Geoff Bourne
22d68f5c7c Enable use-remote-docker 2020-02-04 20:13:02 -06:00
Geoff Bourne
690598da60 Try BuildKit/multiarch support on CircleCI 2020-02-04 20:10:45 -06:00
Geoff Bourne
a24b633ccb Added support for buildx multi-arch builds 2020-02-04 17:36:03 -06:00
Geoff Bourne
5b8cd8cdcc Upgraded easy-add and used templated URLs 2020-02-02 15:16:09 -06:00
Geoff Bourne
c35c85e9b5 Included resolved version in bukkit/spigot jar name to support auto-update
Fixes #431
2020-02-02 08:09:54 -06:00
Geoff Bourne
2ffc1641a0 Added a git pull when docker-versions-create.sh starts with each branch 2020-02-01 08:52:39 -06:00
Geoff Bourne
9d67dceff3 Removed the remaining use of python 2020-01-30 21:39:35 -06:00
Geoff Bourne
c449a31b37 Removed the need for xq 2020-01-30 21:24:36 -06:00
Geoff Bourne
efd3427fc0 Added back yq/xq pip package until full conversion can be done
For #428
2020-01-29 18:02:19 -06:00
Geoff Bourne
88ed017ca7 Simplified mcstatus shim to allow for any command
Fixes #426
2020-01-29 08:57:31 -06:00
Geoff Bourne
30ba3a4b78 Restored python temporarily until jq usage can replace it
For #427
2020-01-27 14:24:09 -06:00
Geoff Bourne
c8380daee5 Fixed mcstatus shim to actually call mc-monitor
For #426
2020-01-27 08:30:54 -06:00
Geoff Bourne
8afb1651fd Added shim for mcstatus
For #426
2020-01-27 07:16:22 -06:00
Geoff Bourne
9560903c80 Replaced mcstatus with mc-monitor, so removed python 2020-01-26 16:57:14 -06:00
Geoff Bourne
e94f6608d2 Fixed UID/GID startup logic to properly handle running as root
Fixes #425
2020-01-17 08:27:11 -06:00
Geoff Bourne
949faf1620 docs: added example kube manifest with statefulset 2019-12-29 15:18:31 -06:00
Geoff Bourne
5b3259b1ef docs: added Discord chat badge 2019-12-28 14:23:04 -06:00
Geoff Bourne
485d7b0612 docs: added info in README about upgrading LATEST/SNAPSHOT versions
For #418
2019-12-27 22:04:16 -06:00
Geoff Bourne
94b037428e Add SKIP_NSSWITCH_CONF option
For #416
2019-11-26 21:34:56 -06:00
Geoff Bourne
b401873298 docs: Revert "update proxy section with correct env vars"
This reverts commit 1c9bbee3

Those env vars already get set by the startup script given PROXY
2019-11-26 08:56:29 -06:00
Geoff Bourne
1c9bbee3b3 docs: update proxy section with correct env vars
Fixes #415
2019-11-23 14:08:32 -06:00
hannah98
5fa33c7813 Better handle CurseForge manifest.json (#414) 2019-11-21 13:50:06 -06:00
Geoff Bourne
581d5fde1d ci: add adopt11 to docker-versions-create.sh 2019-11-16 09:30:39 -06:00
Geoff Bourne
382336d39d ci: add batch mode to docker-versions-create.sh 2019-11-16 09:30:06 -06:00
Geoff Bourne
5bd3a818a3 ci: fix SC2162 in docker-versions-create.sh 2019-11-16 09:29:48 -06:00
Geoff Bourne
97874f3481 ci: pre-declare merge commit message to avoid need for interaction 2019-11-16 09:04:03 -06:00
Alexei
135bafefeb docker-versions-create init (#408) 2019-11-16 08:46:52 -06:00
Dwight Spencer
15b8c5a7e7 (improvement) Offsets healthcheck to T+1m (#397) 2019-11-13 16:52:57 -06:00
jmyoung
15990071d4 Fixed JVM_XX_OPTS for FTB servers (#400) 2019-10-14 11:24:26 -05:00
Geoff Bourne
d00f9d3609 Normalize EULA value to lowercase to match Forge expectations
For #394
2019-10-01 13:54:14 -05:00
Geoff Bourne
5ad745de75 Initial support for GENERIC_PACK
For #392
2019-09-29 11:45:39 -05:00
Pavel Andreyev
b67580af2c Support .conf extension for config files (#388)
* Support .conf extension for config files

* Update the docs for env variables
2019-09-24 10:21:59 -05:00
Geoff Bourne
2900062df5 Always update whitelist from env since it is processed additive anyway
For #283
2019-09-22 16:48:59 -05:00
Geoff Bourne
67fe8931dd Upgrade easy-add, which now logs to stdout 2019-09-22 16:40:54 -05:00
Geoff Bourne
e6f593e8c4 Updating tools to support ARCH=386 builds 2019-09-18 21:14:08 -05:00
Geoff Bourne
8924740cfe Bump mc-server-runner to 1.3.3 to allow for 386 builds 2019-09-17 21:06:29 -05:00
Björn Richter
34d4ae0b59 Only write EULA when it's set to TRUE (#387)
* Only write EULA when it's set to `TRUE`

- This prevents a false value to be written while not being able to correct it afterwards using the environment variable.

* Convert EULA value to upper case to allow lower case `true` as value
2019-09-15 17:15:33 -05:00
Geoff Bourne
62a4541df5 Fix upgrade support for Paper
For #361
2019-09-15 14:09:27 -05:00
Geoff Bourne
401958c0d6 Add debugs for Fabric setup
For #361
2019-09-15 09:54:13 -05:00
Geoff Bourne
8859d223bf Track Minecraft version also in Fabric install marker
For #361
2019-09-14 22:29:54 -05:00
Geoff Bourne
621962ad9c Always populate ops.txt to allow for additive config
For #283
2019-09-08 17:22:20 -05:00
Aurélien Bertron
5c238af3df Add spawn protection setting (#386) 2019-09-08 16:40:45 -05:00
Geoff Bourne
8e148095f0 Adding link for github README 2019-08-24 11:12:41 -05:00
DocQuantum
3c55a05b1c Added ability to add resource-pack from environment vars (#379) 2019-08-24 10:38:59 -05:00
96 changed files with 4410 additions and 1577 deletions

View File

@@ -1,17 +0,0 @@
version: 2
jobs:
minecraft_server:
docker:
- image: circleci/buildpack-deps:19.10
steps:
- checkout
- setup_remote_docker
- run:
name: Build image
command: docker build -t mc:$CIRCLE_BUILD_NUM .
workflows:
version: 2
build:
jobs:
- minecraft_server

View File

@@ -1,4 +1,6 @@
data
testdata
examples
k8s-examples
.idea
.idea
.git

View File

@@ -1,2 +1,4 @@
[start-*]
indent_size = 2
indent_size = 2
indent_style = space
end_of_line = lf

5
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,5 @@
#github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
custom:
- https://www.buymeacoffee.com/itzg
- https://paypal.me/itzg

7
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,7 @@
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"

87
.github/workflows/build-multiarch.yml vendored Normal file
View File

@@ -0,0 +1,87 @@
name: Build and publish multiarch
on:
push:
branches:
- master
- "*-multiarch"
- "multiarch*"
- java8-openj9
- java11*
- java16*
- test/*
tags:
- "[0-9]+.[0-9]+.[0-9]+"
- "[0-9]+.[0-9]+.[0-9]+-multiarch*"
- "[0-9]+.[0-9]+.[0-9]+-*multiarch"
- "[0-9]+.[0-9]+.[0-9]+-java8-openj9"
- "[0-9]+.[0-9]+.[0-9]+-java11*"
- "[0-9]+.[0-9]+.[0-9]+-java16*"
paths-ignore:
- "*.md"
- "docs/**"
- "examples/**"
jobs:
docker-buildx:
if: github.repository == 'itzg/docker-minecraft-server'
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: |
itzg/minecraft-server
tags: |
type=ref,event=branch
type=ref,event=tag
flavor: |
latest=${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2.1.6
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Set up QEMU
uses: docker/setup-qemu-action@v1.2.0
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2.7.0
with:
context: .
platforms: linux/amd64,linux/arm/v7,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
# ensure latest base image is used
pull: true
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
labels: ${{ steps.meta.outputs.labels }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
- # Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache

21
.github/workflows/generate-toc.yml vendored Normal file
View File

@@ -0,0 +1,21 @@
name: Generate README table of contents
on:
push:
branches:
- master
paths:
- README.md
jobs:
generate:
if: github.repository == 'itzg/docker-minecraft-server'
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v2.3.4
- run: |
curl https://raw.githubusercontent.com/ekalinin/github-markdown-toc/master/gh-md-toc -o gh-md-toc
chmod a+x gh-md-toc
./gh-md-toc --insert --no-backup README.md
- uses: stefanzweifel/git-auto-commit-action@v4.12.0
with:
commit_message: "docs: Auto update markdown TOC"

100
.github/workflows/main.yml vendored Normal file
View File

@@ -0,0 +1,100 @@
name: Build and Publish
on:
push:
branches:
- java8
- openj9
- openj9-11
- adopt11
- test/alpine/*
tags:
- "[0-9]+.[0-9]+.[0-9]+-java8"
- "[0-9]+.[0-9]+.[0-9]+-openj9"
- "[0-9]+.[0-9]+.[0-9]+-openj9-11"
- "[0-9]+.[0-9]+.[0-9]+-openj9-nightly"
- "[0-9]+.[0-9]+.[0-9]+-adopt11"
jobs:
test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2.3.4
- name: Run tests
run: |
tests/test.sh
build:
needs:
- test
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2.3.4
- name: Prepare
id: prep
run: |
DOCKER_IMAGE=itzg/minecraft-server
VERSION=edge
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
fi
if [[ $GITHUB_REF == refs/heads/* ]]; then
VERSION=${GITHUB_REF#refs/heads/}
if [[ $VERSION == master ]]; then
VERSION=latest
fi
fi
TAGS="${DOCKER_IMAGE}:${VERSION//\//-}"
echo ::set-output name=tags::${TAGS}
echo ::set-output name=version::${VERSION//\//-}
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2.1.6
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2.7.0
with:
context: .
file: ./Dockerfile
# ensure latest base image is used
pull: true
# publish
push: true
# tags determined by prep step
tags: ${{ steps.prep.outputs.tags }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
labels: |
org.opencontainers.image.documentation=https://github.com/itzg/docker-minecraft-server
org.opencontainers.image.version=${{ steps.prep.outputs.version }}
org.opencontainers.image.source=https://github.com/itzg/docker-minecraft-server
org.opencontainers.image.revision=${{ github.sha }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
- # Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache

16
.github/workflows/pr.yml vendored Normal file
View File

@@ -0,0 +1,16 @@
name: Validate PR
on:
pull_request:
branches: [ master ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
- name: Run tests
run: |
tests/test.sh

3
.gitignore vendored
View File

@@ -1,3 +1,4 @@
/data/
/.idea/
*.iml
*.iml
/gh-md-toc

11
BUILDING.md Normal file
View File

@@ -0,0 +1,11 @@
Ensure buildx/BuildKit support is enabled and run:
```shell script
docker buildx build --platform=linux/arm64 --platform=linux/arm/v7 --platform=linux/amd64 --tag itzg/minecraft-server:multiarch --push .
```
To build for local testing, use:
```shell script
docker buildx build --platform=linux/amd64 --tag mc-multiarch --load .
```

74
DEVELOPMENT.md Normal file
View File

@@ -0,0 +1,74 @@
## Adding a server type
Adding a new server `TYPE` can vary due to the complexity of obtaining and configuring each type; however, the addition of any server type includes at least the following steps:
1. Copy an existing "start-deploy*" script, such as [start-deployMohist](start-deployMohist) and rename it accordingly making sure to retain the "start-deploy" prefix
2. Modify the type-specific behavior between the "start-utils" preamble and the hand-off to `start-setupWorld` at the end of the script
3. Develop and test the changes using the [iterative process described below](#iterative-script-development)
4. Add a case-entry to the `case "${TYPE^^}"` in [start-configuration](start-configuration)
5. Add a section to the [README](README.md). It is recommended to copy-modify an existing section to retain a similar wording and level of detail
6. [Submit a pull request](https://github.com/itzg/docker-minecraft-server/pulls)
## Iterative script development
Individual scripts can be iteratively developed, debugged, and tested using the following procedure.
First, build a baseline of the image to include the packages needed by existing or new scripts:
```shell script
docker build -t mc-dev .
```
Using the baseline image, an interactive container can be started to iteratively run the scripts to be developed. By attaching the current workspace directory, you can use the local editor of your choice to iteratively modify scripts while using the container to run them.
```shell script
docker run -it --rm -v ${PWD}:/scripts -e SCRIPTS=/scripts/ --entrypoint bash mc-dev
```
From within the container you can run individual scripts via the attached `/scripts/` path; however, be sure to set any environment variables expected by the scripts by either `export`ing them manually:
```shell script
export VANILLA_VERSION=1.12.2
/scripts/start-magma
```
...or pre-pending script execution:
```shell script
VANILLA_VERSION=1.12.2 /scripts/start-magma
```
> NOTE: You may want to temporarily add an `exit` statement near the end of your script to isolate execution to just the script you're developing.
## Multi-base-image variants
Several base-image variants are maintained in order to offer choices in JDK provider and version. The variants are maintained in their respective branches:
- openj9
- openj9-nightly
- adopt11
- adopt13
- multiarch
The [docker-versions-create.sh](docker-versions-create.sh) script is configured with the branches to maintain and is used to merge changes from the master branch into the mulit-base variant branches. The script also manages git tagging the master branch along with the merged branches. So a typical use of the script would be like:
```shell script
./docker-versions-create.sh -s -t 1.2.0
```
> Most often the major version will be bumped unless a bug or hotfix needs to be published in which case the patch version should be incremented.
> The build and publishing of those branches and their tags is currently performed within Docker Hub.
## multiarch support
The [multiarch branch](https://github.com/itzg/docker-minecraft-server/tree/multiarch) supports running the image on amd64, arm64, and armv7 (aka RaspberryPi). Unlike the mainline branches, it is based on Ubuntu 18.04 since the openjdk package provided by Ubuntu includes full JIT support on all of the processor types.
The multiarch images are built and published by [a Github action](https://github.com/itzg/docker-minecraft-server/actions?query=workflow%3A%22Build+and+publish+multiarch%22), which [is configured in that branch](https://github.com/itzg/docker-minecraft-server/blob/multiarch/.github/workflows/build-multiarch.yml).
## Generating release notes
The following git command can be used to provide the bulk of release notes content:
```shell script
git log --invert-grep --grep "^ci:" --grep "^misc:" --grep "^docs:" --grep "^build(deps)" --pretty="- %s" 1.1.0..1.2.0
```

View File

@@ -1,68 +1,92 @@
FROM openjdk:8u212-jre-alpine
LABEL maintainer "itzg"
LABEL org.opencontainers.image.authors="Geoff Bourne <itzgeoff@gmail.com>"
RUN apk add --no-cache -U \
openssl \
imagemagick \
lsof \
su-exec \
shadow \
bash \
curl iputils wget \
git \
jq \
mysql-client \
tzdata \
rsync \
nano \
python python-dev py2-pip
RUN pip install mcstatus yq
HEALTHCHECK CMD mcstatus localhost:$SERVER_PORT ping
openssl \
imagemagick \
lsof \
su-exec \
shadow \
bash \
curl iputils wget \
git \
jq \
mysql-client \
tzdata \
rsync \
nano \
sudo \
knock \
ttf-dejavu
RUN addgroup -g 1000 minecraft \
&& adduser -Ss /bin/false -u 1000 -G minecraft -h /home/minecraft minecraft \
&& mkdir -m 777 /data /mods /config /plugins \
&& chown minecraft:minecraft /data /config /mods /plugins /home/minecraft
&& mkdir -m 777 /data \
&& chown minecraft:minecraft /data /home/minecraft
COPY files/sudoers* /etc/sudoers.d
EXPOSE 25565 25575
RUN echo 'hosts: files dns' > /etc/nsswitch.conf
# hook into docker BuildKit --platform support
# see https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
ARG TARGETOS=linux
ARG TARGETARCH=amd64
ARG TARGETVARIANT=""
ARG RESTIFY_VER=1.1.6
ARG RCON_CLI_VER=1.4.6
ARG MC_SERVER_RUNNER_VER=1.3.2
ARG ARCH=amd64
ARG EASY_ADD_VER=0.7.1
ADD https://github.com/itzg/easy-add/releases/download/${EASY_ADD_VER}/easy-add_${TARGETOS}_${TARGETARCH}${TARGETVARIANT} /usr/bin/easy-add
RUN chmod +x /usr/bin/easy-add
ADD https://github.com/itzg/restify/releases/download/${RESTIFY_VER}/restify_${RESTIFY_VER}_linux_${ARCH}.tar.gz /tmp/restify.tgz
RUN tar -x -C /usr/local/bin -f /tmp/restify.tgz restify && \
rm /tmp/restify.tgz
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=1.2.0 --var app=restify --file {{.app}} \
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
ADD https://github.com/itzg/rcon-cli/releases/download/${RCON_CLI_VER}/rcon-cli_${RCON_CLI_VER}_linux_${ARCH}.tar.gz /tmp/rcon-cli.tgz
RUN tar -x -C /usr/local/bin -f /tmp/rcon-cli.tgz rcon-cli && \
rm /tmp/rcon-cli.tgz
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=1.5.1 --var app=rcon-cli --file {{.app}} \
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
ADD https://github.com/itzg/mc-server-runner/releases/download/${MC_SERVER_RUNNER_VER}/mc-server-runner_${MC_SERVER_RUNNER_VER}_linux_${ARCH}.tar.gz /tmp/mc-server-runner.tgz
RUN tar -x -C /usr/local/bin -f /tmp/mc-server-runner.tgz mc-server-runner && \
rm /tmp/mc-server-runner.tgz
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=0.10.1 --var app=mc-monitor --file {{.app}} \
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
COPY mcadmin.jq /usr/share
RUN chmod +x /usr/local/bin/*
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=1.8.0 --var app=mc-server-runner --file {{.app}} \
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
VOLUME ["/data","/mods","/config"]
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=0.1.1 --var app=maven-metadata-release --file {{.app}} \
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
ARG MC_HELPER_VERSION=1.6.1
RUN curl -fsSL https://github.com/itzg/mc-image-helper/releases/download/v${MC_HELPER_VERSION}/mc-image-helper-${MC_HELPER_VERSION}.tgz \
| tar -C /usr/share -zxf - \
&& ln -s /usr/share/mc-image-helper-${MC_HELPER_VERSION}/bin/mc-image-helper /usr/bin
VOLUME ["/data"]
COPY server.properties /tmp/server.properties
COPY log4j2.xml /tmp/log4j2.xml
WORKDIR /data
ENTRYPOINT [ "/start" ]
STOPSIGNAL SIGTERM
ENV UID=1000 GID=1000 \
JVM_XX_OPTS="-XX:+UseG1GC" MEMORY="1G" \
TYPE=VANILLA VERSION=LATEST FORGEVERSION=RECOMMENDED SPONGEBRANCH=STABLE SPONGEVERSION= FABRICVERSION=LATEST LEVEL=world \
PVP=true DIFFICULTY=easy ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \
LEVEL_TYPE=DEFAULT GENERATOR_SETTINGS= WORLD= MODPACK= MODS= SERVER_PORT=25565 ONLINE_MODE=TRUE CONSOLE=true SERVER_NAME="Dedicated Server" \
REPLACE_ENV_VARIABLES="FALSE" ENV_VARIABLE_PREFIX="CFG_"
TYPE=VANILLA VERSION=LATEST \
ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \
SERVER_PORT=25565 ONLINE_MODE=TRUE SERVER_NAME="Dedicated Server" \
ENABLE_AUTOPAUSE=false AUTOPAUSE_TIMEOUT_EST=3600 AUTOPAUSE_TIMEOUT_KN=120 AUTOPAUSE_TIMEOUT_INIT=600 \
AUTOPAUSE_PERIOD=10 AUTOPAUSE_KNOCK_INTERFACE=eth0
COPY start* /
RUN dos2unix /start* && chmod +x /start*
COPY bin/ /usr/local/bin/
COPY bin/mc-health /health.sh
ADD files/autopause /autopause
RUN dos2unix /start* && chmod +x /start* \
&& dos2unix /autopause/* && chmod +x /autopause/*.sh
ENTRYPOINT [ "/start" ]
HEALTHCHECK --start-period=1m CMD mc-health

1531
README.md

File diff suppressed because it is too large Load Diff

15
bin/mc-health Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/bash
# shellcheck source=../start-utils
. ${SCRIPTS:-/}start-utils
if isTrue "${DISABLE_HEALTHCHECK}"; then
echo "Healthcheck disabled"
exit 0
elif isTrue "${ENABLE_AUTOPAUSE}" && [[ "$( ps -ax -o stat,comm | grep 'java' | awk '{ print $1 }')" =~ ^T.*$ ]]; then
echo "Java process suspended by Autopause function"
exit 0
else
mc-monitor status --host localhost --port $SERVER_PORT
exit $?
fi

15
bin/mc-send-to-console Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/bash
: "${CONSOLE_IN_NAMED_PIPE:=/tmp/minecraft-console-in}"
if [ $# = 0 ]; then
echo "ERROR: pass console commands as arguments"
exit 1
fi
if [ ! -p "${CONSOLE_IN_NAMED_PIPE}" ]; then
echo "ERROR: named pipe ${CONSOLE_IN_NAMED_PIPE} is missing"
exit 1
fi
echo "$@" > "${CONSOLE_IN_NAMED_PIPE:-/tmp/minecraft-console-in}"

18
bin/mcstatus Executable file
View File

@@ -0,0 +1,18 @@
#!/bin/bash
echo "WARNING: mcstatus is deprecated; calling mc-monitor instead"
##### mcstatus shim for mc-monitor
# handles translating calls to
# mcstatus (host:port) (command)
# where the actual command is ignore, but is typically ping or status
addr="$1"
IFS=':'
read -a parts <<< "${addr}"
if [[ ${#parts[*]} -gt 1 ]]; then
exec mc-monitor status --host ${parts[0]} --port ${parts[1]}
else
exec mc-monitor status --host ${parts[0]}
fi

View File

@@ -1,18 +0,0 @@
#!/bin/bash
manifest="itzg/minecraft-server:multiarch"
for t in latest rpi3 aarch64; do
docker pull itzg/minecraft-server:$t
done
docker manifest create --amend ${manifest} \
itzg/minecraft-server:aarch64 \
itzg/minecraft-server:latest \
itzg/minecraft-server:rpi3
docker manifest annotate --os linux --arch amd64 ${manifest} itzg/minecraft-server:latest
docker manifest annotate --os linux --arch arm64 ${manifest} itzg/minecraft-server:aarch64
docker manifest annotate --os linux --arch arm --variant v7 ${manifest} itzg/minecraft-server:rpi3
docker manifest push ${manifest}

View File

@@ -10,19 +10,7 @@ services:
- "mc:/data"
environment:
EULA: "TRUE"
CONSOLE: "false"
ENABLE_RCON: "true"
RCON_PASSWORD: "testing"
RCON_PORT: 28016
restart: always
rcon:
image: itzg/rcon
ports:
- "4326:4326"
- "4327:4327"
volumes:
- "rcon:/opt/rcon-web-admin/db"
volumes:
mc:
rcon:
mc: {}

133
docker-versions-create.sh Executable file
View File

@@ -0,0 +1,133 @@
#!/bin/bash
#set -x
# Use this variable to indicate a list of branches that docker hub is watching
branches_list=(
'java8'
'java8-multiarch'
'java8-openj9'
'java11'
'java11-openj9'
'java16'
'java16-openj9'
'multiarch-latest'
)
function TrapExit {
echo "Checking out back in master"
git checkout master
}
batchMode=false
while getopts "hbt:s" arg
do
case $arg in
b)
batchMode=true
;;
t)
tag=${OPTARG}
;;
s)
tagArgs="-s -m 'Signed during docker-versions-create"
;;
h)
echo "
Usage $0 [options]
Options:
-b enable batch mode, which avoids interactive prompts and causes script to fail immediately
when any merge fails
-t TAG tag and push the current revision on master with the given tag
and apply respective tags to each branch
-s enable signed tags
-h display this help and exit
"
exit
;;
*)
echo "Unsupported arg $arg"
exit 2
;;
esac
done
${batchMode} && echo "Using batch mode"
trap TrapExit EXIT SIGTERM
test -d ./.git || { echo ".git folder was not found. Please start this script from root directory of the project!";
exit 1; }
# Making sure we are in master
git checkout master
git pull --all || { echo "Can't pull the repo!"; \
exit 1; }
if [[ $tag ]]; then
git tag $tag
git push origin $tag
fi
git_branches=$(git branch -a)
for branch in "${branches_list[@]}"; do
if [[ "$git_branches" != *"$branch"* ]]; then
echo "Can't update $branch because I can't find it in the list of branches."
exit 1
else
echo "Branch $branch found. Working with it."
git checkout "$branch" || { echo "Can't checkout into the branch. Don't know the cause."; \
exit 1; }
proceed='False'
while [[ "$proceed" == "False" ]]; do
# Ensure local branch is aligned with remote since docker-versions-create may have been run elsewhere
git pull
if git merge -m 'Auto-merging via docker-versions-create' master; then
proceed="True"
echo "Branch $branch updated to current master successfully"
# pushing changes to remote for this branch
git commit -m "Auto merge branch with master" -a
# push may fail if remote doesn't have this branch yet. In this case - sending branch
git push || git push -u origin "$branch" || { echo "Can't push changes to the origin."; exit 1; }
if [[ $tag ]]; then
git tag "$tag-$branch"
git push origin "$tag-$branch"
fi
elif ${batchMode}; then
status=$?
echo "Git merge failed in batch mode"
exit ${status}
# and trap exit gets us back to master
else
cat<<EOL
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Master merge in the branch $branch encountered an error!
You may try to fix the error and merge again. (Commit changes)
Or skip this branch merge completely.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
EOL
printf "Should we try again? (y):"
read -r answer
if [[ "$answer" == '' ]] || [[ "$answer" == 'y' ]] || [[ "$answer" == 'Y' ]]; then
# If you use non-local editor or files are changed in repo
cat <<EOL
The following commands may encounter an error!
This is completely fine if the changes were made locally and remote branch doesn't know about them.
EOL
# Updating branch from remote before trying again
git checkout master
git fetch --all
git pull -a
git checkout "$branch"
continue
else
break
fi
fi
done
fi
done

0
docs/.gitkeep Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
docs/motd-example.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 985 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

3
examples/README.md Normal file
View File

@@ -0,0 +1,3 @@
# Deployment Examples
This directory contains various deployment examples of the [itzg/minecraft-server](https://hub.docker.com/r/itzg/minecraft-server/) Docker image.

View File

@@ -1,3 +0,0 @@
FROM itzg/minecraft-server
ENV TYPE=SPIGOT

View File

@@ -1,13 +0,0 @@
plugins:
worldedit:
file: WorldEdit.jar
url: https://dev.bukkit.org/projects/worldedit/files/latest
FastAsyncWorldEdit:
file: FastAsyncWorldEdit.jar
url: https://empcraft.com/fawe/latest.php?bukkit
worldguard:
file: WorldGuard.jar
url: https://dev.bukkit.org/projects/worldguard/files/latest
citizens:
file: Citizens.jar
url: https://dev.bukkit.org/projects/citizens/files/latest

View File

@@ -0,0 +1,21 @@
version: '3.8'
services:
minecraft:
image: itzg/minecraft-server
ports:
- "25565:25565"
volumes:
- "mc:/data"
environment:
EULA: "TRUE"
ENABLE_AUTOPAUSE: "TRUE"
OVERRIDE_SERVER_PROPERTIES: "TRUE"
MAX_TICK_TIME: "-1"
# More aggressive settings for demo purposes
AUTOPAUSE_TIMEOUT_INIT: "30"
AUTOPAUSE_TIMEOUT_EST: "10"
restart: unless-stopped
volumes:
mc: {}

View File

@@ -1,4 +1,4 @@
version: '3'
version: '3.8'
services:
minecraft:

View File

@@ -1,11 +1,13 @@
version: '3.2'
version: '3.8'
services:
mc:
image: itzg/minecraft-server
image: itzg/minecraft-server:java8
volumes:
- ./modpacks:/modpacks:ro
environment:
EULA: "true"
TYPE: FTB
FTB_SERVER_MOD: https://minecraft.curseforge.com/projects/all-the-mods-expert-remastered/files/2493900/download
TYPE: CURSEFORGE
CF_SERVER_MOD: /modpacks/SkyFactory_4_Server_4.1.0.zip
ports:
- 25565:25565

View File

@@ -0,0 +1,15 @@
version: "3"
services:
mc:
image: ${IMAGE:-itzg/minecraft-server}
environment:
EULA: "true"
TYPE: FABRIC
ports:
- 25565:25565
volumes:
- fabric:/data
volumes:
fabric: {}

View File

@@ -0,0 +1,23 @@
version: "3.8"
services:
mc:
image: itzg/minecraft-server:java8
ports:
# expose the Minecraft server port outside of container
- 25565:25565
environment:
# REQUIRED for all types
EULA: "TRUE"
# Set server type (vs the default of vanilla)
TYPE: FORGE
volumes:
# use a named, managed volume for data volume
- mc_forge:/data
# attach local host directory "mods" in same directory as this compose file
# all mods in this directory get copied into /data/mods at startup
- ./mods:/mods:ro
volumes:
# declared the named volume, but use default/local storage engine
mc_forge: {}

View File

@@ -1,16 +0,0 @@
version: '3.2'
services:
mc:
image: itzg/minecraft-server
environment:
EULA: "true"
TYPE: FTB
FTB_SERVER_MOD: https://www.feed-the-beast.com/projects/ftb-presents-skyfactory-3/files/2481284
ports:
- 25565:25565
volumes:
- mc-ftb:/data
volumes:
mc-ftb:

View File

@@ -0,0 +1,23 @@
version: "3.8"
services:
mc:
# FTBA support is only available in non-Alpine images
image: itzg/minecraft-server:java8-multiarch
ports:
# expose the Minecraft server port outside of container
- 25565:25565
environment:
# REQUIRED for all types
EULA: "TRUE"
# Set server type (vs the default of vanilla)
TYPE: FTBA
# Use Pack ID from https://ftb.neptunepowered.org/pack/ftb-presents-direwolf20-1-12/
FTB_MODPACK_ID: "31"
volumes:
# use a named, managed volume for data volume
- mc_ftb:/data
volumes:
# declared the named volume, but use default/local storage engine
mc_ftb: {}

View File

@@ -1,4 +1,4 @@
version: '3.7'
version: '3.8'
services:
mc:
@@ -7,11 +7,12 @@ services:
EULA: "true"
TYPE: PAPER
VERSION: 1.9.4
command: --noconsole
# needed for Paper versions before 1.14
CONSOLE: "false"
ports:
- 25565:25565
volumes:
- mc-paper:/data
volumes:
mc-paper:
mc-paper:

View File

@@ -1,4 +1,4 @@
version: '3'
version: '3.8'
services:
mc:

View File

@@ -0,0 +1,27 @@
version: '3.8'
services:
rlcraft:
image: itzg/minecraft-server:java8
container_name: rlcraft
volumes:
- rlcraft-modpack:/modpacks:ro
- rlcraft-data:/data
environment:
EULA: "true"
TYPE: "FORGE"
VERSION: "1.12.2"
FORGEVERSION: "14.23.5.2855"
DIFFICULTY: "hard"
MAX_TICK_TIME: "-1"
VIEW_DISTANCE: "6"
ALLOW_FLIGHT: "true"
MEMORY: "4G"
GENERIC_PACK: "/modpacks/RLCraft_Server_Pack_1.12.2_Beta_v2.8.2.zip"
ports:
- 25565:25565
restart: unless-stopped
volumes:
rlcraft-data:
rlcraft-modpack:

View File

@@ -0,0 +1,12 @@
version: "3.8"
services:
mc:
image: itzg/minecraft-server
ports:
- 25565:25565
environment:
EULA: "TRUE"
volumes:
# attach the relative directory 'data' to the container's /data path
- ./data:/data

View File

@@ -0,0 +1,17 @@
version: "3"
services:
mc:
# Only using IMAGE variable to allow for local testing
image: ${IMAGE:-itzg/minecraft-server}
ports:
- 25565:25565
environment:
EULA: "TRUE"
TYPE: SPIGOT
SPIGET_RESOURCES: 9089,34315,3836
volumes:
- data:/data
volumes:
data: {}

View File

@@ -1,11 +1,11 @@
version: '3'
version: '3.8'
# Forge with Sponge API support. THIS REQUIRES DOWNLOADING SPONGEFORGE.
# Place the SpongeForge jar file in /data/mods. Other Forge mods go here as well.
# Place Sponge mods in /data/mods/plugins. Yes, this is a directory inside the Forge mod directory. Do NOT use /data/plugins.
services:
minecraft:
image: itzg/minecraft-server
image: itzg/minecraft-server:java8
ports:
- "25565:25565"
volumes:

View File

@@ -0,0 +1,11 @@
version: "3.8"
services:
mc:
image: itzg/minecraft-server
ports:
- 25565:25565
environment:
EULA: "TRUE"
VERSION: 1.7.2
WORLD: https://www.minecraftmaps.com/survival-maps/cube-survival/download

View File

@@ -0,0 +1,50 @@
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
labels:
app: example
name: example
spec:
replicas: 1
serviceName: example
selector:
matchLabels:
app: example
template:
metadata:
labels:
app: example
spec:
containers:
- name: mc
image: itzg/minecraft-server
env:
- name: EULA
value: "TRUE"
volumeMounts:
- mountPath: /data
name: data
volumeClaimTemplates:
- metadata:
name: data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
---
apiVersion: v1
kind: Service
metadata:
labels:
service: example
name: example
spec:
ports:
- port: 25565
targetPort: 25565
selector:
app: example
type: LoadBalancer

1
examples/modpacks/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
*.zip

View File

@@ -0,0 +1,3 @@
Place server [modpacks downloaded from CurseForge](https://www.curseforge.com/minecraft/modpacks) in this directory.
The example [`docker-compose-curseforge.yml`](../docker-compose-curseforge.yml) references a modpack downloaded from <https://www.curseforge.com/minecraft/modpacks/skyfactory-4/files/3012800>.

View File

@@ -0,0 +1,5 @@
FROM itzg/minecraft-server
ENV TYPE=PAPER
COPY plugins/*.jar /plugins/

View File

@@ -0,0 +1,11 @@
version: '3.7'
services:
mc:
build: .
environment:
EULA: "TRUE"
ports:
- 25565:25565
stdin_open: true
tty: true

View File

@@ -0,0 +1 @@
*.jar

View File

@@ -0,0 +1 @@
Download Bukkit/Spigot plugin jars, such as [WorldEdit](https://dev.bukkit.org/projects/worldedit/files) and place them here. At image build time the `COPY` step will place those jars in `/plugins`. At container startup, the contents of `/plugins` are sync'ed into `/data/plugins` for use with Bukkit/Spigot/Paper server types.

View File

@@ -0,0 +1,122 @@
#!/bin/bash
. /autopause/autopause-fcns.sh
. ${SCRIPTS:-/}start-utils
autopause_error_loop() {
logAutopause "Available interfaces within the docker container:"
INTERFACES=$(echo /sys/class/net/*)
INTERFACES=${INTERFACES//\/sys\/class\/net\//}
logAutopause " $INTERFACES"
logAutopause "Please set the environment variable AUTOPAUSE_KNOCK_INTERFACE to the interface that handles incoming connections."
logAutopause "If unsure which interface to choose, run the ifconfig command in the container."
logAutopause "Autopause failed to initialize. This log entry will be printed every 30 minutes."
while :
do
sleep 1800
logAutopause "Autopause failed to initialize."
done
}
# wait for java process to be started
while :
do
if java_process_exists ; then
break
fi
sleep 0.1
done
# check for interface existence
if [[ -z "$AUTOPAUSE_KNOCK_INTERFACE" ]] ; then
logAutopause "AUTOPAUSE_KNOCK_INTERFACE variable must not be empty!"
autopause_error_loop
fi
if ! [[ -d "/sys/class/net/$AUTOPAUSE_KNOCK_INTERFACE" ]] ; then
logAutopause "Selected interface \"$AUTOPAUSE_KNOCK_INTERFACE\" does not exist!"
autopause_error_loop
fi
sudo /usr/sbin/knockd -c /tmp/knockd-config.cfg -d -i "$AUTOPAUSE_KNOCK_INTERFACE"
if [ $? -ne 0 ] ; then
logAutopause "Failed to start knockd daemon."
logAutopause "Probable cause: Unable to attach to interface \"$AUTOPAUSE_KNOCK_INTERFACE\"."
autopause_error_loop
fi
STATE=INIT
while :
do
case X$STATE in
XINIT)
# Server startup
if mc_server_listening ; then
TIME_THRESH=$(($(current_uptime)+$AUTOPAUSE_TIMEOUT_INIT))
logAutopause "MC Server listening for connections - stopping in $AUTOPAUSE_TIMEOUT_INIT seconds"
STATE=K
fi
;;
XK)
# Knocked
if java_clients_connected ; then
logAutopause "Client connected - waiting for disconnect"
STATE=E
else
if [[ $(current_uptime) -ge $TIME_THRESH ]] ; then
logAutopause "No client connected since startup / knocked - stopping"
/autopause/pause.sh
STATE=S
fi
fi
;;
XE)
# Established
if ! java_clients_connected ; then
TIME_THRESH=$(($(current_uptime)+$AUTOPAUSE_TIMEOUT_EST))
logAutopause "All clients disconnected - stopping in $AUTOPAUSE_TIMEOUT_EST seconds"
STATE=I
fi
;;
XI)
# Idle
if java_clients_connected ; then
logAutopause "Client reconnected - waiting for disconnect"
STATE=E
else
if [[ $(current_uptime) -ge $TIME_THRESH ]] ; then
logAutopause "No client reconnected - stopping"
/autopause/pause.sh
STATE=S
fi
fi
;;
XS)
# Stopped
if rcon_client_exists ; then
/autopause/resume.sh
fi
if java_running ; then
if java_clients_connected ; then
logAutopause "Client connected - waiting for disconnect"
STATE=E
else
TIME_THRESH=$(($(current_uptime)+$AUTOPAUSE_TIMEOUT_KN))
logAutopause "Server was knocked - waiting for clients or timeout"
STATE=K
fi
fi
;;
*)
logAutopause "Error: invalid state: $STATE"
;;
esac
if [[ "$STATE" == "S" ]] ; then
# before rcon times out
sleep 2
else
sleep $AUTOPAUSE_PERIOD
fi
done

View File

@@ -0,0 +1,31 @@
#!/bin/bash
current_uptime() {
echo $(awk '{print $1}' /proc/uptime | cut -d . -f 1)
}
java_running() {
[[ $( ps -a -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]]
}
java_process_exists() {
[[ -n "$(ps -a -o comm | grep 'java')" ]]
}
rcon_client_exists() {
[[ -n "$(ps -a -o comm | grep 'rcon-cli')" ]]
}
mc_server_listening() {
mc-monitor status --host localhost --port $SERVER_PORT --timeout 10s >& /dev/null
}
java_clients_connected() {
local connections
if java_running ; then
connections=$(mc-monitor status --host localhost --port $SERVER_PORT --show-player-count)
else
connections=0
fi
(( $connections > 0 ))
}

View File

@@ -0,0 +1,15 @@
[options]
logfile = /dev/null
[unpauseMCServer-server]
sequence = 25565
seq_timeout = 1
command = /sbin/su-exec minecraft:minecraft /autopause/resume.sh
tcpflags = syn
[unpauseMCServer-rcon]
sequence = 25575
seq_timeout = 1
command = /sbin/su-exec minecraft:minecraft /autopause/resume.sh
tcpflags = syn
[unpauseMCServer-bedrock]
sequence = 19132:udp
command = /usr/sbin/gosu minecraft:minecraft /autopause/resume.sh

21
files/autopause/pause.sh Executable file
View File

@@ -0,0 +1,21 @@
#!/bin/bash
. /start-utils
if [[ $( ps -a -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]] ; then
# save world
rcon-cli save-all >/dev/null
# wait until mc-monitor is no longer connected to the server
while :
do
if [[ -z "$(netstat -nt | grep "127.0.0.1:$SERVER_PORT" | grep 'ESTABLISHED')" ]]; then
break
fi
sleep 0.1
done
# finally pause the process
logAutopauseAction "Pausing Java process"
pkill -STOP java
fi

8
files/autopause/resume.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/bash
. /start-utils
if [[ $( ps -a -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^T.*$ ]] ; then
logAutopauseAction "Knocked, resuming Java process"
pkill -CONT java
fi

2
files/sudoers-mc Normal file
View File

@@ -0,0 +1,2 @@
%minecraft ALL=(ALL) NOPASSWD:/usr/bin/pkill
%minecraft ALL=(ALL) NOPASSWD:/usr/sbin/knockd

34
log4j2.xml Normal file
View File

@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN" packages="com.mojang.util">
<Appenders>
<Console name="SysOut" target="SYSTEM_OUT">
<PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level]: %msg%n" />
</Console>
<Queue name="ServerGuiConsole">
<PatternLayout pattern="[%d{HH:mm:ss} %level]: %msg%n" />
</Queue>
<RollingRandomAccessFile name="File" fileName="logs/latest.log" filePattern="logs/%d{yyyy-MM-dd}-%i.log.gz">
<PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level]: %msg%n" />
<Policies>
<TimeBasedTriggeringPolicy />
<OnStartupTriggeringPolicy />
</Policies>
<DefaultRolloverStrategy>
<Delete basePath="logs">
<IfFileName glob="*.log.gz" />
<IfLastModified age="7d" />
</Delete>
</DefaultRolloverStrategy>
</RollingRandomAccessFile>
</Appenders>
<Loggers>
<Root level="info">
<filters>
<MarkerFilter marker="NETWORK_PACKETS" onMatch="DENY" onMismatch="NEUTRAL" />
</filters>
<AppenderRef ref="SysOut"/>
<AppenderRef ref="File"/>
<AppenderRef ref="ServerGuiConsole"/>
</Root>
</Loggers>
</Configuration>

View File

@@ -1,7 +0,0 @@
.[] |
select(.elements | length > 1) |
select(.elements[].elements[] | select(.class == "version" and .text == $version)) |
.elements[].elements[] |
select(.class|contains("server-jar")) |
.elements[] | select(.name="a") |
.href

View File

@@ -22,6 +22,7 @@ snooper-enabled=true
texture-pack=
online-mode=true
resource-pack=
resource-pack-sha1=
pvp=true
difficulty=1
enable-command-block=true
@@ -36,3 +37,15 @@ motd=A Minecraft Server powered by Docker
generator-settings=
rcon.password=
max-world-size=29999984
broadcast-console-to-ops=true
broadcast-rcon-to-ops=true
enable-jmx-monitoring=false
sync-chunk-writes=true
enable-status=true
entity-broadcast-range-percentage=100
function-permission-level=2
network-compression-threshold=256
op-permission-level=4
prevent-proxy-connections=false
use-native-transport=true
enforce-whitelist=false

40
start Normal file → Executable file
View File

@@ -1,22 +1,46 @@
#!/bin/bash
. ${SCRIPTS:-/}start-utils
umask 0002
chmod g+w /data
if [ $(id -u) = 0 ]; then
if [[ -v UID && $UID != $(id -u) ]]; then
usermod -u $UID minecraft
if ! isTrue "${SKIP_SUDO:-false}" && [ $(id -u) = 0 ]; then
runAsUser=minecraft
runAsGroup=minecraft
if [[ -v UID ]]; then
if [[ $UID != 0 ]]; then
if [[ $UID != $(id -u minecraft) ]]; then
log "Changing uid of minecraft to $UID"
usermod -u $UID minecraft
fi
else
runAsUser=root
fi
fi
if [[ -v GID ]]; then
groupmod -o -g $GID minecraft
if [[ $GID != 0 ]]; then
if [[ $GID != $(id -g minecraft) ]]; then
log "Changing gid of minecraft to $GID"
groupmod -o -g $GID minecraft
fi
else
runAsGroup=root
fi
fi
if [[ $(stat -c "%u" /data) != $UID ]]; then
echo "Changing ownership of /data to $UID ..."
chown -R minecraft:minecraft /data
log "Changing ownership of /data to $UID ..."
chown -R ${runAsUser}:${runAsGroup} /data
fi
exec su-exec minecraft:minecraft /start-configuration $@
if [[ ${SKIP_NSSWITCH_CONF^^} != TRUE ]]; then
echo 'hosts: files dns' > /etc/nsswitch.conf
fi
exec su-exec ${runAsUser}:${runAsGroup} ${SCRIPTS:-/}start-configuration $@
else
exec /start-configuration $@
exec ${SCRIPTS:-/}start-configuration $@
fi

67
start-autopause Executable file
View File

@@ -0,0 +1,67 @@
#!/bin/bash
. ${SCRIPTS:-/}start-utils
log "Autopause functionality enabled"
cp /autopause/knockd-config.cfg /tmp/knockd-config.cfg
# update server port to listen to
regseq="^\s*sequence\s*=\s*$SERVER_PORT\s*$"
linenum=$(grep -nm1 sequence /tmp/knockd-config.cfg | cut -d : -f 1 | tail -n1)
if ! [[ $(awk "NR==$linenum" /tmp/knockd-config.cfg) =~ $regseq ]]; then
sed -i "${linenum}s/sequence.*/sequence = $SERVER_PORT/" /tmp/knockd-config.cfg
log "Updated server port in knockd config"
fi
# update rcon port to listen to
regseq="^\s*sequence\s*=\s*$RCON_PORT\s*$"
linenum=$(grep -nm2 sequence /tmp/knockd-config.cfg | cut -d : -f 1 | tail -n1)
if ! [[ $(awk "NR==$linenum" /tmp/knockd-config.cfg) =~ $regseq ]]; then
sed -i "${linenum}s/sequence.*/sequence = $RCON_PORT/" /tmp/knockd-config.cfg
log "Updated rcon port in knockd config"
fi
if ! [[ $AUTOPAUSE_PERIOD =~ ^[0-9]+$ ]]; then
AUTOPAUSE_PERIOD=10
export AUTOPAUSE_PERIOD
log "Warning: AUTOPAUSE_PERIOD is not numeric, set to 10 (seconds)"
fi
if [ "$AUTOPAUSE_PERIOD" -eq "0" ] ; then
AUTOPAUSE_PERIOD=10
export AUTOPAUSE_PERIOD
log "Warning: AUTOPAUSE_PERIOD must not be 0, set to 10 (seconds)"
fi
if ! [[ $AUTOPAUSE_TIMEOUT_KN =~ ^[0-9]+$ ]] ; then
AUTOPAUSE_TIMEOUT_KN=120
export AUTOPAUSE_TIMEOUT_KN
log "Warning: AUTOPAUSE_TIMEOUT_KN is not numeric, set to 120 (seconds)"
fi
if ! [[ $AUTOPAUSE_TIMEOUT_EST =~ ^[0-9]+$ ]] ; then
AUTOPAUSE_TIMEOUT_EST=3600
export AUTOPAUSE_TIMEOUT_EST
log "Warning: AUTOPAUSE_TIMEOUT_EST is not numeric, set to 3600 (seconds)"
fi
if ! [[ $AUTOPAUSE_TIMEOUT_INIT =~ ^[0-9]+$ ]] ; then
AUTOPAUSE_TIMEOUT_INIT=600
export AUTOPAUSE_TIMEOUT_INIT
log "Warning: AUTOPAUSE_TIMEOUT_INIT is not numeric, set to 600 (seconds)"
fi
if [[ "$AUTOPAUSE_KNOCK_INTERFACE" == "lo" ]] ; then
log "Warning: AUTOPAUSE_KNOCK_INTERFACE is set to the local loopback interface."
log " This is not advisable, as incoming connections are likely not picked up there."
log " Continuing with this setting."
fi
if [[ -n "$MAX_TICK_TIME" && "$MAX_TICK_TIME" != "-1" ]] ; then
log "Warning: MAX_TICK_TIME is non-default, for autopause to work properly, this check should be disabled (-1 for versions >= 1.8.1)"
elif [[ -z "$MAX_TICK_TIME" ]] ; then
if versionLessThan 1.8.1; then
# 10 years
MAX_TICK_TIME=315360000000
else
MAX_TICK_TIME=-1
fi
export MAX_TICK_TIME
fi
/autopause/autopause-daemon.sh &

149
start-configuration Normal file → Executable file
View File

@@ -1,105 +1,168 @@
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
# shellcheck source=start-utils
. ${SCRIPTS:-/}start-utils
: "${EULA:=}"
: "${PROXY:=}"
: "${RCON_PASSWORD_FILE:=}"
shopt -s nullglob
isDebugging && set -x
#umask 002
export HOME=/data
log "Running as uid=$(id -u) gid=$(id -g) with /data as '$(ls -lnd /data)'"
if [ ! -e /data/eula.txt ]; then
if [ "$EULA" != "" ]; then
echo "# Generated via Docker on $(date)" > eula.txt
echo "eula=$EULA" >> eula.txt
if [ $? != 0 ]; then
echo "ERROR: unable to write eula to /data. Please make sure attached directory is writable by uid=${UID}"
exit 2
fi
else
echo ""
echo "Please accept the Minecraft EULA at"
echo " https://account.mojang.com/documents/minecraft_eula"
echo "by adding the following immediately after 'docker run':"
echo " -e EULA=TRUE"
echo ""
if ! isTrue "$EULA"; then
log ""
log "Please accept the Minecraft EULA at"
log " https://account.mojang.com/documents/minecraft_eula"
log "by adding the following immediately after 'docker run':"
log " -e EULA=TRUE"
log ""
exit 1
fi
writeEula
fi
echo "Running as uid=$(id -u) gid=$(id -g) with /data as '$(ls -lnd /data)'"
if ! touch /data/.verify_access; then
echo "ERROR: /data doesn't seem to be writable. Please make sure attached directory is writable by uid=$(id -u)"
exit 2
fi
rm /data/.verify_access || true
if [[ $PROXY ]]; then
export http_proxy="$PROXY"
export https_proxy="$PROXY"
echo "INFO: Giving proxy time to startup..."
export JAVA_TOOL_OPTIONS+="-Djava.net.useSystemProxies=true"
log "INFO: Giving proxy time to startup..."
sleep 5
fi
export SERVER_PROPERTIES=/data/server.properties
if [[ $RCON_PASSWORD_FILE ]]; then
log ""
if [ ! -e ${RCON_PASSWORD_FILE} ]; then
log "Initial RCON password file ${RCON_PASSWORD_FILE} does not seems to exist."
log "Please ensure your configuration."
log "If you are using Docker Secrets feature, please check this for further information: "
log " https://docs.docker.com/engine/swarm/secrets"
log ""
exit 1
else
RCON_PASSWORD=$(cat ${RCON_PASSWORD_FILE})
export RCON_PASSWORD
fi
log ""
fi
if ! which java > /dev/null; then
log "Fixing PATH to include java"
PATH="${PATH}:/usr/bin"
fi
export VERSIONS_JSON=https://launchermeta.mojang.com/mc/game/version_manifest.json
echo "Checking version information."
case "X$VERSION" in
X|XLATEST|Xlatest)
export VANILLA_VERSION=`curl -fsSL $VERSIONS_JSON | jq -r '.latest.release'`
if ! VANILLA_VERSION=$(get --json-path '$.latest.release' "$VERSIONS_JSON"); then
log "ERROR: version lookup failed: $VANILLA_VERSION"
exit 1
fi
;;
XSNAPSHOT|Xsnapshot)
export VANILLA_VERSION=`curl -fsSL $VERSIONS_JSON | jq -r '.latest.snapshot'`
;;
X[1-9]*)
export VANILLA_VERSION=$VERSION
if ! VANILLA_VERSION=$(get --json-path '$.latest.snapshot' "$VERSIONS_JSON"); then
log "ERROR: version lookup failed: $VANILLA_VERSION"
exit 1
fi
;;
*)
export VANILLA_VERSION=`curl -fsSL $VERSIONS_JSON | jq -r '.latest.release'`
VANILLA_VERSION=$VERSION
;;
esac
export VANILLA_VERSION
log "Resolved version given ${VERSION} into ${VANILLA_VERSION}"
cd /data
cd /data || exit 1
export ORIGINAL_TYPE=${TYPE^^}
echo "Checking type information."
if isTrue "${ENABLE_AUTOPAUSE}"; then
${SCRIPTS:-/}start-autopause
fi
log "Resolving type given ${TYPE}"
case "${TYPE^^}" in
*BUKKIT|SPIGOT)
exec /start-deployBukkitSpigot $@
exec ${SCRIPTS:-/}start-deployBukkitSpigot "$@"
;;
PAPER)
exec /start-deployPaper $@
exec ${SCRIPTS:-/}start-deployPaper "$@"
;;
FORGE)
exec /start-deployForge $@
exec ${SCRIPTS:-/}start-deployForge "$@"
;;
FABRIC)
exec /start-deployFabric $@
exec ${SCRIPTS:-/}start-deployFabric "$@"
;;
FTB|CURSEFORGE)
exec /start-deployFTB $@
exec ${SCRIPTS:-/}start-deployCF "$@"
;;
VANILLA)
exec /start-deployVanilla $@
exec "${SCRIPTS:-/}start-deployVanilla" "$@"
;;
SPONGEVANILLA)
exec /start-deploySpongeVanilla $@
exec ${SCRIPTS:-/}start-deploySpongeVanilla "$@"
;;
CUSTOM)
exec /start-deployCustom $@
exec ${SCRIPTS:-/}start-deployCustom "$@"
;;
CURSE_INSTANCE)
exec ${SCRIPTS:-/}start-validateCurseInstance "$@"
;;
MAGMA)
exec ${SCRIPTS:-/}start-deployMagma "$@"
;;
MOHIST)
exec ${SCRIPTS:-/}start-deployMohist "$@"
;;
CATSERVER)
exec ${SCRIPTS:-/}start-deployCatserver "$@"
;;
PURPUR)
exec ${SCRIPTS:-/}start-deployPurpur "$@"
;;
AIRPLANE)
exec ${SCRIPTS:-/}start-deployAirplane "$@"
;;
CANYON)
exec ${SCRIPTS:-/}start-deployCanyon "$@"
;;
LIMBO)
exec ${SCRIPTS:-/}start-deployLimbo "$@"
;;
*)
echo "Invalid type: '$TYPE'"
echo "Must be: VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, FTB, CURSEFORGE, SPONGEVANILLA"
log "Invalid type: '$TYPE'"
log "Must be: VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, FTBA (multiarch-only),"
log " CURSE_INSTANCE, CURSEFORGE, SPONGEVANILLA, PURPUR, CUSTOM,"
log " MAGMA, MOHIST, CATSERVER, AIRPLANE, CANYON, LIMBO"
exit 1
;;

52
start-deployAirplane Executable file
View File

@@ -0,0 +1,52 @@
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
. ${SCRIPTS:-/}start-utils
isDebugging && set -x
if [ "${VERSION}" != "LATEST" ] && [ "${VERSION}" != "1.16" ] && [ "${VERSION}" != "1.17" ] && [ "${VERSION}" != "PURPUR" ] && [ "${VERSION}" != "PURPUR-1.16" ] ; then
log "ERROR: Airplane server type only supports VERSION=LATEST, VERSION=1.17, VERSION=1.16, VERSION=PURPUR or VERSION=PURPUR-1.16. Note that these are branches, not #.#.# versions."
exit 1
fi
: ${AIRPLANE_BUILD:=lastSuccessfulBuild}
: ${AIRPLANE_TYPE:=airplane}
if [ "${VERSION}" = "LATEST" ] || [ "${VERSION}" = "1.17" ]; then
AIRPLANE_BRANCH="1.17"
fi
if [ "${VERSION}" = "1.16" ]; then
AIRPLANE_BRANCH="1.16"
fi
if [ "${VERSION}" = "PURPUR" ]; then
AIRPLANE_BRANCH="Purpur-1.17"
AIRPLANE_TYPE="airplanepurpur"
fi
if [ "${VERSION}" = "PURPUR-1.16" ]; then
AIRPLANE_BRANCH="Purpur-1.16"
AIRPLANE_TYPE="airplanepurpur"
fi
log "Using Airplane-${AIRPLANE_BRANCH} branch"
export SERVER=airplane-${AIRPLANE_BRANCH}-${AIRPLANE_BUILD}.jar
if [ ! -f "$SERVER" ] || isTrue "${FORCE_REDOWNLOAD:-false}"; then
downloadUrl="https://ci.tivy.ca/job/Airplane-${AIRPLANE_BRANCH}/${AIRPLANE_BUILD}/artifact/launcher-${AIRPLANE_TYPE}.jar"
log "Downloading Airplane from $downloadUrl ..."
curl -fsSL -o "$SERVER" "$downloadUrl"
if [ ! -f "$SERVER" ]; then
log "ERROR: failed to download from $downloadUrl (status=$?)"
exit 3
fi
fi
# Normalize on Spigot for later operations
export TYPE=SPIGOT
export SKIP_LOG4J_CONFIG=true
exec ${SCRIPTS:-/}start-spiget "$@"

114
start-deployBukkitSpigot Normal file → Executable file
View File

@@ -1,24 +1,45 @@
#!/bin/bash
. ${SCRIPTS:-/}start-utils
isDebugging && set -x
set -e
function buildSpigotFromSource {
echo "Building Spigot $VANILLA_VERSION from source, might take a while, get some coffee"
if [[ ${TYPE^^} = *BUKKIT ]] && ! versionLessThan "1.14"; then
log "ERR craftbukkit build is only supported for versions less than 1.14"
exit 1
fi
log "Building Spigot $VANILLA_VERSION from source, might take a while, get some coffee"
rm -rf /data/temp
mkdir /data/temp
cd /data/temp
jvmOpts="-Xms${INIT_MEMORY:-$MEMORY} -Xmx${MAX_MEMORY:-$MEMORY}"
logn ''
curl -sSL -o /data/temp/BuildTools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar && \
java $jvmOpts -jar /data/temp/BuildTools.jar --rev $VANILLA_VERSION 2>&1 |tee /data/spigot_build.log| while read l; do echo -n .; done; echo "done"
if ! mv spigot-*.jar /data/spigot_server.jar; then
echo "ERR failed to build Spigot"
cat /data/spigot_build.log
exit 1
fi
mv craftbukkit-*.jar /data/craftbukkit_server.jar
echo "Cleaning up"
java $jvmOpts -jar /data/temp/BuildTools.jar --rev $VANILLA_VERSION 2>&1 |tee /data/spigot_build.log| while read l; do echo -n .; done; log "done"
case ${TYPE^^} in
SPIGOT)
if ! mv spigot-*.jar /data/${SERVER}; then
log "ERR failed to build Spigot"
cat /data/spigot_build.log
exit 1
fi
;;
*BUKKIT)
if ! mv craftbukkit-*.jar /data/${SERVER}; then
log "ERR failed to build Spigot"
cat /data/spigot_build.log
exit 1
fi
;;
esac
log "Cleaning up"
rm -rf /data/temp
cd /data
}
@@ -38,51 +59,74 @@ function downloadSpigot {
;;
esac
local downloadVersion
if [[ ${VERSION} == LATEST ]]; then
downloadVersion=${VANILLA_VERSION}
else
downloadVersion=${VERSION}
if [[ ${VERSION^^} = LATEST ]]; then
VANILLA_VERSION=$(restify https://getbukkit.org/download/spigot --attribute='property=og:title' | jq -r '.[0] | .attributes | select(.property == "og:title") | .content | split(" ") | .[-1]')
fi
if [[ -z $downloadUrl ]]; then
downloadUrl="https://cdn.getbukkit.org/${getbukkitFlavor}/${getbukkitFlavor}-${downloadVersion}.jar"
if versionLessThan 1.16.5; then
downloadUrl="https://cdn.getbukkit.org/${getbukkitFlavor}/${getbukkitFlavor}-${VANILLA_VERSION}.jar"
else
downloadUrl="https://download.getbukkit.org/${getbukkitFlavor}/${getbukkitFlavor}-${VANILLA_VERSION}.jar"
fi
fi
echo "Downloading $match from $downloadUrl ..."
curl -fsSL -o $SERVER "$downloadUrl"
setServerVar
if [ -f $SERVER ]; then
# tell curl to only download when newer
curlArgs="-z $SERVER"
fi
if isDebugging; then
curlArgs="$curlArgs -v"
fi
log "Downloading $match from $downloadUrl ..."
curl -fsSL -o $SERVER $curlArgs "$downloadUrl"
if [[ $? != 0 || $(grep -c "DOCTYPE html" $SERVER) != 0 ]]; then
cat <<EOF
ERROR: failed to download from $downloadUrl
Visit https://getbukkit.org/download/${getbukkitFlavor} to lookup the
exact version, such as 1.4.6-R0.4-SNAPSHOT or 1.8-R0.1-SNAPSHOT-LATEST
exact version, such as 1.4.6-R0.4-SNAPSHOT or 1.8-R0.1-SNAPSHOT-latest.
Click into the version entry to find the **exact** version, because something
like "1.8" is not sufficient according to their download naming.
EOF
if isDebugging && [[ $(grep -c "DOCTYPE html" $SERVER) != 0 ]]; then
cat $SERVER
fi
# remove invalid download
rm $SERVER
exit 3
fi
JVM_OPTS="${JVM_OPTS} -DIReallyKnowWhatIAmDoingISwear"
export JVM_OPTS
}
function setServerVar {
case "$TYPE" in
*BUKKIT|*bukkit)
export SERVER=craftbukkit_server-${VANILLA_VERSION}.jar
;;
*)
export SERVER=spigot_server-${VANILLA_VERSION}.jar
;;
esac
}
case "$TYPE" in
*BUKKIT|*bukkit)
export SERVER=craftbukkit_server.jar
;;
*)
export SERVER=spigot_server.jar
;;
esac
if [ ! -f $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then
if [[ "$BUILD_SPIGOT_FROM_SOURCE" = TRUE || "$BUILD_SPIGOT_FROM_SOURCE" = true || "$BUILD_FROM_SOURCE" = TRUE || "$BUILD_FROM_SOURCE" = true ]]; then
buildSpigotFromSource
else
downloadSpigot
fi
if isTrue "$BUILD_SPIGOT_FROM_SOURCE" || isTrue "$BUILD_FROM_SOURCE"; then
setServerVar
if [ ! -f $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then
buildSpigotFromSource
fi
else
downloadSpigot
fi
# Normalize on Spigot for operations below
export TYPE=SPIGOT
export SKIP_LOG4J_CONFIG=true
# Continue to Final Setup
exec /start-finalSetup01World $@
exec ${SCRIPTS:-/}start-spiget "$@"

241
start-deployCF Executable file
View File

@@ -0,0 +1,241 @@
#!/bin/bash
set -e
. ${SCRIPTS:-/}start-utils
loadForgeVars() {
cfgFile=${1?}
pat='^([^#;][^=]+)=[:space:]*([^;]*)'
while read -r line || [[ -n "$line" ]] ; do
if [[ $line =~ $pat ]]; then
#echo "MATCHED $line"
k=${BASH_REMATCH[1]}
v=${BASH_REMATCH[2]}
case $k in
FORGEURL)
forgeInstallerUrl="$v"
;;
esac
fi
done < "$cfgFile"
}
isDebugging && set -x
: ${FTB_BASE_DIR:=${CF_BASE_DIR:-/data/FeedTheBeast}}
export FTB_BASE_DIR
legacyJavaFixerUrl=https://ftb.forgecdn.net/FTB2/maven/net/minecraftforge/lex/legacyjavafixer/1.0/legacyjavafixer-1.0.jar
export TYPE=CURSEFORGE
FTB_SERVER_MOD=${FTB_SERVER_MOD:-$CF_SERVER_MOD}
log "Looking for Feed-The-Beast / CurseForge server modpack."
requireVar FTB_SERVER_MOD
if ! isTrue ${USE_MODPACK_START_SCRIPT:-true}; then
if ! [ -f "${FTB_SERVER_MOD}" ]; then
log "ERROR unable to find requested modpack file ${FTB_SERVER_MOD}"
exit 2
fi
needsInstall=true
installMarker=/data/.curseforge-installed
if [ -f $installMarker ]; then
if [ "$(cat $installMarker)" != "${FTB_SERVER_MOD}" ]; then
log "Upgrading modpack"
serverJar=$(find ${FTB_BASE_DIR} -not -name "forge*installer.jar" -name "forge*.jar")
if [[ "${serverJar}" ]]; then
rm -rf $(dirname "${serverJar}")/{mods,*.jar,libraries,resources,scripts,config}
fi
else
needsInstall=false
fi
fi
if $needsInstall; then
log "Unpacking FTB server modpack ${FTB_SERVER_MOD} ..."
mkdir -p ${FTB_BASE_DIR}
unzip -o "${FTB_SERVER_MOD}" -d ${FTB_BASE_DIR} | awk '{printf "."} END {print ""}'
serverJar=$(find ${FTB_BASE_DIR} -type f \( -path "*/libraries/*" -o -path "*/mods/*" \) -prune -o -name "forge*.jar" -not -name "forge*installer.jar" -print)
if [[ -z "$serverJar" ]]; then
if [ -f "${FTB_BASE_DIR}/settings.cfg" ]; then
loadForgeVars "${FTB_BASE_DIR}/settings.cfg"
if [[ $forgeInstallerUrl ]]; then
forgeInstallerJar="${FTB_BASE_DIR}/forge-installer.jar"
if ! curl -fsSL -o "$forgeInstallerJar" "$forgeInstallerUrl" ; then
log "ERROR failed to download Forge installer from $forgeInstallerUrl"
exit 2
fi
fi
else
forgeInstallerJar=$(find "${FTB_BASE_DIR}" -name "forge*installer.jar")
fi
if [[ -z "${forgeInstallerJar}" ]]; then
log "ERROR Unable to find forge installer in modpack"
log " or download using modpack config."
log " Make sure you downloaded the server files."
exit 2
fi
forgeInstallerJar=$(ls -t "${forgeInstallerJar}" | head -1)
log "Installing forge server"
dirOfInstaller=$(dirname "${forgeInstallerJar}")
(cd "${dirOfInstaller}"; java -jar $(basename "${forgeInstallerJar}") --installServer)
fi
echo "${FTB_SERVER_MOD}" > $installMarker
fi
export SERVER=$(find ${FTB_BASE_DIR} -type f \( -path "/libraries/*" -o -path "/mods/*" \) -prune -o -name "forge*.jar" -not -name "forge*installer.jar" -maxdepth 2 -print)
if [[ -z "${SERVER}" || ! -f "${SERVER}" ]]; then
log "ERROR unable to locate installed forge server jar"
isDebugging && find ${FTB_BASE_DIR} -name "forge*.jar"
exit 2
fi
export FTB_DIR=$(dirname "${SERVER}")
exec ${SCRIPTS:-/}start-setupWorld $@
fi
entryScriptExpr="
-name ServerStart.sh
-o -name serverstart.sh
-o -name ServerStartLinux.sh
-o -name LaunchServer.sh
-o -name server-start.sh
-o -name start-server.sh
-o -name startserver.sh
-o -name StartServer.sh
"
if [[ -d ${FTB_BASE_DIR} ]]; then
startScriptCount=$(find ${FTB_BASE_DIR} $entryScriptExpr |wc -l)
if [[ $startScriptCount > 1 ]]; then
log "Conflicting FTB/CurseForge packages have been installed. Please cleanup ${FTB_BASE_DIR}"
exit 2
fi
else
startScriptCount=0
fi
# only download and install if a mod pack isn't already installed
# also check for the start script rather than just the folder
# this allows saving just the world separate from the rest of the data directory
if [[ $startScriptCount = 0 ]]; then
srv_modpack=${FTB_SERVER_MOD}
if isURL "${srv_modpack}"; then
case $srv_modpack in
https://www.feed-the-beast.com/*/download|https://www.curseforge.com/minecraft/modpacks/*/download/*/file)
;;
https://www.curseforge.com/minecraft/modpacks/*/download/*)
srv_modpack=${srv_modpack}/file;;
https://www.feed-the-beast.com/*)
srv_modpack=${srv_modpack}/download;;
esac
file=$(basename $(dirname $srv_modpack))
downloaded=/data/${file}.zip
if [ ! -e $downloaded ]; then
log "Downloading FTB modpack...
$srv_modpack -> $downloaded"
curl -sSL -o $downloaded $srv_modpack
fi
srv_modpack=$downloaded
fi
if [[ "${srv_modpack:0:5}" == "data/" ]]; then
# Prepend with "/"
srv_modpack="/${srv_modpack}"
fi
if [[ ! "${srv_modpack:0:1}" == "/" ]]; then
# If not an absolute path, assume file is in "/data"
srv_modpack=/data/${srv_modpack}
fi
if [[ ! -f "${srv_modpack}" ]]; then
log "FTB server modpack ${srv_modpack} not found."
exit 2
fi
if [[ ! "${srv_modpack: -4}" == ".zip" ]]; then
log "FTB server modpack ${srv_modpack} is not a zip archive."
log "Please set FTB_SERVER_MOD to a file with a .zip extension."
exit 2
fi
log "Unpacking FTB server modpack ${srv_modpack} ..."
mkdir -p ${FTB_BASE_DIR}
unzip -o "${srv_modpack}" -d ${FTB_BASE_DIR} | awk '{printf "."} END {print ""}'
installScript=$(find "${FTB_BASE_DIR}" -maxdepth 2 -type f -name install.sh)
if [[ "$installScript" ]]; then
(
cd "$(dirname "${installScript}")"
chmod +x ./install.sh
log "Running included install.sh"
./install.sh
)
fi
fi
if [[ $(find ${FTB_BASE_DIR} $entryScriptExpr | wc -l) = 0 ]]; then
# Allow up to 2 levels since some modpacks have a top-level directory named
# for the modpack
forgeJar=$(find ${FTB_BASE_DIR} -type f \( -path "/libraries/*" -o -path "/mods/*" \) -prune -o -name "forge*.jar" -not -name "forge*installer.jar" -maxdepth 2 -print)
if [[ "$forgeJar" ]]; then
export FTB_BASE_DIR=$(dirname "${forgeJar}")
log "No entry script found, so building one for ${forgeJar}"
cat > "${FTB_BASE_DIR}/ServerStart.sh" <<EOF
#!/bin/sh
. ./settings-local.sh
java \${JAVA_PARAMETERS} -Xmx\${MAX_RAM} -jar $(basename "${forgeJar}") nogui
EOF
chmod +x "${FTB_BASE_DIR}/ServerStart.sh"
else
log "Please make sure you are using the server version of the FTB modpack!"
exit 2
fi
fi
scriptCount=$(find "${FTB_BASE_DIR}" $entryScriptExpr | wc -l)
if [[ $scriptCount = 0 ]]; then
log "Please make sure you are using the server version of the FTB modpack!"
exit 2
elif [[ $scriptCount > 1 ]]; then
log "Ambigous startup scripts in FTB modpack!"
log "found:"
find ${FTB_BASE_DIR} $entryScriptExpr
exit 2
fi
export FTB_SERVER_START=$(find "${FTB_BASE_DIR}" $entryScriptExpr)
export FTB_DIR=$(dirname "${FTB_SERVER_START}")
chmod a+x "${FTB_SERVER_START}"
grep fml.queryResult=confirm "${FTB_SERVER_START}" > /dev/null || \
sed -i 's/-jar/-Dfml.queryResult=confirm -jar/' "${FTB_SERVER_START}"
sed -i 's/.*read.*Restart now/#\0/' "${FTB_SERVER_START}"
legacyJavaFixerPath="${FTB_DIR}/mods/legacyjavafixer.jar"
if isTrue ${FTB_LEGACYJAVAFIXER} && [ ! -e "${legacyJavaFixerPath}" ]; then
log "Installing legacy java fixer to ${legacyJavaFixerPath}"
curl -sSL -o "${legacyJavaFixerPath}" ${legacyJavaFixerUrl}
fi
if [ -e "${FTB_DIR}/FTBInstall.sh" ]; then
pushd "${FTB_DIR}"
sh FTBInstall.sh
popd
elif [ -e "${FTB_DIR}/Install.sh" ]; then
pushd "${FTB_DIR}"
sh Install.sh
popd
fi
exec ${SCRIPTS:-/}start-setupWorld $@

54
start-deployCanyon Executable file
View File

@@ -0,0 +1,54 @@
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
. ${SCRIPTS:-/}start-utils
isDebugging && set -x
: ${CANYON_BUILD:=lastSuccessfulBuild}
JAVA_VER=$(java -version 2>&1 | head -1 | cut -d'"' -f2 | sed '/^1\./s///' | cut -d'.' -f1)
if [ "${JAVA_VER}" != "8" ]; then
log "ERROR: Canyon server type only supports Java version 8"
exit 1
fi
if [ "${VERSION}" != "b1.7.3" ]; then
log "ERROR: Canyon server type only supports VERSION=b1.7.3"
exit 1
fi
canyonJob="https://ci.velocitypowered.com/job/Canyon"
buildRelPath=$(
curl -fsSL "${canyonJob}/${CANYON_BUILD}/api/json" |
jq -r '.artifacts[0].relativePath'
)
buildNumber=$(
curl -fsSL "${canyonJob}/${CANYON_BUILD}/api/json" |
jq -r '.number'
)
baseName=$(basename "${buildRelPath}")
# Add build tag to non-tagged builds for version detection
if [ ${baseName%.*} = 'canyon-server' ]; then
export SERVER=${baseName%.*}_build${buildNumber}.jar
else
export SERVER="${baseName}"
fi
if [ ! -f "$SERVER" ]; then
downloadUrl="${canyonJob}/${CANYON_BUILD}/artifact/${buildRelPath}"
log "Downloading Canyon build ${buildNumber} from $downloadUrl ..."
curl -fsSL -o "$SERVER" "$downloadUrl"
if [ ! -f "$SERVER" ]; then
log "ERROR: failed to download from $downloadUrl (status=$?)"
exit 3
fi
fi
# Normalize on Spigot for later operations
export TYPE=SPIGOT
export SKIP_LOG4J_CONFIG=true
exec ${SCRIPTS:-/}start-spiget "$@"

32
start-deployCatserver Executable file
View File

@@ -0,0 +1,32 @@
#!/bin/bash
. ${SCRIPTS:-/}start-utils
set -o pipefail
set -e
latestAsset=$(
curl -fsSL https://api.github.com/repos/Luohuayu/CatServer/releases/latest | \
jq '.assets[] | select(.name | match(".*-universal.jar"))'
)
if [[ -z "${latestAsset}" ]]; then
log "ERROR: latest release of Catserver is missing universal.jar asset"
exit 1
fi
isDebugging && log "Latest asset ${latestAsset}"
latestJarName=$(echo ${latestAsset} | jq --raw-output '.name')
latestJarId=$(echo ${latestAsset} | jq --raw-output '.id')
export SERVER="/data/${latestJarName}"
if [ ! -f ${SERVER} ]; then
log "Downloading ${latestJarName}"
curl -H "Accept:application/octet-stream" -o "$SERVER" -fsSL https://api.github.com/repos/Luohuayu/CatServer/releases/assets/${latestJarId}
fi
export SKIP_LOG4J_CONFIG=true
# Continue to Final Setup
exec ${SCRIPTS:-/}start-setupWorld "$@"

22
start-deployCustom Normal file → Executable file
View File

@@ -1,29 +1,35 @@
#!/bin/bash
. /start-utils
. ${SCRIPTS:-/}start-utils
isDebugging && set -x
if isURL ${CUSTOM_SERVER}; then
filename=$(basename ${CUSTOM_SERVER})
export SERVER=/data/${filename}
if [[ -f ${SERVER} ]] || [ -n "$FORCE_REDOWNLOAD" ]; then
echo "Using previously downloaded jar at ${SERVER}"
log "Using previously downloaded jar at ${SERVER}"
else
echo "Downloading custom server jar from ${CUSTOM_SERVER} ..."
log "Downloading custom server jar from ${CUSTOM_SERVER} ..."
if ! curl -sSL -o ${SERVER} ${CUSTOM_SERVER}; then
echo "Failed to download from ${CUSTOM_SERVER}"
log "Failed to download from ${CUSTOM_SERVER}"
exit 2
fi
fi
elif [[ -f ${CUSTOM_SERVER} ]]; then
echo "Using custom server jar at ${CUSTOM_SERVER} ..."
export SERVER=${CUSTOM_SERVER}
elif [[ ${GENERIC_PACK} ]]; then
log "Using custom server jar from generic pack at ${CUSTOM_SERVER} ..."
export SERVER=${CUSTOM_SERVER}
else
echo "CUSTOM_SERVER is not properly set to a URL or existing jar file"
log "CUSTOM_SERVER is not properly set to a URL or existing jar file"
exit 2
fi
# Continue to Final Setup
exec /start-finalSetup01World $@
export SKIP_LOG4J_CONFIG=true
exec ${SCRIPTS:-/}start-setupWorld $@

View File

@@ -1,130 +0,0 @@
#!/bin/bash
. /start-utils
export FTB_BASE_DIR=/data/FeedTheBeast
legacyJavaFixerUrl=http://ftb.cursecdn.com/FTB2/maven/net/minecraftforge/lex/legacyjavafixer/1.0/legacyjavafixer-1.0.jar
export TYPE=FEED-THE-BEAST
FTB_SERVER_MOD=${FTB_SERVER_MOD:-$CF_SERVER_MOD}
echo "Looking for Feed-The-Beast / CurseForge server modpack."
if [[ -z $FTB_SERVER_MOD ]]; then
echo "Environment variable FTB_SERVER_MOD not set."
echo "Set FTB_SERVER_MOD to the file name of the FTB server modpack."
echo "(And place the modpack in the /data directory.)"
exit 2
fi
entryScriptExpr="-name ServerStart.sh -o -name ServerStartLinux.sh -o -name LaunchServer.sh"
if [[ -d ${FTB_BASE_DIR} ]]; then
startScriptCount=$(find ${FTB_BASE_DIR} $entryScriptExpr |wc -l)
if [[ $startScriptCount > 1 ]]; then
echo "Conflicting FTB/CurseForge packages have been installed. Please cleanup ${FTB_BASE_DIR}"
exit 2
fi
else
startScriptCount=0
fi
# only download and install if a mod pack isn't already installed
# also check for the start script rather than just the folder
# this allows saving just the world separate from the rest of the data directory
if [[ $startScriptCount = 0 ]]; then
srv_modpack=${FTB_SERVER_MOD}
if isURL ${srv_modpack}; then
case $srv_modpack in
https://www.feed-the-beast.com/*/download|https://www.curseforge.com/minecraft/modpacks/*/download/*/file)
;;
https://www.curseforge.com/minecraft/modpacks/*/download/*)
srv_modpack=${srv_modpack}/file;;
https://www.feed-the-beast.com/*)
srv_modpack=${srv_modpack}/download;;
esac
file=$(basename $(dirname $srv_modpack))
downloaded=/data/${file}.zip
if [ ! -e $downloaded ]; then
echo "Downloading FTB modpack...
$srv_modpack -> $downloaded"
curl -sSL -o $downloaded $srv_modpack
fi
srv_modpack=$downloaded
fi
if [[ ${srv_modpack:0:5} == "data/" ]]; then
# Prepend with "/"
srv_modpack=/${srv_modpack}
fi
if [[ ! ${srv_modpack:0:1} == "/" ]]; then
# If not an absolute path, assume file is in "/data"
srv_modpack=/data/${srv_modpack}
fi
if [[ ! -f ${srv_modpack} ]]; then
echo "FTB server modpack ${srv_modpack} not found."
exit 2
fi
if [[ ! ${srv_modpack: -4} == ".zip" ]]; then
echo "FTB server modpack ${srv_modpack} is not a zip archive."
echo "Please set FTB_SERVER_MOD to a file with a .zip extension."
exit 2
fi
echo "Unpacking FTB server modpack ${srv_modpack} ..."
mkdir -p ${FTB_BASE_DIR}
unzip -o ${srv_modpack} -d ${FTB_BASE_DIR} | awk '{printf "."} END {print ""}'
fi
if [[ $(find ${FTB_BASE_DIR} $entryScriptExpr | wc -l) = 0 ]]; then
forgeJar=$(find ${FTB_BASE_DIR} -name 'forge*.jar' -a -not -name 'forge*installer')
if [[ "$forgeJar" ]]; then
export FTB_BASE_DIR=$(dirname "${forgeJar}")
echo "No entry script found, so building one for ${forgeJar}"
cat > "${FTB_BASE_DIR}/ServerStart.sh" <<EOF
#!/bin/sh
. ./settings-local.sh
java \${JAVA_PARAMETERS} -Xmx\${MAX_RAM} -jar $(basename "${forgeJar}") nogui
EOF
chmod +x "${FTB_BASE_DIR}/ServerStart.sh"
else
echo "Please make sure you are using the server version of the FTB modpack!"
exit 2
fi
fi
scriptCount=$(find "${FTB_BASE_DIR}" $entryScriptExpr | wc -l)
if [[ $scriptCount = 0 ]]; then
echo "Please make sure you are using the server version of the FTB modpack!"
exit 2
elif [[ $scriptCount > 1 ]]; then
echo "Ambigous startup scripts in FTB modpack!"
echo "found:"
find ${FTB_BASE_DIR} $entryScriptExpr
exit 2
fi
export FTB_SERVER_START=$(find "${FTB_BASE_DIR}" $entryScriptExpr)
export FTB_DIR=$(dirname "${FTB_SERVER_START}")
chmod a+x "${FTB_SERVER_START}"
sed -i 's/-jar/-Dfml.queryResult=confirm -jar/' "${FTB_SERVER_START}"
sed -i 's/.*read.*Restart now/#\0/' "${FTB_SERVER_START}"
legacyJavaFixerPath="${FTB_DIR}/mods/legacyjavafixer.jar"
if isTrue ${FTB_LEGACYJAVAFIXER} && [ ! -e "${legacyJavaFixerPath}" ]; then
echo "Installing legacy java fixer to ${legacyJavaFixerPath}"
curl -sSL -o "${legacyJavaFixerPath}" ${legacyJavaFixerUrl}
fi
if [ -e "${FTB_DIR}/FTBInstall.sh" ]; then
pushd "${FTB_DIR}"
sh FTBInstall.sh
popd
elif [ -e "${FTB_DIR}/Install.sh" ]; then
pushd "${FTB_DIR}"
sh Install.sh
popd
fi
# Continue to Final Setup
exec /start-finalSetup01World $@

82
start-deployFTBA Executable file
View File

@@ -0,0 +1,82 @@
#!/bin/bash
ftbInstallMarker=".ftb-installed"
. ${SCRIPTS:-/}start-utils
isDebugging && set -x
set -e
if ! [[ -v FTB_MODPACK_ID ]]; then
log "ERROR FTB_MODPACK_ID is required with TYPE=FTB"
exit 1
fi
if ! [[ ${FTB_MODPACK_ID} =~ [0-9]+ ]]; then
log "ERROR FTB_MODPACK_ID needs to be numeric"
exit 1
fi
if ! [[ -v FTB_MODPACK_VERSION_ID ]]; then
if ! FTB_MODPACK_VERSION_ID=$(curl -fsSL https://api.modpacks.ch/public/modpack/${FTB_MODPACK_ID} | jq -r '.versions | sort_by(.updated)[-1].id'); then
log "ERROR unable to resolve latest modpack version ID for modpack ${FTB_MODPACK_ID}"
exit 1
fi
elif ! [[ ${FTB_MODPACK_VERSION_ID} =~ [0-9]+ ]]; then
log "ERROR FTB_MODPACK_VERSION_ID needs to be numeric"
exit 1
fi
if ! [ -f "${ftbInstallMarker}" ] || [ $(cat "${ftbInstallMarker}") != "${FTB_MODPACK_ID}=${FTB_MODPACK_VERSION_ID}" ]; then
ftbInstaller=/data/ftb-installer
if ! [[ -f "${ftbInstaller}" ]]; then
log "Downloading FTB installer"
if [ "$(uname -m)" == "aarch64" ]; then
log "Downloading ARM installer"
curl -fsSL https://api.modpacks.ch/public/modpack/1/1/server/arm/linux -o "${ftbInstaller}"
else
log "Downloading x86 installer"
curl -fsSL https://api.modpacks.ch/public/modpack/1/1/server/linux -o "${ftbInstaller}"
fi
chmod +x "${ftbInstaller}"
fi
rm -rf forge*jar mods config libraries defaultconfigs changelogs
log "Installing modpack ID ${FTB_MODPACK_ID}, version ID ${FTB_MODPACK_VERSION_ID}"
${ftbInstaller} ${FTB_MODPACK_ID} ${FTB_MODPACK_VERSION_ID} --noscript --auto
rm -f forge*installer.jar
echo "${FTB_MODPACK_ID}=${FTB_MODPACK_VERSION_ID}" > ${ftbInstallMarker}
writeEula
# some modpacks result in --w----r-- permissions
chmod a+r version.json
else
log "FTB modpack ID ${FTB_MODPACK_ID}, version ID ${FTB_MODPACK_VERSION_ID} is ready to go"
fi
isDebugging && cat version.json
forgeVersion=$(jq -r '.targets|unique[] | select(.name == "forge") | .version' version.json)
fabricVersion=$(jq -r '.targets|unique[] | select(.name == "fabric") | .version' version.json)
mcVersion=$(jq -r '.targets|unique[] | select(.name == "minecraft") | .version' version.json)
variants=(
forge-${mcVersion}-${forgeVersion}.jar
forge-${mcVersion}-${forgeVersion}-universal.jar
forge-${mcVersion}-${forgeVersion}-${mcVersion}-universal.jar
fabric-${mcVersion}-${fabricVersion}-server-launch.jar
)
for f in ${variants[@]}; do
if [ -f $f ]; then
export SERVER=$f
break
fi
done
if ! [ -v SERVER ]; then
log "ERROR unable to locate the installed FTB server jar"
ls *.jar
exit 2
fi
exec ${SCRIPTS:-/}start-setupWorld $@

82
start-deployFabric Normal file → Executable file
View File

@@ -1,72 +1,64 @@
#!/bin/bash
set -u
set -eu
# shellcheck source=start-utils
. ${SCRIPTS:-/}start-utils
requireVar VANILLA_VERSION
export TYPE=FABRIC
export SERVER=fabric-server-${VANILLA_VERSION}.jar
FABRIC_INSTALLER=${FABRIC_INSTALLER:-}
FABRIC_INSTALLER_URL=${FABRIC_INSTALLER_URL:-}
FABRICVERSION=${FABRICVERSION:-LATEST}
if [[ -z $FABRIC_INSTALLER && -z $FABRIC_INSTALLER_URL ]]; then
echo "Checking Fabric version information."
case $FABRICVERSION in
LATEST)
curl -fsSL https://maven.fabricmc.net/net/fabricmc/fabric-installer/maven-metadata.xml | xq -c . > /tmp/fabric.json
FABRIC_VERSION=$(< /tmp/fabric.json jq -r ".metadata.versioning.release")
;;
isDebugging && set -x
*)
FABRIC_VERSION=$FABRICVERSION
;;
esac
if [[ ! -e ${SERVER} ]]; then
FABRIC_INSTALLER="/tmp/fabric-installer-$FABRIC_VERSION.jar"
: ${FABRIC_INSTALLER:=}
: ${FABRIC_INSTALLER_URL:=}
: ${FABRIC_INSTALLER_VERSION:=${FABRICVERSION:-LATEST}}
elif [[ -z $FABRIC_INSTALLER ]]; then
FABRIC_INSTALLER="/tmp/fabric-installer.jar"
elif [[ ! -e $FABRIC_INSTALLER ]]; then
echo "ERROR: the given Fabric installer doesn't exist : $FABRIC_INSTALLER"
exit 2
fi
if [[ -z $FABRIC_INSTALLER && -z $FABRIC_INSTALLER_URL ]]; then
log "Checking Fabric version information."
if [[ ${FABRIC_INSTALLER_VERSION^^} = LATEST ]]; then
FABRIC_INSTALLER_VERSION=$(maven-metadata-release https://maven.fabricmc.net/net/fabricmc/fabric-installer/maven-metadata.xml)
fi
installMarker=".fabric-installed-${FABRIC_VERSION:-manual}"
FABRIC_INSTALLER="fabric-installer-${FABRIC_INSTALLER_VERSION}.jar"
FABRIC_INSTALLER_URL="https://maven.fabricmc.net/net/fabricmc/fabric-installer/${FABRIC_INSTALLER_VERSION}/fabric-installer-${FABRIC_INSTALLER_VERSION}.jar"
elif [[ -z $FABRIC_INSTALLER ]]; then
FABRIC_INSTALLER="fabric-installer.jar"
elif [[ ! -e $FABRIC_INSTALLER ]]; then
log "ERROR: the given Fabric installer doesn't exist : $FABRIC_INSTALLER"
exit 2
fi
if [[ ! -e $installMarker ]]; then
if [[ ! -e $FABRIC_INSTALLER ]]; then
if [[ -z $FABRIC_INSTALLER_URL ]]; then
echo "Downloading $FABRIC_VERSION"
downloadUrl="https://maven.fabricmc.net/net/fabricmc/fabric-installer/$FABRIC_VERSION/fabric-installer-$FABRIC_VERSION.jar"
echo "...trying $downloadUrl"
curl -o $FABRIC_INSTALLER -fsSL $downloadUrl
else
echo "Downloading $FABRIC_INSTALLER_URL ..."
if ! curl -o $FABRIC_INSTALLER -fsSL $FABRIC_INSTALLER_URL; then
echo "Failed to download from given location $FABRIC_INSTALLER_URL"
exit 2
fi
log "Downloading $FABRIC_INSTALLER_URL ..."
if ! get -o "$FABRIC_INSTALLER" "$FABRIC_INSTALLER_URL"; then
log "Failed to download from given location $FABRIC_INSTALLER_URL"
exit 2
fi
fi
echo "Installing Fabric $FABRIC_VERSION using $FABRIC_INSTALLER"
log "Installing Fabric ${VANILLA_VERSION} using $FABRIC_INSTALLER"
tries=3
set +e
while ((--tries >= 0)); do
java -jar $FABRIC_INSTALLER server -mcversion $VANILLA_VERSION -downloadMinecraft
java -jar $FABRIC_INSTALLER server \
-mcversion $VANILLA_VERSION \
-downloadMinecraft \
-dir /data
if [[ $? == 0 ]]; then
break
fi
done
set -e
if (($tries < 0)); then
echo "Fabric failed to install after several tries." >&2
log "Fabric failed to install after several tries." >&2
exit 10
fi
export SERVER=fabric-server-launch.jar
echo "Using server $SERVER"
echo $SERVER > $installMarker
else
export SERVER=$(< $installMarker)
mv fabric-server-launch.jar "${SERVER}"
fi
# Contineut to Final Setup
exec /start-finalSetup01World $@
exec ${SCRIPTS:-/}start-setupWorld "$@"

179
start-deployForge Normal file → Executable file
View File

@@ -1,84 +1,42 @@
#!/bin/bash
export TYPE=FORGE
. ${SCRIPTS:-/}start-utils
: ${FORGEVERSION:=RECOMMENDED}
isDebugging && set -x
if [[ -z $FORGE_INSTALLER && -z $FORGE_INSTALLER_URL ]]; then
norm=$VANILLA_VERSION
get_installer() {
if [[ -z $FORGE_INSTALLER_URL ]]; then
log "Downloading $normForgeVersion"
case $VANILLA_VERSION in
*.*.*)
norm=$VANILLA_VERSION ;;
*.*)
norm=${VANILLA_VERSION}.0 ;;
esac
forgeFileNames="
$normForgeVersion/forge-$normForgeVersion-installer.jar
$shortForgeVersion/forge-$shortForgeVersion-installer.jar
"
#################################################################################
echo "Checking Forge version information."
case $FORGEVERSION in
RECOMMENDED)
curl -fsSL -o /tmp/forge.json http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json
FORGE_VERSION=$(cat /tmp/forge.json | jq -r ".promos[\"$VANILLA_VERSION-recommended\"]")
if [ $FORGE_VERSION = null ]; then
FORGE_VERSION=$(cat /tmp/forge.json | jq -r ".promos[\"$VANILLA_VERSION-latest\"]")
if [ $FORGE_VERSION = null ]; then
echo "ERROR: Version $VANILLA_VERSION is not supported by Forge"
echo " Refer to http://files.minecraftforge.net/ for supported versions"
exit 2
fi
fi
;;
*)
FORGE_VERSION=$FORGEVERSION
;;
esac
normForgeVersion=$VANILLA_VERSION-$FORGE_VERSION-$norm
shortForgeVersion=$VANILLA_VERSION-$FORGE_VERSION
FORGE_INSTALLER="/tmp/forge-$shortForgeVersion-installer.jar"
elif [[ -z $FORGE_INSTALLER ]]; then
FORGE_INSTALLER="/tmp/forge-installer.jar"
elif [[ ! -e $FORGE_INSTALLER ]]; then
echo "ERROR: the given Forge installer doesn't exist : $FORGE_INSTALLER"
exit 2
fi
installMarker=".forge-installed-$shortForgeVersion"
if [ ! -e $installMarker ]; then
if [ ! -e $FORGE_INSTALLER ]; then
if [[ -z $FORGE_INSTALLER_URL ]]; then
echo "Downloading $normForgeVersion"
forgeFileNames="
$normForgeVersion/forge-$normForgeVersion-installer.jar
$shortForgeVersion/forge-$shortForgeVersion-installer.jar
END
"
for fn in $forgeFileNames; do
if [ $fn == END ]; then
echo "Unable to compute URL for $normForgeVersion"
exit 2
fi
downloadUrl=http://files.minecraftforge.net/maven/net/minecraftforge/forge/$fn
echo "...trying $downloadUrl"
if curl -o $FORGE_INSTALLER -fsSL $downloadUrl; then
break
fi
done
else
echo "Downloading $FORGE_INSTALLER_URL ..."
if ! curl -o $FORGE_INSTALLER -fsSL $FORGE_INSTALLER_URL; then
echo "Failed to download from given location $FORGE_INSTALLER_URL"
exit 2
for fn in $forgeFileNames; do
downloadUrl=https://maven.minecraftforge.net/net/minecraftforge/forge/$fn
log "...trying $downloadUrl"
if curl -o $FORGE_INSTALLER -fsSL $downloadUrl; then
return
fi
done
log "Unable to locate usable URL for $normForgeVersion"
exit 2
else
log "Downloading $FORGE_INSTALLER_URL ..."
if ! curl -o $FORGE_INSTALLER -fsSL $FORGE_INSTALLER_URL; then
log "Failed to download from given location $FORGE_INSTALLER_URL"
exit 2
fi
fi
}
echo "Installing Forge $shortForgeVersion using $FORGE_INSTALLER"
install() {
if [ ! -e $FORGE_INSTALLER ]; then
get_installer $normForgeVersion $shortForgeVersion
fi
log "Installing Forge $shortForgeVersion using $FORGE_INSTALLER"
mkdir -p mods
tries=3
while ((--tries >= 0)); do
@@ -88,27 +46,90 @@ if [ ! -e $installMarker ]; then
fi
done
if (($tries < 0)); then
echo "Forge failed to install after several tries." >&2
log "Forge failed to install after several tries." >&2
exit 10
fi
# NOTE $shortForgeVersion will be empty if installer location was given to us
echo "Finding installed server jar..."
log "Finding installed server jar..."
unset -v latest
for file in *forge*.jar; do
[[ $file =~ installer ]] || [[ $file -nt $latest ]] && latest=$file
if ! [[ $file =~ installer ]]; then
if [[ -z $latest ]] || [[ $file -nt $latest ]]; then
latest=$file
fi
fi
done
if [[ -z $latest ]]; then
echo "Unable to derive server jar for Forge"
log "Unable to derive server jar for Forge"
exit 2
fi
export SERVER=$latest
echo "Using server $SERVER"
log "Using server $SERVER"
echo $SERVER > $installMarker
}
resolve_versions() {
if [[ -z $FORGE_INSTALLER && -z $FORGE_INSTALLER_URL ]]; then
norm=$VANILLA_VERSION
case $VANILLA_VERSION in
*.*.*)
norm=$VANILLA_VERSION ;;
*.*)
norm=${VANILLA_VERSION}.0 ;;
esac
#################################################################################
log "Checking Forge version information."
case $FORGEVERSION in
RECOMMENDED)
curl -fsSL -o /tmp/forge.json http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json
FORGE_VERSION=$(cat /tmp/forge.json | jq -r ".promos[\"$VANILLA_VERSION-recommended\"]")
if [ $FORGE_VERSION = null ]; then
FORGE_VERSION=$(cat /tmp/forge.json | jq -r ".promos[\"$VANILLA_VERSION-latest\"]")
if [ $FORGE_VERSION = null ]; then
log "ERROR: Version $VANILLA_VERSION is not supported by Forge"
log " Refer to http://files.minecraftforge.net/ for supported versions"
exit 2
fi
fi
;;
*)
FORGE_VERSION=$FORGEVERSION
;;
esac
normForgeVersion=$VANILLA_VERSION-$FORGE_VERSION-$norm
shortForgeVersion=$VANILLA_VERSION-$FORGE_VERSION
FORGE_INSTALLER="/tmp/forge-$shortForgeVersion-installer.jar"
elif [[ -z $FORGE_INSTALLER ]]; then
FORGE_INSTALLER="/tmp/forge-installer.jar"
elif [[ ! -e $FORGE_INSTALLER ]]; then
log "ERROR: the given Forge installer doesn't exist : $FORGE_INSTALLER"
exit 2
else
shortForgeVersion=$VANILLA_VERSION-${FORGE_INSTALLER_CUSTOM_VERSION:-custom}
fi
}
### main
resolve_versions
installMarker="/data/.forge-installed-$shortForgeVersion"
if [ ! -e $installMarker ]; then
install
else
export SERVER=$(cat $installMarker)
if [ ! -e "$SERVER" ] && versionLessThan 1.17; then
rm "$installMarker"
install
fi
fi
# Continue to Final Setup
exec /start-finalSetup01World $@
exec ${SCRIPTS:-/}start-setupWorld $@

63
start-deployLimbo Executable file
View File

@@ -0,0 +1,63 @@
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
. ${SCRIPTS:-/}start-utils
isDebugging && set -x
: ${LIMBO_BUILD:=LATEST}
: ${FORCE_REDOWNLOAD:=false}
: ${LIMBO_SCHEMA_FILENAME:=default.schem}
: ${LEVEL:=Default;${LIMBO_SCHEMA_FILENAME}}
# defaults to localhost, if this is not set
: ${SERVER_IP:=0.0.0.0}
export LEVEL SERVER_IP
if [[ ${LIMBO_BUILD^^} == LATEST ]]; then
LIMBO_BUILD=lastStableBuild
fi
baseUrl="https://ci.loohpjames.com/job/Limbo/${LIMBO_BUILD}"
buildInfoUrl="${baseUrl}/api/json"
buildJson=$(curl -fsSL "${buildInfoUrl}")
if [ $? != 0 ]; then
log "ERROR failed to get build info from ${buildInfoUrl} (status=$?)"
exit 1
fi
if [[ ${LIMBO_BUILD} = lastStableBuild ]]; then
LIMBO_BUILD=$(jq -r '.number' <<<${buildJson})
log "Resolved latest Limbo build to ${LIMBO_BUILD}"
fi
artifactPath=$(jq -r '.artifacts[] | select(.fileName|test("^Limbo-")) | .relativePath' <<<${buildJson})
defaultSchemaPath=$(jq -r '.artifacts[] | select(.fileName|test(".*\\.schem")) | .relativePath' <<<${buildJson})
export SERVER="limbo-${LIMBO_BUILD}.jar"
if [ ! -f "$SERVER" ] || isTrue "$FORCE_REDOWNLOAD"; then
downloadUrl="${baseUrl}/artifact/${artifactPath}"
log "Downloading Limbo from $downloadUrl ..."
if ! curl -fsSL -o "$SERVER" "$downloadUrl"; then
log "ERROR: failed to download from $downloadUrl (status=$?)"
exit 3
fi
fi
if [ ! -f "${LIMBO_SCHEMA_FILENAME}" ]; then
log "Downloading default schem file"
if ! curl -o "${LIMBO_SCHEMA_FILENAME}" -fsSL "${baseUrl}/artifact/${defaultSchemaPath}"; then
log "ERROR: failed to download schema file $baseUrl (status=$?)"
exit 3
fi
fi
if [[ ${LEVEL} != *\;* ]]; then
LEVEL="${LEVEL};${LIMBO_SCHEMA_FILENAME}"
fi
export LEVEL
export SKIP_LOG4J_CONFIG=true
exec ${SCRIPTS:-/}start-setupWorld $@

92
start-deployMagma Executable file
View File

@@ -0,0 +1,92 @@
#!/bin/bash
. ${SCRIPTS:-/}start-utils
export SKIP_LOG4J_CONFIG=true
isDebugging && set -x
: ${VANILLA_VERSION?}
# stable, dev
: ${MAGMA_CHANNEL:=stable}
magmaDownloadServer() {
url=${1?}
tagName=${2?}
markerFile=${3?}
export SERVER="/data/magma-server-${VANILLA_VERSION}.jar"
log "Downloading Magma server file for ${VANILLA_VERSION} @ ${tagName}"
if ! curl -o /data/magma-server-${VANILLA_VERSION}.jar -fsSL "$url"; then
log "ERROR failed to download Magma server from $url (status=$?)"
exit 1
fi
echo -n "$SERVER" > "$markerFile"
}
magmaHandleInstaller() {
url=${1?}
tagName=${2?}
markerFile=${3?}
installerFile="magma-installer-${VANILLA_VERSION}-${tagName}.jar"
log "Downloading Magma installer file for ${VANILLA_VERSION} @ ${tagName}"
if ! curl -o "$installerFile" -fsSL "$url"; then
log "ERROR failed to download Magma installer from $url (status=$?)"
exit 1
fi
echo "forge" > "$markerFile"
export FORGE_INSTALLER="$installerFile"
export FORGE_INSTALLER_CUSTOM_VERSION="$tagName"
# now hand off the rest to forge
exec ${SCRIPTS:-/}start-deployForge "$@"
}
latestMeta=$(curl -fsSL https://api.magmafoundation.org/api/resources/Magma/${VANILLA_VERSION}/${MAGMA_CHANNEL}/latest || exit $?)
if [ $? != 0 ]; then
log "ERROR failed to locate latest Magma info for ${VANILLA_VERSION} in channel ${MAGMA_CHANNEL} (error=$?)"
exit 1
fi
tagName=$(echo "${latestMeta}" | jq -r '.tag_name')
markerFile=".magma-installed-${VANILLA_VERSION}-${tagName}"
if [ -f "${markerFile}" ]; then
installedTagName=$(cat "${markerFile}")
fi
if [ ! -f "${markerFile}" ]; then
if versionLessThan 1.16; then
assetType=server
else
assetType=installer
fi
assetUrl=$(echo "${latestMeta}" | jq -r ".assets | .[].browser_download_url | select(test(\"${assetType}\"))")
if [ $? != 0 ] || [ -z "$assetUrl" ]; then
log "ERROR failed to extract ${assetType} asset type for ${VANILLA_VERSION} in channel ${MAGMA_CHANNEL}"
exit 1
fi
if [[ ${assetType} = server ]]; then
magmaDownloadServer "$assetUrl" "$tagName" "$markerFile"
else
magmaHandleInstaller "$assetUrl" "$tagName" "$markerFile"
fi
else
export SERVER=$(cat "${markerFile}")
if [[ $SERVER == "forge" ]]; then
export FORGE_INSTALLER="magma-installer-${VANILLA_VERSION}-${tagName}.jar"
export FORGE_INSTALLER_CUSTOM_VERSION="$tagName"
# now hand off the rest to forge
exec ${SCRIPTS:-/}start-deployForge "$@"
fi
fi
exec ${SCRIPTS:-/}start-setupWorld $@

43
start-deployMohist Executable file
View File

@@ -0,0 +1,43 @@
#!/bin/bash
. ${SCRIPTS:-/}start-utils
set -o pipefail
set -e
isDebugging && set -x
requireVar VANILLA_VERSION
: ${MOHIST_BUILD:=lastSuccessfulBuild}
mohistJobs=https://ci.codemc.io/job/MohistMC/job/
mohistJob=${mohistJobs}Mohist-${VANILLA_VERSION}/
if ! curl -X HEAD -o /dev/null -fsSL "${mohistJob}"; then
log "ERROR: mohist builds do not exist for ${VANILLA_VERSION}"
log " check https://ci.codemc.io/job/MohistMC/ for available versions"
log " and set VERSION accordingly"
exit 1
fi
buildRelPath=$(
curl -fsSL "${mohistJob}${MOHIST_BUILD}/api/json" |
jq -r '.artifacts[0].relativePath'
)
baseName=$(basename "${buildRelPath}")
if [[ ${baseName} != *-server.jar* ]]; then
log "ERROR: mohist build for ${VANILLA_VERSION} is not a valid server jar, found ${baseName}"
log " check https://ci.codemc.io/job/MohistMC/ for available versions"
log " and set VERSION accordingly"
exit 1
fi
export SERVER="/data/${baseName}"
if [ ! -f ${SERVER} ]; then
log "Downloading ${baseName}"
curl -o "${SERVER}" -fsSL "${mohistJob}${MOHIST_BUILD}/artifact/${buildRelPath}"
fi
export SKIP_LOG4J_CONFIG=true
exec ${SCRIPTS:-/}start-setupWorld "$@"

85
start-deployPaper Normal file → Executable file
View File

@@ -1,18 +1,79 @@
#!/bin/bash
export SERVER=paper_server.jar
if [ ! -f $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then
downloadUrl=${PAPER_DOWNLOAD_URL:-https://papermc.io/api/v1/paper/${VANILLA_VERSION}/latest/download}
echo "Downloading Paper $VANILLA_VERSION from $downloadUrl ..."
curl -fsSL -o $SERVER "$downloadUrl"
if [ ! -f $SERVER ]; then
echo "ERROR: failed to download from $downloadUrl (status=$?)"
exit 3
fi
. ${SCRIPTS:-/}start-utils
set -o pipefail
isDebugging && set -x
if [[ $PAPER_DOWNLOAD_URL ]]; then
export SERVER=$(getFilenameFromUrl "${PAPER_DOWNLOAD_URL}")
if [ -f "$SERVER" ]; then
zarg=(-z "$SERVER")
fi
echo "Preparing custom PaperMC jar from $PAPER_DOWNLOAD_URL"
curl -fsSL -o "$SERVER" "${zarg[@]}" "${PAPER_DOWNLOAD_URL}"
else
# PaperMC API v2 docs : https://papermc.io/api/docs/swagger-ui/index.html?configUrl=/api/openapi/swagger-config
build=${PAPERBUILD:=$(curl -fsSL "https://papermc.io/api/v2/projects/paper/versions/${VANILLA_VERSION}" -H "accept: application/json" \
| jq '.builds[-1]')}
case $? in
0)
;;
22)
versions=$(curl -fsSL "https://papermc.io/api/v2/projects/paper" -H "accept: application/json")
if [[ $VERSION = LATEST ]]; then
VANILLA_VERSION=$(echo "$versions" | jq -r '.versions[-1]')
log "WARN: using ${VANILLA_VERSION} since that's the latest provided by PaperMC"
# re-execute the current script with the newly computed version
exec "$0" "$@"
fi
log "ERROR: ${VANILLA_VERSION} is not published by PaperMC"
log " Set VERSION to one of the following: "
log " $(echo "$versions" | jq -r '.versions | join(", ")')"
exit 1
;;
*)
echo "ERROR: unknown error while looking up PaperMC version=${VANILLA_VERSION}"
exit 1
;;
esac
if [ $? != 0 ]; then
echo "ERROR: failed to lookup PaperMC build from version ${VANILLA_VERSION}"
exit 1
fi
export SERVER=$(curl -fsSL "https://papermc.io/api/v2/projects/paper/versions/${VANILLA_VERSION}/builds/${build}" -H "accept: application/json" \
| jq -r '.downloads.application.name')
if [ $? != 0 ]; then
echo "ERROR: failed to lookup PaperMC download file from version=${VANILLA_VERSION} build=${build}"
exit 1
fi
if [ -f "$SERVER" ]; then
zarg=(-z "$SERVER")
fi
log "Removing old PaperMC versions ..."
shopt -s nullglob
for f in paper-*.jar; do
[[ $f != $SERVER ]] && rm $f
done
log "Downloading PaperMC $VANILLA_VERSION (build $build) ..."
curl -fsSL -o "$SERVER" "${zarg[@]}" \
"https://papermc.io/api/v2/projects/paper/versions/${VANILLA_VERSION}/builds/${build}/downloads/${SERVER}" \
-H "accept: application/java-archive"
if [ $? != 0 ]; then
echo "ERROR: failed to download PaperMC from version=${VANILLA_VERSION} build=${build} download=${SERVER}"
exit 1
fi
fi
# Normalize on Spigot for operations below
# Normalize on Spigot for downstream operations
export TYPE=SPIGOT
export SKIP_LOG4J_CONFIG=true
# Continue to Final Setup
exec /start-finalSetup01World $@
exec ${SCRIPTS:-/}start-spiget "$@"

37
start-deployPurpur Executable file
View File

@@ -0,0 +1,37 @@
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
. ${SCRIPTS:-/}start-utils
isDebugging && set -x
: ${VANILLA_VERSION:?}
: ${PURPUR_BUILD:=LATEST}
: ${FORCE_REDOWNLOAD:=false}
if [[ ${PURPUR_BUILD} == LATEST ]]; then
PURPUR_BUILD=$(curl -fsSL "https://api.pl3x.net/v2/purpur/${VANILLA_VERSION}" |
jq -r '.builds.latest' || echo "")
if [[ -z ${PURPUR_BUILD} ]]; then
log "ERROR: Failed to locate a Purpur build for ${VANILLA_VERSION}."
log " Please check if a download is available at https://purpur.pl3x.net/downloads/"
exit 3
fi
fi
export SERVER="purpur-${VANILLA_VERSION}-${PURPUR_BUILD}.jar"
if [ ! -f "$SERVER" ] || isTrue "$FORCE_REDOWNLOAD"; then
downloadUrl="https://api.pl3x.net/v2/purpur/${VANILLA_VERSION}/${PURPUR_BUILD}/download"
log "Downloading Purpur from $downloadUrl ..."
if ! curl -fsSL -o "$SERVER" "$downloadUrl"; then
log "ERROR: failed to download from $downloadUrl (status=$?)"
exit 3
fi
fi
# Normalize on Spigot for later operations
export TYPE=SPIGOT
export SKIP_LOG4J_CONFIG=true
exec ${SCRIPTS:-/}start-spiget "$@"

13
start-deploySpongeVanilla Normal file → Executable file
View File

@@ -1,9 +1,13 @@
#!/bin/bash
. ${SCRIPTS:-/}start-utils
export TYPE=spongevanilla
: ${SPONGEBRANCH:=STABLE}
: ${SPONGEVERSION:=}
# Parse branch
echo "Choosing branch for Sponge"
log "Choosing branch for Sponge"
case "$SPONGEBRANCH" in
EXPERIMENTAL|experimental|BLEEDING|bleeding)
@@ -18,7 +22,7 @@ esac
# If not SPONGEVERSION selected, detect last version on selected branch
if [ -z $SPONGEVERSION ]; then
echo "Choosing Version for Sponge"
log "Choosing Version for Sponge"
if [ "$SPONGEBRANCH" == "stable" ]; then
export SPONGEVERSION=`curl -fsSL https://dl-api.spongepowered.org/v1/org.spongepowered/$TYPE | jq -r '.buildTypes.stable.latest.version'`
else
@@ -29,9 +33,8 @@ fi
export SERVER="spongevanilla-$SPONGEVERSION.jar"
if [ ! -e $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then
echo "Downloading $SERVER ..."
log "Downloading $SERVER ..."
curl -sSL -o $SERVER https://repo.spongepowered.org/maven/org/spongepowered/$TYPE/$SPONGEVERSION/$SERVER
fi
# Continue to Final Setup
exec /start-finalSetup01World $@
exec ${SCRIPTS:-/}start-setupWorld $@

35
start-deployVanilla Normal file → Executable file
View File

@@ -1,43 +1,46 @@
#!/bin/bash
. /start-utils
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
isDebugging && set -x
set -o pipefail
export SERVER="minecraft_server.${VANILLA_VERSION// /_}.jar"
if [ ! -e $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then
echo "Downloading $SERVER ..."
if [ ! -e "$SERVER" ] || [ -n "$FORCE_REDOWNLOAD" ]; then
log "Downloading $SERVER ..."
debug "Finding version manifest for $VANILLA_VERSION"
versionManifestUrl=$(curl -fsSL 'https://launchermeta.mojang.com/mc/game/version_manifest.json' | jq --arg VANILLA_VERSION "$VANILLA_VERSION" --raw-output '[.versions[]|select(.id == $VANILLA_VERSION)][0].url')
versionManifestUrl=$(get 'https://launchermeta.mojang.com/mc/game/version_manifest.json' | jq --arg VANILLA_VERSION "$VANILLA_VERSION" --raw-output '[.versions[]|select(.id == $VANILLA_VERSION)][0].url')
result=$?
if [ $result != 0 ]; then
echo "ERROR failed to obtain version manifest URL ($result)"
log "ERROR failed to obtain version manifest URL ($result)"
exit 1
fi
if [ $versionManifestUrl = "null" ]; then
echo "ERROR couldn't find a matching manifest entry for $VANILLA_VERSION"
if [ "$versionManifestUrl" = "null" ]; then
log "ERROR couldn't find a matching manifest entry for $VANILLA_VERSION"
exit 1
fi
debug "Found version manifest at $versionManifestUrl"
serverDownloadUrl=$(curl -fsSL ${versionManifestUrl} | jq --raw-output '.downloads.server.url')
serverDownloadUrl=$(get --json-path '$.downloads.server.url' "${versionManifestUrl}")
result=$?
if [ $result != 0 ]; then
echo "ERROR failed to obtain version manifest from $versionManifestUrl ($result)"
log "ERROR failed to obtain version manifest from $versionManifestUrl ($result)"
exit 1
elif [ "$serverDownloadUrl" = "null" ]; then
log "ERROR version $VANILLA_VERSION does not provide a server download"
exit 1
fi
debug "Downloading server from $serverDownloadUrl"
if isDebugging; then
verbose=-v
fi
curl $verbose -fsSL -o $SERVER $serverDownloadUrl
get -o "$SERVER" "$serverDownloadUrl"
result=$?
if [ $result != 0 ]; then
echo "ERROR failed to download server from $serverDownloadUrl ($result)"
log "ERROR failed to download server from $serverDownloadUrl ($result)"
exit 1
fi
fi
# Continue to Final Setup
exec /start-finalSetup01World $@
isDebugging && ls -l
exec "${SCRIPTS:-/}start-setupWorld" "$@"

268
start-finalExec Executable file
View File

@@ -0,0 +1,268 @@
#!/bin/bash
. ${SCRIPTS:-/}start-utils
isDebugging && set -x
if [ -n "$OPS" ]; then
log "Updating ops"
rm -f /data/ops.txt.converted
echo $OPS | awk -v RS=, '{print}' > /data/ops.txt
fi
if isTrue "${OVERRIDE_OPS}"; then
log "Recreating ops.json file at server startup"
rm -f /data/ops.json
fi
if [ -n "$WHITELIST" ]; then
log "Updating whitelist"
rm -f /data/white-list.txt.converted
echo $WHITELIST | awk -v RS=, '{print}' > /data/white-list.txt
fi
if isTrue "${OVERRIDE_WHITELIST}"; then
log "Recreating whitelist.json file at server startup"
rm -f /data/whitelist.json
fi
if [ -n "$ICON" ]; then
if [ ! -e server-icon.png ] || [ "${OVERRIDE_ICON}" == "TRUE" ]; then
log "Using server icon from $ICON..."
# Not sure what it is yet...call it "img"
curl -sSL -o /tmp/icon.img $ICON
specs=$(identify /tmp/icon.img | awk '{print $2,$3}')
if [ "$specs" = "PNG 64x64" ]; then
mv /tmp/icon.img /data/server-icon.png
else
log "Converting image to 64x64 PNG..."
convert /tmp/icon.img -resize 64x64! /data/server-icon.png
fi
fi
fi
if isTrue ${ENABLE_ROLLING_LOGS:-false}; then
# Set up log configuration
LOGFILE="/data/log4j2.xml"
if [ ! -e "$LOGFILE" ]; then
log "Creating log4j2.xml in ${LOGFILE}"
cp /tmp/log4j2.xml "$LOGFILE"
else
log "log4j2.xml already created, skipping"
fi
JVM_OPTS="-Dlog4j.configurationFile=/data/log4j2.xml ${JVM_OPTS}"
fi
# Make sure files exist and are valid JSON (for pre-1.12 to 1.12 upgrades)
log "Checking for JSON files."
JSON_FILES=$(find /data -maxdepth 1 -name '*.json')
for j in $JSON_FILES; do
if [[ $(cat "$j" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') == "" ]]; then
log "Fixing JSON $j"
echo '[]' > $j
fi
done
# Optional disable console
if versionLessThan 1.14 && [[ ${CONSOLE,,} = false ]]; then
EXTRA_ARGS+=" --noconsole"
fi
# Optional disable GUI for headless servers
if [[ ${GUI} = false || ${GUI} = FALSE ]]; then
EXTRA_ARGS+=" nogui"
fi
# put these prior JVM_OPTS at the end to give any memory settings there higher precedence
log "Setting initial memory to ${INIT_MEMORY:=${MEMORY}} and max to ${MAX_MEMORY:=${MEMORY}}"
expandedDOpts=
if [ -n "$JVM_DD_OPTS" ]; then
for dopt in $JVM_DD_OPTS
do
expandedDOpts="${expandedDOpts} -D${dopt/:/=}"
done
fi
if isTrue ${ENABLE_JMX}; then
: ${JMX_PORT:=7091}
JVM_OPTS="${JVM_OPTS}
-Dcom.sun.management.jmxremote.local.only=false
-Dcom.sun.management.jmxremote.port=${JMX_PORT}
-Dcom.sun.management.jmxremote.rmi.port=${JMX_PORT}
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.host=${JMX_BINDING:-0.0.0.0}
-Djava.rmi.server.hostname=${JMX_HOST:-localhost}"
log "JMX is enabled. Make sure you have port forwarding for ${JMX_PORT}"
fi
if isTrue "${USE_AIKAR_FLAGS}"; then
# From https://mcflags.emc.gs/
if (( $(normalizeMemSize "${MAX_MEMORY}") >= $(normalizeMemSize 12g) )); then
log "Using Aikar's >12GB flags"
G1NewSizePercent=40
G1MaxNewSizePercent=50
G1HeapRegionSize=16M
G1ReservePercent=15
InitiatingHeapOccupancyPercent=20
else
log "Using Aikar's flags"
G1NewSizePercent=30
G1MaxNewSizePercent=40
G1HeapRegionSize=8M
G1ReservePercent=20
InitiatingHeapOccupancyPercent=15
fi
JVM_XX_OPTS="${JVM_XX_OPTS}
-XX:+UseG1GC
-XX:+ParallelRefProcEnabled
-XX:MaxGCPauseMillis=200
-XX:+UnlockExperimentalVMOptions
-XX:+DisableExplicitGC
-XX:+AlwaysPreTouch
-XX:G1NewSizePercent=${G1NewSizePercent}
-XX:G1MaxNewSizePercent=${G1MaxNewSizePercent}
-XX:G1HeapRegionSize=${G1HeapRegionSize}
-XX:G1ReservePercent=${G1ReservePercent}
-XX:G1HeapWastePercent=5
-XX:G1MixedGCCountTarget=4
-XX:InitiatingHeapOccupancyPercent=${InitiatingHeapOccupancyPercent}
-XX:G1MixedGCLiveThresholdPercent=90
-XX:G1RSetUpdatingPauseTimePercent=5
-XX:SurvivorRatio=32
-XX:+PerfDisableSharedMem
-XX:MaxTenuringThreshold=1
-Dusing.aikars.flags=https://mcflags.emc.gs
-Daikars.new.flags=true
"
fi
if isTrue "${USE_LARGE_PAGES}"; then
JVM_XX_OPTS="${JVM_XX_OPTS}
-XX:+UseLargePagesInMetaspace
"
fi
if isTrue "${USE_FLARE_FLAGS}"; then
JVM_XX_OPTS="${JVM_XX_OPTS}
-XX:+UnlockDiagnosticVMOptions
-XX:+DebugNonSafepoints
"
fi
if isTrue "${DEBUG_MEMORY}"; then
log "Memory usage and availability (in MB)"
uname -a
free -m
fi
JVM_OPTS="-Xms${INIT_MEMORY} -Xmx${MAX_MEMORY} ${JVM_OPTS}"
function copyFilesForCurseForge() {
# copy player modification files unconditionally since their
# processing into json is additive anyway
[ -f /data/ops.txt ] && cp -f /data/ops.txt "${FTB_DIR}/"
[ -f /data/white-list.txt ] && cp -f /data/white-list.txt "${FTB_DIR}/"
if [ ! -e "${FTB_DIR}/server-icon.png" -a -e /data/server-icon.png ]; then
cp -f /data/server-icon.png "${FTB_DIR}/"
fi
cp -f /data/eula.txt "${FTB_DIR}/"
}
mcServerRunnerArgs=(
--stop-duration "${STOP_DURATION:-60}s"
--named-pipe "${CONSOLE_IN_NAMED_PIPE:-/tmp/minecraft-console-in}"
)
if [[ ${STOP_SERVER_ANNOUNCE_DELAY} ]]; then
mcServerRunnerArgs+=(--stop-server-announce-delay "${STOP_SERVER_ANNOUNCE_DELAY}s")
fi
if [[ ${TYPE} == "CURSE_INSTANCE" ]]; then
if isTrue ${DEBUG_EXEC}; then
set -x
fi
exec mc-server-runner "${mcServerRunnerArgs[@]}" \
--cf-instance-file "${CURSE_INSTANCE_JSON}" \
java $JVM_XX_OPTS $JVM_OPTS $expandedDOpts -jar _SERVERJAR_ "$@" $EXTRA_ARGS
elif [[ ${TYPE} == "CURSEFORGE" && "${SERVER}" ]]; then
copyFilesForCurseForge
cd "${FTB_DIR}" || (log "ERROR: can't go into ${FTB_DIR}"; exit 1)
log "Starting CurseForge server in ${FTB_DIR}..."
if isTrue ${DEBUG_EXEC}; then
set -x
fi
exec mc-server-runner ${bootstrapArgs} "${mcServerRunnerArgs[@]}" java $JVM_XX_OPTS $JVM_OPTS $expandedDOpts -jar $(basename "${SERVER}") "$@" $EXTRA_ARGS
elif [[ ${TYPE} == "CURSEFORGE" ]]; then
mcServerRunnerArgs+=(--shell bash)
copyFilesForCurseForge
cat > "${FTB_DIR}/settings-local.sh" <<EOF
export MIN_RAM="${INIT_MEMORY}"
export MAX_RAM="${MAX_MEMORY}"
export JAVA_PARAMETERS="${JVM_XX_OPTS} -Xms${INIT_MEMORY} ${JVM_OPTS} $expandedDOpts"
EOF
# patch CurseForge cfg file, if present
if [ -f "${FTB_DIR}/settings.cfg" ]; then
sed -i "s/MAX_RAM=[^;]*/MAX_RAM=${MAX_MEMORY}/" "${FTB_DIR}/settings.cfg"
fi
cd "${FTB_DIR}" || (log "ERROR: can't go into ${FTB_DIR}"; exit 1)
log "Running FTB ${FTB_SERVER_START} in ${FTB_DIR} ..."
finalArgs="${FTB_SERVER_START}"
if isTrue ${SETUP_ONLY:=false}; then
echo "SETUP_ONLY: ${finalArgs}"
exit
fi
if isTrue ${DEBUG_EXEC}; then
set -x
fi
if isTrue ${EXEC_DIRECTLY:-false}; then
"${finalArgs[@]}"
else
exec mc-server-runner "${mcServerRunnerArgs[@]}" "${finalArgs[@]}"
fi
elif [[ -x run.sh ]]; then
log "Using Forge supplied run.sh script..."
echo $JVM_XX_OPTS $JVM_OPTS $expandedDOpts > user_jvm_args.txt
exec mc-server-runner "${mcServerRunnerArgs[@]}" --shell bash run.sh
else
# If we have a bootstrap.txt file... feed that in to the server stdin
if [ -f /data/bootstrap.txt ]; then
bootstrapArgs="--bootstrap /data/bootstrap.txt"
fi
log "Starting the Minecraft server..."
finalArgs=(
$JVM_XX_OPTS
$JVM_OPTS
$expandedDOpts
-jar "$SERVER"
"$@" $EXTRA_ARGS
)
if isTrue ${SETUP_ONLY:=false}; then
echo "SETUP_ONLY: java ${finalArgs[*]}"
exit
fi
if isTrue ${DEBUG_EXEC}; then
set -x
fi
if isTrue ${EXEC_DIRECTLY:-false}; then
exec java "${finalArgs[@]}"
else
exec mc-server-runner ${bootstrapArgs} "${mcServerRunnerArgs[@]}" java "${finalArgs[@]}"
fi
fi

View File

@@ -1,50 +0,0 @@
#!/bin/bash
if [ $TYPE = "FEED-THE-BEAST" ]; then
worldDest=$FTB_BASE_DIR/$LEVEL
else
worldDest=/data/$LEVEL
fi
# If no world exists and a URL for a world is supplied, download it and unpack
if [[ "$WORLD" ]] && [ ! -d "$worldDest" ]; then
case "X$WORLD" in
X[Hh][Tt][Tt][Pp]*)
echo "Downloading world from $WORLD"
curl -sSL -o - "$WORLD" > /data/world.zip
echo "Unzipping world"
unzip -o -q /data/world.zip
rm -f /data/world.zip
if [ ! -d $worldDest ]; then
echo World directory not found
for i in /data/*/level.dat; do
if [ -f "$i" ]; then
d=`dirname "$i"`
echo Renaming world directory from $d
mv -f "$d" $worldDest
fi
done
fi
if [ "$TYPE" = "SPIGOT" ]; then
# Reorganise if a Spigot server
echo "Moving End and Nether maps to Spigot location"
[ -d "$worldDest/DIM1" ] && mv -f "$worldDest/DIM1" "/data/${LEVEL}_the_end"
[ -d "$worldDest/DIM-1" ] && mv -f "$worldDest/DIM-1" "/data/${LEVEL}_nether"
fi
;;
*)
if [[ -d $WORLD ]]; then
if [[ ! -d $worldDest ]]; then
echo "Cloning world directory from $WORLD ..."
cp -r $WORLD $worldDest
else
echo "Skipping clone from $WORLD since $worldDest exists"
fi
else
echo "Invalid URL given for world: Must be HTTP or HTTPS and a ZIP file"
fi
;;
esac
fi
exec /start-finalSetup02Modpack $@

View File

@@ -1,109 +0,0 @@
#!/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
rm -rf /data/plugins/*
else
rm -rf /data/mods/*
fi
fi
# If supplied with a URL for a modpack (simple zip of jars), download it and unpack
if [[ "$MODPACK" ]]; then
EFFECTIVE_MODPACK_URL=$(curl -Ls -o /dev/null -w %{url_effective} $MODPACK)
case "X$EFFECTIVE_MODPACK_URL" in
X[Hh][Tt][Tt][Pp]*.zip)
echo "Downloading mod/plugin pack via HTTP"
echo " from $EFFECTIVE_MODPACK_URL ..."
if ! curl -sSL -o /tmp/modpack.zip "$EFFECTIVE_MODPACK_URL"; then
echo "ERROR: failed to download from $EFFECTIVE_MODPACK_URL"
exit 2
fi
if [ "$TYPE" = "SPIGOT" ]; then
mkdir -p /data/plugins
if ! unzip -o -d /data/plugins /tmp/modpack.zip; then
echo "ERROR: failed to unzip the modpack from $EFFECTIVE_MODPACK_URL"
fi
else
mkdir -p /data/mods
if ! unzip -o -d /data/mods /tmp/modpack.zip; then
echo "ERROR: failed to unzip the modpack from $EFFECTIVE_MODPACK_URL"
fi
fi
rm -f /tmp/modpack.zip
;;
*)
echo "Invalid URL given for modpack: Must be HTTP or HTTPS and a ZIP file"
;;
esac
fi
# If supplied with a URL for a plugin download it.
if [[ "$MODS" ]]; then
for i in ${MODS//,/ }
do
EFFECTIVE_MOD_URL=$(curl -Ls -o /dev/null -w %{url_effective} $i)
case "X$EFFECTIVE_MOD_URL" in
X[Hh][Tt][Tt][Pp]*.jar)
echo "Downloading mod/plugin via HTTP"
echo " from $EFFECTIVE_MOD_URL ..."
if ! curl -sSL -o /tmp/${EFFECTIVE_MOD_URL##*/} $EFFECTIVE_MOD_URL; then
echo "ERROR: failed to download from $EFFECTIVE_MOD_URL to /tmp/${EFFECTIVE_MOD_URL##*/}"
exit 2
fi
if [ "$TYPE" = "SPIGOT" ]; then
mkdir -p /data/plugins
mv /tmp/${EFFECTIVE_MOD_URL##*/} /data/plugins/${EFFECTIVE_MOD_URL##*/}
else
mkdir -p /data/mods
mv /tmp/${EFFECTIVE_MOD_URL##*/} /data/mods/${EFFECTIVE_MOD_URL##*/}
fi
rm -f /tmp/${EFFECTIVE_MOD_URL##*/}
;;
*)
echo "Invalid URL given for modpack: Must be HTTP or HTTPS and a JAR file"
;;
esac
done
fi
if [[ "$MANIFEST" ]]; then
EFFECTIVE_MANIFEST_URL=$(curl -Ls -o /dev/null -w %{url_effective} $MANIFEST)
case "X$EFFECTIVE_MANIFEST_URL" in
X*.json)
if [ -f "${EFFECTIVE_MANIFEST_URL}" ]; then
MOD_DIR=${FTB_BASE_DIR:-/data}/mods
if [ ! -d "$MOD_DIR" ]
then
echo "Creating mods dir $MOD_DIR"
mkdir -p "$MOD_DIR"
fi
echo "Starting manifest download..."
cat "${EFFECTIVE_MANIFEST_URL}" | jq -r '.files[] | (.projectID|tostring) + " " + (.fileID|tostring)'| while read -r p f
do
if [ ! -f $MOD_DIR/${p}_${f}.jar ]
then
redirect_url="$(curl -Ls -o /dev/null -w %{url_effective} ${CURSE_URL_BASE}/${p})"
url="$redirect_url/download/${f}/file"
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."
fi
;;
*)
echo "Invalid manifest file for modpack. Please make sure it is a .json file."
;;
esac
fi
exec /start-finalSetup03Modconfig $@

View File

@@ -1,146 +0,0 @@
#!/bin/bash
# FUNCTIONS
function setServerProp {
local prop=$1
local var=$2
if [ -n "$var" ]; then
# normalize booleans
case ${var^^} in
TRUE|FALSE)
var=${var,,} ;;
esac
echo "Setting ${prop} to '${var}' in ${SERVER_PROPERTIES}"
sed -i "/^${prop}\s*=/ c ${prop}=${var}" "$SERVER_PROPERTIES"
else
echo "Skip setting ${prop}"
fi
}
function customizeServerProps {
if [ -n "$WHITELIST" ]; then
echo "Creating whitelist"
setServerProp "whitelist" "true"
setServerProp "white-list" "true"
fi
# If not provided, generate a reasonable default message-of-the-day,
# which shows up in the server listing in the client
if [ -z "$MOTD" ]; then
# snapshot is the odd case where we have to look at version to identify that label
if [[ ${ORIGINAL_TYPE} == "VANILLA" && ${VERSION} == "SNAPSHOT" ]]; then
label=SNAPSHOT
else
label=${ORIGINAL_TYPE}
fi
# Convert label to title-case
label=${label,,}
label=${label^}
MOTD="A ${label} Minecraft Server powered by Docker"
fi
setServerProp "server-name" "$SERVER_NAME"
setServerProp "server-port" "$SERVER_PORT"
setServerProp "motd" "$MOTD"
setServerProp "allow-nether" "$ALLOW_NETHER"
setServerProp "announce-player-achievements" "$ANNOUNCE_PLAYER_ACHIEVEMENTS"
setServerProp "enable-command-block" "$ENABLE_COMMAND_BLOCK"
setServerProp "spawn-animals" "$SPAWN_ANIMALS"
setServerProp "spawn-monsters" "$SPAWN_MONSTERS"
setServerProp "spawn-npcs" "$SPAWN_NPCS"
setServerProp "generate-structures" "$GENERATE_STRUCTURES"
setServerProp "view-distance" "$VIEW_DISTANCE"
setServerProp "hardcore" "$HARDCORE"
setServerProp "snooper-enabled" "$SNOOPER_ENABLED"
setServerProp "max-build-height" "$MAX_BUILD_HEIGHT"
setServerProp "force-gamemode" "$FORCE_GAMEMODE"
setServerProp "max-tick-time" "$MAX_TICK_TIME"
setServerProp "enable-query" "$ENABLE_QUERY"
setServerProp "query.port" "$QUERY_PORT"
setServerProp "enable-rcon" "$ENABLE_RCON"
setServerProp "rcon.password" "$RCON_PASSWORD"
setServerProp "rcon.port" "$RCON_PORT"
setServerProp "max-players" "$MAX_PLAYERS"
setServerProp "max-world-size" "$MAX_WORLD_SIZE"
setServerProp "level-name" "$LEVEL"
setServerProp "level-seed" "$SEED"
setServerProp "pvp" "$PVP"
setServerProp "generator-settings" "$GENERATOR_SETTINGS"
setServerProp "online-mode" "$ONLINE_MODE"
setServerProp "allow-flight" "$ALLOW_FLIGHT"
setServerProp "level-type" "${LEVEL_TYPE^^}"
if [ -n "$DIFFICULTY" ]; then
case $DIFFICULTY in
peaceful|0)
DIFFICULTY=0
;;
easy|1)
DIFFICULTY=1
;;
normal|2)
DIFFICULTY=2
;;
hard|3)
DIFFICULTY=3
;;
*)
echo "DIFFICULTY must be peaceful, easy, normal, or hard."
exit 1
;;
esac
setServerProp "difficulty" "$DIFFICULTY"
fi
if [ -n "$MODE" ]; then
echo "Setting mode"
MODE_LC=$( echo $MODE | tr '[:upper:]' '[:lower:]' )
case $MODE_LC in
0|1|2|3)
;;
su*)
MODE=0
;;
c*)
MODE=1
;;
a*)
MODE=2
;;
sp*)
MODE=3
;;
*)
echo "ERROR: Invalid game mode: $MODE"
exit 1
;;
esac
setServerProp "gamemode" "$MODE"
fi
}
# Deploy server.properties file
if [[ ${TYPE} == "FEED-THE-BEAST" ]]; then
export SERVER_PROPERTIES=${FTB_DIR}/server.properties
echo "detected FTB, changing properties path to ${SERVER_PROPERTIES}"
fi
if [ ! -e "$SERVER_PROPERTIES" ]; then
echo "Creating server.properties in ${SERVER_PROPERTIES}"
cp /tmp/server.properties "$SERVER_PROPERTIES"
customizeServerProps
elif [ -n "${OVERRIDE_SERVER_PROPERTIES}" ]; then
case ${OVERRIDE_SERVER_PROPERTIES^^} in
TRUE|1)
customizeServerProps
;;
*)
echo "server.properties already created, skipping"
;;
esac
else
echo "server.properties already created, skipping"
fi
exec /start-finalSetup05EnvVariables $@

View File

@@ -1,15 +0,0 @@
#!/bin/bash
if [ "$REPLACE_ENV_VARIABLES" = "TRUE" ]; then
echo "Replacing env variables in configs that match the prefix $ENV_VARIABLE_PREFIX..."
while IFS='=' read -r name value ; do
# check if name of env variable matches the prefix
# sanity check environment variables to avoid code injections
if [[ "$name" = $ENV_VARIABLE_PREFIX* ]] && [[ $value =~ ^[0-9a-zA-Z_:/=?.+\-]*$ ]] && [[ $name =~ ^[0-9a-zA-Z_\-]*$ ]]; then
echo "Replacing $name with $value ..."
find /data/ -type f \( -name "*.yml" -or -name "*.yaml" -or -name "*.txt" -or -name "*.cfg" -or -name "*.properties" \) -exec sed -i 's#${'"$name"'}#'"$value"'#g' {} \;
fi
done < <(env)
fi
exec /start-minecraftFinalSetup $@

View File

@@ -1,129 +0,0 @@
#!/bin/bash
. /start-utils
if [ -n "$OPS" -a ! -e ops.txt.converted ]; then
echo "Setting ops"
echo $OPS | awk -v RS=, '{print}' >> ops.txt
fi
if [ -n "$WHITELIST" -a ! -e white-list.txt.converted ]; then
echo "Setting whitelist"
echo $WHITELIST | awk -v RS=, '{print}' >> white-list.txt
fi
if [ -n "$ICON" -a ! -e server-icon.png ]; then
echo "Using server icon from $ICON..."
# Not sure what it is yet...call it "img"
curl -sSL -o /tmp/icon.img $ICON
specs=$(identify /tmp/icon.img | awk '{print $2,$3}')
if [ "$specs" = "PNG 64x64" ]; then
mv /tmp/icon.img /data/server-icon.png
else
echo "Converting image to 64x64 PNG..."
convert /tmp/icon.img -resize 64x64! /data/server-icon.png
fi
fi
# Make sure files exist and are valid JSON (for pre-1.12 to 1.12 upgrades)
echo "Checking for JSON files."
JSON_FILES=$(find . -maxdepth 1 -name '*.json')
for j in $JSON_FILES; do
if [[ $(python -c "print open('$j').read().strip()==''") = True ]]; then
echo "Fixing JSON $j"
echo '[]' > $j
fi
done
# If any modules have been provided, copy them over
mkdir -p /data/mods
if [ -d /mods ]; then
echo "Copying any mods over..."
rsync -a --out-format="update:%f:Last Modified %M" --prune-empty-dirs --update /mods /data
fi
[ -d /data/config ] || mkdir /data/config
for c in /config/*
do
if [ -f "$c" ]; then
echo Copying configuration `basename "$c"`
cp -rf "$c" /data/config
fi
done
mkdir -p /data/plugins
if [ "$TYPE" = "SPIGOT" ]; then
if [ -d /plugins ]; then
echo "Copying any Bukkit plugins over..."
# Copy plugins over using rsync to allow deeply nested updates of plugins
# only updates files if the source file is newer and print updated files
rsync -a --out-format="update:%f:Last Modified %M" --prune-empty-dirs --update /plugins /data
fi
fi
EXTRA_ARGS=""
# Optional disable console
if [[ ${CONSOLE} = false || ${CONSOLE} = FALSE ]]; then
EXTRA_ARGS+="--noconsole"
fi
# Optional disable GUI for headless servers
if [[ ${GUI} = false || ${GUI} = FALSE ]]; then
EXTRA_ARGS="${EXTRA_ARGS} nogui"
fi
# put these prior JVM_OPTS at the end to give any memory settings there higher precedence
echo "Setting initial memory to ${INIT_MEMORY:=${MEMORY}} and max to ${MAX_MEMORY:=${MEMORY}}"
expandedDOpts=
if [ -n "$JVM_DD_OPTS" ]; then
for dopt in $JVM_DD_OPTS
do
expandedDOpts="${expandedDOpts} -D${dopt/:/=}"
done
fi
mcServerRunnerArgs="--stop-duration 60s"
if [[ ${TYPE} == "FEED-THE-BEAST" ]]; then
if [ ! -e "${FTB_DIR}/ops.json" -a -e /data/ops.txt ]; then
cp -f /data/ops.txt ${FTB_DIR}/
fi
if [ ! -e "${FTB_DIR}/whitelist.json" -a -e /data/white-list.txt ]; then
cp -f /data/white-list.txt ${FTB_DIR}/
fi
cp -f /data/eula.txt "${FTB_DIR}/"
cat > "${FTB_DIR}/settings-local.sh" <<EOF
export MIN_RAM="${INIT_MEMORY}"
export MAX_RAM="${MAX_MEMORY}"
export JAVA_PARAMETERS="-Xms${INIT_MEMORY} $expandedDOpts"
EOF
# patch CurseForge cfg file, if present
if [ -f "${FTB_DIR}/settings.cfg" ]; then
sed -i "s/MAX_RAM=[^;]*/MAX_RAM=${MAX_MEMORY}/" "${FTB_DIR}/settings.cfg"
fi
cd "${FTB_DIR}"
echo "Running FTB ${FTB_SERVER_START} in ${FTB_DIR} ..."
if isTrue ${DEBUG_EXEC}; then
set -x
fi
exec mc-server-runner ${mcServerRunnerArgs} "${FTB_SERVER_START}"
else
# If we have a bootstrap.txt file... feed that in to the server stdin
if [ -f /data/bootstrap.txt ]; then
bootstrapArgs="--bootstrap /data/bootstrap.txt"
fi
echo "Starting the Minecraft server..."
JVM_OPTS="-Xms${INIT_MEMORY} -Xmx${MAX_MEMORY} ${JVM_OPTS}"
if isTrue ${DEBUG_EXEC}; then
set -x
fi
exec mc-server-runner ${bootstrapArgs} ${mcServerRunnerArgs} java $JVM_XX_OPTS $JVM_OPTS $expandedDOpts -jar $SERVER "$@" $EXTRA_ARGS
fi

34
start-setupEnvVariables Executable file
View File

@@ -0,0 +1,34 @@
#!/bin/bash
. ${SCRIPTS:-/}start-utils
set -e
: ${REPLACE_ENV_IN_PLACE:=${REPLACE_ENV_VARIABLES:-false}}
: ${REPLACE_ENV_PATHS:=/data}
: ${REPLACE_ENV_SUFFIXES:=yml,yaml,txt,cfg,conf,properties,hjson,json,tml,toml}
: ${REPLACE_ENV_VARIABLE_PREFIX:=${ENV_VARIABLE_PREFIX:-CFG_}}
: ${REPLACE_ENV_VARIABLES_EXCLUDES:=}
: ${REPLACE_ENV_VARIABLES_EXCLUDE_PATHS:=}
: ${PATCH_DEFINITIONS:=}
: ${DEBUG:=false}
if isTrue "${REPLACE_ENV_IN_PLACE}"; then
log "Replacing env variables in ${REPLACE_ENV_PATHS} that match the prefix $REPLACE_ENV_VARIABLE_PREFIX ..."
mc-image-helper --debug=${DEBUG} interpolate \
--replace-env-file-suffixes="${REPLACE_ENV_SUFFIXES}" \
--replace-env-excludes="${REPLACE_ENV_VARIABLES_EXCLUDES}" \
--replace-env-exclude-paths="${REPLACE_ENV_VARIABLES_EXCLUDE_PATHS}" \
--replace-env-prefix=${REPLACE_ENV_VARIABLE_PREFIX} \
"${REPLACE_ENV_PATHS[@]}"
fi
if [[ ${PATCH_DEFINITIONS} ]]; then
log "Applying patch definitions from ${PATCH_DEFINITIONS}"
mc-image-helper --debug=${DEBUG} patch \
--patch-env-prefix=${REPLACE_ENV_VARIABLE_PREFIX} \
"${PATCH_DEFINITIONS}"
fi
exec ${SCRIPTS:-/}start-finalExec $@

10
start-finalSetup03Modconfig → start-setupModconfig Normal file → Executable file
View File

@@ -1,11 +1,13 @@
#!/bin/bash
. ${SCRIPTS:-/}start-utils
# If supplied with a URL for a config (simple zip of configurations), download it and unpack
if [[ "$MODCONFIG" ]]; then
case "X$MODCONFIG" in
X[Hh][Tt][Tt][Pp]*[Zz][iI][pP])
echo "Downloading mod/plugin configs via HTTP"
echo " from $MODCONFIG ..."
log "Downloading mod/plugin configs via HTTP"
log " from $MODCONFIG ..."
curl -sSL -o /tmp/modconfig.zip "$MODCONFIG"
if [ "$TYPE" = "SPIGOT" ]; then
mkdir -p /data/plugins
@@ -17,9 +19,9 @@ case "X$MODCONFIG" in
rm -f /tmp/modconfig.zip
;;
*)
echo "Invalid URL given for modconfig: Must be HTTP or HTTPS and a ZIP file"
log "Invalid URL given for modconfig: Must be HTTP or HTTPS and a ZIP file"
;;
esac
fi
exec /start-finalSetup04ServerProperties $@
exec ${SCRIPTS:-/}start-setupMounts $@

178
start-setupModpack Executable file
View File

@@ -0,0 +1,178 @@
#!/bin/bash
set -e -o pipefail
# shellcheck source=start-utils
. ${SCRIPTS:-/}start-utils
if isDebugging; then
set -x
fi
# CURSE_URL_BASE used in manifest downloads below
CURSE_URL_BASE=${CURSE_URL_BASE:-https://minecraft.curseforge.com/projects}
# Remove old mods/plugins
if isTrue ${REMOVE_OLD_MODS:-false}; then
removeOldMods /data/mods
removeOldMods /data/plugins
fi
# If supplied with a URL for a modpack (simple zip of jars), download it and unpack
if [[ "$MODPACK" ]]; then
if isURL "${MODPACK}"; then
if [[ "${MODPACK}" == *.zip ]]; then
downloadUrl="${MODPACK}"
else
downloadUrl=$(curl -Ls -o /dev/null -w %{url_effective} $MODPACK)
if ! [[ $downloadUrl == *.zip ]]; then
log "ERROR Invalid URL given for MODPACK: $downloadUrl resolved from $MODPACK"
log " Must be HTTP, HTTPS or FTP and a ZIP file"
exit 1
fi
fi
log "Downloading mod/plugin pack"
log " from $downloadUrl ..."
if ! curl -sSL -o /tmp/modpack.zip "$downloadUrl"; then
log "ERROR: failed to download from $downloadUrl"
exit 2
fi
elif [[ "$MODPACK" =~ .*\.zip ]]; then
if ! cp $MODPACK /tmp/modpack.zip; then
log "ERROR: failed to copy from $MODPACK"
exit 2
fi
else
log "ERROR Invalid URL or Path given for MODPACK: $MODPACK"
exit 1
fi
if [ "$TYPE" = "SPIGOT" ]; then
mkdir -p /data/plugins
if ! unzip -o -d /data/plugins /tmp/modpack.zip; then
log "ERROR: failed to unzip the modpack from $downloadUrl"
fi
else
mkdir -p /data/mods
if ! unzip -o -d /data/mods /tmp/modpack.zip; then
log "ERROR: failed to unzip the modpack from $downloadUrl"
fi
fi
rm -f /tmp/modpack.zip
fi
# If supplied with a URL for a plugin download it.
if [[ "$MODS" ]]; then
if [ "$TYPE" = "SPIGOT" ]; then
out_dir=/data/plugins
else
out_dir=/data/mods
fi
mkdir -p "$out_dir"
for i in ${MODS//,/ }
do
if isURL "$i"; then
log "Downloading mod/plugin $i ..."
if ! get -o "${out_dir}" "$i"; then
log "ERROR: failed to download from $i into $out_dir"
exit 2
fi
elif [[ -f "$i" && "$i" =~ .*\.jar ]]; then
log "Copying plugin located at $i ..."
out_file=$(basename "$i")
if ! cp "$i" "${out_dir}/$out_file"; then
log "ERROR: failed to copy from $i into $out_dir"
exit 2
fi
elif [[ -d "$i" ]]; then
log "Copying plugin jars from $i ..."
cp "$i"/*.jar "${out_dir}"
else
log "ERROR Invalid URL or path given in MODS: $i"
exit 2
fi
done
fi
if [[ "$MANIFEST" ]]; then
if [[ -e "$MANIFEST" ]]; then
EFFECTIVE_MANIFEST_FILE=$MANIFEST
elif isURL "$MANIFEST"; then
EFFECTIVE_MANIFEST_FILE=/tmp/manifest.json
EFFECTIVE_MANIFEST_URL=$(curl -Ls -o /dev/null -w %{effective_url} $MANIFEST)
curl -Ls -o $EFFECTIVE_MANIFEST_FILE "$EFFECTIVE_MANIFEST_URL"
else
log "MANIFEST='$MANIFEST' is not a valid manifest url or location"
exit 2
fi
case "X$EFFECTIVE_MANIFEST_FILE" in
X*.json)
if [ -f "${EFFECTIVE_MANIFEST_FILE}" ]; then
MOD_DIR=${FTB_BASE_DIR:-/data}/mods
if [ ! -d "$MOD_DIR" ]
then
log "Creating mods dir $MOD_DIR"
mkdir -p "$MOD_DIR"
fi
log "Starting manifest download..."
cat "${EFFECTIVE_MANIFEST_FILE}" | jq -r '.files[] | (.projectID|tostring) + " " + (.fileID|tostring)'| while read -r p f
do
if [ ! -f $MOD_DIR/${p}_${f}.jar ]
then
redirect_url="$(curl -Ls -o /dev/null -w %{effective_url} ${CURSE_URL_BASE}/${p})"
url="$redirect_url/download/${f}/file"
log 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
log "Could not find manifest file, unsufficient privs, or malformed path."
fi
;;
*)
log "Invalid manifest file for modpack. Please make sure it is a .json file."
;;
esac
fi
if [[ "${GENERIC_PACK}" ]]; then
if isURL "${GENERIC_PACK}"; then
log "Downloading generic pack ..."
if ! curl -fsSL -o /tmp/generic_pack.zip "${GENERIC_PACK}"; then
log "ERROR: failed to download ${GENERIC_PACK}"
exit 2
fi
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
exec ${SCRIPTS:-/}start-setupModconfig $@

69
start-setupMounts Executable file
View File

@@ -0,0 +1,69 @@
#!/bin/bash
. ${SCRIPTS:-/}start-utils
: ${SYNC_SKIP_NEWER_IN_DESTINATION:=${PLUGINS_SYNC_UPDATE:-true}}
: ${REPLACE_ENV_DURING_SYNC:=true}
: ${REPLACE_ENV_SUFFIXES:=yml,yaml,txt,cfg,conf,properties,hjson,json,tml,toml}
: ${REPLACE_ENV_VARIABLE_PREFIX:=${ENV_VARIABLE_PREFIX:-CFG_}}
: ${REPLACE_ENV_VARIABLES_EXCLUDES:=}
: ${REPLACE_ENV_VARIABLES_EXCLUDE_PATHS:=}
: ${DEBUG:=false}
set -e
isDebugging && set -x
if isTrue ${SYNC_SKIP_NEWER_IN_DESTINATION}; then
updateArg="--skip-newer-in-destination"
fi
if isTrue ${REPLACE_ENV_DURING_SYNC}; then
subcommand=sync-and-interpolate
else
subcommand=sync
fi
if [ -d /plugins ]; then
case ${TYPE} in
SPIGOT|BUKKIT|PAPER|MAGMA)
mkdir -p /data/plugins
log "Copying plugins over..."
mc-image-helper \
--debug=${DEBUG} ${subcommand} $updateArg \
--replace-env-file-suffixes="${REPLACE_ENV_SUFFIXES}" \
--replace-env-excludes="${REPLACE_ENV_VARIABLES_EXCLUDES}" \
--replace-env-exclude-paths="${REPLACE_ENV_VARIABLES_EXCLUDE_PATHS}" \
--replace-env-prefix=${REPLACE_ENV_VARIABLE_PREFIX} \
/plugins /data/plugins
;;
esac
fi
# If any modules have been provided, copy them over
: ${COPY_MODS_DEST:="/data/mods"}
if [ -d /mods ]; then
log "Copying any mods over..."
mc-image-helper \
--debug=${DEBUG} ${subcommand} $updateArg \
--replace-env-file-suffixes="${REPLACE_ENV_SUFFIXES}" \
--replace-env-excludes="${REPLACE_ENV_VARIABLES_EXCLUDES}" \
--replace-env-exclude-paths="${REPLACE_ENV_VARIABLES_EXCLUDE_PATHS}" \
--replace-env-prefix=${REPLACE_ENV_VARIABLE_PREFIX} \
/mods "${COPY_MODS_DEST}"
fi
: ${COPY_CONFIG_DEST:="/data/config"}
if [ -d /config ]; then
log "Copying any configs from /config to ${COPY_CONFIG_DEST}"
mc-image-helper \
--debug=${DEBUG} ${subcommand} $updateArg \
--replace-env-file-suffixes="${REPLACE_ENV_SUFFIXES}" \
--replace-env-excludes="${REPLACE_ENV_VARIABLES_EXCLUDES}" \
--replace-env-exclude-paths="${REPLACE_ENV_VARIABLES_EXCLUDE_PATHS}" \
--replace-env-prefix=${REPLACE_ENV_VARIABLE_PREFIX} \
/config "${COPY_CONFIG_DEST}"
fi
exec ${SCRIPTS:-/}start-setupServerProperties $@

221
start-setupServerProperties Executable file
View File

@@ -0,0 +1,221 @@
#!/bin/bash
. ${SCRIPTS:-/}start-utils
: ${SERVER_PROPERTIES:=/data/server.properties}
# FUNCTIONS
function setServerProp {
local prop=$1
local var=$2
if [ -n "$var" ]; then
# normalize booleans
case ${var^^} in
TRUE|FALSE)
var=${var,,} ;;
esac
if grep "${prop}" "$SERVER_PROPERTIES" > /dev/null; then
log "Setting ${prop} to '${var}' in ${SERVER_PROPERTIES}"
sed -i "/^${prop}\s*=/ c ${prop}=${var//\\/\\\\}" "$SERVER_PROPERTIES"
else
log "Adding ${prop} with '${var}' in ${SERVER_PROPERTIES}"
echo "${prop}=${var}" >> "$SERVER_PROPERTIES"
fi
else
isDebugging && log "Skip setting ${prop}"
fi
}
function customizeServerProps {
if [ -n "$WHITELIST" ] || isTrue ${ENABLE_WHITELIST:-false}; then
log "Creating whitelist"
setServerProp "whitelist" "true"
setServerProp "white-list" "true"
else
log "Disabling whitelist"
setServerProp "whitelist" "false"
setServerProp "white-list" "false"
fi
# If not provided, generate a reasonable default message-of-the-day,
# which shows up in the server listing in the client
if [ -z "$MOTD" ]; then
# snapshot is the odd case where we have to look at version to identify that label
if [[ ${ORIGINAL_TYPE} == "VANILLA" && ${VERSION} == "SNAPSHOT" ]]; then
label=SNAPSHOT
else
label=${ORIGINAL_TYPE}
fi
# Convert label to title-case
label=${label,,}
label=${label^}
MOTD="A ${label} Minecraft Server powered by Docker"
fi
setServerProp "server-name" "$SERVER_NAME"
setServerProp "server-ip" "$SERVER_IP"
setServerProp "server-port" "$SERVER_PORT"
setServerProp "motd" "$(echo $MOTD | mc-image-helper asciify)"
setServerProp "allow-nether" "$ALLOW_NETHER"
setServerProp "announce-player-achievements" "$ANNOUNCE_PLAYER_ACHIEVEMENTS"
setServerProp "enable-command-block" "$ENABLE_COMMAND_BLOCK"
setServerProp "spawn-animals" "$SPAWN_ANIMALS"
setServerProp "spawn-monsters" "$SPAWN_MONSTERS"
setServerProp "spawn-npcs" "$SPAWN_NPCS"
setServerProp "spawn-protection" "$SPAWN_PROTECTION"
setServerProp "generate-structures" "$GENERATE_STRUCTURES"
setServerProp "view-distance" "$VIEW_DISTANCE"
setServerProp "hardcore" "$HARDCORE"
setServerProp "snooper-enabled" "$SNOOPER_ENABLED"
setServerProp "max-build-height" "$MAX_BUILD_HEIGHT"
setServerProp "force-gamemode" "$FORCE_GAMEMODE"
setServerProp "max-tick-time" "$MAX_TICK_TIME"
setServerProp "enable-query" "$ENABLE_QUERY"
setServerProp "query.port" "$QUERY_PORT"
setServerProp "enable-rcon" "$ENABLE_RCON"
setServerProp "rcon.password" "$RCON_PASSWORD"
setServerProp "rcon.port" "$RCON_PORT"
setServerProp "max-players" "$MAX_PLAYERS"
setServerProp "max-world-size" "$MAX_WORLD_SIZE"
setServerProp "level-name" "$LEVEL"
setServerProp "level-seed" "$SEED"
setServerProp "pvp" "${PVP}"
setServerProp "generator-settings" "$GENERATOR_SETTINGS"
setServerProp "online-mode" "$ONLINE_MODE"
setServerProp "allow-flight" "$ALLOW_FLIGHT"
setServerProp "level-type" "${LEVEL_TYPE^^}"
setServerProp "resource-pack" "$RESOURCE_PACK"
setServerProp "resource-pack-sha1" "$RESOURCE_PACK_SHA1"
setServerProp "player-idle-timeout" "$PLAYER_IDLE_TIMEOUT"
setServerProp "broadcast-console-to-ops" "$BROADCAST_CONSOLE_TO_OPS"
setServerProp "broadcast-rcon-to-ops" "$BROADCAST_RCON_TO_OPS"
setServerProp "enable-jmx-monitoring" "$ENABLE_JMX"
setServerProp "sync-chunk-writes" "$SYNC_CHUNK_WRITES"
setServerProp "enable-status" "$ENABLE_STATUS"
setServerProp "entity-broadcast-range-percentage" "$ENTITY_BROADCAST_RANGE_PERCENTAGE"
setServerProp "function-permission-level" "$FUNCTION_PERMISSION_LEVEL"
setServerProp "network-compression-threshold" "$NETWORK_COMPRESSION_THRESHOLD"
setServerProp "op-permission-level" "$OP_PERMISSION_LEVEL"
setServerProp "prevent-proxy-connections" "$PREVENT_PROXY_CONNECTIONS"
setServerProp "use-native-transport" "$USE_NATIVE_TRANSPORT"
setServerProp "enforce-whitelist" "$ENFORCE_WHITELIST"
setServerProp "simulation-distance" "$SIMULATION_DISTANCE"
if [ -n "$DIFFICULTY" ]; then
case $DIFFICULTY in
peaceful|0)
if versionLessThan 1.13; then
DIFFICULTY=0
else
DIFFICULTY=peaceful
fi
;;
easy|1)
if versionLessThan 1.13; then
DIFFICULTY=1
else
DIFFICULTY=easy
fi
;;
normal|2)
if versionLessThan 1.13; then
DIFFICULTY=2
else
DIFFICULTY=normal
fi
;;
hard|3)
if versionLessThan 1.13; then
DIFFICULTY=3
else
DIFFICULTY=hard
fi
;;
*)
log "DIFFICULTY must be peaceful, easy, normal, or hard."
exit 1
;;
esac
setServerProp "difficulty" "$DIFFICULTY"
fi
if [ -n "$MODE" ]; then
log "Setting mode"
MODE_LC=$( echo $MODE | tr '[:upper:]' '[:lower:]' )
case $MODE_LC in
su*|0)
if versionLessThan 1.13; then
MODE=0
else
MODE=survival
fi
;;
c*|1)
if versionLessThan 1.13; then
MODE=1
else
MODE=creative
fi
;;
a*|2)
if versionLessThan 1.13; then
MODE=2
else
MODE=adventure
fi
;;
sp*|3)
if versionLessThan 1.13; then
MODE=3
else
MODE=spectator
fi
;;
*)
log "ERROR: Invalid game mode: $MODE"
exit 1
;;
esac
setServerProp "gamemode" "$MODE"
fi
}
# Deploy server.properties file
if [[ ${TYPE} == "CURSEFORGE" ]]; then
export SERVER_PROPERTIES="${FTB_DIR}/server.properties"
log "detected FTB, changing properties path to ${SERVER_PROPERTIES}"
fi
if [ ! -e "$SERVER_PROPERTIES" ]; then
log "Creating server.properties in ${SERVER_PROPERTIES}"
cp /tmp/server.properties "$SERVER_PROPERTIES"
customizeServerProps
elif [ -n "${OVERRIDE_SERVER_PROPERTIES}" ]; then
case ${OVERRIDE_SERVER_PROPERTIES^^} in
TRUE|1)
customizeServerProps
;;
*)
log "server.properties already created, skipping"
;;
esac
else
log "server.properties already created, skipping"
fi
if isTrue "${ENABLE_AUTOPAUSE}"; then
current_max_tick=$( grep 'max-tick-time' "$SERVER_PROPERTIES" | sed -r 's/( )+//g' | awk -F= '{print $2}' )
if (( $current_max_tick > 0 && $current_max_tick < 86400000 )); then
log "Warning: The server.properties for the server doesn't have the Server Watchdog (effectively) disabled."
log "Warning (cont): Autopause functionality resuming the process might trigger the Watchdog and restart the server completely."
log "Warning (cont): Set the max-tick-time property to a high value (or disable the Watchdog with value -1 for versions 1.8.1+)."
fi
fi
if isDebugging; then
log "DEBUG Dumping server.properties"
cat "${SERVER_PROPERTIES}"
fi
exec ${SCRIPTS:-/}start-setupEnvVariables $@

74
start-setupWorld Executable file
View File

@@ -0,0 +1,74 @@
#!/bin/bash
. ${SCRIPTS:-/}start-utils
set -e
isDebugging && set -x
: ${LEVEL:=world}
export LEVEL
if [ $TYPE = "CURSEFORGE" ]; then
worldDest=$FTB_DIR/$LEVEL
else
worldDest=/data/$LEVEL
fi
if [[ "$WORLD" ]] && ( isTrue "${FORCE_WORLD_COPY}" || [ ! -d "$worldDest" ] ); then
if isTrue "${FORCE_WORLD_COPY}"; then
log "Removing existing world data in $worldDest ${worldDest}_nether ${worldDest}_the_end"
rm -rf "$worldDest" \
"${worldDest}_nether" \
"${worldDest}_the_end"
fi
if isURL $WORLD; then
curl -fsSL "$WORLD" -o /tmp/world.zip
zipSrc=/tmp/world.zip
elif [[ "$WORLD" =~ .*\.zip ]]; then
zipSrc="$WORLD"
fi
if [[ "$zipSrc" ]]; then
log "Unzipping world"
# Stage contents so that the correct subdirectory can be picked off
mkdir -p /tmp/world-data
(cd /tmp/world-data && unzip -o -q "$zipSrc")
if [ "$TYPE" = "SPIGOT" ]; then
baseDirs=$(find /tmp/world-data -name "level.dat" -not -path "*_nether*" -not -path "*_the_end*" -exec dirname "{}" \;)
else
baseDirs=$(find /tmp/world-data -name "level.dat" -exec dirname "{}" \;)
fi
count=$(echo "$baseDirs" | wc -l)
if [[ $count -gt 1 ]]; then
baseDir="$(echo "$baseDirs" | sed -n ${WORLD_INDEX:-1}p)"
baseName=$(basename "$baseDir")
log "WARN multiple levels found, picking: $baseName"
elif [[ $count -gt 0 ]]; then
baseDir="$baseDirs"
else
log "ERROR invalid world content"
exit 1
fi
rsync --remove-source-files --recursive --delete "$baseDir/" "$worldDest"
if [ "$TYPE" = "SPIGOT" ]; then
log "Copying end and nether ..."
[ -d "${baseDir}_nether" ] && rsync --remove-source-files --recursive --delete "${baseDir}_nether/" "${worldDest}_nether"
[ -d "${baseDir}_the_end" ] && rsync --remove-source-files --recursive --delete "${baseDir}_the_end/" "${worldDest}_the_end"
fi
else
log "Cloning world directory from $WORLD ..."
rsync --recursive --delete "${WORLD%/}"/ "$worldDest"
fi
if [ "$TYPE" = "SPIGOT" ]; then
# Reorganise if a Spigot server
log "Moving End and Nether maps to Spigot location"
[ -d "$worldDest/DIM1" ] && mv -f "$worldDest/DIM1" "${worldDest}_the_end"
[ -d "$worldDest/DIM-1" ] && mv -f "$worldDest/DIM-1" "${worldDest}_nether"
fi
fi
exec ${SCRIPTS:-/}start-setupModpack $@

104
start-spiget Executable file
View File

@@ -0,0 +1,104 @@
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
. ${SCRIPTS:-/}start-utils
handleDebugMode
: ${SPIGET_RESOURCES:=}
: ${SPIGET_DOWNLOAD_TOLERANCE:=5} # in minutes
containsJars() {
file=${1?}
pat='\.jar$'
while read -r line; do
if [[ $line =~ $pat ]]; then
return 0
fi
done <<<$(unzip -l "$file")
return 1
}
getResourceFromSpiget() {
resource=${1?}
log "Downloading resource ${resource} ..."
mkdir -p /data/plugins
versionfile="/data/plugins/.${resource}-version.json"
versionfileNew="/tmp/.${resource}-version.json"
if [ -f "$versionfile" ]; then
if [[ -n $(find "$versionfile" -mmin +${SPIGET_DOWNLOAD_TOLERANCE}) ]]; then
urlVersion="https://api.spiget.org/v2/resources/${resource}/versions/latest"
if ! curl -o "${versionfileNew}" -fsSL -H "User-Agent: itzg/minecraft-server" "${extraCurlArgs[@]}" "${urlVersion}"; then
log "ERROR failed to download resource version meta data '${resource}' from ${urlVersion}"
exit 2
fi
installedVersion=$(jq -r '.name' $versionfile)
newVersion=$(jq -r '.name' $versionfileNew)
if [ "$installedVersion" = "$newVersion" ]; then
log "resource '${resource}' not downloaded because installed version '${installedVersion}' already up to date ('${newVersion}')"
mv "${versionfileNew}" "${versionfile}"
else
if downloadResourceFromSpiget "${resource}"; then
mv "${versionfileNew}" "${versionfile}"
fi
fi
else
log "resource '${resource}' not checked because version meta file newer than '${SPIGET_DOWNLOAD_TOLERANCE}' minutes"
fi
else
if downloadResourceFromSpiget "${resource}"; then
urlVersion="https://api.spiget.org/v2/resources/${resource}/versions/latest"
if ! curl -o "${versionfileNew}" -fsSL -H "User-Agent: itzg/minecraft-server" "${extraCurlArgs[@]}" "${urlVersion}"; then
log "ERROR failed to download resource version meta data '${resource}' from ${urlVersion}"
exit 2
fi
mv "${versionfileNew}" "${versionfile}"
fi
fi
}
downloadResourceFromSpiget() {
resource=${1?}
tmpfile="/tmp/${resource}.zip"
url="https://api.spiget.org/v2/resources/${resource}/download"
if ! curl -o "${tmpfile}" -fsSL -H "User-Agent: itzg/minecraft-server" "${extraCurlArgs[@]}" "${url}"; then
log "ERROR failed to download resource '${resource}' from ${url}"
exit 2
fi
if containsJars "${tmpfile}"; then
log "Extracting contents of resource ${resource} into plugins"
unzip -o -q -d /data/plugins "${tmpfile}"
rm "${tmpfile}"
else
log "Moving resource ${resource} into plugins"
mv "${tmpfile}" "/data/plugins/${resource}.jar"
fi
}
if [[ ${SPIGET_RESOURCES} ]]; then
if isTrue ${REMOVE_OLD_MODS:-false}; then
removeOldMods /data/plugins
REMOVE_OLD_MODS=false
fi
log "Getting plugins via Spiget"
IFS=',' read -r -a resources <<<"${SPIGET_RESOURCES}"
for resource in "${resources[@]}"; do
getResourceFromSpiget "${resource}"
done
fi
exec ${SCRIPTS:-/}start-setupWorld $@

174
start-utils Normal file → Executable file
View File

@@ -1,42 +1,190 @@
#!/bin/bash
function isURL {
function join_by() {
local d=$1
shift
echo -n "$1"
shift
printf "%s" "${@/#/$d}"
}
function isURL() {
local value=$1
if [[ ${value:0:8} == "https://" || ${value:0:7} = "http://" ]]; then
if [[ ${value:0:8} == "https://" || ${value:0:7} == "http://" || ${value:0:6} == "ftp://" ]]; then
return 0
else
return 1
fi
}
function isTrue {
function isValidFileURL() {
suffix=${1:?Missing required suffix arg}
url=${2:?Missing required url arg}
[[ "$url" == http*://*.${suffix} || "$url" == http*://*.${suffix}\?* ]]
}
function resolveEffectiveUrl() {
url="${1:?Missing required url argument}"
if ! curl -Ls -o /dev/null -w %{url_effective} "$url"; then
log "ERROR failed to resolve effective URL from $url"
exit 2
fi
}
function getFilenameFromUrl() {
url="${1:?Missing required url argument}"
strippedOfQuery="${url%\?*}"
basename "$strippedOfQuery"
}
function isTrue() {
local value=${1,,}
result=
case ${value} in
true|on)
result=0
;;
*)
result=1
;;
true | on)
result=0
;;
*)
result=1
;;
esac
return ${result}
}
function isDebugging {
if [[ ${DEBUG^^} = TRUE ]]; then
function isDebugging() {
if isTrue "${DEBUG:-false}"; then
return 0
else
return 1
fi
}
function debug {
function handleDebugMode() {
if isDebugging; then
echo "DEBUG: $*"
set -x
extraCurlArgs=(-v)
fi
}
function debug() {
if isDebugging; then
log "DEBUG: $*"
fi
}
function logn() {
echo -n "[init] $*"
}
function log() {
echo "[init] $*"
}
function logAutopause() {
echo "[Autopause loop] $*"
}
function logAutopauseAction() {
echo "[$(date -Iseconds)] [Autopause] $*"
}
function normalizeMemSize() {
local scale=1
case ${1,,} in
*k)
scale=1024
;;
*m)
scale=1048576
;;
*g)
scale=1073741824
;;
esac
val=${1:0:-1}
echo $((val * scale))
}
function versionLessThan() {
local activeParts
IFS=. read -ra activeParts <<<"${VANILLA_VERSION}"
local givenParts
IFS=. read -ra givenParts <<<"$1"
if ((${#activeParts[@]} < 2)); then
return 1
fi
if ((${#activeParts[@]} == 2)); then
if ((activeParts[0] < givenParts[0])) ||
((activeParts[0] == givenParts[0] && activeParts[1] < givenParts[1])); then
return 0
else
return 1
fi
else
if ((activeParts[0] < givenParts[0])) ||
((activeParts[0] == givenParts[0] && activeParts[1] < givenParts[1])) ||
((activeParts[0] == givenParts[0] && activeParts[1] == givenParts[1] && activeParts[2] < givenParts[2])); then
return 0
else
return 1
fi
fi
}
requireVar() {
if [ ! -v $1 ]; then
log "ERROR: $1 is required to be set"
exit 1
fi
if [ -z "${!1}" ]; then
log "ERROR: $1 is required to be set"
exit 1
fi
}
requireEnum() {
var=${1?}
shift
for allowed in $*; do
if [[ ${!var} = $allowed ]]; then
return 0
fi
done
log "ERROR: $var must be set to one of $@"
# exit 1
}
function writeEula() {
if ! echo "# Generated via Docker
# $(date)
eula=${EULA,,}
" >/data/eula.txt; then
log "ERROR: unable to write eula to /data. Please make sure attached directory is writable by uid=${UID}"
exit 2
fi
}
function removeOldMods {
if [ -d "$1" ]; then
find "$1" -mindepth 1 -maxdepth ${REMOVE_OLD_MODS_DEPTH:-16} -wholename "${REMOVE_OLD_MODS_INCLUDE:-*}" -not -wholename "${REMOVE_OLD_MODS_EXCLUDE:-}" -delete
fi
}
function get() {
local flags=()
if isTrue "${DEBUG_GET:-false}"; then
flags+=("--debug")
fi
mc-image-helper "${flags[@]}" get "$@"
}

17
start-validateCurseInstance Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
. ${SCRIPTS:-/}start-utils
if ! [[ -v CURSE_INSTANCE_JSON ]]; then
log "ERROR: CURSE_INSTANCE_JSON needs to be set"
exit 2
elif ! [ -f "${CURSE_INSTANCE_JSON}" ] && [ -f "${CURSE_INSTANCE_JSON}/minecraftinstance.json" ]; then
CURSE_INSTANCE_JSON="${CURSE_INSTANCE_JSON}/minecraftinstance.json"
elif ! [ -f "${CURSE_INSTANCE_JSON}" ]; then
log "ERROR: CURSE_INSTANCE_JSON file does not exist: ${CURSE_INSTANCE_JSON}"
exit 2
fi
log "Resolved CURSE_INSTANCE_JSON as ${CURSE_INSTANCE_JSON}"
exec ${SCRIPTS:-/}start-setupWorld "$@"

View File

@@ -0,0 +1,21 @@
version: "3.8"
services:
sut:
depends_on:
- mc
image: itzg/mc-monitor:0.6.0
command: status --host mc --retry-interval 1s --retry-limit 120
mc:
restart: "no"
build:
context: ..
args:
TARGETOS: linux
TARGETARCH: amd64
cache_from:
- itzg/minecraft-server:latest
environment:
EULA: "TRUE"
VERSION: "1.16.5"

17
tests/test.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
cd $(dirname $0)
failed=false
args="-f docker-compose.test.yml"
docker-compose $args run sut || failed=true
echo "
Result: failed=$failed"
$failed && docker-compose $args logs mc
docker-compose $args down -v
if $failed; then
exit 1
fi