Compare commits

...

186 Commits

Author SHA1 Message Date
Geoff Bourne
48414b3e87 Auto-merging via docker-versions-create 2022-02-08 19:18:43 -06:00
Jordy Hulck
4cb227629f Distro aware checksum (#1345) 2022-02-08 19:17:26 -06:00
dependabot[bot]
932cd8f89e build(deps): bump docker/build-push-action from 2.8.0 to 2.9.0 (#1339) 2022-02-07 06:54:56 -06:00
Geoff Bourne
f2f8d58d3b Only skip up-to-date files with MODS and MODS_FILE (#1338)
Fixes #1254
2022-02-06 17:46:17 -06:00
Luc Ritchie
b7bbe1b0a6 Support Spigot-style and vanilla-style world zips, for any server type (#1305) 2022-02-06 15:51:28 -06:00
itzg
1dd9a2e6e0 docs: Auto update markdown TOC 2022-02-06 18:45:40 +00:00
chblodg
aa7b997697 Adding support for crafting tweaks and resource packs (#1336)
Co-authored-by: christopher blodgett <christopher.blodgett@gmail.com>
Co-authored-by: Geoff Bourne <itzgeoff@gmail.com>
Co-authored-by: Floyd Everest <me@floydeverest.com>
2022-02-06 12:45:25 -06:00
Geoff Bourne
c2bf2bbcc5 Use rfc-2822 for log timestamp 2022-02-05 22:56:24 -06:00
Geoff Bourne
68b926f2b1 Auto-merging via docker-versions-create 2022-02-05 22:52:42 -06:00
Geoff Bourne
306671ffe7 Disabled world_from_tarzstd test for now 2022-02-05 22:50:12 -06:00
Geoff Bourne
be99d171f5 Added extract detection for application/x-zstd 2022-02-05 22:47:58 -06:00
Geoff Bourne
882f3b1cd8 Added zstd package 2022-02-05 22:44:13 -06:00
Geoff Bourne
eb6c7c98f0 build: adjusted discord workflow name 2022-02-05 22:40:42 -06:00
Geoff Bourne
3472c67ca8 build: give issue-label workflow a name 2022-02-05 16:10:12 -06:00
Geoff Bourne
8995e63b72 build: fixed typo in push condition 2022-02-05 16:03:40 -06:00
Geoff Bourne
b65f108917 build: also push git tag builds 2022-02-05 16:02:27 -06:00
itzg
2b374a2073 docs: Auto update markdown TOC 2022-02-05 18:38:46 +00:00
Geoff Bourne
b5b164d5d3 feat: added SKIP_GENERIC_PACK_UPDATE_CHECK and FORCE_GENERIC_PACK_UPDATE (#1333) 2022-02-05 12:38:33 -06:00
itzg
0cde40604e docs: Auto update markdown TOC 2022-02-05 18:27:33 +00:00
Geoff Bourne
22f2eb7308 feat: add option to include timestamp with init logs (#1332) 2022-02-05 12:27:17 -06:00
Geoff Bourne
4a1d2d2b80 build: adjusted for eclipse-temurin:8-jdk not being on armv7 2022-02-02 22:27:38 -06:00
Geoff Bourne
10922b261b build: build-multiarch tags were too broad 2022-02-02 22:18:54 -06:00
Geoff Bourne
13883b20e7 Auto-merging via docker-versions-create 2022-02-02 22:15:47 -06:00
itzg
de0188de3d docs: Auto update markdown TOC 2022-02-02 02:53:20 +00:00
Geoff Bourne
2b093ad421 docs: fixed Forge homepage link
Fixes #1244
2022-02-01 20:53:05 -06:00
itzg
0ec73b141f docs: Auto update markdown TOC 2022-02-01 21:08:27 +00:00
Geoff Bourne
de0bb14abd docs: added inspect command to see anonymous volume path 2022-02-01 15:08:09 -06:00
Geoff Bourne
26809ef1f0 build: enable exit on failure for verify in setuponlytests
Related to #1305
2022-01-31 21:44:18 -06:00
itzg
dca4f86fa6 docs: Auto update markdown TOC 2022-01-31 01:50:07 +00:00
Geoff Bourne
eb0c30d134 feat: added prefix/suffix support for GENERIC_PACKS (#1321)
For #1315
2022-01-30 19:49:54 -06:00
Geoff Bourne
c55cce628d fix: bumped mc-image-helper to 1.16.3 to use specific user agent (#1320) 2022-01-30 14:05:50 -06:00
Geoff Bourne
c52c3fb04a fix: adjusted extract's file type matching for x-gzip 2022-01-30 13:53:57 -06:00
Alexandre Boucey
240238013b Use Log4J2 JVM flag when file download fail (#1316) 2022-01-30 13:46:09 -06:00
Geoff Bourne
67c8879c6b Merge latest from master 2022-01-30 12:08:38 -06:00
Geoff Bourne
18f0f0ceee fix: speedup generic pack update check (#1317)
#1281
2022-01-30 11:17:21 -06:00
Geoff Bourne
aca8701072 fix: speedup generic pack update check
#1281
2022-01-30 11:09:34 -06:00
Geoff Bourne
c424fe1c7b build: corrected issue-label to use issue.number 2022-01-29 22:09:18 -06:00
Geoff Bourne
eb694463c5 build: switch to matrix builds for Debian based variant builds (#1313) 2022-01-29 14:53:34 -06:00
Geoff Bourne
469afb3200 build: fixed issue.id reference in issue-label workflow 2022-01-28 22:44:37 -06:00
itzg
8f8acc40f5 docs: Auto update markdown TOC 2022-01-28 00:42:48 +00:00
chblodg
7dbd8256ea Adding ForgeAPI version pinning and dependency download. (#1308)
Co-authored-by: christopher blodgett <christopher.blodgett@gmail.com>
Co-authored-by: Geoff Bourne <itzgeoff@gmail.com>
2022-01-27 18:42:33 -06:00
Geoff Bourne
66468975e0 build: added id to labelled issue discord message 2022-01-27 15:03:00 -06:00
Geoff Bourne
6d27ce8461 build: updated issue label workflow with more labels 2022-01-27 14:47:03 -06:00
Geoff Bourne
b0817f2a83 build: updated issues workflow with 'help wanted'
See #1310
2022-01-27 14:44:44 -06:00
Geoff Bourne
21602a79e7 Refactored ops and whitelist processing into its own file (#1306) 2022-01-26 20:25:52 -06:00
Luc Ritchie
8a42dfe232 Fix loading world from compressed tar archives (#1304) 2022-01-25 16:19:15 -06:00
dependabot[bot]
d02bbb798e build(deps): bump docker/build-push-action from 2.7.0 to 2.8.0 (#1300) 2022-01-24 07:35:03 -06:00
Geoff Bourne
d2452ba18f Merge latest from master 2022-01-23 22:22:45 -06:00
Geoff Bourne
7f940626d8 Auto-merging via docker-versions-create 2022-01-23 10:59:40 -06:00
Geoff Bourne
7246d836ec Auto-merging via docker-versions-create 2022-01-20 23:10:34 +00:00
Geoff Bourne
c01e97ca94 Auto-merging via docker-versions-create 2022-01-17 13:22:19 -06:00
Geoff Bourne
b59eefd556 Auto-merging via docker-versions-create 2022-01-10 06:57:20 -06:00
Geoff Bourne
ce6ef7d81c Auto-merging via docker-versions-create 2022-01-08 15:22:09 -06:00
Geoff Bourne
0a2e6721fb Installed GNU-style find package
#1127
2022-01-06 22:11:26 -06:00
Geoff Bourne
5461107b83 Merged latest from master 2022-01-06 21:56:50 -06:00
Geoff Bourne
5356c76dd6 Merged latest from master 2021-12-23 16:07:34 -06:00
Geoff Bourne
bd97029446 Auto-merging via docker-versions-create 2021-12-13 21:27:47 -06:00
Geoff Bourne
6537cfb5b5 Auto-merging via docker-versions-create 2021-12-12 19:51:09 -06:00
Geoff Bourne
6729ba462e Merge branch 'master' of github.com:itzg/docker-minecraft-server 2021-12-12 15:35:14 -06:00
Geoff Bourne
4b28d5e472 fix: qualify Fabric server jar by installer version
Fixes #1191
2021-12-12 15:28:30 -06:00
Geoff Bourne
51002c956e Merging latest from master 2021-12-12 09:01:39 -06:00
Geoff Bourne
de62cf8dc7 Auto-merging via docker-versions-create 2021-12-11 16:23:55 -06:00
Geoff Bourne
3f2022da40 Merge branch 'master' of github.com:itzg/docker-minecraft-server 2021-12-11 16:23:25 -06:00
Geoff Bourne
0f7464403c build: added github release creation step to docker-versions-create.sh 2021-12-11 16:09:15 -06:00
Geoff Bourne
c9d5ad7530 Auto-merging via docker-versions-create 2021-12-10 21:01:24 -06:00
Geoff Bourne
1be933bd63 Auto-merging via docker-versions-create 2021-12-10 10:41:48 -06:00
Geoff Bourne
99b792dec1 Auto-merging via docker-versions-create 2021-12-10 07:56:57 -06:00
Geoff Bourne
ee5267cf41 Merge branch 'master' into java8 2021-12-06 22:20:24 -06:00
Geoff Bourne
0a46d0382e build: also run tests with java8 2021-12-06 22:16:50 -06:00
Geoff Bourne
cc61497f7e build: test 1.12.2 with java8 2021-12-06 22:15:32 -06:00
Geoff Bourne
2c2cbadd9a build: fixed combined test/build jobs 2021-12-06 22:11:43 -06:00
Geoff Bourne
bfc29d289d Auto-merging via docker-versions-create 2021-12-06 22:04:39 -06:00
Geoff Bourne
84a1313261 Auto-merging via docker-versions-create 2021-12-04 09:59:45 -06:00
Geoff Bourne
39bcfddf3c Auto-merging via docker-versions-create 2021-12-02 19:46:33 -06:00
Geoff Bourne
e6ea8197aa Auto-merging via docker-versions-create 2021-11-24 15:57:25 -06:00
Geoff Bourne
0184c095fc Auto-merging via docker-versions-create 2021-11-24 14:34:08 -06:00
Geoff Bourne
524a7e21f3 Merge branch 'master' into java8 2021-11-16 18:57:49 -06:00
Geoff Bourne
f817cae945 Merge latest from master 2021-11-16 18:51:22 -06:00
Geoff Bourne
675d05920b Auto-merging via docker-versions-create 2021-11-15 20:48:02 -06:00
Geoff Bourne
106a7132d4 Auto-merging via docker-versions-create 2021-11-13 19:17:46 -06:00
Geoff Bourne
0e04a10efa Auto-merging via docker-versions-create 2021-11-13 18:52:19 -06:00
Geoff Bourne
0d8df635d6 Auto-merging via docker-versions-create 2021-11-12 21:24:10 -06:00
Geoff Bourne
e0dedc194d Auto-merging via docker-versions-create 2021-11-06 21:36:59 -05:00
Geoff Bourne
ef32e8ed4c Auto-merging via docker-versions-create 2021-11-04 21:03:18 -05:00
Geoff Bourne
489b583ad7 Auto-merging via docker-versions-create 2021-10-31 09:44:37 -05:00
Geoff Bourne
8c4dff22fb Switched base image to JDK
#1064
2021-10-27 21:23:27 -05:00
Geoff Bourne
455f31c9d8 Auto-merging via docker-versions-create 2021-10-25 19:22:48 -05:00
Geoff Bourne
bac1bfb5dc Auto-merging via docker-versions-create 2021-10-24 20:25:05 -05:00
Geoff Bourne
9994c64b51 Auto-merging via docker-versions-create 2021-10-23 09:42:03 -05:00
Geoff Bourne
92079fc01f Merged latest from master 2021-10-21 21:55:29 -05:00
Geoff Bourne
98378130f2 Fixed Crucible libraries unzip for Alpine
#1052
2021-10-19 21:17:54 -05:00
Geoff Bourne
42856da49d Auto-merged latest from master 2021-10-18 22:08:22 -05:00
Geoff Bourne
83b05609d3 Added support for Crucible server type
#1052
2021-10-18 22:01:52 -05:00
Geoff Bourne
21fab1bf41 Auto-merging via docker-versions-create 2021-10-17 14:51:54 -05:00
Geoff Bourne
2849359a11 Auto-merging via docker-versions-create 2021-10-15 18:56:01 -05:00
Geoff Bourne
cd337f34da Auto-merging via docker-versions-create 2021-10-15 18:46:01 -05:00
Geoff Bourne
7a9aa760a2 Auto-merging via docker-versions-create 2021-10-10 09:55:28 -05:00
Geoff Bourne
2fd405ec5b Auto-merging via docker-versions-create 2021-10-09 15:24:22 -05:00
Geoff Bourne
cbfe9a069c Merged latest from master 2021-10-09 12:02:02 -05:00
Geoff Bourne
2db61fd72f Auto-merging via docker-versions-create 2021-10-02 19:21:27 -05:00
Geoff Bourne
6e2073fda5 Auto-merging via docker-versions-create 2021-09-29 10:26:44 -05:00
Geoff Bourne
ae48a8710e Auto-merging via docker-versions-create 2021-09-27 20:40:23 -05:00
Geoff Bourne
3b54a9fd67 Auto-merging via docker-versions-create 2021-09-20 12:29:36 -05:00
Geoff Bourne
a66efb1a4f Auto-merging via docker-versions-create 2021-09-15 21:30:00 -05:00
Geoff Bourne
83938d8989 Auto-merging via docker-versions-create 2021-09-15 21:05:30 -05:00
Geoff Bourne
8335b81bd8 Merged latest from master 2021-09-15 21:01:21 -05:00
Geoff Bourne
b9c379ec6c Auto-merging via docker-versions-create 2021-09-15 20:35:51 -05:00
Geoff Bourne
b9ecbf7497 Auto-merging via docker-versions-create 2021-08-30 21:36:02 -05:00
Geoff Bourne
eca00e88bf Auto-merging via docker-versions-create 2021-08-10 12:55:04 -05:00
Geoff Bourne
2a3169344d Auto-merging via docker-versions-create 2021-08-01 12:11:15 -05:00
Geoff Bourne
8ec4f0d244 Auto-merging via docker-versions-create 2021-07-31 09:26:17 -05:00
Geoff Bourne
d45250ebf2 Auto-merging via docker-versions-create 2021-07-26 19:34:15 -05:00
Geoff Bourne
03110aef99 Merged latest from master 2021-07-25 09:58:03 -05:00
Geoff Bourne
f344e7e823 Auto-merging via docker-versions-create 2021-07-25 09:35:30 -05:00
Geoff Bourne
c7fcaf1ec6 Auto-merging via docker-versions-create 2021-07-23 21:26:32 -05:00
Geoff Bourne
9d700041a7 Auto-merging via docker-versions-create 2021-07-17 21:13:39 -05:00
Geoff Bourne
4af4ed69a5 Auto-merging via docker-versions-create 2021-07-17 20:56:25 -05:00
Geoff Bourne
d215c14996 Auto-merging via docker-versions-create 2021-07-17 18:02:29 -05:00
Geoff Bourne
4716254b5b Auto-merging via docker-versions-create 2021-07-14 18:43:03 -05:00
Geoff Bourne
3c2b7f0718 Auto-merging via docker-versions-create 2021-07-12 19:08:38 -05:00
Geoff Bourne
0fd43f5a05 Auto-merging via docker-versions-create 2021-07-09 19:57:21 -05:00
Geoff Bourne
fae6479453 Auto-merging via docker-versions-create 2021-07-08 17:58:19 -05:00
Geoff Bourne
d9df5bf773 Auto-merging via docker-versions-create 2021-07-08 08:02:40 -05:00
itzg
13d7248c38 Auto-merging via docker-versions-create 2021-07-08 12:55:55 +00: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
itzg
d543df768b Auto-merging via docker-versions-create 2021-07-06 12:22:19 +00:00
itzg
74968389a2 Auto-merging via docker-versions-create 2021-07-05 12:10:23 +00:00
itzg
1701718515 Auto-merging via docker-versions-create 2021-07-04 19:53:56 +00:00
Geoff Bourne
ed6937654c Auto-merging from master 2021-07-03 14:22:14 -05:00
Geoff Bourne
73eb6e2e45 Auto-merge from master 2021-07-02 15:52:08 -05:00
itzg
8b982472a4 Auto-merging via docker-versions-create 2021-07-02 16:55:49 +00:00
itzg
ab406727d6 Auto-merging via docker-versions-create 2021-06-28 12:13:57 +00:00
itzg
5fc74a45f7 Auto-merging via docker-versions-create 2021-06-27 13:13:05 +00:00
itzg
17ecd48cd8 Auto-merging via docker-versions-create 2021-06-24 12:46:59 +00:00
Geoff Bourne
4732ce27a6 Auto-merging via docker-versions-create 2021-06-23 22:32:34 -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
Geoff Bourne
9ddd768f44 Auto-merging via docker-versions-create 2021-06-05 17:49:30 -05:00
Geoff Bourne
62e1ff8ffa Restored correct ps usage for autopause in Alpine
#897
2021-05-27 08:22:17 -05:00
Geoff Bourne
5f95d135f5 Auto-merging via docker-versions-create 2021-05-24 20:49:44 -05:00
Geoff Bourne
8e32d26b0f Merge branch 'master' into java8 2021-05-23 12:26:33 -05:00
Geoff Bourne
573f064970 Merge from master 2021-05-22 12:58:53 -05:00
Geoff Bourne
0bc6f4075b Auto-merging via docker-versions-create 2021-05-21 23:01:07 -05:00
Geoff Bourne
4ebcc0ef48 Auto-merging via docker-versions-create 2021-05-21 22:47:21 -05:00
Geoff Bourne
57720cf394 Merge branch 'master' into java8 2021-05-21 22:15: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
Geoff Bourne
08bc419dc8 Auto-merging via docker-versions-create 2021-05-19 20:27:11 -05:00
Geoff Bourne
67c23017d0 Auto-merging via docker-versions-create 2021-05-19 20:24:31 -05:00
Geoff Bourne
6e1ba3667c Auto-merging via docker-versions-create 2021-05-19 20:18:57 -05:00
Geoff Bourne
0c2f8b903b Auto-merging via docker-versions-create 2021-05-15 12:40:56 -05:00
Geoff Bourne
b9335d9cd6 Auto-merging via docker-versions-create 2021-05-06 20:12:25 -05:00
Geoff Bourne
0d92092b90 Auto-merging via docker-versions-create 2021-04-30 14:27:40 -05:00
Geoff Bourne
e653a41b3f Auto-merging via docker-versions-create 2021-04-30 11:11:19 -05:00
Geoff Bourne
82e63c54c4 Auto-merging via docker-versions-create 2021-04-28 16:50:55 -05:00
Geoff Bourne
f9c573f598 Auto-merging via docker-versions-create 2021-04-26 08:20:41 -05:00
Geoff Bourne
bf8b9cf20d Auto-merging via docker-versions-create 2021-04-24 13:42:07 -05:00
Geoff Bourne
0dd5a412d9 Auto-merging via docker-versions-create 2021-04-23 21:02:46 -05:00
Geoff Bourne
b389561091 Auto-merging via docker-versions-create 2021-04-18 13:29:12 -05:00
Geoff Bourne
6ee055761d Merge branch 'master' into java8 2021-04-11 10:41:32 -05:00
Geoff Bourne
49f9ff645e Auto-merging via docker-versions-create 2021-04-11 10:08:47 -05:00
Geoff Bourne
004cbdb9f7 Auto-merging via docker-versions-create 2021-04-08 19:12:56 -05:00
Geoff Bourne
45856a1a81 Auto-merging via docker-versions-create 2021-04-01 16:30:55 -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
1c85a685de Added support for CF modpacks using settings.cfg
#772 #800
2021-03-14 15:02:40 -05: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
Geoff Bourne
140a8aa90c Merge branch 'master' into java8 2021-03-11 19:40:26 -06:00
Geoff Bourne
76dcff9d18 Merge branch 'master' into java8 2021-03-11 17:23:48 -06:00
Geoff Bourne
a9a86d249b Merge branch 'master' into java8
# Conflicts:
#	start-configuration
2021-03-06 16:23:07 -06:00
Geoff Bourne
595760d301 Shifted PATH-fix earlier in startup 2021-03-06 16:04:06 -06:00
Geoff Bourne
6d3f194ce3 Merge from master 2021-02-27 20:47:00 -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
e78e5af96d Fix PATH to include java when needed 2021-02-10 14:49:13 -06:00
Geoff Bourne
0fb9700fc7 Auto-merging via docker-versions-create 2021-02-10 14:01:35 -06:00
Geoff Bourne
18925ef32c Merged latest from master 2021-02-08 21:16:50 -06:00
Geoff Bourne
f06b990f8a Auto-merging via docker-versions-create 2021-02-07 18:03:40 -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
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
7814ca21b5 Merge branch 'master' into java8
# Conflicts:
#	README.md
#	start-configuration
2021-01-30 18:56:33 -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
2d07dee4df Prepared forge branch's Dockerfile 2021-01-30 15:58:03 -06:00
93 changed files with 987 additions and 398 deletions

View File

@@ -3,29 +3,60 @@ on:
push: push:
branches: branches:
- master - master
- java8-multiarch
- java8-openj9
- java11*
- java16*
- java17*
- test/** - test/**
tags: tags:
- "[0-9]+.[0-9]+.[0-9]+" - "[0-9]+.[0-9]+.[0-9]+"
- "[0-9]+.[0-9]+.[0-9]+-java8-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: paths-ignore:
- "*.md" - "*.md"
- "docs/**" - "docs/**"
- "examples/**" - "examples/**"
env:
IMAGE_TO_TEST: itzg/minecraft-server:test-${{ github.repository_owner }}-${{ github.run_id }}
jobs: jobs:
build: build:
if: github.repository == 'itzg/docker-minecraft-server' if: github.repository == 'itzg/docker-minecraft-server'
strategy:
fail-fast: false
matrix:
variant:
- java17
- java17-openj9
- java8-multiarch
- java8-openj9
- java11
- java11-openj9
include:
- variant: java17
baseImage: eclipse-temurin:17
tagPrefix: java17-
platforms: linux/amd64,linux/arm/v7,linux/arm64
mcVersion: LATEST
- variant: java17-openj9
baseImage: ibm-semeru-runtimes:open-17-jdk
tagPrefix: java17-openj9-
platforms: linux/amd64,linux/arm64
mcVersion: LATEST
- variant: java8-multiarch
baseImage: eclipse-temurin:8-jdk
tagPrefix: java8-
platforms: linux/amd64,linux/arm64
mcVersion: 1.12.2
- variant: java8-openj9
baseImage: ibm-semeru-runtimes:open-8-jdk
tagPrefix: java8-openj9-
platforms: linux/amd64,linux/arm64
mcVersion: 1.12.2
- variant: java11
baseImage: adoptopenjdk:11-jdk-hotspot
tagPrefix: java11-
platforms: linux/amd64,linux/arm/v7,linux/arm64
mcVersion: 1.16.5
- variant: java11-openj9
baseImage: ibm-semeru-runtimes:open-11-jdk
tagPrefix: java11-openj9-
platforms: linux/amd64,linux/arm64
mcVersion: 1.16.5
env:
IMAGE_TO_TEST: itzg/minecraft-server:test-${{ matrix.variant }}-${{ github.run_id }}
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
steps: steps:
- name: Checkout - name: Checkout
@@ -38,10 +69,13 @@ jobs:
images: | images: |
itzg/minecraft-server itzg/minecraft-server
tags: | tags: |
type=ref,event=branch type=ref,event=tag,enable=${{ matrix.variant == 'java17' }}
type=ref,event=tag type=ref,event=tag,suffix=-${{ matrix.variant }}
type=raw,value=${{ matrix.variant }}
flavor: | flavor: |
latest=${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} latest=${{ matrix.variant == 'java17' }}
labels: |
org.opencontainers.image.authors=Geoff Bourne <itzgeoff@gmail.com>
- name: Setup Docker Buildx - name: Setup Docker Buildx
uses: docker/setup-buildx-action@v1 uses: docker/setup-buildx-action@v1
@@ -56,38 +90,37 @@ jobs:
password: ${{ secrets.DOCKER_PASSWORD }} password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build for test - name: Build for test
uses: docker/build-push-action@v2.7.0 uses: docker/build-push-action@v2.9.0
if: github.ref_name == 'master' || startsWith(github.ref_name, 'test/')
with: with:
context: .
platforms: linux/amd64 platforms: linux/amd64
tags: ${{ env.IMAGE_TO_TEST }} tags: ${{ env.IMAGE_TO_TEST }}
# ensure latest base image is used # ensure latest base image is used
pull: true pull: true
# load into daemon for test usage in next step
load: true load: true
push: false push: false
cache-from: type=gha build-args: |
BASE_IMAGE=${{ matrix.baseImage }}
cache-from: type=gha,scope=${{ matrix.variant }}
# no cache-to to avoid cross-cache update from next build step # no cache-to to avoid cross-cache update from next build step
- name: Run tests - name: Run tests
# It is assumed that image variants are merged from master and tested there env:
if: github.ref_name == 'master' || startsWith(github.ref_name, 'test/') MINECRAFT_VERSION: ${{ matrix.mcVersion }}
run: | run: |
tests/test.sh tests/test.sh
- name: Build and push - name: Build and push
id: docker_build id: docker_build
uses: docker/build-push-action@v2.7.0 uses: docker/build-push-action@v2.9.0
with: with:
context: . platforms: ${{ matrix.platforms }}
platforms: linux/amd64,linux/arm/v7,linux/arm64 push: ${{ github.ref_type == 'tag' || github.ref_name == 'master' }}
push: true
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
# ensure latest base image is used # ensure latest base image is used
pull: true pull: true
cache-from: type=gha
cache-to: type=gha,mode=max
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
build-args: |
- name: Image digest BASE_IMAGE=${{ matrix.baseImage }}
run: echo ${{ steps.docker_build.outputs.digest }} cache-from: type=gha,scope=${{ matrix.variant }}
cache-to: type=gha,mode=max,scope=${{ matrix.variant }}

View File

@@ -27,7 +27,7 @@ jobs:
uses: docker/setup-buildx-action@v1 uses: docker/setup-buildx-action@v1
- name: Build - name: Build
uses: docker/build-push-action@v2.7.0 uses: docker/build-push-action@v2.9.0
with: with:
context: . context: .
platforms: linux/amd64 platforms: linux/amd64
@@ -36,7 +36,7 @@ jobs:
cache-from: type=gha cache-from: type=gha
- name: Run Setup Only Tests - name: Run Setup Only Tests
run: sh tests/setuponlytests/test.sh run: bash tests/setuponlytests/test.sh
# - name: Run Full Minecraft Service Tests # - name: Run Full Minecraft Service Tests
# run: | # run: |

View File

@@ -1,4 +1,4 @@
name: discord name: Discord notifications
on: on:
workflow_run: workflow_run:

View File

@@ -1,9 +1,11 @@
name: Issue labels
on: on:
issues: issues:
types: [labeled] types: [labeled]
env: env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} DISCORD_WEBHOOK: ${{ secrets.DISCORD_ISSUES_WEBHOOK }}
jobs: jobs:
labelNotify: labelNotify:
@@ -11,7 +13,13 @@ jobs:
timeout-minutes: 5 timeout-minutes: 5
steps: steps:
- name: notify - name: notify
if: github.event.label.name == 'enhancement' || github.event.label.name == 'bug' if: >
github.event.label.name == 'enhancement'
|| github.event.label.name == 'bug'
|| github.event.label.name == 'help wanted'
|| github.event.label.name == 'priority/high'
|| github.event.label.name == 'question'
|| github.event.label.name == 'status/waiting on upstream'
uses: Ilshidur/action-discord@master uses: Ilshidur/action-discord@master
with: with:
args: "[${{ github.event.issue.title }}](<${{ github.event.issue.html_url }}>) added `${{ github.event.label.name }}` label" args: "[${{ github.event.issue.title }} (#${{ github.event.issue.number }})](<${{ github.event.issue.html_url }}>) added `${{ github.event.label.name }}` label"

View File

@@ -4,16 +4,9 @@ on:
push: push:
branches: branches:
- java8 - java8
- openj9
- openj9-11
- adopt11
- test/alpine/* - test/alpine/*
tags: tags:
- "[0-9]+.[0-9]+.[0-9]+-java8" - "[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"
env: env:
IMAGE_TO_TEST: itzg/minecraft-server:test-${{ github.repository_owner }}-${{ github.run_id }} IMAGE_TO_TEST: itzg/minecraft-server:test-${{ github.repository_owner }}-${{ github.run_id }}
@@ -53,7 +46,7 @@ jobs:
password: ${{ secrets.DOCKER_PASSWORD }} password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build for test - name: Build for test
uses: docker/build-push-action@v2.7.0 uses: docker/build-push-action@v2.9.0
if: github.ref_name == 'java8' if: github.ref_name == 'java8'
with: with:
context: . context: .
@@ -75,7 +68,7 @@ jobs:
- name: Build and push - name: Build and push
id: docker_build id: docker_build
uses: docker/build-push-action@v2.7.0 uses: docker/build-push-action@v2.9.0
with: with:
context: . context: .
file: ./Dockerfile file: ./Dockerfile
@@ -92,6 +85,4 @@ jobs:
org.opencontainers.image.version=${{ steps.prep.outputs.version }} org.opencontainers.image.version=${{ steps.prep.outputs.version }}
org.opencontainers.image.source=https://github.com/itzg/docker-minecraft-server org.opencontainers.image.source=https://github.com/itzg/docker-minecraft-server
org.opencontainers.image.revision=${{ github.sha }} org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.authors=Geoff Bourne <itzgeoff@gmail.com>
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}

View File

@@ -24,7 +24,7 @@ jobs:
uses: docker/setup-buildx-action@v1 uses: docker/setup-buildx-action@v1
- name: Build - name: Build
uses: docker/build-push-action@v2.7.0 uses: docker/build-push-action@v2.9.0
with: with:
context: . context: .
platforms: linux/amd64 platforms: linux/amd64
@@ -53,7 +53,7 @@ jobs:
- name: Push - name: Push
if: contains(github.event.pull_request.labels.*.name, 'ci/push-image') if: contains(github.event.pull_request.labels.*.name, 'ci/push-image')
uses: docker/build-push-action@v2.7.0 uses: docker/build-push-action@v2.9.0
with: with:
context: . context: .
platforms: linux/amd64,linux/arm/v7,linux/arm64 platforms: linux/amd64,linux/arm/v7,linux/arm64

View File

@@ -15,8 +15,24 @@ Individual scripts can be iteratively developed, debugged, and tested using the
First, build a baseline of the image to include the packages needed by existing or new scripts: First, build a baseline of the image to include the packages needed by existing or new scripts:
```shell script PowerShell:
docker build -t mc-dev . ```powershell
$env:IMAGE_TO_TEST="mc-dev"
docker build -t $env:IMAGE_TO_TEST .
pushd tests/setuponlytests/vanillatweaks_file/
docker-compose run mc
docker-compose down --remove-orphans
popd
```
Bash:
```bash
export IMAGE_TO_TEST=mc-dev
docker build -t $IMAGE_TO_TEST .
pushd tests/setuponlytests/vanillatweaks_file/
docker-compose run mc
docker-compose down --remove-orphans
popd
``` ```
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. 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.

View File

@@ -1,31 +1,32 @@
FROM eclipse-temurin:17-jdk ARG BASE_IMAGE=openjdk:8-jdk-alpine
FROM ${BASE_IMAGE}
LABEL org.opencontainers.image.authors="Geoff Bourne <itzgeoff@gmail.com>" RUN apk add --no-cache -U \
openssl \
imagemagick \
file \
lsof \
su-exec \
# GNU compatible 'find'
findutils \
shadow \
bash \
curl iputils \
git \
jq \
mysql-client \
tzdata \
rsync \
nano \
sudo \
knock \
ttf-dejavu \
zstd
RUN apt-get update \ RUN addgroup -g 1000 minecraft \
&& DEBIAN_FRONTEND=noninteractive \ && adduser -Ss /bin/false -u 1000 -G minecraft -h /home/minecraft minecraft \
apt-get install -y \ && mkdir -m 777 /data \
imagemagick \ && chown minecraft:minecraft /data /home/minecraft
file \
gosu \
sudo \
net-tools \
iputils-ping \
curl \
git \
jq \
dos2unix \
mysql-client \
tzdata \
rsync \
nano \
unzip \
knockd \
ttf-dejavu \
&& apt-get clean
RUN addgroup --gid 1000 minecraft \
&& adduser --system --shell /bin/false --uid 1000 --ingroup minecraft --home /data minecraft
COPY --chmod=644 files/sudoers* /etc/sudoers.d COPY --chmod=644 files/sudoers* /etc/sudoers.d
@@ -33,9 +34,9 @@ EXPOSE 25565 25575
# hook into docker BuildKit --platform support # hook into docker BuildKit --platform support
# see https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope # see https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
ARG TARGETOS ARG TARGETOS=linux
ARG TARGETARCH ARG TARGETARCH=amd64
ARG TARGETVARIANT ARG TARGETVARIANT=""
ARG EASY_ADD_VER=0.7.1 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 ADD https://github.com/itzg/easy-add/releases/download/${EASY_ADD_VER}/easy-add_${TARGETOS}_${TARGETARCH}${TARGETVARIANT} /usr/bin/easy-add
@@ -61,7 +62,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=0.1.1 --var app=maven-metadata-release --file {{.app}} \ --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 --from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
ARG MC_HELPER_VERSION=1.16.0 ARG MC_HELPER_VERSION=1.16.5
ARG MC_HELPER_BASE_URL=https://github.com/itzg/mc-image-helper/releases/download/v${MC_HELPER_VERSION} ARG MC_HELPER_BASE_URL=https://github.com/itzg/mc-image-helper/releases/download/v${MC_HELPER_VERSION}
RUN curl -fsSL ${MC_HELPER_BASE_URL}/mc-image-helper-${MC_HELPER_VERSION}.tgz \ RUN curl -fsSL ${MC_HELPER_BASE_URL}/mc-image-helper-${MC_HELPER_VERSION}.tgz \
| tar -C /usr/share -zxf - \ | tar -C /usr/share -zxf - \
@@ -73,7 +74,7 @@ WORKDIR /data
STOPSIGNAL SIGTERM STOPSIGNAL SIGTERM
ENV UID=1000 GID=1000 \ ENV UID=1000 GID=1000 \
MEMORY="1G" \ JVM_XX_OPTS="-XX:+UseG1GC" MEMORY="1G" \
TYPE=VANILLA VERSION=LATEST \ TYPE=VANILLA VERSION=LATEST \
ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \ ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \
ENABLE_AUTOPAUSE=false AUTOPAUSE_TIMEOUT_EST=3600 AUTOPAUSE_TIMEOUT_KN=120 AUTOPAUSE_TIMEOUT_INIT=600 \ ENABLE_AUTOPAUSE=false AUTOPAUSE_TIMEOUT_EST=3600 AUTOPAUSE_TIMEOUT_KN=120 AUTOPAUSE_TIMEOUT_INIT=600 \

108
README.md
View File

@@ -68,8 +68,8 @@ By default, the container will download the latest version of the "vanilla" [Min
* [Optional plugins, mods, and config attach points](#optional-plugins-mods-and-config-attach-points) * [Optional plugins, mods, and config attach points](#optional-plugins-mods-and-config-attach-points)
* [Auto-downloading SpigotMC/Bukkit/PaperMC plugins](#auto-downloading-spigotmcbukkitpapermc-plugins) * [Auto-downloading SpigotMC/Bukkit/PaperMC plugins](#auto-downloading-spigotmcbukkitpapermc-plugins)
* [Downloadable mod/plugin pack for Forge, Fabric, and Bukkit-like Servers](#downloadable-modplugin-pack-for-forge-fabric-and-bukkit-like-servers) * [Downloadable mod/plugin pack for Forge, Fabric, and Bukkit-like Servers](#downloadable-modplugin-pack-for-forge-fabric-and-bukkit-like-servers)
* [<strong>ForgeAPI</strong> usage to use non-version specific projects](#forgeapi-usage-to-use-non-version-specific-projects) * [ForgeAPI usage to use non-version specific projects](#forgeapi-usage-to-use-non-version-specific-projects)
* [Generic pack file](#generic-pack-file) * [Generic pack files](#generic-pack-files)
* [Mod/Plugin URL Listing File](#modplugin-url-listing-file) * [Mod/Plugin URL Listing File](#modplugin-url-listing-file)
* [Remove old mods/plugins](#remove-old-modsplugins) * [Remove old mods/plugins](#remove-old-modsplugins)
* [Working with world data](#working-with-world-data) * [Working with world data](#working-with-world-data)
@@ -134,6 +134,7 @@ By default, the container will download the latest version of the "vanilla" [Min
* [Stop Duration](#stop-duration) * [Stop Duration](#stop-duration)
* [Setup only](#setup-only) * [Setup only](#setup-only)
* [Enable Flare Flags](#enable-flare-flags) * [Enable Flare Flags](#enable-flare-flags)
* [Enable timestamps in init logs](#enable-timestamps-in-init-logs)
* [Autopause](#autopause) * [Autopause](#autopause)
* [Description](#description) * [Description](#description)
* [Enabling Autopause](#enabling-autopause) * [Enabling Autopause](#enabling-autopause)
@@ -141,7 +142,7 @@ By default, the container will download the latest version of the "vanilla" [Min
* [Running on RaspberryPi](#running-on-raspberrypi) * [Running on RaspberryPi](#running-on-raspberrypi)
* [Contributing](#contributing) * [Contributing](#contributing)
<!-- Added by: runner, at: Mon Jan 24 04:19:37 UTC 2022 --> <!-- Added by: runner, at: Sun Feb 6 18:45:39 UTC 2022 -->
<!--te--> <!--te-->
@@ -244,6 +245,8 @@ If you had used the commands in the first section, without the `-v` volume attac
> In this example, it is assumed the original container was given a `--name` of "mc", so change the container identifier accordingly. > In this example, it is assumed the original container was given a `--name` of "mc", so change the container identifier accordingly.
> You can also locate the Docker-managed directory from the `Source` field obtained from `docker inspect <container id or name> -f "{{json .Mounts}}"`
First, stop the existing container: First, stop the existing container:
```shell ```shell
docker stop mc docker stop mc
@@ -286,7 +289,7 @@ When using the image `itzg:/minecraft-server` without a tag, the `latest` image
| Tag name | Java version | Linux | JVM Type | Architecture | | Tag name | Java version | Linux | JVM Type | Architecture |
| -------------- | -------------|--------|----------|-------------------| | -------------- | -------------|--------|----------|-------------------|
| latest | 17 | Debian | Hotspot | amd64,arm64,armv7 | | latest | 16 | Debian | Hotspot | amd64,arm64,armv7 |
| java8 | 8 | Alpine | Hotspot | amd64 | | java8 | 8 | Alpine | Hotspot | amd64 |
| java8-multiarch | 8 | Debian | Hotspot | amd64,arm64,armv7 | | java8-multiarch | 8 | Debian | Hotspot | amd64,arm64,armv7 |
| java8-openj9 | 8 | Debian | OpenJ9 | amd64 | | java8-openj9 | 8 | Debian | OpenJ9 | amd64 |
@@ -391,7 +394,7 @@ To troubleshoot any issues with memory allocation reported by the JVM, set the e
### Running a Forge Server ### Running a Forge Server
Enable [Forge server](http://www.minecraftforge.net/wiki/) mode by adding a `-e TYPE=FORGE` to your command-line. Enable [Forge server](http://www.minecraftforge.net/) mode by adding a `-e TYPE=FORGE` to your command-line.
The overall version is specified by `VERSION`, [as described in the section above](#versions) and will run the recommended Forge version by default. You can also choose to run a specific Forge version with `FORGEVERSION`, such as `-e FORGEVERSION=14.23.5.2854`. The overall version is specified by `VERSION`, [as described in the section above](#versions) and will run the recommended Forge version by default. You can also choose to run a specific Forge version with `FORGEVERSION`, such as `-e FORGEVERSION=14.23.5.2854`.
@@ -744,9 +747,9 @@ You may also download or copy over individual mods using the `MODS` environment
docker run -d -e MODS=https://www.example.com/mods/mod1.jar,/plugins/common,/plugins/special/mod2.jar ... docker run -d -e MODS=https://www.example.com/mods/mod1.jar,/plugins/common,/plugins/special/mod2.jar ...
### **ForgeAPI** usage to use non-version specific projects ### ForgeAPI usage to use non-version specific projects
**NOTE:** This potentially could lead to unexpected behavior if the Mod recieves an update with unexpected behavior. **NOTE:** This potentially could lead to unexpected behavior if the Mod receives an update with unexpected behavior.
This is more complicated because you will be pulling/using the latest mod for the release of your game. To get started make sure you have a [CursedForge API Key](https://docs.curseforge.com/#getting-started). Then use the environmental parameters in your docker build. This is more complicated because you will be pulling/using the latest mod for the release of your game. To get started make sure you have a [CursedForge API Key](https://docs.curseforge.com/#getting-started). Then use the environmental parameters in your docker build.
@@ -756,6 +759,7 @@ Parameters to use the ForgeAPI:
* `MODS_FORGEAPI_FILE` - Required or use MODS_FORGEAPI_PROJECTIDS (Overrides MODS_FORGEAPI_PROJECTIDS) * `MODS_FORGEAPI_FILE` - Required or use MODS_FORGEAPI_PROJECTIDS (Overrides MODS_FORGEAPI_PROJECTIDS)
* `MODS_FORGEAPI_PROJECTIDS` - Required or use MODS_FORGEAPI_FILE * `MODS_FORGEAPI_PROJECTIDS` - Required or use MODS_FORGEAPI_FILE
* `MODS_FORGEAPI_RELEASES` - Default is release, Options: [Release|Beta|Alpha] * `MODS_FORGEAPI_RELEASES` - Default is release, Options: [Release|Beta|Alpha]
* `MODS_FORGEAPI_DOWNLOAD_DEPENDENCIES` - Default is False, attempts to download required mods (releaseType Release) defined in Forge.
* `REMOVE_OLD_FORGEAPI_MODS` - Default is False * `REMOVE_OLD_FORGEAPI_MODS` - Default is False
* `REMOVE_OLD_DATAPACKS_DEPTH` - Default is 1 * `REMOVE_OLD_DATAPACKS_DEPTH` - Default is 1
* `REMOVE_OLD_DATAPACKS_INCLUDE` - Default is *.jar * `REMOVE_OLD_DATAPACKS_INCLUDE` - Default is *.jar
@@ -768,7 +772,13 @@ Example of expected forge api project ids, releases, and key:
MODS_FORGEAPI_KEY: $WRX... MODS_FORGEAPI_KEY: $WRX...
``` ```
Example of expected ForgeAPI file format: **Note**: name is currently unused, but can be used to document each entry. Example of expected ForgeAPI file format.
**Field Description**:
* `name` is currently unused, but can be used to document each entry.
* `projectId` id is the id found on the CurseForge website for a particular mod
* `releaseType` Type corresponds to forge's R, B, A icon for each file. Default Release, options are (release|beta|alpha).
* `fileName` is used for version pinning if latest file will not work for you.
```json ```json
[ [
@@ -781,15 +791,33 @@ Example of expected ForgeAPI file format: **Note**: name is currently unused, bu
"name": "fabric voice mod", "name": "fabric voice mod",
"projectId": "416089", "projectId": "416089",
"releaseType": "beta" "releaseType": "beta"
},
{
"name": "Biomes o plenty",
"projectId": "220318",
"fileName": "BiomesOPlenty-1.18.1-15.0.0.100-universal.jar",
"releaseType": "release"
} }
] ]
``` ```
### Generic pack file ### Generic pack files
To install all of the server content (jars, mods, plugins, configs, etc) from a zip file, such as a CurseForge modpack that is missing a server start script, then set `GENERIC_PACK` to the container path of the zip file. That, combined with `TYPE`, allows for custom content along with container managed server download and install. To install all the server content (jars, mods, plugins, configs, etc.) from a zip or tgz file, then set `GENERIC_PACK` to the container path or URL of the archive file. This can also be used to apply a CurseForge modpack that is missing a server start script and/or Forge installer.
If multiple generic packs need to be applied together, set `GENERIC_PACKS` instead, with a comma separated list of zip file paths and/or URLs to zip files. If multiple generic packs need to be applied together, set `GENERIC_PACKS` instead, with a comma separated list of archive file paths and/or URLs to files.
To avoid repetition, each entry will be prefixed by the value of `GENERIC_PACKS_PREFIX` and suffixed by the value of `GENERIC_PACKS_SUFFIX`, both of which are optional. For example, the following variables
```
GENERIC_PACKS=configs-v9.0.1,mods-v4.3.6
GENERIC_PACKS_PREFIX=https://cdn.example.org/
GENERIC_PACKS_SUFFIX=.zip
```
would expand to `https://cdn.example.org/configs-v9.0.1.zip,https://cdn.example.org/mods-v4.3.6.zip`.
If applying large generic packs, the update check can be time-consuming since a SHA1 checksum is compared. To skip the update check set `SKIP_GENERIC_PACK_UPDATE_CHECK` to "true". Conversely, the generic pack(s) can be forced to be applied without comparing the checksum by setting `FORCE_GENERIC_PACK_UPDATE` to "true".
### Mod/Plugin URL Listing File ### Mod/Plugin URL Listing File
@@ -868,6 +896,9 @@ Datapacks will be placed in `/data/$LEVEL/datapacks`
VanillaTweaks datapacks can be installed with a share code from the website UI **OR** a json file to specify packs to download and install. VanillaTweaks datapacks can be installed with a share code from the website UI **OR** a json file to specify packs to download and install.
Datapacks will be placed in `/data/$LEVEL/datapacks`
Resourcepacks will be placed in `/data/resourcepacks`
Accepted Parameters: Accepted Parameters:
- `VANILLATWEAKS_FILE` - `VANILLATWEAKS_FILE`
@@ -878,13 +909,19 @@ Accepted Parameters:
- `REMOVE_OLD_VANILLATWEAKS_EXCLUDE` - `REMOVE_OLD_VANILLATWEAKS_EXCLUDE`
Example of expected Vanillatweaks sharecode: Example of expected Vanillatweaks sharecode:
**Note**: ResourcePacks, DataPacks, and CraftingTweaks all have separate sharecodes
```yaml ```yaml
VANILLATWEAKS_SHARECODE: MGr52E VANILLATWEAKS_SHARECODE: MGr52E,tF1zL2,LnEDwT
``` ```
Example of expected Vanillatweaks file format: Example of expected Vanillatweaks file format:
```yaml
VANILLATWEAKS_FILE: /config/vt-datapacks.json,/config/vt-craftingtweaks.json,/config/vt-resourcepacks.json
```
Datapacks Json:
```json ```json
{ {
"version": "1.18", "version": "1.18",
@@ -892,18 +929,39 @@ Example of expected Vanillatweaks file format:
"survival": [ "survival": [
"graves", "graves",
"multiplayer sleep", "multiplayer sleep",
"afk display",
"armor statues",
"unlock all recipes",
"fast leaf decay",
"coordinates hud"
], ],
"items": ["armored elytra"] "items": ["armored elytra"]
} }
} }
``` ```
Datapacks will be placed in `/data/$LEVEL/datapacks` Resourcepacks Json:
```json
{
"type": "resourcepacks",
"version": "1.18",
"packs": {
"aesthetic": ["CherryPicking", "BlackNetherBricks", "AlternateBlockDestruction"]
},
"result": "ok"
}
```
CraftingTweaks Json:
```json
{
"type": "craftingtweaks",
"version": "1.18",
"packs": {
"quality of life": [
"dropper to dispenser",
"double slabs",
"back to blocks"
]
},
"result": "ok"
}
```
## Server configuration ## Server configuration
@@ -1534,6 +1592,20 @@ To enable the JVM flags required to fully support the [Flare profiling suite](ht
Flare is built-in to Airplane/Pufferfish/Purpur, and is available in [plugin form](https://github.com/TECHNOVE/FlarePlugin) for other server types. Flare is built-in to Airplane/Pufferfish/Purpur, and is available in [plugin form](https://github.com/TECHNOVE/FlarePlugin) for other server types.
### Enable timestamps in init logs
Before the container starts the Minecraft Server its output is prefixed with `[init]`, such as
```
[init] Starting the Minecraft server...
```
To also include the timestamp with each log, set `LOG_TIMESTAMP` to "true". The log output will then look like:
```
[init] 2022-02-05 16:58:33+00:00 Starting the Minecraft server...
```
## Autopause ## Autopause
### Description ### Description

View File

@@ -3,12 +3,6 @@
# Use this variable to indicate a list of branches that docker hub is watching # Use this variable to indicate a list of branches that docker hub is watching
branches_list=( branches_list=(
'java8' 'java8'
'java8-multiarch'
'java8-openj9'
'java11'
'java11-openj9'
'java17'
'java17-openj9'
) )
function TrapExit { function TrapExit {

View File

@@ -5,15 +5,15 @@ current_uptime() {
} }
java_running() { java_running() {
[[ $( ps -ax -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]] [[ $( ps -a -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]]
} }
java_process_exists() { java_process_exists() {
[[ -n "$(ps -ax -o comm | grep 'java')" ]] [[ -n "$(ps -a -o comm | grep 'java')" ]]
} }
rcon_client_exists() { rcon_client_exists() {
[[ -n "$(ps -ax -o comm | grep 'rcon-cli')" ]] [[ -n "$(ps -a -o comm | grep 'rcon-cli')" ]]
} }
mc_server_listening() { mc_server_listening() {

View File

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

View File

@@ -2,7 +2,7 @@
. /start-utils . /start-utils
if [[ $( ps -ax -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]] ; then if [[ $( ps -a -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]] ; then
# save world # save world
rcon-cli save-all >/dev/null rcon-cli save-all >/dev/null

View File

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

View File

@@ -40,7 +40,7 @@ if ! isTrue "${SKIP_SUDO:-false}" && [ $(id -u) = 0 ]; then
echo 'hosts: files dns' > /etc/nsswitch.conf echo 'hosts: files dns' > /etc/nsswitch.conf
fi fi
exec gosu ${runAsUser}:${runAsGroup} ${SCRIPTS:-/}start-configuration "$@" exec su-exec ${runAsUser}:${runAsGroup} ${SCRIPTS:-/}start-configuration "$@"
else else
exec ${SCRIPTS:-/}start-configuration "$@" exec ${SCRIPTS:-/}start-configuration "$@"
fi fi

View File

@@ -3,7 +3,7 @@ set -euo pipefail
IFS=$'\n\t' IFS=$'\n\t'
# shellcheck source=start-utils # shellcheck source=start-utils
. ${SCRIPTS:-/}start-utils . "${SCRIPTS:-/}start-utils"
: "${EULA:=}" : "${EULA:=}"
: "${PROXY:=}" : "${PROXY:=}"
@@ -66,9 +66,12 @@ if [[ $RCON_PASSWORD_FILE ]]; then
log "" log ""
fi fi
# Some Docker management UIs grab all the image declared variables and present them for configuration.
# When upgrading images across Java versions, that creates a mismatch in PATH's expected by base image.
if ! which java > /dev/null; then if ! which java > /dev/null; then
log "Fixing PATH to include java" log "ERROR: PATH should not be explicitly passed into the container"
PATH="${PATH}:/opt/java/openjdk/bin" log " Remove configuration of that variable."
exit 1
fi fi
export VERSIONS_JSON=https://launchermeta.mojang.com/mc/game/version_manifest.json export VERSIONS_JSON=https://launchermeta.mojang.com/mc/game/version_manifest.json
@@ -116,39 +119,31 @@ fi
log "Resolving type given ${TYPE}" log "Resolving type given ${TYPE}"
case "${TYPE^^}" in case "${TYPE^^}" in
*BUKKIT|SPIGOT) *BUKKIT|SPIGOT)
exec ${SCRIPTS:-/}start-deployBukkitSpigot "$@" exec "${SCRIPTS:-/}start-deployBukkitSpigot" "$@"
;; ;;
PAPER) PAPER)
exec ${SCRIPTS:-/}start-deployPaper "$@" exec "${SCRIPTS:-/}start-deployPaper" "$@"
;; ;;
FORGE) FORGE)
if versionLessThan 1.17; then evaluateJavaCompatibilityForForge
log "**********************************************************************" exec "${SCRIPTS:-/}start-deployForge" "$@"
log "WARNING: The image tag itzg/minecraft-server:java8 is recommended"
log " since some mods require Java 8"
log " Exception traces reporting ClassCastException: class jdk.internal.loader.ClassLoaders\$AppClassLoader"
log " can be fixed with java8"
log "**********************************************************************"
fi
exec ${SCRIPTS:-/}start-deployForge "$@"
;; ;;
FABRIC) FABRIC)
exec ${SCRIPTS:-/}start-deployFabric "$@" exec "${SCRIPTS:-/}start-deployFabric" "$@"
;; ;;
FTBA) FTBA)
exec ${SCRIPTS:-/}start-deployFTBA "$@" log "ERROR: TYPE=FTBA is not supported with this image variant."
log " Use itzg/minecraft-server:java8-multiarch instead."
exit 1
;; ;;
FTB|CURSEFORGE) FTB|CURSEFORGE)
log "**********************************************************************" evaluateJavaCompatibilityForForge
log "NOTE: Some mods and modpacks may require Java 8." exec "${SCRIPTS:-/}start-deployCF" "$@"
log " If so, use itzg/minecraft-server:java8"
log "**********************************************************************"
exec ${SCRIPTS:-/}start-deployCF "$@"
;; ;;
VANILLA) VANILLA)
@@ -156,52 +151,50 @@ case "${TYPE^^}" in
;; ;;
SPONGEVANILLA) SPONGEVANILLA)
exec ${SCRIPTS:-/}start-deploySpongeVanilla "$@" exec "${SCRIPTS:-/}start-deploySpongeVanilla" "$@"
;; ;;
CUSTOM) CUSTOM)
exec ${SCRIPTS:-/}start-deployCustom "$@" evaluateJavaCompatibilityForForge
exec "${SCRIPTS:-/}start-deployCustom" "$@"
;; ;;
MAGMA) MAGMA)
exec ${SCRIPTS:-/}start-deployMagma "$@" evaluateJavaCompatibilityForForge
exec "${SCRIPTS:-/}start-deployMagma" "$@"
;; ;;
MOHIST) MOHIST)
exec ${SCRIPTS:-/}start-deployMohist "$@" evaluateJavaCompatibilityForForge
exec "${SCRIPTS:-/}start-deployMohist" "$@"
;; ;;
CATSERVER) CATSERVER)
exec ${SCRIPTS:-/}start-deployCatserver "$@" evaluateJavaCompatibilityForForge
exec "${SCRIPTS:-/}start-deployCatserver" "$@"
;; ;;
PURPUR) PURPUR)
exec ${SCRIPTS:-/}start-deployPurpur "$@" exec "${SCRIPTS:-/}start-deployPurpur" "$@"
;; ;;
AIRPLANE) AIRPLANE)
exec ${SCRIPTS:-/}start-deployAirplane "$@" exec "${SCRIPTS:-/}start-deployAirplane" "$@"
;; ;;
PUFFERFISH) PUFFERFISH)
exec ${SCRIPTS:-/}start-deployPufferfish "$@" exec "${SCRIPTS:-/}start-deployPufferfish" "$@"
;; ;;
CANYON) CANYON)
exec ${SCRIPTS:-/}start-deployCanyon "$@" exec "${SCRIPTS:-/}start-deployCanyon" "$@"
;; ;;
LIMBO) LIMBO)
exec ${SCRIPTS:-/}start-deployLimbo "$@" exec "${SCRIPTS:-/}start-deployLimbo" "$@"
;; ;;
CRUCIBLE) CRUCIBLE)
log "**********************************************************************"
log "WARNING: The image tag itzg/minecraft-server:java8 is recommended"
log " since some mods require Java 8"
log " Exception traces reporting ClassCastException: class jdk.internal.loader.ClassLoaders\$AppClassLoader"
log " can be fixed with java8"
log "**********************************************************************"
exec "${SCRIPTS:-/}start-deployCrucible" "$@" exec "${SCRIPTS:-/}start-deployCrucible" "$@"
;; ;;

View File

@@ -42,6 +42,5 @@ fi
# Normalize on Spigot for later operations # Normalize on Spigot for later operations
export FAMILY=SPIGOT export FAMILY=SPIGOT
export SKIP_LOG4J_CONFIG=true
exec "${SCRIPTS:-/}start-spiget" "$@" exec "${SCRIPTS:-/}start-spiget" "$@"

View File

@@ -127,6 +127,5 @@ fi
# Normalize on Spigot for operations below # Normalize on Spigot for operations below
export FAMILY=SPIGOT export FAMILY=SPIGOT
export SKIP_LOG4J_CONFIG=true
exec ${SCRIPTS:-/}start-spiget "$@" exec ${SCRIPTS:-/}start-spiget "$@"

View File

@@ -111,6 +111,8 @@ if ! isTrue "${USE_MODPACK_START_SCRIPT:-true}"; then
exit 2 exit 2
fi fi
forgeInstallerJar=$(ls -t "${forgeInstallerJar}" | head -1)
log "Installing forge server" log "Installing forge server"
dirOfInstaller=$(dirname "${forgeInstallerJar}") dirOfInstaller=$(dirname "${forgeInstallerJar}")
(cd "${dirOfInstaller}"; java -jar "$(basename "${forgeInstallerJar}")" --installServer) (cd "${dirOfInstaller}"; java -jar "$(basename "${forgeInstallerJar}")" --installServer)

View File

@@ -44,6 +44,5 @@ fi
# Normalize on Spigot for later operations # Normalize on Spigot for later operations
export FAMILY=SPIGOT export FAMILY=SPIGOT
export SKIP_LOG4J_CONFIG=true
exec ${SCRIPTS:-/}start-spiget "$@" exec ${SCRIPTS:-/}start-spiget "$@"

View File

@@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
. ${SCRIPTS:-/}start-utils # shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
set -o pipefail set -o pipefail
set -e set -e
@@ -26,8 +27,6 @@ if [ ! -f ${SERVER} ]; then
curl -H "Accept:application/octet-stream" -o "$SERVER" -fsSL https://api.github.com/repos/Luohuayu/CatServer/releases/assets/${latestJarId} curl -H "Accept:application/octet-stream" -o "$SERVER" -fsSL https://api.github.com/repos/Luohuayu/CatServer/releases/assets/${latestJarId}
fi fi
export SKIP_LOG4J_CONFIG=true
export FAMILY=HYBRID export FAMILY=HYBRID
# Continue to Final Setup
exec ${SCRIPTS:-/}start-setupWorld "$@" exec "${SCRIPTS:-/}start-setupWorld" "$@"

View File

@@ -47,6 +47,7 @@ if [ ! -d "$librariesDir" ]; then
exit 1 exit 1
fi fi
mkdir "$librariesDir"
if ! unzip /tmp/libraries.zip -d "$librariesDir"; then if ! unzip /tmp/libraries.zip -d "$librariesDir"; then
log "ERROR: failed to unzip Crucible libraries" log "ERROR: failed to unzip Crucible libraries"
exit 1 exit 1
@@ -55,7 +56,6 @@ if [ ! -d "$librariesDir" ]; then
fi fi
export SERVER export SERVER
export SKIP_LOG4J_CONFIG=true
export FAMILY=HYBRID export FAMILY=HYBRID
exec "${SCRIPTS:-$(dirname "$0")}/start-setupWorld" "$@" exec "${SCRIPTS:-$(dirname "$0")}/start-setupWorld" "$@"

View File

@@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
. ${SCRIPTS:-/}start-utils # shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
isDebugging && set -x isDebugging && set -x
if isURL ${CUSTOM_SERVER}; then if isURL ${CUSTOM_SERVER}; then
@@ -30,6 +31,6 @@ else
fi fi
export SKIP_LOG4J_CONFIG=true
export FAMILY=HYBRID export FAMILY=HYBRID
exec ${SCRIPTS:-/}start-setupWorld $@ exec ${SCRIPTS:-/}start-setupWorld $@

View File

@@ -2,7 +2,8 @@
ftbInstallMarker=".ftb-installed" ftbInstallMarker=".ftb-installed"
. ${SCRIPTS:-/}start-utils # shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
isDebugging && set -x isDebugging && set -x
set -e set -e
@@ -80,4 +81,5 @@ if ! [ -v SERVER ]; then
fi fi
export FAMILY=FORGE export FAMILY=FORGE
exec ${SCRIPTS:-/}start-setupWorld $@ exec ${SCRIPTS:-/}start-setupWorld $@

View File

@@ -38,18 +38,23 @@ install() {
get_installer "$normForgeVersion" "$shortForgeVersion" get_installer "$normForgeVersion" "$shortForgeVersion"
fi fi
log "Installing Forge $shortForgeVersion using $FORGE_INSTALLER" log "Installing Forge $shortForgeVersion. This might take a minute or two..."
mkdir -p mods mkdir -p mods
tries=3 tries=3
while ((--tries >= 0)); do while true; do
if java -jar "$FORGE_INSTALLER" --installServer; then if ! java -jar "$FORGE_INSTALLER" --installServer &> forge-installer.log; then
break if ((--tries <= 0)); then
cat forge-installer.log
log "
ERROR Forge failed to install after several tries.
"
exit 1
fi
log "Install failed. Trying again..."
else
break # out of this loop
fi fi
done done
if ((tries < 0)); then
log "Forge failed to install after several tries." >&2
exit 10
fi
# NOTE $shortForgeVersion will be empty if installer location was given to us # NOTE $shortForgeVersion will be empty if installer location was given to us
log "Finding installed server jar..." log "Finding installed server jar..."
unset -v latest unset -v latest
@@ -148,4 +153,5 @@ else
fi fi
export FAMILY=FORGE export FAMILY=FORGE
exec "${SCRIPTS:-/}start-setupWorld" "$@" exec "${SCRIPTS:-/}start-setupWorld" "$@"

View File

@@ -58,7 +58,5 @@ if [[ ${LEVEL} != *\;* ]]; then
fi fi
export LEVEL export LEVEL
export SKIP_LOG4J_CONFIG=true
export FAMILY=LIMBO export FAMILY=LIMBO
exec ${SCRIPTS:-/}start-setupWorld $@ exec ${SCRIPTS:-/}start-setupWorld $@

View File

@@ -1,13 +1,12 @@
#!/bin/bash #!/bin/bash
. ${SCRIPTS:-/}start-utils # shellcheck source=start-utils
export SKIP_LOG4J_CONFIG=true . "${SCRIPTS:-/}start-utils"
isDebugging && set -x isDebugging && set -x
: ${VANILLA_VERSION?} : "${VANILLA_VERSION?}"
# stable, dev # stable, dev
: ${MAGMA_CHANNEL:=stable} : "${MAGMA_CHANNEL:=stable}"
magmaDownloadServer() { magmaDownloadServer() {
@@ -90,4 +89,5 @@ else
fi fi
export FAMILY=HYBRID export FAMILY=HYBRID
exec ${SCRIPTS:-/}start-setupWorld "$@"
exec "${SCRIPTS:-/}start-setupWorld" "$@"

View File

@@ -38,7 +38,6 @@ if [ ! -f "${SERVER}" ]; then
get -o "${SERVER}" "${mohistJob}${MOHIST_BUILD}/artifact/${buildRelPath}" get -o "${SERVER}" "${mohistJob}${MOHIST_BUILD}/artifact/${buildRelPath}"
fi fi
export SKIP_LOG4J_CONFIG=true
export FAMILY=HYBRID export FAMILY=HYBRID
exec "${SCRIPTS:-$(dirname "$0")}/start-setupWorld" "$@" exec "${SCRIPTS:-$(dirname "$0")}/start-setupWorld" "$@"

View File

@@ -74,6 +74,5 @@ fi
# Normalize on Spigot for downstream operations # Normalize on Spigot for downstream operations
export FAMILY=SPIGOT export FAMILY=SPIGOT
export SKIP_LOG4J_CONFIG=true
exec ${SCRIPTS:-/}start-spiget "$@" exec ${SCRIPTS:-/}start-spiget "$@"

View File

@@ -40,6 +40,5 @@ fi
# Normalize on Spigot for later operations # Normalize on Spigot for later operations
export FAMILY=SPIGOT export FAMILY=SPIGOT
export SKIP_LOG4J_CONFIG=true
exec ${SCRIPTS:-/}start-spiget "$@" exec ${SCRIPTS:-/}start-spiget "$@"

View File

@@ -6,9 +6,9 @@ IFS=$'\n\t'
. "${SCRIPTS:-/}start-utils" . "${SCRIPTS:-/}start-utils"
isDebugging && set -x isDebugging && set -x
: ${VANILLA_VERSION:?} : "${VANILLA_VERSION:?}"
: ${PURPUR_BUILD:=LATEST} : "${PURPUR_BUILD:=LATEST}"
: ${FORCE_REDOWNLOAD:=false} : "${FORCE_REDOWNLOAD:=false}"
if [[ ${PURPUR_BUILD} == LATEST ]]; then if [[ ${PURPUR_BUILD} == LATEST ]]; then
if ! PURPUR_BUILD=$(get --json-path=".builds.latest" "https://api.purpurmc.org/v2/purpur/${VANILLA_VERSION}"); then if ! PURPUR_BUILD=$(get --json-path=".builds.latest" "https://api.purpurmc.org/v2/purpur/${VANILLA_VERSION}"); then
@@ -31,6 +31,5 @@ fi
# Normalize on Spigot for later operations # Normalize on Spigot for later operations
export FAMILY=SPIGOT export FAMILY=SPIGOT
export SKIP_LOG4J_CONFIG=true
exec "${SCRIPTS:-/}start-spiget" "$@" exec "${SCRIPTS:-/}start-spiget" "$@"

View File

@@ -1,97 +1,9 @@
#!/bin/bash #!/bin/bash
. ${SCRIPTS:-/}start-utils # shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
isDebugging && set -x isDebugging && set -x
if versionLessThan 1.7.6; then
opsFile=ops.txt
whitelistFile=white-list.txt
else
opsFile=ops.json
whitelistFile=whitelist.json
fi
function process_user_file() {
local output=$1
local source=$2
if isURL "$source"; then
log "Downloading $output from $source"
if ! get -o /data/$output "$source"; then
log "ERROR: failed to download from $source"
exit 2
fi
else
log "Copying $output from $source"
if ! cp "$source" /data/$output; then
log "ERROR: failed to copy from $source"
exit 1
fi
fi
}
function process_user_csv() {
local output=$1
local list=$2
local playerDataList
if [[ "$output" == *"ops"* ]]; then
# Extra data for ops.json
userData='{"uuid": .id, "name": .username, "level": 4}'
else
userData='{"uuid": .id, "name": .username}'
fi
log "Updating ${output%.*}"
for i in ${list//,/ }
do
if [ -e "$output" ] && grep -q "$i" "$output"; then
log "$i already present in $output, skipping"
continue
fi
if ! playerData=$(get "https://playerdb.co/api/player/minecraft/$i" | jq -re ".data.player"); then
log "WARNING: Could not lookup user $i for ${output} addition"
else
playerDataList=$playerDataList$(echo $playerData | jq -r "$userData")
fi
done
local newUsers=$(echo $playerDataList | jq -s .)
if [[ $output =~ .*\.txt ]]; then
# username list for txt config (Minecraft <= 1.7.5)
echo $newUsers | jq -r '.[].name' >> /data/${output}
sort -u /data/${output} -o /data/${output}
elif [ -e /data/${output} ]; then
# Merge with existing json file
local currentUsers=$(cat /data/${output})
jq --argjson current "$currentUsers" --argjson new "$newUsers" -n '$new + $current | unique_by(.uuid)' > /data/${output}
else
# New json file
echo $newUsers > /data/${output}
fi
}
if isTrue "${OVERRIDE_OPS}"; then
log "Recreating ${opsFile} file at server startup"
rm -f /data/${opsFile}
fi
if [ -n "${OPS_FILE}" ] && [ ! -e "/data/${opsFile}" ]; then
process_user_file ${opsFile} "$OPS_FILE"
fi
if [ -n "${OPS}" ]; then
process_user_csv ${opsFile} "$OPS"
fi
if isTrue "${OVERRIDE_WHITELIST}"; then
log "Recreating ${whitelistFile} file at server startup"
rm -f /data/${whitelistFile}
fi
if [ -n "${WHITELIST_FILE}" ] && [ ! -e "/data/${whitelistFile}" ]; then
process_user_file ${whitelistFile} "$WHITELIST_FILE"
fi
if [ -n "${WHITELIST}" ]; then
process_user_csv ${whitelistFile} "$WHITELIST"
fi
if [ -n "$ICON" ]; then if [ -n "$ICON" ]; then
if [ ! -e server-icon.png ] || [ "${OVERRIDE_ICON}" == "TRUE" ]; then if [ ! -e server-icon.png ] || [ "${OVERRIDE_ICON}" == "TRUE" ]; then
log "Using server icon from $ICON..." log "Using server icon from $ICON..."
@@ -108,13 +20,15 @@ if [ -n "$ICON" ]; then
fi fi
canUseRollingLogs=true canUseRollingLogs=true
useFallbackJvmFlag=false
patchLog4jConfig() { patchLog4jConfig() {
file=${1?} file=${1?}
url=${2?} url=${2?}
if ! get -o "$file" "$url"; then if ! get -o "$file" "$url"; then
log "ERROR: failed to download corrected log4j config" log "ERROR: failed to download corrected log4j config, fallback to JVM flag"
exit 1 useFallbackJvmFlag=true
return 1
fi fi
JVM_OPTS="-Dlog4j.configurationFile=${file} ${JVM_OPTS}" JVM_OPTS="-Dlog4j.configurationFile=${file} ${JVM_OPTS}"
canUseRollingLogs=false canUseRollingLogs=false
@@ -134,6 +48,10 @@ elif isType PURPUR && versionLessThan 1.17; then
elif isType PURPUR && versionLessThan 1.18.1; then elif isType PURPUR && versionLessThan 1.18.1; then
patchLog4jConfig purpur_log4j2_117.xml https://purpurmc.org/docs/xml/purpur_log4j2_117.xml patchLog4jConfig purpur_log4j2_117.xml https://purpurmc.org/docs/xml/purpur_log4j2_117.xml
elif versionLessThan 1.18.1; then elif versionLessThan 1.18.1; then
useFallbackJvmFlag=true
fi
if ${useFallbackJvmFlag}; then
JVM_OPTS="-Dlog4j2.formatMsgNoLookups=true ${JVM_OPTS}" JVM_OPTS="-Dlog4j2.formatMsgNoLookups=true ${JVM_OPTS}"
fi fi
@@ -169,7 +87,7 @@ if versionLessThan 1.14 && [[ ${CONSOLE,,} = false ]]; then
fi fi
# Optional disable GUI for headless servers # Optional disable GUI for headless servers
if [[ ${GUI} = false || ${GUI} = FALSE ]]; then if [[ ${GUI,,} = false ]]; then
EXTRA_ARGS+=" nogui" EXTRA_ARGS+=" nogui"
fi fi
@@ -331,6 +249,10 @@ EOF
elif [[ $SERVER =~ run.sh ]]; then elif [[ $SERVER =~ run.sh ]]; then
log "Using Forge supplied run.sh script..." log "Using Forge supplied run.sh script..."
echo $JVM_XX_OPTS $JVM_OPTS $expandedDOpts > user_jvm_args.txt echo $JVM_XX_OPTS $JVM_OPTS $expandedDOpts > user_jvm_args.txt
if isTrue ${SETUP_ONLY:=false}; then
echo "SETUP_ONLY: bash ${SERVER}"
exit
fi
exec mc-server-runner "${mcServerRunnerArgs[@]}" --shell bash "${SERVER}" exec mc-server-runner "${mcServerRunnerArgs[@]}" --shell bash "${SERVER}"
else else
# If we have a bootstrap.txt file... feed that in to the server stdin # If we have a bootstrap.txt file... feed that in to the server stdin

View File

@@ -32,4 +32,4 @@ if [[ ${PATCH_DEFINITIONS} ]]; then
"${PATCH_DEFINITIONS}" "${PATCH_DEFINITIONS}"
fi fi
exec "${SCRIPTS:-/}start-finalExec" "$@" exec "${SCRIPTS:-/}start-setupRbac" "$@"

View File

@@ -7,6 +7,7 @@ set -e -o pipefail
: "${MODS_FORGEAPI_PROJECTIDS:=}" : "${MODS_FORGEAPI_PROJECTIDS:=}"
: "${MODS_FORGEAPI_FILE:=}" : "${MODS_FORGEAPI_FILE:=}"
: "${MODS_FORGEAPI_RELEASES:=RELEASE}" : "${MODS_FORGEAPI_RELEASES:=RELEASE}"
: "${MODS_FORGEAPI_DOWNLOAD_DEPENDENCIES:=false}"
: "${REMOVE_OLD_MODS_DEPTH:=1} " : "${REMOVE_OLD_MODS_DEPTH:=1} "
: "${REMOVE_OLD_MODS_INCLUDE:=*.jar}" : "${REMOVE_OLD_MODS_INCLUDE:=*.jar}"
@@ -36,11 +37,11 @@ ensureModKey(){
# NOTE: downcasing release type for comparing types. # NOTE: downcasing release type for comparing types.
updateReleaseNumber(){ updateReleaseNumber(){
releaseType=$1 releaseType=$1
if [ "release" = "${releaseType,,}" ]; then if [ "release" = "${releaseType,,}" ] || [ 1 = "${releaseType,,}" ]; then
RELEASE_NUMBER_FILTER=1 RELEASE_NUMBER_FILTER=1
elif [ "beta" = "${releaseType,,}" ]; then elif [ "beta" = "${releaseType,,}" ] || [ 2 = "${releaseType,,}" ]; then
RELEASE_NUMBER_FILTER=2 RELEASE_NUMBER_FILTER=2
elif [ "alpha" = "${releaseType,,}" ]; then elif [ "alpha" = "${releaseType,,}" ] || [ 3 = "${releaseType,,}" ]; then
RELEASE_NUMBER_FILTER=3 RELEASE_NUMBER_FILTER=3
fi fi
} }
@@ -52,12 +53,12 @@ retrieveVersionTypeNumber(){
-H 'Accept: application/json' -H 'x-api-key: '${MODS_FORGEAPI_KEY}'') -H 'Accept: application/json' -H 'x-api-key: '${MODS_FORGEAPI_KEY}'')
if [ ! "$minecraft_types" ]; then if [ ! "$minecraft_types" ]; then
log "ERROR: unable to retrieve version types for ${VERSION_NAME} from ForgeAPI" log "ERROR: unable to retrieve version types for ${VERSION_NAME} from ForgeAPI. Check Forge API key or supplied Minecraft version"
exit 2 exit 2
fi fi
TYPE_ID=$(jq -n "$minecraft_types" | jq --arg VERSION_NAME "$VERSION_NAME" -jc ' TYPE_ID=$(jq -n "$minecraft_types" | jq --arg VERSION_NAME "$VERSION_NAME" -jc '
.data[] | select(.name==$VERSION_NAME) | .id') .data[]? | select(.name==$VERSION_NAME) | .id')
if [ ! "$TYPE_ID" ]; then if [ ! "$TYPE_ID" ]; then
log "ERROR: unable to retrieve version types for ${VERSION_NAME} from ForgeAPI" log "ERROR: unable to retrieve version types for ${VERSION_NAME} from ForgeAPI"
@@ -68,6 +69,7 @@ retrieveVersionTypeNumber(){
modFileByProjectID(){ modFileByProjectID(){
project_id=$(echo $1 | tr -d '"') project_id=$(echo $1 | tr -d '"')
project_id_release_type=$2 project_id_release_type=$2
project_id_file_name=$3
unset PROJECT_FILE unset PROJECT_FILE
# if Type id isn't defined use minecraft version to go get it. # if Type id isn't defined use minecraft version to go get it.
@@ -100,9 +102,13 @@ modFileByProjectID(){
fi fi
# grabs the highest ID of the releaseTypes selected. # grabs the highest ID of the releaseTypes selected.
# Default is 1 for Release, Beta is 2, and Alpha is 3. Using less than we can validate highest release. # Default is 1 for Release, Beta is 2, and Alpha is 3. Using less than we can validate highest release.
current_project_file=$(jq -n "$project_files" | jq --arg RELEASE_FILTER "$RELEASE_NUMBER_FILTER" -jc ' if [ $project_id_file_name ]; then
.data | sort_by(.id) | reverse | map(select(.releaseType<=($RELEASE_FILTER|tonumber))) | .[0]') current_project_file=$(jq -n "$project_files" | jq --arg FILE_NAME "$project_id_file_name" -jc '
.data | map(select(.fileName<=($FILE_NAME))) | .[0]')
else
current_project_file=$(jq -n "$project_files" | jq --arg RELEASE_FILTER "$RELEASE_NUMBER_FILTER" -jc '
.data | sort_by(.id) | reverse | map(select(.releaseType<=($RELEASE_FILTER|tonumber))) | .[0]')
fi
# Logic to grab the latest release over the entire pagination # Logic to grab the latest release over the entire pagination
if [ ! "$PROJECT_FILE" ]; then if [ ! "$PROJECT_FILE" ]; then
PROJECT_FILE=$current_project_file PROJECT_FILE=$current_project_file
@@ -143,6 +149,40 @@ downloadModPackfromModFile() {
fi fi
} }
downloadDependencies(){
if [ "$PROJECT_FILE" ]; then
dependencies=$(jq -n "$PROJECT_FILE" | jq -jc '.dependencies' )
required_dependencies=$(jq -n "$dependencies" | jq --arg REQUIRED_FILTER "3" -jc '
map(select(.relationType==($REQUIRED_FILTER|tonumber)))')
if [ "$required_dependencies" ]; then
jq -n "$required_dependencies" | jq -c '.[]?' | while read current_dependency; do
mod_id=$(jq -n "$current_dependency" | jq -jc '.modId' )
# BROKEN: Example Voice mod keeps returning the voice mod file id instead of the mod file id.
# file_id=$(jq -n "$current_dependency" | jq -jc '.fileId' )
# dependency_data=$(curl -X GET -s \
# "${FORGEAPI_BASE_URL}/mods/${mod_id}/files/${file_id}/download-url" \
# -H 'Accept: application/json' -H 'x-api-key: '${MODS_FORGEAPI_KEY}'')
# if [ ! "$dependency_data" ]; then
# log "ERROR: unable to retrieve dependency data files for ${project_id} from ForgeAPI"
# exit 2
# fi
# dependency_download_url=$(jq -n "$dependency_data" | jq -jc '.data' )
# echo "Downloading dependency ${dependency_download_url}"
# if ! get -o "${out_dir}/" $dependency_download_url ; then
# log "ERROR: failed to download dependency from ${dependency_download_url}"
# exit 2
# fi
# Using current mod path and release to go get the REQUIRED DEPENDENCY
# NOTE: we are ASUMING it will be release.
modFileByProjectID $mod_id "release"
downloadModPackfromModFile
done
fi
fi
}
# Use forge api json file to filter and download the correct mods # Use forge api json file to filter and download the correct mods
if [ "$MODS_FORGEAPI_FILE" ] && [ -z "$MODS_FORGEAPI_PROJECTIDS" ]; then if [ "$MODS_FORGEAPI_FILE" ] && [ -z "$MODS_FORGEAPI_PROJECTIDS" ]; then
ensureModKey ensureModKey
@@ -150,18 +190,19 @@ if [ "$MODS_FORGEAPI_FILE" ] && [ -z "$MODS_FORGEAPI_PROJECTIDS" ]; then
log "ERROR: given MODS_FORGEAPI_FILE file does not exist" log "ERROR: given MODS_FORGEAPI_FILE file does not exist"
exit 2 exit 2
fi fi
MODS_FORGEAPI_PROJECTIDS=$(jq --raw-output '[.[] | .projectId] | join(",")' $MODS_FORGEAPI_FILE)
if [ ! "$MODS_FORGEAPI_PROJECTIDS" ]; then
log "ERROR: unable to retrieve packs from $MODS_FORGEAPI_FILE"
exit 2
fi
# Needs loop here to look up release types befor calling download. # Needs loop here to look up release types befor calling download.
for project_id in ${MODS_FORGEAPI_PROJECTIDS//,/ }; do jq -n "$required_dependencies" | jq -c '.[]?' | while read current_project; do
current_release_type=$(jq --arg PROJECT_ID "$project_id" -jc ' # Per stack overflow we can use //empty to return empty string that works with -z
.[] | select(.projectId==$PROJECT_ID) | .releaseType' "$MODS_FORGEAPI_FILE") project_id=$(jq -n "$current_project" | jq -jc '.projectId // empty' )
modFileByProjectID $project_id $current_release_type current_release_type=$(jq -n "$current_project" | jq -jc '.releaseType // empty' )
current_file_name=$(jq -n "$current_project" | jq -jc '.fileName // empty' )
modFileByProjectID $project_id $current_release_type $current_file_name
downloadModPackfromModFile downloadModPackfromModFile
if isTrue "${MODS_FORGEAPI_DOWNLOAD_DEPENDENCIES}"; then
downloadDependencies
fi
done done
fi fi
@@ -171,6 +212,9 @@ if [ "$MODS_FORGEAPI_PROJECTIDS" ] && [ -z "$MODS_FORGEAPI_FILE" ]; then
for project_id in ${MODS_FORGEAPI_PROJECTIDS//,/ }; do for project_id in ${MODS_FORGEAPI_PROJECTIDS//,/ }; do
modFileByProjectID $project_id modFileByProjectID $project_id
downloadModPackfromModFile downloadModPackfromModFile
if isTrue "${MODS_FORGEAPI_DOWNLOAD_DEPENDENCIES}"; then
downloadDependencies
fi
done done
fi fi

View File

@@ -29,7 +29,7 @@ if [[ "${PACKWIZ_URL}" ]]; then
if [[ -z "${latestPackwiz}" ]]; then if [[ -z "${latestPackwiz}" ]]; then
log "WARNING: Could not retrieve Packwiz bootstrap installer release information" log "WARNING: Could not retrieve Packwiz bootstrap installer release information"
else else
isDebugging && log "Latest packwiz ${latestPackWiz}" isDebugging && log "Latest packwiz ${latestPackwiz}"
latestPackwizVer=$(echo ${latestPackwiz} | jq --raw-output '.tag_name') latestPackwizVer=$(echo ${latestPackwiz} | jq --raw-output '.tag_name')
latestPackwizUrl=$(echo ${latestPackwiz} | jq --raw-output '.assets[] | select(.name | match("packwiz-installer-bootstrap.jar")) | .url') latestPackwizUrl=$(echo ${latestPackwiz} | jq --raw-output '.assets[] | select(.name | match("packwiz-installer-bootstrap.jar")) | .url')
: "${PACKWIZ_JAR:=packwiz-installer-bootstrap_${latestPackwizVer}.jar}" : "${PACKWIZ_JAR:=packwiz-installer-bootstrap_${latestPackwizVer}.jar}"
@@ -92,7 +92,7 @@ elif [[ "$MODS" ]]; then
do do
if isURL "$i"; then if isURL "$i"; then
log "Downloading mod/plugin $i ..." log "Downloading mod/plugin $i ..."
if ! get -o "${out_dir}" "$i"; then if ! get --skip-up-to-date -o "${out_dir}" "$i"; then
log "ERROR: failed to download from $i into $out_dir" log "ERROR: failed to download from $i into $out_dir"
exit 2 exit 2
fi fi
@@ -128,7 +128,7 @@ elif [[ "$MODS_FILE" ]]; then
args=( args=(
-o "${out_dir}" -o "${out_dir}"
--log-progress-each --log-progress-each
--skip-existing --skip-up-to-date
--uris-file "${MODS_FILE}" --uris-file "${MODS_FILE}"
) )
if isTrue "${REMOVE_OLD_MODS}"; then if isTrue "${REMOVE_OLD_MODS}"; then
@@ -188,15 +188,19 @@ esac
fi fi
: "${GENERIC_PACKS:=${GENERIC_PACK}}" : "${GENERIC_PACKS:=${GENERIC_PACK}}"
: "${GENERIC_PACKS_PREFIX:=}"
: "${GENERIC_PACKS_SUFFIX:=}"
if [[ "${GENERIC_PACKS}" ]]; then if [[ "${GENERIC_PACKS}" ]]; then
IFS=',' read -ra packs <<< "${GENERIC_PACKS}" IFS=',' read -ra packs <<< "${GENERIC_PACKS}"
packFiles=() packFiles=()
for pack in "${packs[@]}"; do for packEntry in "${packs[@]}"; do
if isURL "$pack"; then pack="${GENERIC_PACKS_PREFIX}${packEntry}${GENERIC_PACKS_SUFFIX}"
if isURL "${pack}"; then
mkdir -p /data/packs mkdir -p /data/packs
if ! outfile=$(get -o /data/packs --output-filename --skip-existing "$pack"); then log "Downloading generic pack from $pack"
if ! outfile=$(get -o /data/packs --output-filename --skip-up-to-date "$pack"); then
log "ERROR: failed to download $pack" log "ERROR: failed to download $pack"
exit 2 exit 2
fi fi
@@ -207,12 +211,18 @@ if [[ "${GENERIC_PACKS}" ]]; then
done done
isDebugging && [ -f "$sum_file}" ] && cat "$sum_file" isDebugging && [ -f "$sum_file}" ] && cat "$sum_file"
if ! sha256sum -c "${sum_file}" --status 2> /dev/null; then
log "Checking if generic packs are up to date"
if isTrue "${SKIP_GENERIC_PACK_UPDATE_CHECK:-false}" && [ -f "$sum_file" ]; then
log "Skipping generic pack update check"
elif isTrue "${FORCE_GENERIC_PACK_UPDATE}" || ! checkSum "${sum_file}"; then
log "Generic pack(s) are out of date. Re-applying..."
base_dir=/tmp/generic_pack_base base_dir=/tmp/generic_pack_base
mkdir -p ${base_dir} mkdir -p ${base_dir}
for pack in "${packFiles[@]}"; do for pack in "${packFiles[@]}"; do
isDebugging && ls -l "${pack}" isDebugging && ls -l "${pack}"
unzip -q -d ${base_dir} "${pack}" extract "${pack}" "${base_dir}"
done done
# recalculate the actual base directory of content # recalculate the actual base directory of content
@@ -240,7 +250,8 @@ if [[ "${GENERIC_PACKS}" ]]; then
cp -R -f "${base_dir}"/* /data cp -R -f "${base_dir}"/* /data
rm -rf /tmp/generic_pack_base rm -rf /tmp/generic_pack_base
sha256sum "${packFiles[@]}" > "${sum_file}" log "Saving generic pack(s) checksum"
sha1sum "${packFiles[@]}" > "${sum_file}"
isDebugging && cat "$sum_file" isDebugging && cat "$sum_file"
fi fi
fi fi

98
scripts/start-setupRbac Normal file
View File

@@ -0,0 +1,98 @@
#!/bin/bash
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
isDebugging && set -x
if versionLessThan 1.7.6; then
opsFile=ops.txt
whitelistFile=white-list.txt
else
opsFile=ops.json
whitelistFile=whitelist.json
fi
function process_user_file() {
local output=$1
local source=$2
if isURL "$source"; then
log "Downloading $output from $source"
if ! get -o "/data/$output" "$source"; then
log "ERROR: failed to download from $source"
exit 2
fi
else
log "Copying $output from $source"
if ! cp "$source" "/data/$output"; then
log "ERROR: failed to copy from $source"
exit 1
fi
fi
}
function process_user_csv() {
local output=$1
local list=$2
local playerDataList
if [[ "$output" == *"ops"* ]]; then
# Extra data for ops.json
userData='{"uuid": .id, "name": .username, "level": 4}'
else
userData='{"uuid": .id, "name": .username}'
fi
log "Updating ${output%.*}"
for i in ${list//,/ }
do
if [ -e "$output" ] && grep -q "$i" "$output"; then
log "$i already present in $output, skipping"
continue
fi
if ! playerData=$(get "https://playerdb.co/api/player/minecraft/$i" | jq -re ".data.player"); then
log "WARNING: Could not lookup user $i for ${output} addition"
else
playerDataList=$playerDataList$(echo "$playerData" | jq -r "$userData")
fi
done
local newUsers=$(echo "$playerDataList" | jq -s .)
if [[ $output =~ .*\.txt ]]; then
# username list for txt config (Minecraft <= 1.7.5)
echo $newUsers | jq -r '.[].name' >> "/data/${output}"
sort -u /data/${output} -o /data/${output}
elif [ -e /data/${output} ]; then
# Merge with existing json file
local currentUsers=$(cat "/data/${output}")
jq --argjson current "$currentUsers" --argjson new "$newUsers" -n '$new + $current | unique_by(.uuid)' > "/data/${output}"
else
# New json file
echo $newUsers > "/data/${output}"
fi
}
if isTrue "${OVERRIDE_OPS}"; then
log "Recreating ${opsFile} file at server startup"
rm -f /data/${opsFile}
fi
if [ -n "${OPS_FILE}" ] && [ ! -e "/data/${opsFile}" ]; then
process_user_file ${opsFile} "$OPS_FILE"
fi
if [ -n "${OPS}" ]; then
process_user_csv ${opsFile} "$OPS"
fi
if isTrue "${OVERRIDE_WHITELIST}"; then
log "Recreating ${whitelistFile} file at server startup"
rm -f /data/${whitelistFile}
fi
if [ -n "${WHITELIST_FILE}" ] && [ ! -e "/data/${whitelistFile}" ]; then
process_user_file ${whitelistFile} "$WHITELIST_FILE"
fi
if [ -n "${WHITELIST}" ]; then
process_user_csv ${whitelistFile} "$WHITELIST"
fi
exec "${SCRIPTS:-/}start-finalExec" "$@"

View File

@@ -12,73 +12,115 @@ set -e -o pipefail
. "${SCRIPTS:-/}start-utils" . "${SCRIPTS:-/}start-utils"
isDebugging && set -x isDebugging && set -x
out_dir=/data/${LEVEL:-world}/datapacks VT_VERSION=""
DATAPACKS_DIR="/data/${LEVEL:-world}/datapacks"
RESOURCEPACKS_DIR="/data/resourcepacks"
# Remove old VANILLATWEAKS # Remove old VANILLATWEAKS
if isTrue "${REMOVE_OLD_VANILLATWEAKS}" && [ -z "${VANILLATWEAKS_FILE}" ]; then if isTrue "${REMOVE_OLD_VANILLATWEAKS}"; then
if [ -d "$out_dir" ]; then # NOTE: datapacks include crafting tweaks.
find "$out_dir" -mindepth 1 -maxdepth ${REMOVE_OLD_VANILLATWEAKS_DEPTH:-16} -wholename "${REMOVE_OLD_VANILLATWEAKS_INCLUDE:-*}" -not -wholename "${REMOVE_OLD_VANILLATWEAKS_EXCLUDE:-}" -delete if [ -d "$DATAPACKS_DIR" ]; then
find "$DATAPACKS_DIR" -mindepth 1 -maxdepth ${REMOVE_OLD_VANILLATWEAKS_DEPTH:-16} -wholename "${REMOVE_OLD_VANILLATWEAKS_INCLUDE:-*}" -not -wholename "${REMOVE_OLD_VANILLATWEAKS_EXCLUDE:-}" -delete
fi
if [ -d "$RESOURCEPACKS_DIR" ]; then
find "$RESOURCEPACKS_DIR" -mindepth 1 -maxdepth ${REMOVE_OLD_VANILLATWEAKS_DEPTH:-16} -wholename "${REMOVE_OLD_VANILLATWEAKS_INCLUDE:-*}" -not -wholename "${REMOVE_OLD_VANILLATWEAKS_EXCLUDE:-}" -delete
fi fi
fi fi
# Gets the download url and downloads the actual files.
getUrlAndDownload(){
VT_FILE=$1
URL_SUFFIX=$2
OUTPUT_FILE=$3
PACKS=$(jq -jc '.packs // empty' $VT_FILE)
if [ ! "$PACKS" ]; then
log "ERROR: unable to retrieve ${URL_SUFFIX} from ${VT_FILE}"
exit 2
fi
ZIPDATA_URL="https://vanillatweaks.net/assets/server/zip${URL_SUFFIX}.php"
DOWNLOAD_URL=$(curl -X POST -F "packs=${PACKS}" -F "version=${VT_VERSION}" $ZIPDATA_URL | jq -r '.link // empty')
if [ ! "$DOWNLOAD_URL" ]; then
log "ERROR: unable to retrieve ${URL_SUFFIX} packs from vanillatweaks.net!"
exit 2
fi
if ! get -o $OUTPUT_FILE "https://vanillatweaks.net${DOWNLOAD_URL}"; then
log "ERROR: failed to download ${URL_SUFFIX} from ${DOWNLOAD_URL}"
exit 2
fi
}
# Datapacks Handler
downloadDatapacks(){
VT_FILE=$1
URL_SUFFIX="datapacks"
OUTPUT_FILE="/tmp/vanillatweaks.zip"
getUrlAndDownload $VT_FILE $URL_SUFFIX $OUTPUT_FILE
mkdir -p "$DATAPACKS_DIR"
if ! unzip -o -d "$DATAPACKS_DIR" $OUTPUT_FILE; then
log "ERROR: failed to unzip the datapacks ${DATAPACKS} from ${OUTPUT_FILE}"
fi
rm -f $OUTPUT_FILE
}
# Crafting Tweaks Handler
downloadCraftingtweaks(){
VT_FILE=$1
mkdir -p "$DATAPACKS_DIR"
getUrlAndDownload $VT_FILE "craftingtweaks" "${DATAPACKS_DIR}/craftingtweaks.zip"
}
# Resourcepacks Handler
downloadResourcepacks(){
VT_FILE=$1
mkdir -p "$RESOURCEPACKS_DIR"
getUrlAndDownload $VT_FILE "resourcepacks" "${RESOURCEPACKS_DIR}/resourcepacks.zip"
}
# Example: VANILLATWEAKS_SHARECODE=MGr52E # Example: VANILLATWEAKS_SHARECODE=MGr52E
# Code generated from the UI website, typically a alphanumeric 6 digit code. # Code generated from the UI website, typically a alphanumeric 6 digit code.
if [[ "$VANILLATWEAKS_SHARECODE" ]]; then if [[ "$VANILLATWEAKS_SHARECODE" ]]; then
VANILLATWEAKS_FILE=/tmp/vanillatweaksfile.json VANILLATWEAKS_FILE=()
SHARECODE_LOOKUP_URL="https://vanillatweaks.net/assets/server/sharecode.php?code=${VANILLATWEAKS_SHARECODE}" for SHARECODE in ${VANILLATWEAKS_SHARECODE//,/ }; do
curl -f $SHARECODE_LOOKUP_URL -o $VANILLATWEAKS_FILE TMP_FILE="/tmp/${SHARECODE}.json"
if [ ! -f "$VANILLATWEAKS_FILE" ]; then SHARECODE_LOOKUP_URL="https://vanillatweaks.net/assets/server/sharecode.php?code=${SHARECODE}"
log "ERROR: Unable to use share code provided to retreive vanillatweaks file" if ! get -o "$TMP_FILE" "$SHARECODE_LOOKUP_URL"; then
exit 2 log "ERROR: Unable to use ${SHARECODE} share code provided to retrieve vanillatweaks file"
fi exit 2
fi
VANILLATWEAKS_FILE+="${TMP_FILE},"
done
fi fi
# Use vanillatweaks file to specify VT and datapacks # Use vanillatweaks file to specify VT and datapacks and crafting tweaks
if [[ "$VANILLATWEAKS_FILE" ]]; then if [[ "$VANILLATWEAKS_FILE" ]]; then
if [ ! -f "$VANILLATWEAKS_FILE" ]; then for VT_FILE in ${VANILLATWEAKS_FILE//,/ }; do
log "ERROR: given VANILLATWEAKS_FILE file does not exist" if [ ! -f "$VT_FILE" ]; then
exit 2 log "ERROR: given VANILLATWEAKS_FILE file does not exist"
fi exit 2
fi
PACKS=$(jq -jc '.packs' $VANILLATWEAKS_FILE) VT_VERSION=$(jq -jc '.version // empty' $VT_FILE)
if [ ! "$PACKS" ]; then if [ ! "$VT_VERSION" ]; then
log "ERROR: unable to retrieve packs from $VANILLATWEAKS_FILE" log "ERROR: unable to retrieve version from $VT_FILE"
exit 2 exit 2
fi fi
VT_VERSION=$(jq -jc '.version' $VANILLATWEAKS_FILE) TYPE=$(jq -jc '.type // empty' $VT_FILE)
if [ ! "$VT_VERSION" ]; then if [[ "$TYPE" = "datapacks" ]]; then
log "ERROR: unable to retrieve version from $VANILLATWEAKS_FILE" downloadDatapacks $VT_FILE
exit 2 elif [[ "$TYPE" = "craftingtweaks" ]]; then
fi downloadCraftingtweaks $VT_FILE
fi elif [[ "$TYPE" = "resourcepacks" ]]; then
downloadResourcepacks $VT_FILE
fi
# Download and unzip packs # cleans up temp vanilla tweaks file download to get stored packs
if [[ "$PACKS" ]] && [[ "$VT_VERSION" ]]; then if [[ "$VANILLATWEAKS_SHARECODE" ]]; then
VT_ZIPDATA_URL=https://vanillatweaks.net/assets/server/zipdatapacks.php rm -f $VT_FILE
DOWNLOAD_URL=$(curl -X POST -F "packs=${PACKS}" -F "version=${VT_VERSION}" $VT_ZIPDATA_URL | jq -r '.link') fi
if [ ! "$DOWNLOAD_URL" ]; then done
log "ERROR: unable to retrieve DOWNLOAD_URL from vanillatweaks.net!"
exit 2
fi
TEMPZIP=/tmp/vanillatweaks.zip
if ! get -o $TEMPZIP "https://vanillatweaks.net${DOWNLOAD_URL}"; then
log "ERROR: failed to download from ${DOWNLOAD_URL}"
exit 2
fi
mkdir -p "$out_dir"
if ! unzip -o -d "$out_dir" $TEMPZIP; then
log "ERROR: failed to unzip the ${PACKS} from ${$TEMPZIP}"
fi
# clean up files time!
rm -f $TEMPZIP
# cleans up temp vanilla tweaks file download to get stored packs
if [[ "$VANILLATWEAKS_SHARECODE" ]]; then
rm -f $VANILLATWEAKS_FILE
fi
fi fi
exec "${SCRIPTS:-/}start-setupDatapack" "$@" exec "${SCRIPTS:-/}start-setupDatapack" "$@"

View File

@@ -37,11 +37,7 @@ if [[ "$WORLD" ]] && ( isTrue "${FORCE_WORLD_COPY}" || [ ! -d "$worldDest" ] );
exit 1 exit 1
fi fi
if [ "$FAMILY" = "SPIGOT" ]; then baseDirs=$(find /tmp/world-data -name "level.dat" -exec dirname "{}" \;)
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
if ! [[ $baseDirs ]]; then if ! [[ $baseDirs ]]; then
log "ERROR world content is not valid since level.dat could not be found" log "ERROR world content is not valid since level.dat could not be found"
@@ -50,20 +46,65 @@ if [[ "$WORLD" ]] && ( isTrue "${FORCE_WORLD_COPY}" || [ ! -d "$worldDest" ] );
count=$(echo "$baseDirs" | wc -l) count=$(echo "$baseDirs" | wc -l)
if [[ $count -gt 1 ]]; then if [[ $count -gt 1 ]]; then
baseDir="$(echo "$baseDirs" | sed -n ${WORLD_INDEX:-1}p)" baseDirsNoSpigotSuffix=$(echo "$baseDirs" | sed -re 's:(_nether|_the_end)/?$::' | sort -u)
baseName=$(basename "$baseDir") if [ $(echo "$baseDirsNoSpigotSuffix" | wc -l) -eq 1 ]; then
log "WARN multiple levels found, picking: $baseName" baseDir="$baseDirsNoSpigotSuffix"
baseName=$(basename "$baseDir")
log "Found Spigot naming conventions, taking $baseName as main dimension"
else
baseDir="$(echo "$baseDirs" | sed -n ${WORLD_INDEX:-1}p)"
baseName=$(basename "$baseDir")
log "WARN multiple levels found, picking: $baseName"
fi
elif [[ $count -gt 0 ]]; then elif [[ $count -gt 0 ]]; then
baseDir="$baseDirs" baseDir="$baseDirs"
else else
log "ERROR invalid world content" log "ERROR invalid world content"
exit 1 exit 1
fi fi
if [ -d "${baseDir}_nether/DIM-1" ]; then
if [ -d "$baseDir/DIM-1" ]; then
log "WARN found Nether dimension in both $baseDir and ${baseDir}_nether, picking ${baseDir}_nether"
rm -r "$baseDir/DIM-1"
fi
fi
if [ -d "${baseDir}_the_end/DIM1" ]; then
if [ -d "$baseDir/DIM1" ]; then
log "WARN found End dimension in both $baseDir and ${baseDir}_the_end, picking ${baseDir}_the_end"
rm -r "$baseDir/DIM1"
fi
fi
log "Copying world..."
rsync --remove-source-files --recursive --delete "$baseDir/" "$worldDest" rsync --remove-source-files --recursive --delete "$baseDir/" "$worldDest"
if [ "$FAMILY" = "SPIGOT" ]; then if [ "$FAMILY" = "SPIGOT" ]; then
log "Copying end and nether ..." if [ -d "${baseDir}_nether" ]; then
[ -d "${baseDir}_nether" ] && rsync --remove-source-files --recursive --delete "${baseDir}_nether/" "${worldDest}_nether" log "Copying Spigot Nether..."
[ -d "${baseDir}_the_end" ] && rsync --remove-source-files --recursive --delete "${baseDir}_the_end/" "${worldDest}_the_end" rsync --remove-source-files --recursive --delete "${baseDir}_nether/" "${worldDest}_nether"
elif [ -d "$worldDest/DIM-1" ]; then
log "Moving Nether to Spigot location..."
mkdir -p "${worldDest}_nether"
mv -f "$worldDest/DIM-1" "${worldDest}_nether/"
fi
if [ -d "${baseDir}_the_end" ]; then
log "Copying Spigot End..."
rsync --remove-source-files --recursive --delete "${baseDir}_the_end/" "${worldDest}_the_end"
elif [ -d "$worldDest/DIM1" ]; then
log "Moving End to Spigot location..."
mkdir -p "${worldDest}_the_end"
mv -f "$worldDest/DIM1" "${worldDest}_the_end/"
fi
else
if [ -d "${baseDir}_nether/DIM-1" ]; then
log "Copying Spigot Nether to vanilla location..."
rsync --remove-source-files --recursive --delete "${baseDir}_nether/DIM-1" "${worldDest}/"
fi
if [ -d "${baseDir}_the_end/DIM1" ]; then
log "Copying Spigot End to vanilla location..."
rsync --remove-source-files --recursive --delete "${baseDir}_the_end/DIM1" "${worldDest}/"
fi
fi fi
elif [ -d "$WORLD" ]; then elif [ -d "$WORLD" ]; then
log "Cloning world directory from $WORLD ..." log "Cloning world directory from $WORLD ..."

View File

@@ -40,6 +40,10 @@ function getFilenameFromUrl() {
} }
function isTrue() { function isTrue() {
local oldState
oldState=$(shopt -po xtrace)
shopt -u -o xtrace
local value=${1,,} local value=${1,,}
result= result=
@@ -53,6 +57,7 @@ function isTrue() {
;; ;;
esac esac
eval "$oldState"
return ${result} return ${result}
} }
@@ -82,7 +87,18 @@ function logn() {
} }
function log() { function log() {
echo "[init] $*" local oldState
# The return status when listing options is zero if all optnames are enabled, non- zero otherwise.
oldState=$(shopt -po xtrace || true)
shopt -u -o xtrace
if isDebugging || isTrue "${LOG_TIMESTAMP:-false}"; then
ts=" $(date --rfc-2822)"
else
ts=
fi
echo "[init]${ts} $*"
eval "$oldState"
} }
function logAutopause() { function logAutopause() {
@@ -183,6 +199,7 @@ function isFamily() {
} }
function isType() { function isType() {
for t in "${@}"; do for t in "${@}"; do
# shellcheck disable=SC2153
if [[ $TYPE == "$t" ]]; then if [[ $TYPE == "$t" ]]; then
return 0 return 0
fi fi
@@ -190,17 +207,49 @@ function isType() {
return 1 return 1
} }
function evaluateJavaCompatibilityForForge() {
javaRelease=$(mc-image-helper java-release)
if versionLessThan 1.18 && (( javaRelease > 8 )); then
log "**********************************************************************"
log "WARNING: Some mods and modpacks may require Java 8."
log " Please use itzg/minecraft-server:java8"
log "**********************************************************************"
sleep 5
fi
}
function extract() { function extract() {
src=${1?} src=${1?}
destDir=${2?} destDir=${2?}
type=$(file -b --mime-type "${src}") type=$(file -b --mime-type "${src}")
if [[ $type == application/zip ]]; then case "${type}" in
unzip -q -d "${destDir}" "${src}" application/zip)
elif [[ $type == application/x-tar ]]; then unzip -q -d "${destDir}" "${src}"
tar -C "${destDir}" -xf "${src}" ;;
application/x-tar|application/gzip|application/x-gzip|application/x-bzip2|application/zstd|application/x-zstd)
tar -C "${destDir}" -xf "${src}"
;;
*)
log "ERROR: unsupported archive type: $type"
return 1
;;
esac
}
function checkSum() {
local sum_file=${1?}
# Get distro
distro=$(cat /etc/os-release | grep -E "^ID=" | cut -d= -f2 | sed -e 's/"//g')
if [ "${distro}" == "debian" ] && sha1sum -c "${sum_file}" --status 2> /dev/null; then
return 0
elif [ "${distro}" == "ubuntu" ] && sha1sum -c "${sum_file}" --status 2> /dev/null; then
return 0
elif [ "${distro}" == "alpine" ] && sha1sum -c "${sum_file}" -s 2> /dev/null; then
return 0
else else
log "ERROR: unsupported archive type: $type"
return 1 return 1
fi fi
} }

View File

@@ -0,0 +1,15 @@
version: "3"
services:
mc:
restart: "no"
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
environment:
EULA: "TRUE"
SETUP_ONLY: "TRUE"
VERSION: ${MINECRAFT_VERSION:-LATEST}
TYPE: "PAPER"
WORLD: /worlds/world-for-testing.zip
volumes:
- ./worlds:/worlds:ro
- ./data:/data

View File

@@ -0,0 +1,5 @@
mc-image-helper assert fileExists world/level.dat && \
mc-image-helper assert fileExists world_nether/DIM-1/some_spigot_nether_file && \
mc-image-helper assert fileExists world_the_end/DIM1/some_spigot_end_file && \
! mc-image-helper assert fileExists world_nether/DIM-1/some_vanilla_nether_file && \
! mc-image-helper assert fileExists world_the_end/DIM1/some_vanilla_end_file

View File

@@ -8,7 +8,7 @@ services:
EULA: "TRUE" EULA: "TRUE"
SETUP_ONLY: "TRUE" SETUP_ONLY: "TRUE"
VERSION: ${MINECRAFT_VERSION:-LATEST} VERSION: ${MINECRAFT_VERSION:-LATEST}
WORLD: /worlds/world-for-testing.tgz WORLD: /worlds/world-for-testing.zip
volumes: volumes:
- ./worlds:/worlds:ro - ./worlds:/worlds:ro
- ./data:/data - ./data:/data

View File

@@ -0,0 +1,5 @@
mc-image-helper assert fileExists world/level.dat && \
mc-image-helper assert fileExists world/DIM-1/some_spigot_nether_file && \
mc-image-helper assert fileExists world/DIM1/some_spigot_end_file && \
! mc-image-helper assert fileExists world/DIM-1/some_vanilla_nether_file && \
! mc-image-helper assert fileExists world/DIM1/some_vanilla_end_file

View File

@@ -8,10 +8,11 @@ services:
EULA: "TRUE" EULA: "TRUE"
SETUP_ONLY: "TRUE" SETUP_ONLY: "TRUE"
VERSION: ${MINECRAFT_VERSION:-LATEST} VERSION: ${MINECRAFT_VERSION:-LATEST}
MODS_FORGEAPI_FILE: /config/example.json MODS_FORGEAPI_FILE: /config/forgeapi_mods.json
# Key is defined in .github/workflows/pr.yml and ci.yml # Key is defined in .github/workflows/pr.yml and ci.yml
# This should be coming from github secrets. # This should be coming from github secrets.
MODS_FORGEAPI_KEY: ${MODS_FORGEAPI_KEY} MODS_FORGEAPI_KEY: ${MODS_FORGEAPI_KEY}
REMOVE_OLD_FORGEAPI_MODS: "TRUE" REMOVE_OLD_FORGEAPI_MODS: "TRUE"
MODS_FORGEAPI_DOWNLOAD_DEPENDENCIES: "FALSE"
volumes: volumes:
- ./example.json:/config/example.json:ro - ./forgeapi_mods.json:/config/forgeapi_mods.json:ro

View File

@@ -7,5 +7,11 @@
"name": "Fabric Voice Mod", "name": "Fabric Voice Mod",
"projectId": "416089", "projectId": "416089",
"releaseType": "beta" "releaseType": "beta"
},
{
"name": "Biomes o plenty",
"projectId": "220318",
"fileName": "BiomesOPlenty-1.18.1-15.0.0.100-universal.jar",
"releaseType": "release"
} }
] ]

View File

@@ -0,0 +1 @@
[[ $MODS_FORGEAPI_KEY ]] || exit 1

View File

@@ -8,7 +8,8 @@ services:
EULA: "TRUE" EULA: "TRUE"
SETUP_ONLY: "TRUE" SETUP_ONLY: "TRUE"
VERSION: ${MINECRAFT_VERSION:-LATEST} VERSION: ${MINECRAFT_VERSION:-LATEST}
MODS_FORGEAPI_PROJECTIDS: 306612,416089 MODS_FORGEAPI_DOWNLOAD_DEPENDENCIES: "TRUE"
MODS_FORGEAPI_PROJECTIDS: 306612,416089,220318
# Allows for Beta releases of 416089 the Fabric Voice Mod # Allows for Beta releases of 416089 the Fabric Voice Mod
MODS_FORGEAPI_RELEASES: BETA MODS_FORGEAPI_RELEASES: BETA
MODS_FORGEAPI_KEY: ${MODS_FORGEAPI_KEY} MODS_FORGEAPI_KEY: ${MODS_FORGEAPI_KEY}

View File

@@ -0,0 +1 @@
[[ $MODS_FORGEAPI_KEY ]] || exit 1

View File

@@ -0,0 +1,14 @@
version: "3"
services:
mc:
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
environment:
EULA: "true"
SETUP_ONLY: "TRUE"
GENERIC_PACKS: testing
GENERIC_PACKS_PREFIX: /packs/
GENERIC_PACKS_SUFFIX: .zip
volumes:
- ./packs:/packs
- ./data:/data

View File

@@ -0,0 +1 @@
mc-image-helper assert fileExists one.txt mods/two.txt

View File

@@ -1,12 +1,24 @@
version: "3" version: "3"
services: services:
web:
image: nginx
volumes:
- ./web:/usr/share/nginx/html
mc: mc:
depends_on:
- web
image: ${IMAGE_TO_TEST:-itzg/minecraft-server} image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
environment: environment:
EULA: "true" EULA: "true"
SETUP_ONLY: "TRUE" SETUP_ONLY: "true"
GENERIC_PACKS: https://github.com/itzg/mc-image-helper/releases/download/v1.9.5/mc-image-helper-1.9.5.zip,/packs/testing.zip GENERIC_PACKS: http://web/configs.zip,/packs/testing.zip
LOG_TIMESTAMP: "true"
# the following are only used to speed up test execution
TYPE: CUSTOM
CUSTOM_SERVER: /servers/fake.jar
VERSION: 1.18.1
volumes: volumes:
- ./packs:/packs - ./packs:/packs
- ./data:/data - ./data:/data
- ./fake.jar:/servers/fake.jar

View File

@@ -1 +1,2 @@
mc-image-helper assert fileExists one.txt mods/two.txt mc-image-helper assert fileExists one.txt mods/two.txt
mc-image-helper assert fileExists config/opt.yml

Binary file not shown.

View File

@@ -0,0 +1,13 @@
version: "3"
services:
mc:
restart: "no"
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
environment:
EULA: "TRUE"
SETUP_ONLY: "TRUE"
VERSION: ${MINECRAFT_VERSION:-LATEST}
OPS: itzg
volumes:
- ./data:/data

View File

@@ -0,0 +1,3 @@
mc-image-helper assert jsonPathEquals --file=ops.json --path='$[0].name' --expect=itzg
mc-image-helper assert jsonPathEquals --file=ops.json --path='$[0].uuid' --expect=5cddfd26-fc86-4981-b52e-c42bb10bfdef
mc-image-helper assert jsonPathEquals --file=ops.json --path='$[0].level' --expect=4

View File

@@ -0,0 +1,15 @@
version: "3"
services:
mc:
restart: "no"
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
environment:
EULA: "TRUE"
SETUP_ONLY: "TRUE"
VERSION: ${MINECRAFT_VERSION:-LATEST}
TYPE: "PAPER"
WORLD: /worlds/world-for-testing.zip
volumes:
- ./worlds:/worlds:ro
- ./data:/data

View File

@@ -0,0 +1,4 @@
mc-image-helper assert fileExists world/level.dat && \
mc-image-helper assert fileExists world/some_overworld_file && \
mc-image-helper assert fileExists world_nether/DIM-1/some_nether_file && \
mc-image-helper assert fileExists world_the_end/DIM1/some_end_file

View File

@@ -0,0 +1,14 @@
version: "3"
services:
mc:
restart: "no"
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
environment:
EULA: "TRUE"
SETUP_ONLY: "TRUE"
VERSION: ${MINECRAFT_VERSION:-LATEST}
WORLD: /worlds/world-for-testing.zip
volumes:
- ./worlds:/worlds:ro
- ./data:/data

View File

@@ -0,0 +1,4 @@
mc-image-helper assert fileExists world/level.dat && \
mc-image-helper assert fileExists world/some_overworld_file && \
mc-image-helper assert fileExists world/DIM-1/some_nether_file && \
mc-image-helper assert fileExists world/DIM1/some_end_file

View File

@@ -11,15 +11,26 @@ setupOnlyMinecraftTest(){
cd "$folder" cd "$folder"
result=0 result=0
if ! logs=$(docker compose run --quiet-pull mc 2>&1); then if [ -f require.sh ]; then
echo "${folder} setup FAILED" # require.sh scripts can check for environment variables, etc that are required for the test.
# The script should exit with a non-zero status to indicate the test requirements are missing
# and the test should be skipped
if ! bash require.sh; then
echo "${folder} SKIP"
cd ..
return 0
fi
fi
if ! logs=$(docker-compose run mc 2>&1); then
echo "${folder} test scenario FAILED"
echo ":::::::::::: LOGS :::::::::::::::: echo ":::::::::::: LOGS ::::::::::::::::
$logs $logs
:::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::::::::
" "
result=1 result=1
elif [ -f verify.sh ]; then elif [ -f verify.sh ]; then
if ! docker run --rm --entrypoint bash -v "${PWD}/data":/data -v "${PWD}/verify.sh":/verify "${IMAGE_TO_TEST:-itzg/minecraft-server}" /verify; then if ! docker run --rm --entrypoint bash -v "${PWD}/data":/data -v "${PWD}/verify.sh":/verify "${IMAGE_TO_TEST:-itzg/minecraft-server}" -e /verify; then
echo "${folder} verify FAILED" echo "${folder} verify FAILED"
result=1 result=1
else else
@@ -29,7 +40,7 @@ $logs
echo "${folder} PASS" echo "${folder} PASS"
fi fi
docker compose down -v --remove-orphans docker-compose down -v --remove-orphans
cd .. cd ..
return $result return $result

View File

@@ -0,0 +1,15 @@
version: "3"
services:
mc:
restart: "no"
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
environment:
EULA: "TRUE"
SETUP_ONLY: "TRUE"
VERSION: ${MINECRAFT_VERSION:-LATEST}
TYPE: "PAPER"
WORLD: /worlds/world-for-testing.zip
volumes:
- ./worlds:/worlds:ro
- ./data:/data

View File

@@ -0,0 +1,3 @@
mc-image-helper assert fileExists world/level.dat && \
mc-image-helper assert fileExists world_nether/DIM-1/some_nether_file && \
mc-image-helper assert fileExists world_the_end/DIM1/some_end_file

View File

@@ -0,0 +1,14 @@
version: "3"
services:
mc:
restart: "no"
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
environment:
EULA: "TRUE"
SETUP_ONLY: "TRUE"
VERSION: ${MINECRAFT_VERSION:-LATEST}
WORLD: /worlds/world-for-testing.zip
volumes:
- ./worlds:/worlds:ro
- ./data:/data

View File

@@ -0,0 +1,3 @@
mc-image-helper assert fileExists world/level.dat && \
mc-image-helper assert fileExists world/DIM-1/some_nether_file && \
mc-image-helper assert fileExists world/DIM1/some_end_file

View File

@@ -8,7 +8,10 @@ services:
EULA: "TRUE" EULA: "TRUE"
SETUP_ONLY: "TRUE" SETUP_ONLY: "TRUE"
VERSION: ${MINECRAFT_VERSION:-LATEST} VERSION: ${MINECRAFT_VERSION:-LATEST}
VANILLATWEAKS_FILE: /config/vanillatweaks-datapacks.json VANILLATWEAKS_FILE: /config/vt-datapacks.json,/config/vt-craftingtweaks.json,/config/vt-resourcepacks.json
REMOVE_OLD_VANILLATWEAKS: "TRUE" REMOVE_OLD_VANILLATWEAKS: "FALSE"
volumes: volumes:
- ./vanillatweaks-datapacks.json:/config/vanillatweaks-datapacks.json:ro - ./data:/data
- ./vt-datapacks.json:/config/vt-datapacks.json:ro
- ./vt-craftingtweaks.json:/config/vt-craftingtweaks.json:ro
- ./vt-resourcepacks.json:/config/vt-resourcepacks.json:ro

View File

@@ -0,0 +1,4 @@
mc-image-helper assert fileExists "/data/world/datapacks/afk*"
mc-image-helper assert fileExists "/data/world/datapacks/graves*"
mc-image-helper assert fileExists "/data/world/datapacks/craftingtweaks*"
mc-image-helper assert fileExists "/data/resourcepacks/resourcepacks*"

View File

@@ -0,0 +1,12 @@
{
"type": "craftingtweaks",
"version": "1.18",
"packs": {
"quality of life": [
"dropper to dispenser",
"double slabs",
"back to blocks"
]
},
"result": "ok"
}

View File

@@ -0,0 +1,8 @@
{
"type": "resourcepacks",
"version": "1.18",
"packs": {
"aesthetic": ["CherryPicking", "BlackNetherBricks", "AlternateBlockDestruction"]
},
"result": "ok"
}

View File

@@ -8,5 +8,7 @@ services:
EULA: "TRUE" EULA: "TRUE"
SETUP_ONLY: "TRUE" SETUP_ONLY: "TRUE"
VERSION: ${MINECRAFT_VERSION:-LATEST} VERSION: ${MINECRAFT_VERSION:-LATEST}
VANILLATWEAKS_SHARECODE: MGr52E VANILLATWEAKS_SHARECODE: MGr52E,tF1zL2,LnEDwT
REMOVE_OLD_VANILLATWEAKS: "TRUE" REMOVE_OLD_VANILLATWEAKS: "FALSE"
volumes:
- ./data:/data

View File

@@ -0,0 +1,4 @@
mc-image-helper assert fileExists "/data/world/datapacks/afk*"
mc-image-helper assert fileExists "/data/world/datapacks/graves*"
mc-image-helper assert fileExists "/data/world/datapacks/craftingtweaks*"
mc-image-helper assert fileExists "/data/resourcepacks/resourcepacks*"

View File

@@ -0,0 +1,15 @@
version: "3"
services:
mc:
restart: "no"
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
environment:
EULA: "TRUE"
SETUP_ONLY: "TRUE"
VERSION: ${MINECRAFT_VERSION:-LATEST}
WHITELIST: itzg
ENFORCE_WHITELIST: "true"
OVERRIDE_SERVER_PROPERTIES: "true"
volumes:
- ./data:/data

View File

@@ -0,0 +1,4 @@
mc-image-helper assert jsonPathEquals --file=whitelist.json --path='$[0].name' --expect=itzg
mc-image-helper assert jsonPathEquals --file=whitelist.json --path='$[0].uuid' --expect=5cddfd26-fc86-4981-b52e-c42bb10bfdef
mc-image-helper assert propertyEquals --file=server.properties --property=white-list --expect=true
mc-image-helper assert propertyEquals --file=server.properties --property=enforce-whitelist --expect=true

View File

@@ -0,0 +1,14 @@
version: "3"
services:
mc:
restart: "no"
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
environment:
EULA: "TRUE"
SETUP_ONLY: "TRUE"
VERSION: ${MINECRAFT_VERSION:-LATEST}
WORLD: /worlds/world-for-testing.tar
volumes:
- ./worlds:/worlds:ro
- ./data:/data

View File

@@ -0,0 +1,14 @@
version: "3"
services:
mc:
restart: "no"
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
environment:
EULA: "TRUE"
SETUP_ONLY: "TRUE"
VERSION: ${MINECRAFT_VERSION:-LATEST}
WORLD: /worlds/world-for-testing.tar.bz2
volumes:
- ./worlds:/worlds:ro
- ./data:/data

View File

@@ -0,0 +1 @@
mc-image-helper assert fileExists world/level.dat

View File

@@ -0,0 +1,14 @@
version: "3"
services:
mc:
restart: "no"
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
environment:
EULA: "TRUE"
SETUP_ONLY: "TRUE"
VERSION: ${MINECRAFT_VERSION:-LATEST}
WORLD: /worlds/world-for-testing.tar.gz
volumes:
- ./worlds:/worlds:ro
- ./data:/data

View File

@@ -0,0 +1 @@
mc-image-helper assert fileExists world/level.dat

View File

@@ -0,0 +1,14 @@
version: "3"
services:
mc:
restart: "no"
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
environment:
EULA: "TRUE"
SETUP_ONLY: "TRUE"
VERSION: ${MINECRAFT_VERSION:-LATEST}
WORLD: /worlds/world-for-testing.tar.zst
volumes:
- ./worlds:/worlds:ro
- ./data:/data

View File

@@ -0,0 +1 @@
mc-image-helper assert fileExists world/level.dat