mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-02-17 15:13:55 +00:00
Compare commits
821 Commits
20200413
...
java11-ope
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3bb8378530 | ||
|
|
cbbc817279 | ||
|
|
18d8aba20f | ||
|
|
09834c289a | ||
|
|
880dca1ae5 | ||
|
|
65f5b26913 | ||
|
|
b1e33d4049 | ||
|
|
284c260886 | ||
|
|
05bbb45046 | ||
|
|
d11fe229df | ||
|
|
e516a7e512 | ||
|
|
b7801565c2 | ||
|
|
bd4760e504 | ||
|
|
edc25b216f | ||
|
|
68ace07c4a | ||
|
|
0eef6d5d41 | ||
|
|
b8a1b4f634 | ||
|
|
5499867ae8 | ||
|
|
e4c575c130 | ||
|
|
f29f098b26 | ||
|
|
1d751ab2bc | ||
|
|
03472579b5 | ||
|
|
4f87662664 | ||
|
|
5dd008fed8 | ||
|
|
7e2937aa8d | ||
|
|
529781adda | ||
|
|
977d082638 | ||
|
|
e50bbcd10f | ||
|
|
c506cf11ac | ||
|
|
967d5159ea | ||
|
|
79f978359c | ||
|
|
4c7bb313be | ||
|
|
83d3555eab | ||
|
|
e93cc569c6 | ||
|
|
5c0cf03548 | ||
|
|
00cae995a7 | ||
|
|
4ba0a9c98c | ||
|
|
6520655d6c | ||
|
|
6bd722b11b | ||
|
|
4576882f07 | ||
|
|
224553f695 | ||
|
|
cc100fd8bb | ||
|
|
a7a0e54cb9 | ||
|
|
ce32eb8d4f | ||
|
|
39519427bb | ||
|
|
c6a7d11f60 | ||
|
|
2f1fed822c | ||
|
|
bf5824b6e5 | ||
|
|
52bf2ae094 | ||
|
|
fa4a0e92ce | ||
|
|
c15e231d7e | ||
|
|
cc885276f5 | ||
|
|
9dee47cb6d | ||
|
|
28ce5118f3 | ||
|
|
39611fa9cb | ||
|
|
bb56de694a | ||
|
|
c4d4d2bcc1 | ||
|
|
4e44f33db9 | ||
|
|
58c085527f | ||
|
|
79fa4b95c3 | ||
|
|
d5f1660c77 | ||
|
|
f36a987f22 | ||
|
|
6729ba462e | ||
|
|
3a3b5fc002 | ||
|
|
4b28d5e472 | ||
|
|
771951b38e | ||
|
|
eccc989887 | ||
|
|
c4aa105042 | ||
|
|
ffcb76f73f | ||
|
|
9e8a924ac7 | ||
|
|
3f2022da40 | ||
|
|
0f7464403c | ||
|
|
bee39343a6 | ||
|
|
e9326db933 | ||
|
|
dd1cc82fcd | ||
|
|
93825895b9 | ||
|
|
492aebc718 | ||
|
|
e66b2eda60 | ||
|
|
b51813f026 | ||
|
|
3bb21d8581 | ||
|
|
ee738da7d7 | ||
|
|
fb6fa9b7d7 | ||
|
|
0314d0eb09 | ||
|
|
0718a62007 | ||
|
|
529d92fa63 | ||
|
|
f7836abc06 | ||
|
|
0855f76512 | ||
|
|
cd09a932f9 | ||
|
|
46d21f58cf | ||
|
|
3e63be9988 | ||
|
|
aaaf7796b0 | ||
|
|
aba10c1d99 | ||
|
|
c4dd0d2bae | ||
|
|
e4733d1dca | ||
|
|
6c636c3d9c | ||
|
|
9098b198c3 | ||
|
|
927ec2a2c3 | ||
|
|
c5950bf7d2 | ||
|
|
07a251b544 | ||
|
|
b8e163d8b1 | ||
|
|
cd72acb6c6 | ||
|
|
24942a6f04 | ||
|
|
75dcc746f8 | ||
|
|
263a10848a | ||
|
|
ac1b8092e0 | ||
|
|
ff4d46d509 | ||
|
|
66ead9128a | ||
|
|
55ff76a85d | ||
|
|
aa0dd571b4 | ||
|
|
dca29dcbb5 | ||
|
|
84c577cc96 | ||
|
|
5e8fc43857 | ||
|
|
66a17c8d58 | ||
|
|
57f7ee50a6 | ||
|
|
f8ac58e200 | ||
|
|
71954edf75 | ||
|
|
597faa102a | ||
|
|
442fccfc41 | ||
|
|
784ec6104c | ||
|
|
817a01bbc3 | ||
|
|
6381b0aded | ||
|
|
66c0558174 | ||
|
|
9116be11ae | ||
|
|
b9a1434398 | ||
|
|
969f4c8db6 | ||
|
|
e6916e91e7 | ||
|
|
cf032f7d7e | ||
|
|
9544aeaf7a | ||
|
|
babeac1693 | ||
|
|
c5d032eeb7 | ||
|
|
130b067955 | ||
|
|
2372cb93d3 | ||
|
|
df7d6c298a | ||
|
|
375fb73586 | ||
|
|
a8a60264e9 | ||
|
|
721df8d32b | ||
|
|
2375a6796c | ||
|
|
e04e943e1c | ||
|
|
1bf75671f6 | ||
|
|
7d56de9d15 | ||
|
|
e14311318c | ||
|
|
a8de790b57 | ||
|
|
cafddd3b12 | ||
|
|
fc958faf7b | ||
|
|
402894cd8d | ||
|
|
f97cea4b06 | ||
|
|
f3dd4f0123 | ||
|
|
0198c15b8c | ||
|
|
e813007f49 | ||
|
|
df2962bdb3 | ||
|
|
367f07b784 | ||
|
|
9de9ec2e34 | ||
|
|
6ad7773e2b | ||
|
|
8177dd9a5a | ||
|
|
81994ec3b3 | ||
|
|
102a3b54ba | ||
|
|
ecee4069f1 | ||
|
|
3713d9c4e8 | ||
|
|
c7f1d13f9b | ||
|
|
cc8d18d41f | ||
|
|
afd863ab89 | ||
|
|
46f6653b13 | ||
|
|
3237d1a996 | ||
|
|
386e34e05b | ||
|
|
4fd234e482 | ||
|
|
38fd0dac8b | ||
|
|
11ac111036 | ||
|
|
9803547967 | ||
|
|
1a0c7c4f85 | ||
|
|
7b7d5db796 | ||
|
|
58de72c458 | ||
|
|
738bfd51d5 | ||
|
|
34baf8a354 | ||
|
|
68662fd2ca | ||
|
|
cc9e0fe1ef | ||
|
|
6d80a9d123 | ||
|
|
9c354d5775 | ||
|
|
2dce24c1bd | ||
|
|
6f80ce5584 | ||
|
|
c8df2d8e31 | ||
|
|
765ac6072d | ||
|
|
2e8f27a8ef | ||
|
|
e20dd63f76 | ||
|
|
3e62389325 | ||
|
|
f3c880f96a | ||
|
|
2c7796ea0b | ||
|
|
0daeeb70f7 | ||
|
|
86782865c4 | ||
|
|
ddcabb175a | ||
|
|
d9962dff26 | ||
|
|
7b09e525e8 | ||
|
|
2eefb12e6b | ||
|
|
5777a248d4 | ||
|
|
97a6a4ba85 | ||
|
|
531d33af1c | ||
|
|
0618d690fa | ||
|
|
9f19edf137 | ||
|
|
6aa3b1066f | ||
|
|
393544a194 | ||
|
|
4aea1753bd | ||
|
|
b452514c36 | ||
|
|
c42d8971ca | ||
|
|
ee7f2ee739 | ||
|
|
6008660a81 | ||
|
|
043d9778b8 | ||
|
|
8bf7c6cccd | ||
|
|
80d7efb365 | ||
|
|
4304c75595 | ||
|
|
fd01947aaa | ||
|
|
32ed58692c | ||
|
|
63b919f1a9 | ||
|
|
57d9da96a1 | ||
|
|
b890882e54 | ||
|
|
ec97c67aca | ||
|
|
e5e9b0d928 | ||
|
|
1764d0c0a4 | ||
|
|
2e37c16b2c | ||
|
|
5c79befd28 | ||
|
|
bcdab80f41 | ||
|
|
c3cf892e40 | ||
|
|
2b865723bf | ||
|
|
1d41593a84 | ||
|
|
52452020dd | ||
|
|
65f2562d52 | ||
|
|
3482944ac8 | ||
|
|
9d03a1dc13 | ||
|
|
15840cef6c | ||
|
|
012d3e7b65 | ||
|
|
ea80b658dc | ||
|
|
10d254bbbc | ||
|
|
8acb3f8a90 | ||
|
|
1b00a8692b | ||
|
|
75759ded24 | ||
|
|
814559bef8 | ||
|
|
8bac02bbcf | ||
|
|
7ef031e244 | ||
|
|
250d32e3dc | ||
|
|
bdeab5bb9c | ||
|
|
764e1e9363 | ||
|
|
72461546b8 | ||
|
|
98ad3b0f4a | ||
|
|
0cbb0aa0b5 | ||
|
|
7afd2adacf | ||
|
|
4c52d0ec42 | ||
|
|
9f66622472 | ||
|
|
0122b74815 | ||
|
|
1f2f33d6c0 | ||
|
|
1a3c454d7f | ||
|
|
fa11d313fb | ||
|
|
20bc2a97d9 | ||
|
|
1b4f26d2e8 | ||
|
|
0cd49c4c81 | ||
|
|
6c1cd2537d | ||
|
|
cf31f24752 | ||
|
|
27523a1c45 | ||
|
|
e1d0fe6b92 | ||
|
|
d3f4a4991e | ||
|
|
296ddbdec5 | ||
|
|
f7cd34b8d8 | ||
|
|
7bafffbd06 | ||
|
|
201ec3be5a | ||
|
|
7d1d5af097 | ||
|
|
f9ce5bce4d | ||
|
|
748768c771 | ||
|
|
f307077636 | ||
|
|
5bf6013d6b | ||
|
|
179cd878a9 | ||
|
|
788548d1f4 | ||
|
|
0ae15c2b3c | ||
|
|
b5b4257032 | ||
|
|
657db124b2 | ||
|
|
f5ea43b3d3 | ||
|
|
01747510d5 | ||
|
|
ff8b160a2b | ||
|
|
28b7afda15 | ||
|
|
ecd253dd3e | ||
|
|
428a7c1875 | ||
|
|
8d0dbcd50e | ||
|
|
3ba8889194 | ||
|
|
327f21f1bb | ||
|
|
c96d6b2958 | ||
|
|
c144da4485 | ||
|
|
da8fb37317 | ||
|
|
4d7e29cb3a | ||
|
|
2a1f5b7500 | ||
|
|
17099320e9 | ||
|
|
f3dbb4dd2d | ||
|
|
1725a6ed14 | ||
|
|
b3b3cdde08 | ||
|
|
8ab55e1ef3 | ||
|
|
b8cd510a0e | ||
|
|
0d5eb2ea9e | ||
|
|
32a5ab5138 | ||
|
|
2b0fd2e5c0 | ||
|
|
4168821ec4 | ||
|
|
6353488db7 | ||
|
|
b446d4cc3f | ||
|
|
fb97af317e | ||
|
|
16b2762025 | ||
|
|
fe758aab61 | ||
|
|
c5a3e2e376 | ||
|
|
4c2868f6c9 | ||
|
|
5018298c81 | ||
|
|
37b81aa0be | ||
|
|
6a3a0465a4 | ||
|
|
34d67d6018 | ||
|
|
9c4403d7ff | ||
|
|
919aff0080 | ||
|
|
3c0566cb87 | ||
|
|
8504cf7caf | ||
|
|
4357066cdf | ||
|
|
67ca9a7fc4 | ||
|
|
9c9c295a79 | ||
|
|
daa3292000 | ||
|
|
2da5e2b2ec | ||
|
|
c5119ad27b | ||
|
|
4808507da8 | ||
|
|
101a7486f2 | ||
|
|
11a286fe26 | ||
|
|
80e576db2d | ||
|
|
ca80b4730f | ||
|
|
3a73e47b83 | ||
|
|
80a8ce8a46 | ||
|
|
62824051c8 | ||
|
|
d804323cab | ||
|
|
c4a2403943 | ||
|
|
cbaef446ac | ||
|
|
8aa1312ae2 | ||
|
|
7ec09fcfe9 | ||
|
|
2aad0a9407 | ||
|
|
c090095e08 | ||
|
|
f24bc00eb9 | ||
|
|
6ead8c3cf0 | ||
|
|
f91ee5d245 | ||
|
|
3a18a19583 | ||
|
|
dd6700e659 | ||
|
|
f620b09134 | ||
|
|
ca8a27babe | ||
|
|
2838251c67 | ||
|
|
19cc894662 | ||
|
|
15320f0eb2 | ||
|
|
f7cff34527 | ||
|
|
af758af51a | ||
|
|
9d231801da | ||
|
|
acdf8c35fa | ||
|
|
33c2154a98 | ||
|
|
f890b316da | ||
|
|
c5f2bf1059 | ||
|
|
2e4cf0b731 | ||
|
|
f5a319b0b3 | ||
|
|
2533d2c694 | ||
|
|
b1fed81821 | ||
|
|
0064c0357f | ||
|
|
20cd8cce1d | ||
|
|
bc8af2784f | ||
|
|
e300810a16 | ||
|
|
33b48a8a4b | ||
|
|
6f2f1174e6 | ||
|
|
adbe75ae7e | ||
|
|
dae2add713 | ||
|
|
38946fd294 | ||
|
|
1f25fae04f | ||
|
|
047ef107ae | ||
|
|
1bb2f92f5b | ||
|
|
727a1f29d1 | ||
|
|
012bd3a307 | ||
|
|
ae5b19b0aa | ||
|
|
81d9c55eee | ||
|
|
caffa2fd8d | ||
|
|
90cfe0e151 | ||
|
|
491800280c | ||
|
|
d60c2e0815 | ||
|
|
fb0babe261 | ||
|
|
e6bc8abdc1 | ||
|
|
8de8eb3104 | ||
|
|
fbee644b4e | ||
|
|
aaf327b308 | ||
|
|
d404e0f50e | ||
|
|
c5bb83c6d0 | ||
|
|
2d3fa3c09e | ||
|
|
8bf3b64831 | ||
|
|
f7b3c77f78 | ||
|
|
9ff04f8637 | ||
|
|
dd7953ab4c | ||
|
|
23fde3387a | ||
|
|
d968048ef5 | ||
|
|
ecbdb2b18d | ||
|
|
6d26ca04be | ||
|
|
373921777a | ||
|
|
577eef3631 | ||
|
|
2f489b04ae | ||
|
|
21d7fb476b | ||
|
|
a2c393ccc5 | ||
|
|
73a11c91d2 | ||
|
|
8673f919fd | ||
|
|
1e32161652 | ||
|
|
38eb769c1b | ||
|
|
5e372ed9f4 | ||
|
|
e027a81317 | ||
|
|
0a51713bd7 | ||
|
|
d5cde03db1 | ||
|
|
4c3a329e31 | ||
|
|
6c94e49732 | ||
|
|
af77b29509 | ||
|
|
449f2bfa09 | ||
|
|
c9815e2ccb | ||
|
|
9bd6bc64b0 | ||
|
|
a5fe016854 | ||
|
|
93cd299c77 | ||
|
|
e8f8d8b4d4 | ||
|
|
b806ea6871 | ||
|
|
cb17180dea | ||
|
|
78ec4ba2a7 | ||
|
|
317104de30 | ||
|
|
63412975c3 | ||
|
|
9c87f8749d | ||
|
|
5fc36516f4 | ||
|
|
c608c8a57e | ||
|
|
853a9884d7 | ||
|
|
ecafaf4ea1 | ||
|
|
eb490e92c3 | ||
|
|
98c7e43927 | ||
|
|
d8786d4785 | ||
|
|
02181021ce | ||
|
|
fa60f8c16e | ||
|
|
3084a2f409 | ||
|
|
f473cfc6f2 | ||
|
|
8a34aa5c45 | ||
|
|
cc204c297f | ||
|
|
bb210ff59e | ||
|
|
671e84bec9 | ||
|
|
fc2ba2df32 | ||
|
|
e5bee8e79b | ||
|
|
1b13ddcf32 | ||
|
|
de707049d4 | ||
|
|
e95ae2dbbb | ||
|
|
4606c27cdc | ||
|
|
ba88bf72ce | ||
|
|
75967cec02 | ||
|
|
0a35f661bd | ||
|
|
f141806fb4 | ||
|
|
d80f40075c | ||
|
|
44dbe80096 | ||
|
|
c7546ef08a | ||
|
|
6fe5bb4aa8 | ||
|
|
589a9aa3db | ||
|
|
2c8d1a9255 | ||
|
|
a8c11c0cdb | ||
|
|
34ae93f379 | ||
|
|
bd57d291c1 | ||
|
|
7310daf51d | ||
|
|
78d9d888db | ||
|
|
bccdc7f5e8 | ||
|
|
3854526389 | ||
|
|
74072847ca | ||
|
|
c5857bfc0b | ||
|
|
8b380894f9 | ||
|
|
b090737162 | ||
|
|
476abc9dad | ||
|
|
a2cbf07b6d | ||
|
|
2a67344b93 | ||
|
|
9ecb617d2e | ||
|
|
9381776345 | ||
|
|
5a47bb11ba | ||
|
|
4be4fc4808 | ||
|
|
d939be28e6 | ||
|
|
bb8c7756c7 | ||
|
|
3261fbd7e9 | ||
|
|
7164d2b885 | ||
|
|
185fccf712 | ||
|
|
0c860ade12 | ||
|
|
cfb2739cd9 | ||
|
|
b1bb3f38f3 | ||
|
|
0f0017b02d | ||
|
|
a99f7a494b | ||
|
|
65b3997e72 | ||
|
|
5e8f947ce5 | ||
|
|
3e9308d315 | ||
|
|
5f48a4e5e5 | ||
|
|
e593ca4bda | ||
|
|
b731eaaffb | ||
|
|
75f5a430e4 | ||
|
|
e0c721585e | ||
|
|
da21c2e0a7 | ||
|
|
2b989e4c39 | ||
|
|
7d6c80b941 | ||
|
|
a3039eea12 | ||
|
|
cbf9577a24 | ||
|
|
70ea32e89d | ||
|
|
10a3037ab3 | ||
|
|
9ccfca5061 | ||
|
|
52cbf1fb64 | ||
|
|
190e401452 | ||
|
|
b881a27c8d | ||
|
|
6fab527eed | ||
|
|
9690832247 | ||
|
|
60a68963a8 | ||
|
|
e5948081a7 | ||
|
|
7aa47e2a60 | ||
|
|
327538a98f | ||
|
|
f6c71e27d8 | ||
|
|
4628da7ea2 | ||
|
|
02ba96c421 | ||
|
|
87f6fe6b20 | ||
|
|
8049bd5b80 | ||
|
|
5225ba06c8 | ||
|
|
d695fc3fbc | ||
|
|
a2132292ac | ||
|
|
c31b191b96 | ||
|
|
c4b573f608 | ||
|
|
28810fcba3 | ||
|
|
8d1989a595 | ||
|
|
d022956e24 | ||
|
|
2bdaa4dc4e | ||
|
|
46bfbaada1 | ||
|
|
e659343821 | ||
|
|
44138564b0 | ||
|
|
3c77abbbab | ||
|
|
209c6e6dab | ||
|
|
6fa827e9a1 | ||
|
|
cd3ea7fd2e | ||
|
|
d3bd697cb2 | ||
|
|
6c6bf030c5 | ||
|
|
6e2b3ae0c7 | ||
|
|
9915929340 | ||
|
|
298bf5fb0a | ||
|
|
6ae431b2f0 | ||
|
|
44769b6001 | ||
|
|
ebabfeb669 | ||
|
|
5c1f176848 | ||
|
|
4186cfd91c | ||
|
|
457e9b53c7 | ||
|
|
861aec6bd6 | ||
|
|
21572d3547 | ||
|
|
89afba7437 | ||
|
|
53f5fbb77f | ||
|
|
9299f00d20 | ||
|
|
e5e97a3560 | ||
|
|
32bc0382d6 | ||
|
|
fa53abdfb7 | ||
|
|
0cbfb81b4c | ||
|
|
d47c801b18 | ||
|
|
c056b9d2dd | ||
|
|
92a15ea85d | ||
|
|
6fe022ccc8 | ||
|
|
f397dd71a9 | ||
|
|
b71eb666a7 | ||
|
|
02e0a47a52 | ||
|
|
b176be942d | ||
|
|
a2ab0d75ed | ||
|
|
60809fe5ad | ||
|
|
51c5902db0 | ||
|
|
c48f6c31ce | ||
|
|
b2d23edf6d | ||
|
|
31f25cfd1b | ||
|
|
7d4e4c167e | ||
|
|
4a8e416fe1 | ||
|
|
090e624ebc | ||
|
|
eb12030975 | ||
|
|
e46af9d54c | ||
|
|
861faaa285 | ||
|
|
8312233a93 | ||
|
|
959bf73485 | ||
|
|
ce4efd0b70 | ||
|
|
c8dc751b82 | ||
|
|
beeaf1a996 | ||
|
|
f856276d71 | ||
|
|
0300854c46 | ||
|
|
96aa1054dc | ||
|
|
7c862df92a | ||
|
|
e7937206af | ||
|
|
e49c1c2f01 | ||
|
|
081b2c11e4 | ||
|
|
f342f4aa98 | ||
|
|
57390b02ca | ||
|
|
f06e9f5ede | ||
|
|
4e73e69342 | ||
|
|
a698248dff | ||
|
|
c6ff80b71c | ||
|
|
37cad3f255 | ||
|
|
5700f36a6f | ||
|
|
34f800d815 | ||
|
|
b8ef6eba3f | ||
|
|
8d3ca813ed | ||
|
|
ffec50141a | ||
|
|
54027049d3 | ||
|
|
4c2829e3d2 | ||
|
|
69e308d420 | ||
|
|
ad46f10b55 | ||
|
|
cd0fdfc95b | ||
|
|
d95abfce82 | ||
|
|
942a125e04 | ||
|
|
cc5fe0859a | ||
|
|
e97a00e61d | ||
|
|
a3677d5aa8 | ||
|
|
f927933c46 | ||
|
|
8f15aac6fc | ||
|
|
b519c43e16 | ||
|
|
5ab83bcb21 | ||
|
|
84ce3b4b47 | ||
|
|
02c8393bc6 | ||
|
|
b07c43a32f | ||
|
|
9469291731 | ||
|
|
ce1b337f7f | ||
|
|
c29baf446d | ||
|
|
fdf5fb46bc | ||
|
|
8c6ca5e999 | ||
|
|
bb2b9eeea9 | ||
|
|
d1cbce3f89 | ||
|
|
55b5f6821f | ||
|
|
ee8e1b9322 | ||
|
|
f9b8db0715 | ||
|
|
2fb01b4adf | ||
|
|
02bce8c3a8 | ||
|
|
468671a3fa | ||
|
|
20bd5c4c36 | ||
|
|
ffb50cfe28 | ||
|
|
8ee650f38d | ||
|
|
3de2bf88df | ||
|
|
1fcbd8410f | ||
|
|
de082d0fb2 | ||
|
|
51e6d5dfbd | ||
|
|
3cc5cdbc06 | ||
|
|
842c69fd80 | ||
|
|
d40bbdc3a5 | ||
|
|
c458823014 | ||
|
|
61c291ae4e | ||
|
|
b69ec47b18 | ||
|
|
32abf1614f | ||
|
|
f613228619 | ||
|
|
51fc8e824d | ||
|
|
a916cc8320 | ||
|
|
ca9f883352 | ||
|
|
9d68fa3b88 | ||
|
|
d3a5885d95 | ||
|
|
c1db13c1f6 | ||
|
|
31b0f711b8 | ||
|
|
59ca1ce3a6 | ||
|
|
0f7bd5f4fd | ||
|
|
aff9031284 | ||
|
|
01130757d6 | ||
|
|
397d080da2 | ||
|
|
f97b3bf82e | ||
|
|
cb5d052829 | ||
|
|
b7bcd252d3 | ||
|
|
0908d21bed | ||
|
|
aa43926da2 | ||
|
|
a368f4cf57 | ||
|
|
08a4bde6c1 | ||
|
|
f68e979229 | ||
|
|
544b1f243d | ||
|
|
391e807c78 | ||
|
|
4099cde737 | ||
|
|
4d878985d4 | ||
|
|
e56a74dc81 | ||
|
|
34c45ec883 | ||
|
|
72d7d4a65e | ||
|
|
cb0add3b90 | ||
|
|
71a48ce10f | ||
|
|
31b8535854 | ||
|
|
ed1bb73c22 | ||
|
|
b7ac28e902 | ||
|
|
3cb72797b6 | ||
|
|
6f1f8d7806 | ||
|
|
b06f1115d4 | ||
|
|
777ad31de0 | ||
|
|
8b977f8786 | ||
|
|
7c3139226c | ||
|
|
0ddabf3089 | ||
|
|
6cfc7e45ef | ||
|
|
9ea675bc89 | ||
|
|
42f90c8806 | ||
|
|
c8b6eac8fe | ||
|
|
d78272c1fa | ||
|
|
48ccdf128f | ||
|
|
2322dffd49 | ||
|
|
8a5e5bf01e | ||
|
|
99ed83022e | ||
|
|
07185534fb | ||
|
|
9bacaa11d8 | ||
|
|
4fe55b5a28 | ||
|
|
bd503f224d | ||
|
|
b5c91647ca | ||
|
|
c359a0f2ac | ||
|
|
c7c4c7497a | ||
|
|
e442baab31 | ||
|
|
8101c8b51c | ||
|
|
49d9f4a89d | ||
|
|
aebe35c9d4 | ||
|
|
a26361c79f | ||
|
|
eba1ef6ab9 | ||
|
|
a486458a08 | ||
|
|
82b8401414 | ||
|
|
8b6ee91ec1 | ||
|
|
06cffd9e15 | ||
|
|
beaccbcf3b | ||
|
|
21ee5e2401 | ||
|
|
6462e1580c | ||
|
|
8b5552bb62 | ||
|
|
747c188824 | ||
|
|
692087dd25 | ||
|
|
6fe13e8654 | ||
|
|
3b2b98b9fe | ||
|
|
796f2fe14a | ||
|
|
4fef391b64 | ||
|
|
83f6cebd0b | ||
|
|
90183ae823 | ||
|
|
3c9df03584 | ||
|
|
367c6cfd92 | ||
|
|
5e75410e7c | ||
|
|
38028f7d0c | ||
|
|
3ca514f2b2 | ||
|
|
a07ae685e2 | ||
|
|
c07f899870 | ||
|
|
092b530537 | ||
|
|
cf691499a1 | ||
|
|
0bb9cccdc6 | ||
|
|
4cb12f6cae | ||
|
|
ecbdeb2096 | ||
|
|
9a7a532f7b | ||
|
|
825833c859 | ||
|
|
c4c3613874 | ||
|
|
e527fd9551 | ||
|
|
3a03156cb3 | ||
|
|
b3780186f8 | ||
|
|
c4654e44d8 | ||
|
|
9c6047e3fc | ||
|
|
260cc7d180 | ||
|
|
bbe930e552 | ||
|
|
a655fe860e | ||
|
|
ddf36aa879 | ||
|
|
34c31c561d | ||
|
|
3cc7d00d71 | ||
|
|
ed214b1382 | ||
|
|
f8405e298c | ||
|
|
539159ba50 | ||
|
|
f2c9d2f905 | ||
|
|
1b11331881 | ||
|
|
b71afff29f | ||
|
|
b4c6950f95 | ||
|
|
047a477f7b | ||
|
|
ec0329efb1 | ||
|
|
477caa12c3 | ||
|
|
8f82ff9b1d | ||
|
|
7d97fdcbec | ||
|
|
5ee0150154 | ||
|
|
1bcacfc474 | ||
|
|
34603184a4 | ||
|
|
78cb05adda | ||
|
|
8493252645 | ||
|
|
2ee5a25c91 | ||
|
|
60ef1b8867 | ||
|
|
3eaf756aa2 | ||
|
|
bc318fa185 | ||
|
|
f93c42a23f | ||
|
|
f5dde77efe | ||
|
|
2b7f923865 | ||
|
|
80099ad63d | ||
|
|
b273bf2947 | ||
|
|
2241ba8819 | ||
|
|
3cf58e3caf | ||
|
|
450442a916 | ||
|
|
8c866bd17d | ||
|
|
8deaf1850b | ||
|
|
6da2aca975 | ||
|
|
11989d17e3 | ||
|
|
aa42633ab2 | ||
|
|
5aa6e5c2a9 | ||
|
|
825398f4d4 | ||
|
|
ccac249c01 | ||
|
|
f2806d9335 | ||
|
|
b11806e341 | ||
|
|
9ec336283f | ||
|
|
71a7afab17 | ||
|
|
bbdb2c9b36 | ||
|
|
ede58d9159 | ||
|
|
48e09f42fc | ||
|
|
ec7d182d38 | ||
|
|
b271b529ea | ||
|
|
d24690ab8c | ||
|
|
89fa3ff8fe | ||
|
|
5c0a3a64ab | ||
|
|
b66629b951 | ||
|
|
de866a322f | ||
|
|
9c7c95cf4f | ||
|
|
e32ffd1819 | ||
|
|
79ac19937f | ||
|
|
08e8fcdc7c | ||
|
|
6941e63a2c | ||
|
|
c68997936a | ||
|
|
40547439b2 | ||
|
|
095c6ad099 | ||
|
|
691fe638e4 | ||
|
|
fbdee6a7a7 | ||
|
|
664f3d7eaa | ||
|
|
c2846fc586 | ||
|
|
e9b1332119 | ||
|
|
757a5146a1 | ||
|
|
f9defda106 | ||
|
|
e6a3ca0a1f | ||
|
|
14342c9632 | ||
|
|
1cf478f5b3 | ||
|
|
9ff94f9bd5 | ||
|
|
9842a52820 | ||
|
|
dbca9c30b0 | ||
|
|
220f2fbd79 | ||
|
|
f6df4d6694 | ||
|
|
0406e89c2a | ||
|
|
5ef21e1ddf | ||
|
|
414d5bd8ac | ||
|
|
15ccf03b28 | ||
|
|
828a48998f | ||
|
|
4b590e03ff | ||
|
|
0db8780ad9 | ||
|
|
5b744176df | ||
|
|
20b15e0330 | ||
|
|
818539e3de | ||
|
|
f48741f65c | ||
|
|
e9e5af849f | ||
|
|
22d68f5c7c | ||
|
|
690598da60 |
@@ -1,22 +0,0 @@
|
||||
version: 2
|
||||
jobs:
|
||||
minecraft_server:
|
||||
docker:
|
||||
- image: circleci/buildpack-deps:19.10
|
||||
steps:
|
||||
- checkout
|
||||
- setup_remote_docker
|
||||
- run:
|
||||
name: Build image
|
||||
command: docker build -t mc:$CIRCLE_BUILD_NUM .
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
build:
|
||||
jobs:
|
||||
- minecraft_server:
|
||||
filters:
|
||||
branches:
|
||||
ignore:
|
||||
- armv7
|
||||
- multiarch
|
||||
@@ -1,5 +1,6 @@
|
||||
data
|
||||
testdata
|
||||
examples
|
||||
k8s-examples
|
||||
.idea
|
||||
.git
|
||||
.git
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
[start-*]
|
||||
indent_size = 2
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
end_of_line = lf
|
||||
|
||||
5
.github/FUNDING.yml
vendored
Normal file
5
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
|
||||
#github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||
custom:
|
||||
- https://www.buymeacoffee.com/itzg
|
||||
- https://paypal.me/itzg
|
||||
40
.github/ISSUE_TEMPLATE/bug.yml
vendored
Normal file
40
.github/ISSUE_TEMPLATE/bug.yml
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
name: Bug Report
|
||||
description: File a bug report
|
||||
labels:
|
||||
- bug
|
||||
- status/needs triage
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thanks for taking the time to report a bug.
|
||||
|
||||
Please double check some things first:
|
||||
- Do you just have a question about something? If so, asking in the [Q&A Discussions](https://github.com/itzg/docker-minecraft-server/discussions/categories/q-a) or asking on [the Discord server](https://discord.gg/DXfKpjB) would be best.
|
||||
- Is this bug happening after the `[init]` prefixed logs and after the log that says "Starting the Minecraft server"? If so, please report the bug with Mojang or the respective server provider.
|
||||
- Are you seeing a performance problem? If so, that is typically outside the scope of the image setup mechanims. Ask a question as above or contact the respective server provider.
|
||||
- type: textarea
|
||||
id: problem
|
||||
attributes:
|
||||
label: Describe the problem
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: container
|
||||
attributes:
|
||||
label: Container definition
|
||||
description: Please provide the compose file or run command used to create the container
|
||||
value: |
|
||||
```
|
||||
Paste run command or compose file here
|
||||
```
|
||||
- type: textarea
|
||||
id: logs
|
||||
attributes:
|
||||
label: Container logs
|
||||
description: |
|
||||
Please provide container logs from the start of the container, which will be the ones prefixed with `[init]`. It is even better if you can set the variable `DEBUG` to "true" and provide those debug container logs.
|
||||
value: |
|
||||
```
|
||||
Paste logs here
|
||||
```
|
||||
7
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
7
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
contact_links:
|
||||
- name: Ask a question in discussions
|
||||
url: https://github.com/itzg/docker-minecraft-server/discussions
|
||||
about: Please ask questions here
|
||||
- name: Ask a question on Discord
|
||||
url: https://discord.gg/DXfKpjB
|
||||
about: Please ask questions here
|
||||
29
.github/ISSUE_TEMPLATE/enhancement.yml
vendored
Normal file
29
.github/ISSUE_TEMPLATE/enhancement.yml
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
name: Enhancement Request
|
||||
description: Request an enhancement
|
||||
labels:
|
||||
- enhancement
|
||||
- status/needs triage
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thanks for taking the time to request an enhancement.
|
||||
|
||||
Even if you plan on submitting a pull request with a contributed enhancement it is best to describe the enhancement here first. Somebody might already be working on a similar thing and could use your help.
|
||||
- type: dropdown
|
||||
id: type
|
||||
attributes:
|
||||
label: Enhancement Type
|
||||
options:
|
||||
- Improve an existing feature
|
||||
- A completely new feature
|
||||
- New server type
|
||||
- Not sure
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: Describe the enhancement
|
||||
validations:
|
||||
required: true
|
||||
7
.github/dependabot.yml
vendored
Normal file
7
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
version: 2
|
||||
updates:
|
||||
# Maintain dependencies for GitHub Actions
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
6
.github/no-response.yml
vendored
6
.github/no-response.yml
vendored
@@ -1,6 +0,0 @@
|
||||
daysUntilClose: 14
|
||||
responseRequiredLabel: "status/waiting on feedback"
|
||||
closeComment: >
|
||||
This issue has been automatically closed because there has been no response
|
||||
after requesting feedback. Please feel free to re-open this issue if the
|
||||
scenario still exists and provide a comment with more information.
|
||||
4
.github/release.yml
vendored
Normal file
4
.github/release.yml
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
changelog:
|
||||
exclude:
|
||||
authors:
|
||||
- dependabot
|
||||
93
.github/workflows/build-multiarch.yml
vendored
Normal file
93
.github/workflows/build-multiarch.yml
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
name: Build and publish multiarch
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- java8-multiarch
|
||||
- java8-openj9
|
||||
- java11*
|
||||
- java16*
|
||||
- java17*
|
||||
- test/**
|
||||
tags:
|
||||
- "[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:
|
||||
- "*.md"
|
||||
- "docs/**"
|
||||
- "examples/**"
|
||||
|
||||
env:
|
||||
IMAGE_TO_TEST: itzg/minecraft-server:test-${{ github.repository_owner }}-${{ github.run_id }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
if: github.repository == 'itzg/docker-minecraft-server'
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2.4.0
|
||||
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v3
|
||||
with:
|
||||
images: |
|
||||
itzg/minecraft-server
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=ref,event=tag
|
||||
flavor: |
|
||||
latest=${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
|
||||
|
||||
- name: Setup Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1.2.0
|
||||
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USER }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Build for test
|
||||
uses: docker/build-push-action@v2.7.0
|
||||
if: github.ref_name == 'master' || startsWith(github.ref_name, 'test/')
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64
|
||||
tags: ${{ env.IMAGE_TO_TEST }}
|
||||
# ensure latest base image is used
|
||||
pull: true
|
||||
load: true
|
||||
push: false
|
||||
cache-from: type=gha
|
||||
# no cache-to to avoid cross-cache update from next build step
|
||||
|
||||
- name: Run tests
|
||||
# It is assumed that image variants are merged from master and tested there
|
||||
if: github.ref_name == 'master' || startsWith(github.ref_name, 'test/')
|
||||
run: |
|
||||
tests/test.sh
|
||||
|
||||
- name: Build and push
|
||||
id: docker_build
|
||||
uses: docker/build-push-action@v2.7.0
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
# ensure latest base image is used
|
||||
pull: true
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
|
||||
- name: Image digest
|
||||
run: echo ${{ steps.docker_build.outputs.digest }}
|
||||
43
.github/workflows/ci.yml
vendored
Normal file
43
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
name: ContinuousIntegration
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'dev*'
|
||||
- '!master'
|
||||
- '!java*'
|
||||
- '!multi*'
|
||||
paths-ignore:
|
||||
- "*.md"
|
||||
- "docs/**"
|
||||
- "examples/**"
|
||||
|
||||
env:
|
||||
IMAGE_TO_TEST: ${{ secrets.IMAGE_ORG }}/minecraft-server:test-${{ github.repository_owner }}-${{ github.run_id }}
|
||||
MODS_FORGEAPI_KEY: ${{ secrets.MODS_FORGEAPI_KEY }}
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2.4.0
|
||||
|
||||
- name: Setup Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Build
|
||||
uses: docker/build-push-action@v2.7.0
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64
|
||||
tags: ${{ env.IMAGE_TO_TEST }}
|
||||
load: true
|
||||
cache-from: type=gha
|
||||
|
||||
- name: Run Setup Only Tests
|
||||
run: sh tests/setuponlytests/test.sh
|
||||
|
||||
# - name: Run Full Minecraft Service Tests
|
||||
# run: |
|
||||
# tests/fulltests/test.sh
|
||||
26
.github/workflows/discord.yml
vendored
Normal file
26
.github/workflows/discord.yml
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
name: discord
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ["ContinuousIntegration", "Build and Publish", "Build and publish multiarch" ]
|
||||
types:
|
||||
- completed
|
||||
|
||||
env:
|
||||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
||||
|
||||
jobs:
|
||||
discord:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- name: on-success
|
||||
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
||||
uses: Ilshidur/action-discord@master
|
||||
with:
|
||||
args: "Github repo: ${{ github.repository }}\n- Branch: ${{ github.event.workflow_run.head_branch }}\n- [Link: to Actions](<${{ github.event.workflow_run.html_url }}>)\n- Status: 🎉 ${{ github.event.workflow_run.conclusion }} 🍏"
|
||||
- name: on-failure
|
||||
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
|
||||
uses: Ilshidur/action-discord@master
|
||||
with:
|
||||
args: "Github repo: ${{ github.repository }}\n- Branch: ${{ github.event.workflow_run.head_branch }}\n- [Link: to Actions](<${{ github.event.workflow_run.html_url }}>)\n- Status: 🤔 ${{ github.event.workflow_run.conclusion }} 💣💥"
|
||||
21
.github/workflows/generate-toc.yml
vendored
Normal file
21
.github/workflows/generate-toc.yml
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
name: Generate README table of contents
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- README.md
|
||||
jobs:
|
||||
generate:
|
||||
if: github.repository == 'itzg/docker-minecraft-server'
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- uses: actions/checkout@v2.4.0
|
||||
- run: |
|
||||
curl https://raw.githubusercontent.com/ekalinin/github-markdown-toc/master/gh-md-toc -o gh-md-toc
|
||||
chmod a+x gh-md-toc
|
||||
./gh-md-toc --insert --no-backup README.md
|
||||
- uses: stefanzweifel/git-auto-commit-action@v4.13.1
|
||||
with:
|
||||
commit_message: "docs: Auto update markdown TOC"
|
||||
17
.github/workflows/issue-label.yml
vendored
Normal file
17
.github/workflows/issue-label.yml
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
on:
|
||||
issues:
|
||||
types: [labeled]
|
||||
|
||||
env:
|
||||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
||||
|
||||
jobs:
|
||||
labelNotify:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- name: notify
|
||||
if: github.event.label.name == 'enhancement' || github.event.label.name == 'bug'
|
||||
uses: Ilshidur/action-discord@master
|
||||
with:
|
||||
args: "[${{ github.event.issue.title }}](<${{ github.event.issue.html_url }}>) added `${{ github.event.label.name }}` label"
|
||||
97
.github/workflows/main.yml
vendored
Normal file
97
.github/workflows/main.yml
vendored
Normal file
@@ -0,0 +1,97 @@
|
||||
name: Build and Publish
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- java8
|
||||
- openj9
|
||||
- openj9-11
|
||||
- adopt11
|
||||
- test/alpine/*
|
||||
tags:
|
||||
- "[0-9]+.[0-9]+.[0-9]+-java8"
|
||||
- "[0-9]+.[0-9]+.[0-9]+-openj9"
|
||||
- "[0-9]+.[0-9]+.[0-9]+-openj9-11"
|
||||
- "[0-9]+.[0-9]+.[0-9]+-openj9-nightly"
|
||||
- "[0-9]+.[0-9]+.[0-9]+-adopt11"
|
||||
|
||||
env:
|
||||
IMAGE_TO_TEST: itzg/minecraft-server:test-${{ github.repository_owner }}-${{ github.run_id }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2.4.0
|
||||
|
||||
- name: Prepare
|
||||
id: prep
|
||||
run: |
|
||||
DOCKER_IMAGE=itzg/minecraft-server
|
||||
VERSION=edge
|
||||
if [[ $GITHUB_REF == refs/tags/* ]]; then
|
||||
VERSION=${GITHUB_REF#refs/tags/}
|
||||
fi
|
||||
if [[ $GITHUB_REF == refs/heads/* ]]; then
|
||||
VERSION=${GITHUB_REF#refs/heads/}
|
||||
if [[ $VERSION == master ]]; then
|
||||
VERSION=latest
|
||||
fi
|
||||
fi
|
||||
TAGS="${DOCKER_IMAGE}:${VERSION//\//-}"
|
||||
echo ::set-output name=tags::${TAGS}
|
||||
echo ::set-output name=version::${VERSION//\//-}
|
||||
|
||||
- name: Setup Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USER }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Build for test
|
||||
uses: docker/build-push-action@v2.7.0
|
||||
if: github.ref_name == 'java8'
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64
|
||||
tags: ${{ env.IMAGE_TO_TEST }}
|
||||
# ensure latest base image is used
|
||||
pull: true
|
||||
load: true
|
||||
push: false
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
- name: Run tests
|
||||
if: github.ref_name == 'java8'
|
||||
run: |
|
||||
tests/test.sh
|
||||
env:
|
||||
MINECRAFT_VERSION: 1.12.2
|
||||
|
||||
- name: Build and push
|
||||
id: docker_build
|
||||
uses: docker/build-push-action@v2.7.0
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
# ensure latest base image is used
|
||||
pull: true
|
||||
# publish
|
||||
push: true
|
||||
# tags determined by prep step
|
||||
tags: ${{ steps.prep.outputs.tags }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
labels: |
|
||||
org.opencontainers.image.documentation=https://github.com/itzg/docker-minecraft-server
|
||||
org.opencontainers.image.version=${{ steps.prep.outputs.version }}
|
||||
org.opencontainers.image.source=https://github.com/itzg/docker-minecraft-server
|
||||
org.opencontainers.image.revision=${{ github.sha }}
|
||||
|
||||
- name: Image digest
|
||||
run: echo ${{ steps.docker_build.outputs.digest }}
|
||||
64
.github/workflows/pr.yml
vendored
Normal file
64
.github/workflows/pr.yml
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
name: PullRequest
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
types: [assigned, opened, synchronize, labeled]
|
||||
paths-ignore:
|
||||
- "*.md"
|
||||
- "docs/**"
|
||||
- "examples/**"
|
||||
|
||||
env:
|
||||
IMAGE_TO_TEST: itzg/minecraft-server:test-${{ github.repository_owner }}-${{ github.run_id }}
|
||||
MODS_FORGEAPI_KEY: ${{ secrets.MODS_FORGEAPI_KEY }}
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2.4.0
|
||||
|
||||
- name: Setup Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Build
|
||||
uses: docker/build-push-action@v2.7.0
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64
|
||||
tags: ${{ env.IMAGE_TO_TEST }}
|
||||
load: true
|
||||
cache-from: type=gha
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
tests/test.sh
|
||||
|
||||
- name: Gather Docker metadata
|
||||
if: contains(github.event.pull_request.labels.*.name, 'ci/push-image')
|
||||
id: meta
|
||||
uses: docker/metadata-action@v3
|
||||
with:
|
||||
images: |
|
||||
itzg/minecraft-server
|
||||
|
||||
- name: Login to DockerHub
|
||||
if: contains(github.event.pull_request.labels.*.name, 'ci/push-image')
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USER }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Push
|
||||
if: contains(github.event.pull_request.labels.*.name, 'ci/push-image')
|
||||
uses: docker/build-push-action@v2.7.0
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
pull: true
|
||||
push: true
|
||||
cache-from: type=gha
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
25
.github/workflows/stale-check.yml
vendored
Normal file
25
.github/workflows/stale-check.yml
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
name: Stale Check
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: 0 2 * * *
|
||||
|
||||
jobs:
|
||||
check:
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: Process Stale Issues
|
||||
uses: actions/stale@v4.1.0
|
||||
with:
|
||||
stale-issue-label: status/stale
|
||||
stale-pr-label: status/stale
|
||||
stale-issue-message: >
|
||||
This issue is stale because it has been open 30 days with no activity.
|
||||
Please add a comment describing the reason to keep this issue open.
|
||||
days-before-stale: 30
|
||||
days-before-close: 5
|
||||
exempt-issue-labels: 'enhancement,keep,status/needs triage,priority/high'
|
||||
|
||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1,3 +1,5 @@
|
||||
.vscode
|
||||
/data/
|
||||
/.idea/
|
||||
*.iml
|
||||
*.iml
|
||||
/gh-md-toc
|
||||
|
||||
11
BUILDING.md
Normal file
11
BUILDING.md
Normal file
@@ -0,0 +1,11 @@
|
||||
Ensure buildx/BuildKit support is enabled and run:
|
||||
|
||||
```shell script
|
||||
docker buildx build --platform=linux/arm64 --platform=linux/arm/v7 --platform=linux/amd64 --tag itzg/minecraft-server:multiarch --push .
|
||||
```
|
||||
|
||||
To build for local testing, use:
|
||||
|
||||
```shell script
|
||||
docker buildx build --platform=linux/amd64 --tag mc-multiarch --load .
|
||||
```
|
||||
119
DEVELOPMENT.md
Normal file
119
DEVELOPMENT.md
Normal file
@@ -0,0 +1,119 @@
|
||||
## Adding a server type
|
||||
|
||||
Adding a new server `TYPE` can vary due to the complexity of obtaining and configuring each type; however, the addition of any server type includes at least the following steps:
|
||||
|
||||
1. Copy an existing "start-deploy*" script, such as [start-deployMohist](scripts/start-deployMohist) and rename it accordingly making sure to retain the "start-deploy" prefix
|
||||
2. Modify the type-specific behavior between the "start-utils" preamble and the hand-off to `start-setupWorld` at the end of the script
|
||||
3. Develop and test the changes using the [iterative process described below](#iterative-script-development)
|
||||
4. Add a case-entry to the `case "${TYPE^^}"` in [start-configuration](scripts/start-configuration)
|
||||
5. Add a section to the [README](README.md). It is recommended to copy-modify an existing section to retain a similar wording and level of detail
|
||||
6. [Submit a pull request](https://github.com/itzg/docker-minecraft-server/pulls)
|
||||
|
||||
## Iterative script development
|
||||
|
||||
Individual scripts can be iteratively developed, debugged, and tested using the following procedure.
|
||||
|
||||
First, build a baseline of the image to include the packages needed by existing or new scripts:
|
||||
|
||||
```shell script
|
||||
docker build -t mc-dev .
|
||||
```
|
||||
|
||||
Using the baseline image, an interactive container can be started to iteratively run the scripts to be developed. By attaching the current workspace directory, you can use the local editor of your choice to iteratively modify scripts while using the container to run them.
|
||||
|
||||
```shell script
|
||||
docker run -it --rm -v ${PWD}:/scripts -e SCRIPTS=/scripts/ --entrypoint bash mc-dev
|
||||
```
|
||||
|
||||
From within the container you can run individual scripts via the attached `/scripts/` path; however, be sure to set any environment variables expected by the scripts by either `export`ing them manually:
|
||||
|
||||
```shell script
|
||||
export VANILLA_VERSION=1.12.2
|
||||
/scripts/start-magma
|
||||
```
|
||||
|
||||
...or pre-pending script execution:
|
||||
|
||||
```shell script
|
||||
VANILLA_VERSION=1.12.2 /scripts/start-magma
|
||||
```
|
||||
|
||||
> NOTE: You may want to temporarily add an `exit` statement near the end of your script to isolate execution to just the script you're developing.
|
||||
|
||||
## Using development copy of mc-image-helper
|
||||
|
||||
In the cloned copy of [`mc-image-helper`](https://github.com/itzg/mc-image-helper), create an up-to-date snapshot build of the tgz distribution using:
|
||||
|
||||
```shell
|
||||
./gradlew distTar
|
||||
```
|
||||
|
||||
Assuming [http-server](https://www.npmjs.com/package/http-server) is installed globally, start a static web server using:
|
||||
|
||||
```shell
|
||||
http-server ./build/distributions -p 0
|
||||
```
|
||||
|
||||
Note the port that was selected by http-server and pass the build arguments, such as:
|
||||
|
||||
```shell
|
||||
--build-arg MC_HELPER_VERSION=1.8.1-SNAPSHOT \
|
||||
--build-arg MC_HELPER_BASE_URL=http://host.docker.internal:8080
|
||||
```
|
||||
|
||||
Now the image can be built like normal and it will install mc-image-helper from the locally built copy.
|
||||
|
||||
## Multi-base-image variants
|
||||
|
||||
Several base-image variants are maintained in order to offer choices in JDK provider and version. The variants are maintained in their respective branches:
|
||||
- openj9
|
||||
- openj9-nightly
|
||||
- adopt11
|
||||
- adopt13
|
||||
- multiarch
|
||||
|
||||
The [docker-versions-create.sh](docker-versions-create.sh) script is configured with the branches to maintain and is used to merge changes from the master branch into the mulit-base variant branches. The script also manages git tagging the master branch along with the merged branches. So a typical use of the script would be like:
|
||||
|
||||
```shell script
|
||||
./docker-versions-create.sh -s -t 1.2.0
|
||||
```
|
||||
|
||||
> Most often the major version will be bumped unless a bug or hotfix needs to be published in which case the patch version should be incremented.
|
||||
|
||||
> The build and publishing of those branches and their tags is currently performed within Docker Hub.
|
||||
|
||||
## multiarch support
|
||||
|
||||
The [multiarch branch](https://github.com/itzg/docker-minecraft-server/tree/multiarch) supports running the image on amd64, arm64, and armv7 (aka RaspberryPi). Unlike the mainline branches, it is based on Ubuntu 18.04 since the openjdk package provided by Ubuntu includes full JIT support on all of the processor types.
|
||||
|
||||
The multiarch images are built and published by [a Github action](https://github.com/itzg/docker-minecraft-server/actions?query=workflow%3A%22Build+and+publish+multiarch%22), which [is configured in that branch](https://github.com/itzg/docker-minecraft-server/blob/multiarch/.github/workflows/build-multiarch.yml).
|
||||
|
||||
## Generating release notes
|
||||
|
||||
The following git command can be used to provide the bulk of release notes content:
|
||||
|
||||
```shell script
|
||||
git log --invert-grep --grep "^ci:" --grep "^misc:" --grep "^docs:" --pretty="* %s" 1.1.0..1.2.0
|
||||
```
|
||||
## Tracking changes from master without content
|
||||
|
||||
The following script uses the [ours](https://git-scm.com/docs/merge-strategies#Documentation/merge-strategies.txt-ours) merging strategy to track the history from master into the other branches without actually bringing the changes over. It is useful when a change is specific to master only, such as bumping the base Java version for the `latest` image tag.
|
||||
|
||||
```shell
|
||||
branches=(
|
||||
java8
|
||||
java8-multiarch
|
||||
java8-openj9
|
||||
java11
|
||||
java11-openj9
|
||||
java16
|
||||
java16-openj9
|
||||
java17
|
||||
)
|
||||
|
||||
for b in "${branches[@]}"; do
|
||||
git checkout "$b"
|
||||
git merge -s ours -m "Track latest from master" master
|
||||
git push origin
|
||||
done
|
||||
```
|
||||
93
Dockerfile
93
Dockerfile
@@ -1,36 +1,41 @@
|
||||
FROM openjdk:8u212-jre-alpine
|
||||
FROM adoptopenjdk:11-jdk-openj9
|
||||
|
||||
LABEL maintainer "itzg"
|
||||
LABEL org.opencontainers.image.authors="Geoff Bourne <itzgeoff@gmail.com>"
|
||||
|
||||
RUN apk add --no-cache -U \
|
||||
openssl \
|
||||
RUN apt-get update \
|
||||
&& DEBIAN_FRONTEND=noninteractive \
|
||||
apt-get install -y \
|
||||
imagemagick \
|
||||
lsof \
|
||||
su-exec \
|
||||
shadow \
|
||||
bash \
|
||||
curl iputils wget \
|
||||
file \
|
||||
gosu \
|
||||
sudo \
|
||||
net-tools \
|
||||
iputils-ping \
|
||||
curl \
|
||||
git \
|
||||
jq \
|
||||
dos2unix \
|
||||
mysql-client \
|
||||
tzdata \
|
||||
rsync \
|
||||
nano
|
||||
nano \
|
||||
unzip \
|
||||
knockd \
|
||||
ttf-dejavu \
|
||||
&& apt-get clean
|
||||
|
||||
HEALTHCHECK --start-period=1m CMD mc-monitor status --host localhost --port $SERVER_PORT
|
||||
RUN addgroup --gid 1000 minecraft \
|
||||
&& adduser --system --shell /bin/false --uid 1000 --ingroup minecraft --home /data minecraft
|
||||
|
||||
RUN addgroup -g 1000 minecraft \
|
||||
&& adduser -Ss /bin/false -u 1000 -G minecraft -h /home/minecraft minecraft \
|
||||
&& mkdir -m 777 /data /mods /config /plugins \
|
||||
&& chown minecraft:minecraft /data /config /mods /plugins /home/minecraft
|
||||
COPY --chmod=644 files/sudoers* /etc/sudoers.d
|
||||
|
||||
EXPOSE 25565 25575
|
||||
|
||||
# hook into docker BuildKit --platform support
|
||||
# see https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
|
||||
ARG TARGETOS=linux
|
||||
ARG TARGETARCH=amd64
|
||||
ARG TARGETVARIANT=""
|
||||
ARG TARGETOS
|
||||
ARG TARGETARCH
|
||||
ARG TARGETVARIANT
|
||||
|
||||
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
|
||||
@@ -41,37 +46,49 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
||||
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||
|
||||
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
||||
--var version=1.4.7 --var app=rcon-cli --file {{.app}} \
|
||||
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||
--var version=1.5.1 --var app=rcon-cli --file {{.app}} \
|
||||
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||
|
||||
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
||||
--var version=0.1.7 --var app=mc-monitor --file {{.app}} \
|
||||
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||
--var version=0.10.3 --var app=mc-monitor --file {{.app}} \
|
||||
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||
|
||||
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
||||
--var version=1.4.2 --var app=mc-server-runner --file {{.app}} \
|
||||
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||
--var version=1.8.0 --var app=mc-server-runner --file {{.app}} \
|
||||
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||
|
||||
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
||||
--var version=0.1.1 --var app=maven-metadata-release --file {{.app}} \
|
||||
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||
--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
|
||||
|
||||
COPY mcstatus /usr/local/bin
|
||||
ARG MC_HELPER_VERSION=1.16.0
|
||||
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 \
|
||||
| tar -C /usr/share -zxf - \
|
||||
&& ln -s /usr/share/mc-image-helper-${MC_HELPER_VERSION}/bin/mc-image-helper /usr/bin
|
||||
|
||||
VOLUME ["/data"]
|
||||
COPY server.properties /tmp/server.properties
|
||||
COPY log4j2.xml /tmp/log4j2.xml
|
||||
WORKDIR /data
|
||||
|
||||
ENTRYPOINT [ "/start" ]
|
||||
STOPSIGNAL SIGTERM
|
||||
|
||||
ENV UID=1000 GID=1000 \
|
||||
JVM_XX_OPTS="-XX:+UseG1GC" MEMORY="1G" \
|
||||
TYPE=VANILLA VERSION=LATEST FORGEVERSION=RECOMMENDED SPONGEBRANCH=STABLE SPONGEVERSION= FABRICVERSION=LATEST LEVEL=world \
|
||||
PVP=true DIFFICULTY=easy ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \
|
||||
RESOURCE_PACK= RESOURCE_PACK_SHA1= \
|
||||
LEVEL_TYPE=DEFAULT GENERATOR_SETTINGS= WORLD= MODPACK= MODS= SERVER_PORT=25565 ONLINE_MODE=TRUE CONSOLE=true SERVER_NAME="Dedicated Server" \
|
||||
REPLACE_ENV_VARIABLES="FALSE" ENV_VARIABLE_PREFIX="CFG_"
|
||||
MEMORY="1G" \
|
||||
TYPE=VANILLA VERSION=LATEST \
|
||||
ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \
|
||||
ENABLE_AUTOPAUSE=false AUTOPAUSE_TIMEOUT_EST=3600 AUTOPAUSE_TIMEOUT_KN=120 AUTOPAUSE_TIMEOUT_INIT=600 \
|
||||
AUTOPAUSE_PERIOD=10 AUTOPAUSE_KNOCK_INTERFACE=eth0 \
|
||||
ENABLE_AUTOSTOP=false AUTOSTOP_TIMEOUT_EST=3600 AUTOSTOP_TIMEOUT_INIT=1800 AUTOSTOP_PERIOD=10
|
||||
|
||||
COPY start* /
|
||||
RUN dos2unix /start* && chmod +x /start*
|
||||
COPY --chmod=755 scripts/start* /
|
||||
COPY --chmod=755 bin/ /usr/local/bin/
|
||||
COPY --chmod=755 bin/mc-health /health.sh
|
||||
COPY --chmod=644 files/server.properties /tmp/server.properties
|
||||
COPY --chmod=644 files/log4j2.xml /tmp/log4j2.xml
|
||||
COPY --chmod=755 files/autopause /autopause
|
||||
COPY --chmod=755 files/autostop /autostop
|
||||
|
||||
RUN dos2unix /start* /autopause/* /autostop/*
|
||||
|
||||
ENTRYPOINT [ "/start" ]
|
||||
HEALTHCHECK --start-period=1m CMD mc-health
|
||||
|
||||
18
bin/mc-health
Executable file
18
bin/mc-health
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
# shellcheck source=../scripts/start-utils
|
||||
. "${SCRIPTS:-/}start-utils"
|
||||
if [ -f /data/.mc-health.env ]; then
|
||||
. /data/.mc-health.env
|
||||
fi
|
||||
|
||||
if isTrue "${DISABLE_HEALTHCHECK}"; then
|
||||
echo "Healthcheck disabled"
|
||||
exit 0
|
||||
elif isTrue "${ENABLE_AUTOPAUSE}" && [[ "$( ps -ax -o stat,comm | grep 'java' | awk '{ print $1 }')" =~ ^T.*$ ]]; then
|
||||
echo "Java process suspended by Autopause function"
|
||||
exit 0
|
||||
else
|
||||
mc-monitor status "${MC_HEALTH_EXTRA_ARGS[@]}" --host localhost --port "${SERVER_PORT:-25565}"
|
||||
exit $?
|
||||
fi
|
||||
15
bin/mc-send-to-console
Executable file
15
bin/mc-send-to-console
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
: "${CONSOLE_IN_NAMED_PIPE:=/tmp/minecraft-console-in}"
|
||||
|
||||
if [ $# = 0 ]; then
|
||||
echo "ERROR: pass console commands as arguments"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -p "${CONSOLE_IN_NAMED_PIPE}" ]; then
|
||||
echo "ERROR: named pipe ${CONSOLE_IN_NAMED_PIPE} is missing"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
gosu minecraft bash -c "echo $* > '${CONSOLE_IN_NAMED_PIPE:-/tmp/minecraft-console-in}'"
|
||||
@@ -1,18 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
manifest="itzg/minecraft-server:multiarch"
|
||||
|
||||
for t in latest rpi3 aarch64; do
|
||||
docker pull itzg/minecraft-server:$t
|
||||
done
|
||||
|
||||
docker manifest create --amend ${manifest} \
|
||||
itzg/minecraft-server:aarch64 \
|
||||
itzg/minecraft-server:latest \
|
||||
itzg/minecraft-server:rpi3
|
||||
|
||||
docker manifest annotate --os linux --arch amd64 ${manifest} itzg/minecraft-server:latest
|
||||
docker manifest annotate --os linux --arch arm64 ${manifest} itzg/minecraft-server:aarch64
|
||||
docker manifest annotate --os linux --arch arm --variant v7 ${manifest} itzg/minecraft-server:rpi3
|
||||
|
||||
docker manifest push ${manifest}
|
||||
@@ -1,28 +0,0 @@
|
||||
version: '3'
|
||||
# Other docker-compose examples in /examples
|
||||
|
||||
services:
|
||||
minecraft:
|
||||
image: itzg/minecraft-server
|
||||
ports:
|
||||
- "25565:25565"
|
||||
volumes:
|
||||
- "mc:/data"
|
||||
environment:
|
||||
EULA: "TRUE"
|
||||
CONSOLE: "false"
|
||||
ENABLE_RCON: "true"
|
||||
RCON_PASSWORD: "testing"
|
||||
RCON_PORT: 28016
|
||||
restart: always
|
||||
rcon:
|
||||
image: itzg/rcon
|
||||
ports:
|
||||
- "4326:4326"
|
||||
- "4327:4327"
|
||||
volumes:
|
||||
- "rcon:/opt/rcon-web-admin/db"
|
||||
|
||||
volumes:
|
||||
mc:
|
||||
rcon:
|
||||
@@ -1,7 +1,15 @@
|
||||
#!/bin/bash
|
||||
#set -x
|
||||
# Use this variable to indicate a list of branches that docker hub is watching
|
||||
branches_list=('openj9' 'openj9-nightly' 'adopt11' 'adopt13' 'multiarch' 'armv7')
|
||||
branches_list=(
|
||||
'java8'
|
||||
'java8-multiarch'
|
||||
'java8-openj9'
|
||||
'java11'
|
||||
'java11-openj9'
|
||||
'java17'
|
||||
'java17-openj9'
|
||||
)
|
||||
|
||||
function TrapExit {
|
||||
echo "Checking out back in master"
|
||||
@@ -10,12 +18,32 @@ function TrapExit {
|
||||
|
||||
batchMode=false
|
||||
|
||||
while getopts "b" arg
|
||||
while getopts "hbt:s" arg
|
||||
do
|
||||
case $arg in
|
||||
b)
|
||||
batchMode=true
|
||||
;;
|
||||
t)
|
||||
tag=${OPTARG}
|
||||
;;
|
||||
s)
|
||||
tagArgs="-s -m 'Signed during docker-versions-create"
|
||||
;;
|
||||
h)
|
||||
echo "
|
||||
Usage $0 [options]
|
||||
|
||||
Options:
|
||||
-b enable batch mode, which avoids interactive prompts and causes script to fail immediately
|
||||
when any merge fails
|
||||
-t TAG tag and push the current revision on master with the given tag
|
||||
and apply respective tags to each branch
|
||||
-s enable signed tags
|
||||
-h display this help and exit
|
||||
"
|
||||
exit
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported arg $arg"
|
||||
exit 2
|
||||
@@ -34,6 +62,10 @@ test -d ./.git || { echo ".git folder was not found. Please start this script fr
|
||||
git checkout master
|
||||
git pull --all || { echo "Can't pull the repo!"; \
|
||||
exit 1; }
|
||||
if [[ $tag ]]; then
|
||||
git tag $tag
|
||||
git push origin $tag
|
||||
fi
|
||||
|
||||
git_branches=$(git branch -a)
|
||||
|
||||
@@ -57,6 +89,10 @@ for branch in "${branches_list[@]}"; do
|
||||
git commit -m "Auto merge branch with master" -a
|
||||
# push may fail if remote doesn't have this branch yet. In this case - sending branch
|
||||
git push || git push -u origin "$branch" || { echo "Can't push changes to the origin."; exit 1; }
|
||||
if [[ $tag ]]; then
|
||||
git tag "$tag-$branch"
|
||||
git push origin "$tag-$branch"
|
||||
fi
|
||||
elif ${batchMode}; then
|
||||
status=$?
|
||||
echo "Git merge failed in batch mode"
|
||||
@@ -94,3 +130,28 @@ EOL
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
if [[ $tag ]]; then
|
||||
if [ -f "$HOME/.github.env" ]; then
|
||||
source "$HOME/.github.env"
|
||||
if [[ $GITHUB_TOKEN ]]
|
||||
then
|
||||
auth=(-u ":$GITHUB_TOKEN")
|
||||
base=https://api.github.com
|
||||
: "${owner:=itzg}"
|
||||
: "${repo:=docker-minecraft-server}"
|
||||
read -r -d '' releaseBody << EOF
|
||||
{
|
||||
"tag_name": "$tag",
|
||||
"name": "$tag",
|
||||
"generate_release_notes": true
|
||||
}
|
||||
EOF
|
||||
if ! curl "${auth[@]}" -H "Accept: application/vnd.github.v3+json" \
|
||||
"${base}/repos/${owner}/${repo}/releases" -d "$releaseBody"; then
|
||||
echo "ERROR failed to create github release $tag"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
0
docs/.gitkeep
Normal file
0
docs/.gitkeep
Normal file
BIN
docs/level-vs-world.drawio.png
Normal file
BIN
docs/level-vs-world.drawio.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 32 KiB |
BIN
docs/motd-example.png
Normal file
BIN
docs/motd-example.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 985 B |
BIN
docs/start-script-flow.drawio.png
Normal file
BIN
docs/start-script-flow.drawio.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 34 KiB |
BIN
docs/world-copy-compose-project.drawio.png
Normal file
BIN
docs/world-copy-compose-project.drawio.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 65 KiB |
1
examples/.gitignore
vendored
Normal file
1
examples/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/data/
|
||||
21
examples/docker-compose-autopause.yml
Normal file
21
examples/docker-compose-autopause.yml
Normal file
@@ -0,0 +1,21 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
minecraft:
|
||||
image: itzg/minecraft-server
|
||||
ports:
|
||||
- "25565:25565"
|
||||
volumes:
|
||||
- "mc:/data"
|
||||
environment:
|
||||
EULA: "TRUE"
|
||||
ENABLE_AUTOPAUSE: "TRUE"
|
||||
OVERRIDE_SERVER_PROPERTIES: "TRUE"
|
||||
MAX_TICK_TIME: "-1"
|
||||
# More aggressive settings for demo purposes
|
||||
AUTOPAUSE_TIMEOUT_INIT: "30"
|
||||
AUTOPAUSE_TIMEOUT_EST: "10"
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
mc: {}
|
||||
20
examples/docker-compose-autostop.yml
Normal file
20
examples/docker-compose-autostop.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
minecraft:
|
||||
image: itzg/minecraft-server
|
||||
ports:
|
||||
- "25565:25565"
|
||||
volumes:
|
||||
- "mc:/data"
|
||||
environment:
|
||||
EULA: "TRUE"
|
||||
ENABLE_AUTOSTOP: "TRUE"
|
||||
# More aggressive settings for demo purposes
|
||||
AUTOSTOP_TIMEOUT_INIT: "30"
|
||||
AUTOSTOP_TIMEOUT_EST: "20"
|
||||
# Important not to auto-restart the server!!!
|
||||
restart: "no"
|
||||
|
||||
volumes:
|
||||
mc: {}
|
||||
@@ -1,4 +1,4 @@
|
||||
version: '3'
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
minecraft:
|
||||
|
||||
@@ -1,11 +1,19 @@
|
||||
version: '3.2'
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
mc:
|
||||
image: itzg/minecraft-server
|
||||
image: itzg/minecraft-server:${IMAGE_TAG:-java8}
|
||||
volumes:
|
||||
- ./modpacks:/modpacks:ro
|
||||
- data:/data
|
||||
environment:
|
||||
EULA: "true"
|
||||
TYPE: FTB
|
||||
FTB_SERVER_MOD: https://minecraft.curseforge.com/projects/all-the-mods-expert-remastered/files/2493900/download
|
||||
TYPE: CURSEFORGE
|
||||
CF_SERVER_MOD: https://media.forgecdn.net/files/3482/169/Valhelsia+3-3.4.4-SERVER.zip
|
||||
# CF_SERVER_MOD: https://media.forgecdn.net/files/3012/800/SkyFactory-4_Server_4.2.2.zip
|
||||
# CF_SERVER_MOD: /modpacks/${MODPACK:-SkyFactory_4_Server_4.1.0.zip}
|
||||
ports:
|
||||
- 25565:25565
|
||||
- "25565:25565"
|
||||
|
||||
volumes:
|
||||
data: {}
|
||||
@@ -1,20 +0,0 @@
|
||||
version: "3.7"
|
||||
|
||||
services:
|
||||
mc:
|
||||
image: itzg/minecraft-server
|
||||
ports:
|
||||
- 25565:25565
|
||||
volumes:
|
||||
# Attach .../Curse/Minecraft/Instances for use at /instances
|
||||
- ./Instances:/instances:ro
|
||||
# Attach /data as usual
|
||||
- ./ServerData:/data
|
||||
environment:
|
||||
EULA: "TRUE"
|
||||
# Modpacks generally need more memory, so let's give at 2 GB
|
||||
MEMORY: 2G
|
||||
# Use new CURSE_INSTANCE type
|
||||
TYPE: CURSE_INSTANCE
|
||||
# Reference directory of or full path to minecraftinstance.json
|
||||
CURSE_INSTANCE_JSON: /instances/FTB Presents SkyFactory 3
|
||||
15
examples/docker-compose-fabric.yml
Normal file
15
examples/docker-compose-fabric.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
version: "3"
|
||||
|
||||
services:
|
||||
mc:
|
||||
image: ${IMAGE:-itzg/minecraft-server}
|
||||
environment:
|
||||
EULA: "true"
|
||||
TYPE: FABRIC
|
||||
ports:
|
||||
- 25565:25565
|
||||
volumes:
|
||||
- fabric:/data
|
||||
|
||||
volumes:
|
||||
fabric: {}
|
||||
24
examples/docker-compose-forge.yml
Normal file
24
examples/docker-compose-forge.yml
Normal file
@@ -0,0 +1,24 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
mc:
|
||||
image: itzg/minecraft-server
|
||||
ports:
|
||||
# expose the Minecraft server port outside of container
|
||||
- "25565:25565"
|
||||
environment:
|
||||
# REQUIRED for all types
|
||||
EULA: "TRUE"
|
||||
# Set server type (vs the default of vanilla)
|
||||
TYPE: FORGE
|
||||
DEBUG: "true"
|
||||
volumes:
|
||||
# use a named, managed volume for data volume
|
||||
- mc_forge:/data
|
||||
# attach local host directory "mods" in same directory as this compose file
|
||||
# all mods in this directory get copied into /data/mods at startup
|
||||
- ./mods:/mods:ro
|
||||
|
||||
volumes:
|
||||
# declared the named volume, but use default/local storage engine
|
||||
mc_forge: {}
|
||||
@@ -1,16 +0,0 @@
|
||||
version: '3.2'
|
||||
|
||||
services:
|
||||
mc:
|
||||
image: itzg/minecraft-server
|
||||
environment:
|
||||
EULA: "true"
|
||||
TYPE: FTB
|
||||
FTB_SERVER_MOD: https://www.feed-the-beast.com/projects/ftb-presents-skyfactory-3/files/2481284
|
||||
ports:
|
||||
- 25565:25565
|
||||
volumes:
|
||||
- mc-ftb:/data
|
||||
|
||||
volumes:
|
||||
mc-ftb:
|
||||
24
examples/docker-compose-ftba.yml
Normal file
24
examples/docker-compose-ftba.yml
Normal file
@@ -0,0 +1,24 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
mc:
|
||||
# FTBA support is only available in non-Alpine images
|
||||
image: itzg/minecraft-server:${IMAGE_TAG:-java8-multiarch}
|
||||
ports:
|
||||
# expose the Minecraft server port outside of container
|
||||
- 25565:25565
|
||||
environment:
|
||||
# REQUIRED for all types
|
||||
EULA: "TRUE"
|
||||
# Set server type (vs the default of vanilla)
|
||||
TYPE: FTBA
|
||||
# Use Pack ID from https://ftb.neptunepowered.org/pack/ftb-presents-direwolf20-1-12/
|
||||
FTB_MODPACK_ID: "31"
|
||||
FTB_MODPACK_VERSION_ID: ""
|
||||
volumes:
|
||||
# use a named, managed volume for data volume
|
||||
- ftba:/data
|
||||
|
||||
volumes:
|
||||
# declared the named volume, but use default/local storage engine
|
||||
ftba: {}
|
||||
21
examples/docker-compose-generic-pack.yml
Normal file
21
examples/docker-compose-generic-pack.yml
Normal file
@@ -0,0 +1,21 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
mc:
|
||||
image: itzg/minecraft-server:${IMAGE_TAG:-latest}
|
||||
volumes:
|
||||
- data:/data
|
||||
- ./modpacks:/modpacks:ro
|
||||
environment:
|
||||
EULA: "true"
|
||||
TYPE: FORGE
|
||||
DEBUG: "${DEBUG:-false}"
|
||||
VERSION: ${VERSION:-1.17.1}
|
||||
FORGEVERSION: ${FORGEVERSION:-37.0.90}
|
||||
GENERIC_PACK: /modpacks/${MODPACK:-Server-Files-0.0.21.zip}
|
||||
REMOVE_OLD_MODS: "${REMOVE_OLD_MODS:-false}"
|
||||
ports:
|
||||
- "25565:25565"
|
||||
|
||||
volumes:
|
||||
data: {}
|
||||
19
examples/docker-compose-mods-file.yml
Normal file
19
examples/docker-compose-mods-file.yml
Normal file
@@ -0,0 +1,19 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
mc:
|
||||
image: itzg/minecraft-server
|
||||
environment:
|
||||
EULA: "true"
|
||||
TYPE: FORGE
|
||||
VERSION: 1.15.2
|
||||
MODS_FILE: /extras/mods.txt
|
||||
REMOVE_OLD_MODS: "true"
|
||||
ports:
|
||||
- 25565:25565
|
||||
volumes:
|
||||
- data:/data
|
||||
- ./mods.txt:/extras/mods.txt:ro
|
||||
|
||||
volumes:
|
||||
data:
|
||||
17
examples/docker-compose-mohist.yml
Normal file
17
examples/docker-compose-mohist.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
mc:
|
||||
image: itzg/minecraft-server
|
||||
ports:
|
||||
- "25565:25565"
|
||||
environment:
|
||||
EULA: "TRUE"
|
||||
TYPE: MOHIST
|
||||
VERSION: 1.12.2
|
||||
DEBUG: "true"
|
||||
volumes:
|
||||
- data:/data
|
||||
|
||||
volumes:
|
||||
data: {}
|
||||
@@ -1,17 +1,19 @@
|
||||
version: '3.7'
|
||||
|
||||
version: '3.8'
|
||||
services:
|
||||
mc:
|
||||
image: itzg/minecraft-server
|
||||
container_name: paper
|
||||
environment:
|
||||
EULA: "true"
|
||||
ENABLE_RCON: "true"
|
||||
TYPE: PAPER
|
||||
VERSION: 1.9.4
|
||||
command: --noconsole
|
||||
VIEW_DISTANCE: 10
|
||||
MEMORY: 2G
|
||||
CONSOLE: "false"
|
||||
ports:
|
||||
- 25565:25565
|
||||
volumes:
|
||||
- mc-paper:/data
|
||||
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
mc-paper:
|
||||
mc-paper:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
version: '3'
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
mc:
|
||||
|
||||
27
examples/docker-compose-rlcraft.yml
Normal file
27
examples/docker-compose-rlcraft.yml
Normal file
@@ -0,0 +1,27 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
rlcraft:
|
||||
image: itzg/minecraft-server:java8
|
||||
container_name: rlcraft
|
||||
volumes:
|
||||
- rlcraft-modpack:/modpacks:ro
|
||||
- rlcraft-data:/data
|
||||
environment:
|
||||
EULA: "true"
|
||||
TYPE: "FORGE"
|
||||
VERSION: "1.12.2"
|
||||
FORGEVERSION: "14.23.5.2855"
|
||||
DIFFICULTY: "hard"
|
||||
MAX_TICK_TIME: "-1"
|
||||
VIEW_DISTANCE: "6"
|
||||
ALLOW_FLIGHT: "true"
|
||||
MEMORY: "4G"
|
||||
GENERIC_PACK: "/modpacks/RLCraft_Server_Pack_1.12.2_Beta_v2.8.2.zip"
|
||||
ports:
|
||||
- 25565:25565
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
rlcraft-data:
|
||||
rlcraft-modpack:
|
||||
12
examples/docker-compose-simple.yml
Normal file
12
examples/docker-compose-simple.yml
Normal file
@@ -0,0 +1,12 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
mc:
|
||||
image: itzg/minecraft-server
|
||||
ports:
|
||||
- 25565:25565
|
||||
environment:
|
||||
EULA: "TRUE"
|
||||
volumes:
|
||||
# attach the relative directory 'data' to the container's /data path
|
||||
- ./data:/data
|
||||
17
examples/docker-compose-spiget.yml
Normal file
17
examples/docker-compose-spiget.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
version: "3"
|
||||
|
||||
services:
|
||||
mc:
|
||||
# Only using IMAGE variable to allow for local testing
|
||||
image: ${IMAGE:-itzg/minecraft-server}
|
||||
ports:
|
||||
- 25565:25565
|
||||
environment:
|
||||
EULA: "TRUE"
|
||||
TYPE: SPIGOT
|
||||
SPIGET_RESOURCES: 9089,34315,3836
|
||||
volumes:
|
||||
- data:/data
|
||||
|
||||
volumes:
|
||||
data: {}
|
||||
@@ -1,11 +1,11 @@
|
||||
version: '3'
|
||||
version: '3.8'
|
||||
# Forge with Sponge API support. THIS REQUIRES DOWNLOADING SPONGEFORGE.
|
||||
# Place the SpongeForge jar file in /data/mods. Other Forge mods go here as well.
|
||||
# Place Sponge mods in /data/mods/plugins. Yes, this is a directory inside the Forge mod directory. Do NOT use /data/plugins.
|
||||
|
||||
services:
|
||||
minecraft:
|
||||
image: itzg/minecraft-server
|
||||
image: itzg/minecraft-server:java8
|
||||
ports:
|
||||
- "25565:25565"
|
||||
volumes:
|
||||
|
||||
11
examples/docker-compose-world-download.yml
Normal file
11
examples/docker-compose-world-download.yml
Normal file
@@ -0,0 +1,11 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
mc:
|
||||
image: itzg/minecraft-server
|
||||
ports:
|
||||
- 25565:25565
|
||||
environment:
|
||||
EULA: "TRUE"
|
||||
VERSION: 1.7.2
|
||||
WORLD: https://www.minecraftmaps.com/survival-maps/cube-survival/download
|
||||
16
examples/docker-compose.yml
Normal file
16
examples/docker-compose.yml
Normal file
@@ -0,0 +1,16 @@
|
||||
version: '3'
|
||||
# Other docker-compose examples in /examples
|
||||
|
||||
services:
|
||||
minecraft:
|
||||
image: itzg/minecraft-server
|
||||
ports:
|
||||
- "25565:25565"
|
||||
volumes:
|
||||
- "mc:/data"
|
||||
environment:
|
||||
EULA: "TRUE"
|
||||
restart: always
|
||||
|
||||
volumes:
|
||||
mc: {}
|
||||
@@ -3,18 +3,18 @@ apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
labels:
|
||||
app: example
|
||||
name: example
|
||||
app: mc-example
|
||||
name: mc-example
|
||||
spec:
|
||||
replicas: 1
|
||||
serviceName: example
|
||||
serviceName: mc-example
|
||||
selector:
|
||||
matchLabels:
|
||||
app: example
|
||||
app: mc-example
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: example
|
||||
app: mc-example
|
||||
spec:
|
||||
containers:
|
||||
- name: mc
|
||||
@@ -25,6 +25,18 @@ spec:
|
||||
volumeMounts:
|
||||
- mountPath: /data
|
||||
name: data
|
||||
readinessProbe:
|
||||
exec:
|
||||
command:
|
||||
- mc-monitor
|
||||
- status
|
||||
- --host
|
||||
- localhost
|
||||
- --port
|
||||
- "25565"
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 5
|
||||
failureThreshold: 18
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: data
|
||||
@@ -39,12 +51,12 @@ apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
labels:
|
||||
service: example
|
||||
name: example
|
||||
service: mc-example
|
||||
name: mc-example
|
||||
spec:
|
||||
ports:
|
||||
- port: 25565
|
||||
targetPort: 25565
|
||||
selector:
|
||||
app: example
|
||||
type: LoadBalancer
|
||||
app: mc-example
|
||||
type: NodePort
|
||||
|
||||
1
examples/modpacks/.gitignore
vendored
Normal file
1
examples/modpacks/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
*.zip
|
||||
3
examples/modpacks/README.md
Normal file
3
examples/modpacks/README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
Place server [modpacks downloaded from CurseForge](https://www.curseforge.com/minecraft/modpacks) in this directory.
|
||||
|
||||
The example [`docker-compose-curseforge.yml`](../docker-compose-curseforge.yml) references a modpack downloaded from <https://www.curseforge.com/minecraft/modpacks/skyfactory-4/files/3012800>.
|
||||
80
examples/mods.txt
Normal file
80
examples/mods.txt
Normal file
@@ -0,0 +1,80 @@
|
||||
https://edge.forgecdn.net/files/2965/233/Bookshelf-1.15.2-5.6.40.jar
|
||||
https://edge.forgecdn.net/files/2926/27/ProgressiveBosses-2.1.5-mc1.15.2.jar
|
||||
https://edge.forgecdn.net/files/3248/905/goblintraders-1.3.1-1.15.2.jar
|
||||
https://edge.forgecdn.net/files/3272/32/jei-1.15.2-6.0.3.16.jar
|
||||
https://edge.forgecdn.net/files/2871/647/ToastControl-1.15.2-3.0.1.jar
|
||||
https://edge.forgecdn.net/files/3101/903/Druidcraft-1.15-0.4.45.jar
|
||||
https://edge.forgecdn.net/files/2880/426/DefaultOptions_1.15.2-11.0.1.jar
|
||||
https://edge.forgecdn.net/files/2996/535/MekanismAdditions-1.15.2-9.10.9.422.jar
|
||||
https://edge.forgecdn.net/files/3147/275/blockcarpentry-1.15-0.8.2.jar
|
||||
https://edge.forgecdn.net/files/3005/715/refinedstorageaddons-0.6.3.jar
|
||||
https://edge.forgecdn.net/files/3140/146/rftoolsbase-1.15-1.1.10.jar
|
||||
https://edge.forgecdn.net/files/3236/649/cc-tweaked-1.15.2-1.95.3.jar
|
||||
https://edge.forgecdn.net/files/3048/970/light-overlay-4.7.2.jar
|
||||
https://edge.forgecdn.net/files/3015/904/randompatches-1.15.2-1.22.1.1.jar
|
||||
https://edge.forgecdn.net/files/3131/439/engineersdecor-1.15.2-1.1.4.jar
|
||||
https://edge.forgecdn.net/files/3051/255/carryon-1.15.2-1.13.0.5.jar
|
||||
https://edge.forgecdn.net/files/3175/752/EnderStorage-1.15.2-2.5.2.164-universal.jar
|
||||
https://edge.forgecdn.net/files/2997/84/Savage-and-Ravage-1.15.2-1.1.4.jar
|
||||
https://edge.forgecdn.net/files/3053/840/PackMenu-1.15.2-1.2.8.jar
|
||||
https://edge.forgecdn.net/files/3003/397/JEITweaker-1.15.2-1.0.1.3.jar
|
||||
https://edge.forgecdn.net/files/3069/489/absentbydesign-1.15.2-1.1.1.jar
|
||||
https://edge.forgecdn.net/files/2997/601/Upgrade-Aquatic-1.15.2-1.7.1.jar
|
||||
https://edge.forgecdn.net/files/2950/766/ReAuth-1.14-1.15-3.8.1.jar
|
||||
https://edge.forgecdn.net/files/3024/179/Powah-1.15.2-1.1.15.jar
|
||||
https://edge.forgecdn.net/files/3092/975/StorageDrawers-1.15.2-7.0.3.jar
|
||||
https://edge.forgecdn.net/files/2853/267/furniture-7.0.0-pre16-1.15.1.jar
|
||||
https://edge.forgecdn.net/files/2987/251/AppleSkin-mc1.15.2-forge-1.0.14.jar
|
||||
https://edge.forgecdn.net/files/2980/323/industrial-foregoing-1.15.2-2.3.3-e356e61.jar
|
||||
https://edge.forgecdn.net/files/3024/178/Lollipop-1.15.2-1.0.16.jar
|
||||
https://edge.forgecdn.net/files/3210/106/tablechair-1.4.jar
|
||||
https://edge.forgecdn.net/files/3047/358/xercapaint-1.15.2-3.3.jar
|
||||
https://edge.forgecdn.net/files/2873/657/BonsaiTrees-2.1.2.6.jar
|
||||
https://edge.forgecdn.net/files/2938/583/config-2-3.0.jar
|
||||
https://edge.forgecdn.net/files/2991/235/Waystones_1.15.2-6.0.2.jar
|
||||
https://edge.forgecdn.net/files/2957/23/OpenLoader-1.15.2-4.0.5.jar
|
||||
https://edge.forgecdn.net/files/3275/718/XaerosWorldMap_1.13.2_Forge_1.15.2.jar
|
||||
https://edge.forgecdn.net/files/2876/104/AI-Improvements-1.15.2-0.3.0.jar
|
||||
https://edge.forgecdn.net/files/3005/515/mysticallib-1.15.2-2.0.1.jar
|
||||
https://edge.forgecdn.net/files/3008/867/WAWLA-1.15.2-3.0.4.jar
|
||||
https://edge.forgecdn.net/files/2964/474/WailaHarvestability-mc1.15.2-1.1.12.jar
|
||||
https://edge.forgecdn.net/files/3103/508/Kiwi-1.15.2-2.8.5.jar
|
||||
https://edge.forgecdn.net/files/3128/662/Atum-1.15.2-2.1.12.jar
|
||||
https://edge.forgecdn.net/files/2988/910/Buzzier-Bees-1.15.2-1.5.2.jar
|
||||
https://edge.forgecdn.net/files/3030/627/u_team_core-1.15.2-3.0.2.169.jar
|
||||
https://edge.forgecdn.net/files/3003/984/SilentLib-1.15.2-4.6.6+59.jar
|
||||
https://edge.forgecdn.net/files/2968/353/refinedpipes-0.4.2.jar
|
||||
https://edge.forgecdn.net/files/3140/149/rftoolsbuilder-1.15-2.1.16.jar
|
||||
https://edge.forgecdn.net/files/3067/203/mightyarchitect-mc1.15.2_v0.5.jar
|
||||
https://edge.forgecdn.net/files/2980/153/EquipmentTooltips-1.15.2-1.4.3+14.jar
|
||||
https://edge.forgecdn.net/files/3103/510/FruitTrees-1.15.2-1.7.0.jar
|
||||
https://edge.forgecdn.net/files/2989/38/Atmospheric-1.15.2-1.4.1.jar
|
||||
https://edge.forgecdn.net/files/3096/836/rftoolscontrol-1.15-3.0.9.jar
|
||||
https://edge.forgecdn.net/files/2989/662/Enhanced-Mushrooms-1.15.2-v1.2.2.jar
|
||||
https://edge.forgecdn.net/files/3227/891/SimpleStorageNetwork-1.15.2-1.0.2.jar
|
||||
https://edge.forgecdn.net/files/3217/290/minecolonies-0.13.645-RELEASE-universal.jar
|
||||
https://edge.forgecdn.net/files/2935/384/SnowRealMagic-1.15.2-1.7.5.jar
|
||||
https://edge.forgecdn.net/files/2988/584/aiotbotania-1.15.2-1.2.3.jar
|
||||
https://edge.forgecdn.net/files/3255/408/mowziesmobs-1.5.15.jar
|
||||
https://edge.forgecdn.net/files/3062/510/HealthOverlay-1.15.2-1.0.2.jar
|
||||
https://edge.forgecdn.net/files/3023/121/neoncraft-1.1.jar
|
||||
https://edge.forgecdn.net/files/2997/617/Swamp-Expansion-1.15.2-1.7.3.jar
|
||||
https://edge.forgecdn.net/files/2980/252/titanium-1.15.2-2.4.2.jar
|
||||
https://edge.forgecdn.net/files/3152/946/rftoolsutility-1.15-2.1.20.jar
|
||||
https://edge.forgecdn.net/files/3083/277/swingthroughgrass-1.15.2-1.4.1.jar
|
||||
https://edge.forgecdn.net/files/3138/530/SilentGear-1.15.2-1.11.4+187.jar
|
||||
https://edge.forgecdn.net/files/3105/429/DarkUtilities-1.15.2-3.1.9.jar
|
||||
https://edge.forgecdn.net/files/3099/23/ImmersiveEngineering-1.15.2-4.1.1-125.jar
|
||||
https://edge.forgecdn.net/files/2856/529/FastFurnace-1.15.1-3.0.0.jar
|
||||
https://edge.forgecdn.net/files/2988/999/BiomesOPlenty-1.15.2-10.0.0.366-universal.jar
|
||||
https://edge.forgecdn.net/files/2989/95/The-Endergetic-Expansion-1.15.2-v1.3.2.jar
|
||||
https://edge.forgecdn.net/files/2993/960/FluxNetworks-1.15.2-5.0.3-4.jar
|
||||
https://edge.forgecdn.net/files/3028/611/ServerTabInfo-1.15.2-1.2.8.jar
|
||||
https://edge.forgecdn.net/files/3134/277/fairylights-3.0.15-1.15.2.jar
|
||||
https://edge.forgecdn.net/files/3048/54/useful_backpacks-1.15.2-1.10.3.77.jar
|
||||
https://edge.forgecdn.net/files/3273/515/mcw-trapdoors-1.0.2-mc1.15.2.jar
|
||||
https://edge.forgecdn.net/files/2986/639/CraftingTweaks_1.15.2-11.0.1.jar
|
||||
https://edge.forgecdn.net/files/3261/454/create-mc1.15.2_v0.3.1a.jar
|
||||
https://edge.forgecdn.net/files/3211/10/supermartijn642configlib-1.0.5-mc1.15.jar
|
||||
https://edge.forgecdn.net/files/2995/786/TerraForged-1.15.2-0.0.15.jar
|
||||
https://edge.forgecdn.net/files/2892/562/leavesdecayonotherleaves-1.1.jar
|
||||
27
examples/vanilla-tweaks/docker-compose.yml
Normal file
27
examples/vanilla-tweaks/docker-compose.yml
Normal file
@@ -0,0 +1,27 @@
|
||||
version: "3.3"
|
||||
|
||||
services:
|
||||
vanillatweaks_file:
|
||||
restart: "no"
|
||||
image: itzg/minecraft-server
|
||||
ports:
|
||||
- "25565:25565/tcp"
|
||||
environment:
|
||||
EULA: "TRUE"
|
||||
VERSION: ${MINECRAFT_VERSION:-LATEST}
|
||||
VANILLATWEAKS_FILE: /config/vanillatweaks-datapacks.json
|
||||
REMOVE_OLD_VANILLATWEAKS: "TRUE"
|
||||
volumes:
|
||||
- data:/data
|
||||
- ./vanillatweaks-datapacks.json:/config/vanillatweaks-datapacks.json:ro
|
||||
vanillatweaks_sharecode:
|
||||
# port is set to 25566 to not conflict with vanillatweaks_file example
|
||||
ports:
|
||||
- "25566:25565/tcp"
|
||||
restart: "no"
|
||||
image: itzg/minecraft-server
|
||||
environment:
|
||||
EULA: "TRUE"
|
||||
VERSION: ${MINECRAFT_VERSION:-LATEST}
|
||||
VANILLATWEAKS_SHARECODE: MGr52E
|
||||
REMOVE_OLD_VANILLATWEAKS: "TRUE"
|
||||
15
examples/vanilla-tweaks/vanillatweaks-datapacks.json
Normal file
15
examples/vanilla-tweaks/vanillatweaks-datapacks.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"version": "1.18",
|
||||
"packs": {
|
||||
"survival": [
|
||||
"graves",
|
||||
"multiplayer sleep",
|
||||
"afk display",
|
||||
"armor statues",
|
||||
"unlock all recipes",
|
||||
"fast leaf decay",
|
||||
"coordinates hud"
|
||||
],
|
||||
"items": ["armored elytra"]
|
||||
}
|
||||
}
|
||||
122
files/autopause/autopause-daemon.sh
Executable file
122
files/autopause/autopause-daemon.sh
Executable file
@@ -0,0 +1,122 @@
|
||||
#!/bin/bash
|
||||
|
||||
. /autopause/autopause-fcns.sh
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
|
||||
|
||||
autopause_error_loop() {
|
||||
logAutopause "Available interfaces within the docker container:"
|
||||
INTERFACES=$(echo /sys/class/net/*)
|
||||
INTERFACES=${INTERFACES//\/sys\/class\/net\//}
|
||||
logAutopause " $INTERFACES"
|
||||
logAutopause "Please set the environment variable AUTOPAUSE_KNOCK_INTERFACE to the interface that handles incoming connections."
|
||||
logAutopause "If unsure which interface to choose, run the ifconfig command in the container."
|
||||
logAutopause "Autopause failed to initialize. This log entry will be printed every 30 minutes."
|
||||
while :
|
||||
do
|
||||
sleep 1800
|
||||
logAutopause "Autopause failed to initialize."
|
||||
done
|
||||
}
|
||||
|
||||
# wait for java process to be started
|
||||
while :
|
||||
do
|
||||
if java_process_exists ; then
|
||||
break
|
||||
fi
|
||||
sleep 0.1
|
||||
done
|
||||
|
||||
# check for interface existence
|
||||
if [[ -z "$AUTOPAUSE_KNOCK_INTERFACE" ]] ; then
|
||||
logAutopause "AUTOPAUSE_KNOCK_INTERFACE variable must not be empty!"
|
||||
autopause_error_loop
|
||||
fi
|
||||
if ! [[ -d "/sys/class/net/$AUTOPAUSE_KNOCK_INTERFACE" ]] ; then
|
||||
logAutopause "Selected interface \"$AUTOPAUSE_KNOCK_INTERFACE\" does not exist!"
|
||||
autopause_error_loop
|
||||
fi
|
||||
|
||||
sudo /usr/sbin/knockd -c /tmp/knockd-config.cfg -d -i "$AUTOPAUSE_KNOCK_INTERFACE"
|
||||
if [ $? -ne 0 ] ; then
|
||||
logAutopause "Failed to start knockd daemon."
|
||||
logAutopause "Probable cause: Unable to attach to interface \"$AUTOPAUSE_KNOCK_INTERFACE\"."
|
||||
autopause_error_loop
|
||||
fi
|
||||
|
||||
STATE=INIT
|
||||
|
||||
while :
|
||||
do
|
||||
case X$STATE in
|
||||
XINIT)
|
||||
# Server startup
|
||||
if mc_server_listening ; then
|
||||
TIME_THRESH=$(($(current_uptime)+$AUTOPAUSE_TIMEOUT_INIT))
|
||||
logAutopause "MC Server listening for connections - stopping in $AUTOPAUSE_TIMEOUT_INIT seconds"
|
||||
STATE=K
|
||||
fi
|
||||
;;
|
||||
XK)
|
||||
# Knocked
|
||||
if java_clients_connected ; then
|
||||
logAutopause "Client connected - waiting for disconnect"
|
||||
STATE=E
|
||||
else
|
||||
if [[ $(current_uptime) -ge $TIME_THRESH ]] ; then
|
||||
logAutopause "No client connected since startup / knocked - stopping"
|
||||
/autopause/pause.sh
|
||||
STATE=S
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
XE)
|
||||
# Established
|
||||
if ! java_clients_connected ; then
|
||||
TIME_THRESH=$(($(current_uptime)+$AUTOPAUSE_TIMEOUT_EST))
|
||||
logAutopause "All clients disconnected - stopping in $AUTOPAUSE_TIMEOUT_EST seconds"
|
||||
STATE=I
|
||||
fi
|
||||
;;
|
||||
XI)
|
||||
# Idle
|
||||
if java_clients_connected ; then
|
||||
logAutopause "Client reconnected - waiting for disconnect"
|
||||
STATE=E
|
||||
else
|
||||
if [[ $(current_uptime) -ge $TIME_THRESH ]] ; then
|
||||
logAutopause "No client reconnected - stopping"
|
||||
/autopause/pause.sh
|
||||
STATE=S
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
XS)
|
||||
# Stopped
|
||||
if rcon_client_exists ; then
|
||||
/autopause/resume.sh
|
||||
fi
|
||||
if java_running ; then
|
||||
if java_clients_connected ; then
|
||||
logAutopause "Client connected - waiting for disconnect"
|
||||
STATE=E
|
||||
else
|
||||
TIME_THRESH=$(($(current_uptime)+$AUTOPAUSE_TIMEOUT_KN))
|
||||
logAutopause "Server was knocked - waiting for clients or timeout"
|
||||
STATE=K
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
logAutopause "Error: invalid state: $STATE"
|
||||
;;
|
||||
esac
|
||||
if [[ "$STATE" == "S" ]] ; then
|
||||
# before rcon times out
|
||||
sleep 2
|
||||
else
|
||||
sleep $AUTOPAUSE_PERIOD
|
||||
fi
|
||||
done
|
||||
31
files/autopause/autopause-fcns.sh
Executable file
31
files/autopause/autopause-fcns.sh
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
current_uptime() {
|
||||
awk '{print $1}' /proc/uptime | cut -d . -f 1
|
||||
}
|
||||
|
||||
java_running() {
|
||||
[[ $( ps -ax -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]]
|
||||
}
|
||||
|
||||
java_process_exists() {
|
||||
[[ -n "$(ps -ax -o comm | grep 'java')" ]]
|
||||
}
|
||||
|
||||
rcon_client_exists() {
|
||||
[[ -n "$(ps -ax -o comm | grep 'rcon-cli')" ]]
|
||||
}
|
||||
|
||||
mc_server_listening() {
|
||||
mc-monitor status --host localhost --port "$SERVER_PORT" --timeout 10s >& /dev/null
|
||||
}
|
||||
|
||||
java_clients_connected() {
|
||||
local connections
|
||||
if java_running ; then
|
||||
connections=$(mc-monitor status --host localhost --port "$SERVER_PORT" --show-player-count)
|
||||
else
|
||||
connections=0
|
||||
fi
|
||||
(( connections > 0 ))
|
||||
}
|
||||
15
files/autopause/knockd-config.cfg
Normal file
15
files/autopause/knockd-config.cfg
Normal file
@@ -0,0 +1,15 @@
|
||||
[options]
|
||||
logfile = /dev/null
|
||||
[unpauseMCServer-server]
|
||||
sequence = 25565
|
||||
seq_timeout = 1
|
||||
command = /usr/sbin/gosu minecraft:minecraft /autopause/resume.sh
|
||||
tcpflags = syn
|
||||
[unpauseMCServer-rcon]
|
||||
sequence = 25575
|
||||
seq_timeout = 1
|
||||
command = /usr/sbin/gosu minecraft:minecraft /autopause/resume.sh
|
||||
tcpflags = syn
|
||||
[unpauseMCServer-bedrock]
|
||||
sequence = 19132:udp
|
||||
command = /usr/sbin/gosu minecraft:minecraft /autopause/resume.sh
|
||||
21
files/autopause/pause.sh
Executable file
21
files/autopause/pause.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
. /start-utils
|
||||
|
||||
if [[ $( ps -ax -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]] ; then
|
||||
# save world
|
||||
rcon-cli save-all >/dev/null
|
||||
|
||||
# wait until mc-monitor is no longer connected to the server
|
||||
while :
|
||||
do
|
||||
if [[ -z "$(netstat -nt | grep "127.0.0.1:$SERVER_PORT" | grep 'ESTABLISHED')" ]]; then
|
||||
break
|
||||
fi
|
||||
sleep 0.1
|
||||
done
|
||||
|
||||
# finally pause the process
|
||||
logAutopauseAction "Pausing Java process"
|
||||
pkill -STOP java
|
||||
fi
|
||||
8
files/autopause/resume.sh
Executable file
8
files/autopause/resume.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
. /start-utils
|
||||
|
||||
if [[ $( ps -ax -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^T.*$ ]] ; then
|
||||
logAutopauseAction "Knocked, resuming Java process"
|
||||
pkill -CONT java
|
||||
fi
|
||||
69
files/autostop/autostop-daemon.sh
Executable file
69
files/autostop/autostop-daemon.sh
Executable file
@@ -0,0 +1,69 @@
|
||||
#!/bin/bash
|
||||
|
||||
# needed for the clients connected function residing in autopause
|
||||
. /autopause/autopause-fcns.sh
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
|
||||
# wait for java process to be started
|
||||
while :
|
||||
do
|
||||
if java_process_exists ; then
|
||||
break
|
||||
fi
|
||||
sleep 0.1
|
||||
done
|
||||
|
||||
STATE=INIT
|
||||
|
||||
while :
|
||||
do
|
||||
case X$STATE in
|
||||
XINIT)
|
||||
# Server startup
|
||||
if mc_server_listening ; then
|
||||
TIME_THRESH=$(($(current_uptime)+$AUTOSTOP_TIMEOUT_INIT))
|
||||
logAutostop "MC Server listening for connections - stopping in $AUTOSTOP_TIMEOUT_INIT seconds"
|
||||
STATE=II
|
||||
fi
|
||||
;;
|
||||
XII)
|
||||
# Initial idle
|
||||
if java_clients_connected ; then
|
||||
logAutostop "Client connected - waiting for disconnect"
|
||||
STATE=E
|
||||
else
|
||||
if [[ $(current_uptime) -ge $TIME_THRESH ]] ; then
|
||||
logAutostop "No client connected since startup - stopping server"
|
||||
/autostop/stop.sh
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
XE)
|
||||
# Established
|
||||
if ! java_clients_connected ; then
|
||||
TIME_THRESH=$(($(current_uptime)+$AUTOSTOP_TIMEOUT_EST))
|
||||
logAutostop "All clients disconnected - stopping in $AUTOSTOP_TIMEOUT_EST seconds"
|
||||
STATE=I
|
||||
fi
|
||||
;;
|
||||
XI)
|
||||
# Idle
|
||||
if java_clients_connected ; then
|
||||
logAutostop "Client reconnected - waiting for disconnect"
|
||||
STATE=E
|
||||
else
|
||||
if [[ $(current_uptime) -ge $TIME_THRESH ]] ; then
|
||||
logAutostop "No client reconnected - stopping"
|
||||
/autostop/stop.sh
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
logAutostop "Error: invalid state: $STATE"
|
||||
;;
|
||||
esac
|
||||
sleep $AUTOSTOP_PERIOD
|
||||
done
|
||||
6
files/autostop/stop.sh
Executable file
6
files/autostop/stop.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
. /start-utils
|
||||
|
||||
logAutostopAction "Stopping Java process"
|
||||
kill -SIGTERM 1
|
||||
@@ -4,7 +4,7 @@
|
||||
<Console name="SysOut" target="SYSTEM_OUT">
|
||||
<PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level]: %msg%n" />
|
||||
</Console>
|
||||
<Queue name="ServerGuiConsole">
|
||||
<Queue name="TerminalConsole">
|
||||
<PatternLayout pattern="[%d{HH:mm:ss} %level]: %msg%n" />
|
||||
</Queue>
|
||||
<RollingRandomAccessFile name="File" fileName="logs/latest.log" filePattern="logs/%d{yyyy-MM-dd}-%i.log.gz">
|
||||
@@ -28,7 +28,7 @@
|
||||
</filters>
|
||||
<AppenderRef ref="SysOut"/>
|
||||
<AppenderRef ref="File"/>
|
||||
<AppenderRef ref="ServerGuiConsole"/>
|
||||
<AppenderRef ref="TerminalConsole"/>
|
||||
</Root>
|
||||
</Loggers>
|
||||
</Configuration>
|
||||
@@ -22,6 +22,7 @@ snooper-enabled=true
|
||||
texture-pack=
|
||||
online-mode=true
|
||||
resource-pack=
|
||||
resource-pack-sha1=
|
||||
pvp=true
|
||||
difficulty=1
|
||||
enable-command-block=true
|
||||
@@ -36,3 +37,15 @@ motd=A Minecraft Server powered by Docker
|
||||
generator-settings=
|
||||
rcon.password=
|
||||
max-world-size=29999984
|
||||
broadcast-console-to-ops=true
|
||||
broadcast-rcon-to-ops=true
|
||||
enable-jmx-monitoring=false
|
||||
sync-chunk-writes=true
|
||||
enable-status=true
|
||||
entity-broadcast-range-percentage=100
|
||||
function-permission-level=2
|
||||
network-compression-threshold=256
|
||||
op-permission-level=4
|
||||
prevent-proxy-connections=false
|
||||
use-native-transport=true
|
||||
enforce-whitelist=false
|
||||
2
files/sudoers-mc
Normal file
2
files/sudoers-mc
Normal file
@@ -0,0 +1,2 @@
|
||||
%minecraft ALL=(ALL) NOPASSWD:/usr/bin/pkill
|
||||
%minecraft ALL=(ALL) NOPASSWD:/usr/sbin/knockd
|
||||
@@ -1,4 +0,0 @@
|
||||
# Moved to top-level
|
||||
|
||||
The contents of this directory have now been moved to the top level of
|
||||
[itzg/docker-minecraft-server](https://github.com/itzg/docker-minecraft-server).
|
||||
8
start → scripts/start
Normal file → Executable file
8
start → scripts/start
Normal file → Executable file
@@ -1,11 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
. /start-utils
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
|
||||
umask 0002
|
||||
chmod g+w /data
|
||||
|
||||
if [ $(id -u) = 0 ]; then
|
||||
if ! isTrue "${SKIP_SUDO:-false}" && [ $(id -u) = 0 ]; then
|
||||
runAsUser=minecraft
|
||||
runAsGroup=minecraft
|
||||
|
||||
@@ -40,7 +40,7 @@ if [ $(id -u) = 0 ]; then
|
||||
echo 'hosts: files dns' > /etc/nsswitch.conf
|
||||
fi
|
||||
|
||||
exec su-exec ${runAsUser}:${runAsGroup} /start-configuration $@
|
||||
exec gosu ${runAsUser}:${runAsGroup} ${SCRIPTS:-/}start-configuration "$@"
|
||||
else
|
||||
exec /start-configuration $@
|
||||
exec ${SCRIPTS:-/}start-configuration "$@"
|
||||
fi
|
||||
73
scripts/start-autopause
Executable file
73
scripts/start-autopause
Executable file
@@ -0,0 +1,73 @@
|
||||
#!/bin/bash
|
||||
|
||||
# shellcheck source=start-utils
|
||||
. "${SCRIPTS:-/}start-utils"
|
||||
|
||||
: "${SERVER_PORT:=25565}"
|
||||
export SERVER_PORT
|
||||
|
||||
log "Autopause functionality enabled"
|
||||
|
||||
isDebugging && set -x
|
||||
|
||||
cp /autopause/knockd-config.cfg /tmp/knockd-config.cfg
|
||||
|
||||
# update server port to listen to
|
||||
regseq="^\s*sequence\s*=\s*$SERVER_PORT\s*$"
|
||||
linenum=$(grep -nm1 sequence /tmp/knockd-config.cfg | cut -d : -f 1 | tail -n1)
|
||||
if ! [[ $(awk "NR==$linenum" /tmp/knockd-config.cfg) =~ $regseq ]]; then
|
||||
sed -i "${linenum}s/sequence.*/sequence = $SERVER_PORT/" /tmp/knockd-config.cfg
|
||||
log "Updated server port in knockd config"
|
||||
fi
|
||||
# update rcon port to listen to
|
||||
regseq="^\s*sequence\s*=\s*$RCON_PORT\s*$"
|
||||
linenum=$(grep -nm2 sequence /tmp/knockd-config.cfg | cut -d : -f 1 | tail -n1)
|
||||
if ! [[ $(awk "NR==$linenum" /tmp/knockd-config.cfg) =~ $regseq ]]; then
|
||||
sed -i "${linenum}s/sequence.*/sequence = $RCON_PORT/" /tmp/knockd-config.cfg
|
||||
log "Updated rcon port in knockd config"
|
||||
fi
|
||||
|
||||
if ! [[ $AUTOPAUSE_PERIOD =~ ^[0-9]+$ ]]; then
|
||||
AUTOPAUSE_PERIOD=10
|
||||
export AUTOPAUSE_PERIOD
|
||||
log "Warning: AUTOPAUSE_PERIOD is not numeric, set to 10 (seconds)"
|
||||
fi
|
||||
if [ "$AUTOPAUSE_PERIOD" -eq "0" ] ; then
|
||||
AUTOPAUSE_PERIOD=10
|
||||
export AUTOPAUSE_PERIOD
|
||||
log "Warning: AUTOPAUSE_PERIOD must not be 0, set to 10 (seconds)"
|
||||
fi
|
||||
if ! [[ $AUTOPAUSE_TIMEOUT_KN =~ ^[0-9]+$ ]] ; then
|
||||
AUTOPAUSE_TIMEOUT_KN=120
|
||||
export AUTOPAUSE_TIMEOUT_KN
|
||||
log "Warning: AUTOPAUSE_TIMEOUT_KN is not numeric, set to 120 (seconds)"
|
||||
fi
|
||||
if ! [[ $AUTOPAUSE_TIMEOUT_EST =~ ^[0-9]+$ ]] ; then
|
||||
AUTOPAUSE_TIMEOUT_EST=3600
|
||||
export AUTOPAUSE_TIMEOUT_EST
|
||||
log "Warning: AUTOPAUSE_TIMEOUT_EST is not numeric, set to 3600 (seconds)"
|
||||
fi
|
||||
if ! [[ $AUTOPAUSE_TIMEOUT_INIT =~ ^[0-9]+$ ]] ; then
|
||||
AUTOPAUSE_TIMEOUT_INIT=600
|
||||
export AUTOPAUSE_TIMEOUT_INIT
|
||||
log "Warning: AUTOPAUSE_TIMEOUT_INIT is not numeric, set to 600 (seconds)"
|
||||
fi
|
||||
if [[ "$AUTOPAUSE_KNOCK_INTERFACE" == "lo" ]] ; then
|
||||
log "Warning: AUTOPAUSE_KNOCK_INTERFACE is set to the local loopback interface."
|
||||
log " This is not advisable, as incoming connections are likely not picked up there."
|
||||
log " Continuing with this setting."
|
||||
fi
|
||||
|
||||
if [[ -n "$MAX_TICK_TIME" && "$MAX_TICK_TIME" != "-1" ]] ; then
|
||||
log "Warning: MAX_TICK_TIME is non-default, for autopause to work properly, this check should be disabled (-1 for versions >= 1.8.1)"
|
||||
elif [[ -z "$MAX_TICK_TIME" ]] ; then
|
||||
if versionLessThan 1.8.1; then
|
||||
# 10 years
|
||||
MAX_TICK_TIME=315360000000
|
||||
else
|
||||
MAX_TICK_TIME=-1
|
||||
fi
|
||||
export MAX_TICK_TIME
|
||||
fi
|
||||
|
||||
/autopause/autopause-daemon.sh &
|
||||
34
scripts/start-autostop
Executable file
34
scripts/start-autostop
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
|
||||
# shellcheck source=start-utils
|
||||
. "${SCRIPTS:-/}start-utils"
|
||||
|
||||
: "${SERVER_PORT:=25565}"
|
||||
export SERVER_PORT
|
||||
|
||||
log "Autostop functionality enabled"
|
||||
|
||||
isDebugging && set -x
|
||||
|
||||
if ! [[ $AUTOSTOP_PERIOD =~ ^[0-9]+$ ]]; then
|
||||
AUTOSTOP_PERIOD=10
|
||||
export AUTOSTOP_PERIOD
|
||||
log "Warning: AUTOSTOP_PERIOD is not numeric, set to 10 (seconds)"
|
||||
fi
|
||||
if [ "$AUTOSTOP_PERIOD" -eq "0" ] ; then
|
||||
AUTOSTOP_PERIOD=10
|
||||
export AUTOSTOP_PERIOD
|
||||
log "Warning: AUTOSTOP_PERIOD must not be 0, set to 10 (seconds)"
|
||||
fi
|
||||
if ! [[ $AUTOSTOP_TIMEOUT_EST =~ ^[0-9]+$ ]] ; then
|
||||
AUTOSTOP_TIMEOUT_EST=3600
|
||||
export AUTOSTOP_TIMEOUT_EST
|
||||
log "Warning: AUTOSTOP_TIMEOUT_EST is not numeric, set to 3600 (seconds)"
|
||||
fi
|
||||
if ! [[ $AUTOSTOP_TIMEOUT_INIT =~ ^[0-9]+$ ]] ; then
|
||||
AUTOSTOP_TIMEOUT_INIT=1800
|
||||
export AUTOSTOP_TIMEOUT_INIT
|
||||
log "Warning: AUTOSTOP_TIMEOUT_INIT is not numeric, set to 1800 (seconds)"
|
||||
fi
|
||||
|
||||
/autostop/autostop-daemon.sh &
|
||||
216
scripts/start-configuration
Executable file
216
scripts/start-configuration
Executable file
@@ -0,0 +1,216 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
# shellcheck source=start-utils
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
|
||||
: "${EULA:=}"
|
||||
: "${PROXY:=}"
|
||||
: "${RCON_PASSWORD_FILE:=}"
|
||||
|
||||
shopt -s nullglob
|
||||
|
||||
isDebugging && set -x
|
||||
|
||||
#umask 002
|
||||
export HOME=/data
|
||||
|
||||
log "Running as uid=$(id -u) gid=$(id -g) with /data as '$(ls -lnd /data)'"
|
||||
|
||||
if [ ! -e /data/eula.txt ]; then
|
||||
if ! isTrue "$EULA"; then
|
||||
log ""
|
||||
log "Please accept the Minecraft EULA at"
|
||||
log " https://account.mojang.com/documents/minecraft_eula"
|
||||
log "by adding the following immediately after 'docker run':"
|
||||
log " -e EULA=TRUE"
|
||||
log ""
|
||||
exit 1
|
||||
fi
|
||||
|
||||
writeEula
|
||||
fi
|
||||
|
||||
if isTrue "${ENABLE_AUTOPAUSE}" && isTrue "${EXEC_DIRECTLY:-false}"; then
|
||||
log "EXEC_DIRECTLY=true is incompatible with ENABLE_AUTOPAUSE=true"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if isTrue "${ENABLE_AUTOPAUSE}" && isTrue "${ENABLE_AUTOSTOP}"; then
|
||||
log "ENABLE_AUTOPAUSE=true is incompatible with ENABLE_AUTOSTOP=true"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $PROXY ]]; then
|
||||
export http_proxy="$PROXY"
|
||||
export https_proxy="$PROXY"
|
||||
export JAVA_TOOL_OPTIONS+="-Djava.net.useSystemProxies=true"
|
||||
log "INFO: Giving proxy time to startup..."
|
||||
sleep 5
|
||||
fi
|
||||
|
||||
if [[ $RCON_PASSWORD_FILE ]]; then
|
||||
log ""
|
||||
if [ ! -e ${RCON_PASSWORD_FILE} ]; then
|
||||
log "Initial RCON password file ${RCON_PASSWORD_FILE} does not seems to exist."
|
||||
log "Please ensure your configuration."
|
||||
log "If you are using Docker Secrets feature, please check this for further information: "
|
||||
log " https://docs.docker.com/engine/swarm/secrets"
|
||||
log ""
|
||||
exit 1
|
||||
else
|
||||
RCON_PASSWORD=$(cat ${RCON_PASSWORD_FILE})
|
||||
export RCON_PASSWORD
|
||||
fi
|
||||
log ""
|
||||
fi
|
||||
|
||||
if ! which java > /dev/null; then
|
||||
log "Fixing PATH to include java"
|
||||
PATH="${PATH}:/opt/java/openjdk/bin"
|
||||
fi
|
||||
|
||||
export VERSIONS_JSON=https://launchermeta.mojang.com/mc/game/version_manifest.json
|
||||
|
||||
case "X$VERSION" in
|
||||
X|XLATEST|Xlatest)
|
||||
if ! VANILLA_VERSION=$(get --json-path '$.latest.release' "$VERSIONS_JSON"); then
|
||||
log "ERROR: version lookup failed: $VANILLA_VERSION"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
XSNAPSHOT|Xsnapshot)
|
||||
if ! VANILLA_VERSION=$(get --json-path '$.latest.snapshot' "$VERSIONS_JSON"); then
|
||||
log "ERROR: version lookup failed: $VANILLA_VERSION"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
VANILLA_VERSION=$VERSION
|
||||
;;
|
||||
esac
|
||||
export VANILLA_VERSION
|
||||
log "Resolved version given ${VERSION} into ${VANILLA_VERSION}"
|
||||
|
||||
cd /data || exit 1
|
||||
|
||||
export ORIGINAL_TYPE=${TYPE^^}
|
||||
|
||||
if isTrue "${ENABLE_AUTOPAUSE}"; then
|
||||
${SCRIPTS:-/}start-autopause
|
||||
fi
|
||||
|
||||
if isTrue "${ENABLE_AUTOSTOP}"; then
|
||||
${SCRIPTS:-/}start-autostop
|
||||
fi
|
||||
|
||||
if versionLessThan 1.7; then
|
||||
echo "
|
||||
MC_HEALTH_EXTRA_ARGS=(
|
||||
--use-server-list-ping
|
||||
)
|
||||
" > /data/.mc-health.env
|
||||
fi
|
||||
|
||||
log "Resolving type given ${TYPE}"
|
||||
case "${TYPE^^}" in
|
||||
*BUKKIT|SPIGOT)
|
||||
exec ${SCRIPTS:-/}start-deployBukkitSpigot "$@"
|
||||
;;
|
||||
|
||||
PAPER)
|
||||
exec ${SCRIPTS:-/}start-deployPaper "$@"
|
||||
;;
|
||||
|
||||
FORGE)
|
||||
if versionLessThan 1.17; then
|
||||
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 "**********************************************************************"
|
||||
fi
|
||||
exec ${SCRIPTS:-/}start-deployForge "$@"
|
||||
;;
|
||||
|
||||
FABRIC)
|
||||
exec ${SCRIPTS:-/}start-deployFabric "$@"
|
||||
;;
|
||||
|
||||
FTBA)
|
||||
exec ${SCRIPTS:-/}start-deployFTBA "$@"
|
||||
;;
|
||||
|
||||
FTB|CURSEFORGE)
|
||||
log "**********************************************************************"
|
||||
log "NOTE: Some mods and modpacks may require Java 8."
|
||||
log " If so, use itzg/minecraft-server:java8"
|
||||
log "**********************************************************************"
|
||||
exec ${SCRIPTS:-/}start-deployCF "$@"
|
||||
;;
|
||||
|
||||
VANILLA)
|
||||
exec "${SCRIPTS:-/}start-deployVanilla" "$@"
|
||||
;;
|
||||
|
||||
SPONGEVANILLA)
|
||||
exec ${SCRIPTS:-/}start-deploySpongeVanilla "$@"
|
||||
;;
|
||||
|
||||
CUSTOM)
|
||||
exec ${SCRIPTS:-/}start-deployCustom "$@"
|
||||
;;
|
||||
|
||||
MAGMA)
|
||||
exec ${SCRIPTS:-/}start-deployMagma "$@"
|
||||
;;
|
||||
|
||||
MOHIST)
|
||||
exec ${SCRIPTS:-/}start-deployMohist "$@"
|
||||
;;
|
||||
|
||||
CATSERVER)
|
||||
exec ${SCRIPTS:-/}start-deployCatserver "$@"
|
||||
;;
|
||||
|
||||
PURPUR)
|
||||
exec ${SCRIPTS:-/}start-deployPurpur "$@"
|
||||
;;
|
||||
|
||||
AIRPLANE)
|
||||
exec ${SCRIPTS:-/}start-deployAirplane "$@"
|
||||
;;
|
||||
|
||||
PUFFERFISH)
|
||||
exec ${SCRIPTS:-/}start-deployPufferfish "$@"
|
||||
;;
|
||||
|
||||
CANYON)
|
||||
exec ${SCRIPTS:-/}start-deployCanyon "$@"
|
||||
;;
|
||||
|
||||
LIMBO)
|
||||
exec ${SCRIPTS:-/}start-deployLimbo "$@"
|
||||
;;
|
||||
|
||||
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" "$@"
|
||||
;;
|
||||
|
||||
*)
|
||||
log "Invalid type: '$TYPE'"
|
||||
log "Must be: VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, FTBA (multiarch-only),"
|
||||
log " CURSEFORGE, SPONGEVANILLA, PURPUR, CUSTOM,"
|
||||
log " MAGMA, MOHIST, CATSERVER, AIRPLANE, PUFFERFISH, CANYON, LIMBO, CRUCIBLE"
|
||||
exit 1
|
||||
;;
|
||||
|
||||
esac
|
||||
47
scripts/start-deployAirplane
Executable file
47
scripts/start-deployAirplane
Executable file
@@ -0,0 +1,47 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
set -euo pipefail
|
||||
isDebugging && set -x
|
||||
|
||||
IFS=$'\n\t'
|
||||
|
||||
if [ "${VERSION}" != "LATEST" ] && [ "${VERSION}" != "PURPUR" ] ; then
|
||||
log "ERROR: Airplane server type only supports VERSION=LATEST, VERSION=PURPUR."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
: ${AIRPLANE_TYPE:=airplane}
|
||||
|
||||
if [ "${VERSION}" = "LATEST" ] ; then
|
||||
AIRPLANE_TYPE="airplane"
|
||||
fi
|
||||
|
||||
if [ "${VERSION}" = "PURPUR" ]; then
|
||||
AIRPLANE_TYPE="airplanepurpur"
|
||||
fi
|
||||
|
||||
log "Using ${AIRPLANE_TYPE} 1.17.1 (1.18 unsupported - use Paper/Pufferfish/Purpur for newer versions)"
|
||||
|
||||
export SERVER=${AIRPLANE_TYPE}-1.17.1.jar
|
||||
|
||||
log "Removing old Airplane versions ..."
|
||||
shopt -s nullglob
|
||||
for f in airplane*.jar; do
|
||||
[[ $f != $SERVER ]] && rm $f
|
||||
done
|
||||
|
||||
if [ ! -f "$SERVER" ] || isTrue "${FORCE_REDOWNLOAD:-false}"; then
|
||||
downloadUrl="https://airplane.gg/dl/launcher-${AIRPLANE_TYPE}1.17.1.jar"
|
||||
log "Downloading Airplane from $downloadUrl ..."
|
||||
if ! get -o "$SERVER" "$downloadUrl"; then
|
||||
log "ERROR: failed to download from $downloadUrl (status=$?)"
|
||||
exit 3
|
||||
fi
|
||||
fi
|
||||
|
||||
# Normalize on Spigot for later operations
|
||||
export FAMILY=SPIGOT
|
||||
export SKIP_LOG4J_CONFIG=true
|
||||
|
||||
exec "${SCRIPTS:-/}start-spiget" "$@"
|
||||
132
scripts/start-deployBukkitSpigot
Executable file
132
scripts/start-deployBukkitSpigot
Executable file
@@ -0,0 +1,132 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
isDebugging && set -x
|
||||
|
||||
set -e
|
||||
|
||||
function buildSpigotFromSource {
|
||||
if [[ ${TYPE^^} = *BUKKIT ]] && ! versionLessThan "1.14"; then
|
||||
log "ERR craftbukkit build is only supported for versions less than 1.14"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
log "Building Spigot $VANILLA_VERSION from source, might take a while, get some coffee"
|
||||
rm -rf /data/temp
|
||||
mkdir /data/temp
|
||||
cd /data/temp
|
||||
|
||||
jvmOpts="-Xms${INIT_MEMORY:-$MEMORY} -Xmx${MAX_MEMORY:-$MEMORY}"
|
||||
|
||||
logn ''
|
||||
curl -sSL -o /data/temp/BuildTools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar && \
|
||||
java $jvmOpts -jar /data/temp/BuildTools.jar --rev $VANILLA_VERSION 2>&1 |tee /data/spigot_build.log| while read l; do echo -n .; done; log "done"
|
||||
|
||||
case ${TYPE^^} in
|
||||
SPIGOT)
|
||||
if ! mv spigot-*.jar /data/${SERVER}; then
|
||||
log "ERR failed to build Spigot"
|
||||
cat /data/spigot_build.log
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
*BUKKIT)
|
||||
if ! mv craftbukkit-*.jar /data/${SERVER}; then
|
||||
log "ERR failed to build Spigot"
|
||||
cat /data/spigot_build.log
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
log "Cleaning up"
|
||||
rm -rf /data/temp
|
||||
cd /data
|
||||
}
|
||||
|
||||
function downloadSpigot {
|
||||
local match
|
||||
case "$TYPE" in
|
||||
*BUKKIT|*bukkit)
|
||||
match="CraftBukkit"
|
||||
downloadUrl=${BUKKIT_DOWNLOAD_URL}
|
||||
getbukkitFlavor=craftbukkit
|
||||
;;
|
||||
*)
|
||||
match="Spigot"
|
||||
downloadUrl=${SPIGOT_DOWNLOAD_URL}
|
||||
getbukkitFlavor=spigot
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ ${VERSION^^} = LATEST ]]; then
|
||||
VANILLA_VERSION=$(restify https://getbukkit.org/download/spigot --attribute='property=og:title' | jq -r '.[0] | .attributes | select(.property == "og:title") | .content | split(" ") | .[-1]')
|
||||
fi
|
||||
|
||||
if [[ -z $downloadUrl ]]; then
|
||||
if versionLessThan 1.16.5 || ([[ ${getbukkitFlavor} = "craftbukkit" ]] && [[ ${VANILLA_VERSION} = "1.16.5" ]]); then
|
||||
downloadUrl="https://cdn.getbukkit.org/${getbukkitFlavor}/${getbukkitFlavor}-${VANILLA_VERSION}.jar"
|
||||
else
|
||||
downloadUrl="https://download.getbukkit.org/${getbukkitFlavor}/${getbukkitFlavor}-${VANILLA_VERSION}.jar"
|
||||
fi
|
||||
fi
|
||||
|
||||
setServerVar
|
||||
if [ -f $SERVER ]; then
|
||||
# tell curl to only download when newer
|
||||
curlArgs="-z $SERVER"
|
||||
fi
|
||||
if isDebugging; then
|
||||
curlArgs="$curlArgs -v"
|
||||
fi
|
||||
log "Downloading $match from $downloadUrl ..."
|
||||
curl -fsSL -o $SERVER $curlArgs "$downloadUrl"
|
||||
if [[ $? != 0 || $(grep -c "DOCTYPE html" $SERVER) != 0 ]]; then
|
||||
cat <<EOF
|
||||
|
||||
ERROR: failed to download from $downloadUrl
|
||||
Visit https://getbukkit.org/download/${getbukkitFlavor} to lookup the
|
||||
exact version, such as 1.4.6-R0.4-SNAPSHOT or 1.8-R0.1-SNAPSHOT-latest.
|
||||
Click into the version entry to find the **exact** version, because something
|
||||
like "1.8" is not sufficient according to their download naming.
|
||||
|
||||
EOF
|
||||
|
||||
if isDebugging && [[ $(grep -c "DOCTYPE html" $SERVER) != 0 ]]; then
|
||||
cat $SERVER
|
||||
fi
|
||||
|
||||
# remove invalid download
|
||||
rm $SERVER
|
||||
exit 3
|
||||
fi
|
||||
|
||||
JVM_OPTS="${JVM_OPTS} -DIReallyKnowWhatIAmDoingISwear"
|
||||
export JVM_OPTS
|
||||
}
|
||||
|
||||
function setServerVar {
|
||||
case "$TYPE" in
|
||||
*BUKKIT|*bukkit)
|
||||
export SERVER=craftbukkit_server-${VANILLA_VERSION}.jar
|
||||
;;
|
||||
*)
|
||||
export SERVER=spigot_server-${VANILLA_VERSION}.jar
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
if isTrue "$BUILD_SPIGOT_FROM_SOURCE" || isTrue "$BUILD_FROM_SOURCE"; then
|
||||
setServerVar
|
||||
if [ ! -f $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
||||
buildSpigotFromSource
|
||||
fi
|
||||
else
|
||||
downloadSpigot
|
||||
fi
|
||||
|
||||
# Normalize on Spigot for operations below
|
||||
export FAMILY=SPIGOT
|
||||
export SKIP_LOG4J_CONFIG=true
|
||||
|
||||
exec ${SCRIPTS:-/}start-spiget "$@"
|
||||
240
scripts/start-deployCF
Executable file
240
scripts/start-deployCF
Executable file
@@ -0,0 +1,240 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
# shellcheck source=start-utils
|
||||
. "${SCRIPTS:-/}start-utils"
|
||||
|
||||
loadForgeVars() {
|
||||
cfgFile=${1?}
|
||||
pat='^([^#;][^=]+)=[:space:]*([^;]*)'
|
||||
while read -r line || [[ -n "$line" ]] ; do
|
||||
if [[ $line =~ $pat ]]; then
|
||||
#echo "MATCHED $line"
|
||||
k=${BASH_REMATCH[1]}
|
||||
v=${BASH_REMATCH[2]}
|
||||
case $k in
|
||||
FORGEURL)
|
||||
forgeInstallerUrl="$v"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
done < "$cfgFile"
|
||||
}
|
||||
|
||||
isDebugging && set -x
|
||||
|
||||
: "${FTB_BASE_DIR:=${CF_BASE_DIR:-/data/FeedTheBeast}}"
|
||||
export FTB_BASE_DIR
|
||||
|
||||
legacyJavaFixerUrl=https://ftb.forgecdn.net/FTB2/maven/net/minecraftforge/lex/legacyjavafixer/1.0/legacyjavafixer-1.0.jar
|
||||
export TYPE=CURSEFORGE
|
||||
|
||||
FTB_SERVER_MOD=${FTB_SERVER_MOD:-$CF_SERVER_MOD}
|
||||
|
||||
log "Looking for Feed-The-Beast / CurseForge server modpack."
|
||||
requireVar FTB_SERVER_MOD
|
||||
|
||||
downloadModpack() {
|
||||
srv_modpack=${FTB_SERVER_MOD}
|
||||
if isURL "${srv_modpack}"; then
|
||||
log "Downloading modpack from ${srv_modpack}..."
|
||||
if ! srv_modpack=$(get -o /data --output-filename --skip-existing "${srv_modpack}"); then
|
||||
log "ERROR: failed to download modpack"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
if [[ "${srv_modpack:0:5}" == "data/" ]]; then
|
||||
# Prepend with "/"
|
||||
srv_modpack="/${srv_modpack}"
|
||||
fi
|
||||
if [[ ! "${srv_modpack:0:1}" == "/" ]]; then
|
||||
# If not an absolute path, assume file is in "/data"
|
||||
srv_modpack=/data/${srv_modpack}
|
||||
fi
|
||||
if [[ ! -f "${srv_modpack}" ]]; then
|
||||
log "FTB server modpack ${srv_modpack} not found."
|
||||
exit 2
|
||||
fi
|
||||
if [[ ! "${srv_modpack: -4}" == ".zip" ]]; then
|
||||
log "FTB server modpack ${srv_modpack} is not a zip archive."
|
||||
log "Please set FTB_SERVER_MOD to a file with a .zip extension."
|
||||
exit 2
|
||||
fi
|
||||
FTB_SERVER_MOD=${srv_modpack}
|
||||
}
|
||||
|
||||
if ! isTrue "${USE_MODPACK_START_SCRIPT:-true}"; then
|
||||
downloadModpack
|
||||
|
||||
needsInstall=true
|
||||
installMarker=/data/.curseforge-installed
|
||||
if [ -f $installMarker ]; then
|
||||
if [ "$(cat $installMarker)" != "${FTB_SERVER_MOD}" ]; then
|
||||
log "Upgrading modpack"
|
||||
|
||||
serverJar=$(find "${FTB_BASE_DIR}" -type f \( -path "*/libraries/*" -o -path "*/mods/*" \) -prune -o -name "forge*.jar" -not -name "forge*installer.jar" -print)
|
||||
if [[ "${serverJar}" ]]; then
|
||||
rm -rf "$(dirname "${serverJar}")"/{mods,*.jar,libraries,resources,scripts,config}
|
||||
fi
|
||||
else
|
||||
needsInstall=false
|
||||
fi
|
||||
fi
|
||||
|
||||
if $needsInstall; then
|
||||
log "Unpacking FTB server modpack ${FTB_SERVER_MOD} ..."
|
||||
mkdir -p "${FTB_BASE_DIR}"
|
||||
unzip -o "${FTB_SERVER_MOD}" -d "${FTB_BASE_DIR}" | awk '{printf "."} END {print ""}'
|
||||
|
||||
serverJar=$(find "${FTB_BASE_DIR}" -type f \( -path "*/libraries/*" -o -path "*/mods/*" \) -prune -o -name "forge*.jar" -not -name "forge*installer.jar" -print)
|
||||
if [[ -z "$serverJar" ]]; then
|
||||
|
||||
if [ -f "${FTB_BASE_DIR}/settings.cfg" ]; then
|
||||
loadForgeVars "${FTB_BASE_DIR}/settings.cfg"
|
||||
|
||||
if [[ $forgeInstallerUrl ]]; then
|
||||
forgeInstallerJar="${FTB_BASE_DIR}/forge-installer.jar"
|
||||
if ! curl -fsSL -o "$forgeInstallerJar" "$forgeInstallerUrl" ; then
|
||||
log "ERROR failed to download Forge installer from $forgeInstallerUrl"
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
else
|
||||
forgeInstallerJar=$(find "${FTB_BASE_DIR}" -name "forge*installer.jar")
|
||||
fi
|
||||
|
||||
if [[ -z "${forgeInstallerJar}" ]]; then
|
||||
log "ERROR Unable to find forge installer in modpack"
|
||||
log " or download using modpack config."
|
||||
log " Make sure you downloaded the server files."
|
||||
exit 2
|
||||
fi
|
||||
|
||||
log "Installing forge server"
|
||||
dirOfInstaller=$(dirname "${forgeInstallerJar}")
|
||||
(cd "${dirOfInstaller}"; java -jar "$(basename "${forgeInstallerJar}")" --installServer)
|
||||
fi
|
||||
|
||||
echo "${FTB_SERVER_MOD}" > $installMarker
|
||||
fi
|
||||
|
||||
SERVER=$(find "${FTB_BASE_DIR}" -maxdepth 2 -type f \( -path "/libraries/*" -o -path "/mods/*" \) -prune -o -name "forge*.jar" -not -name "forge*installer.jar" -print)
|
||||
if [[ -z "${SERVER}" || ! -f "${SERVER}" ]]; then
|
||||
log "ERROR unable to locate installed forge server jar"
|
||||
isDebugging && find "${FTB_BASE_DIR}" -name "forge*.jar"
|
||||
exit 2
|
||||
fi
|
||||
export SERVER
|
||||
|
||||
FTB_DIR=$(dirname "${SERVER}")
|
||||
export FTB_DIR
|
||||
|
||||
exec "${SCRIPTS:-/}start-setupWorld" "$@"
|
||||
fi
|
||||
|
||||
entryScriptExpr="
|
||||
-name ServerStart.sh
|
||||
-o -name serverstart.sh
|
||||
-o -name ServerStartLinux.sh
|
||||
-o -name LaunchServer.sh
|
||||
-o -name server-start.sh
|
||||
-o -name start-server.sh
|
||||
-o -name startserver.sh
|
||||
-o -name StartServer.sh
|
||||
"
|
||||
|
||||
if [[ -d ${FTB_BASE_DIR} ]]; then
|
||||
startScriptCount=$(find "${FTB_BASE_DIR}" $entryScriptExpr |wc -l)
|
||||
if (( startScriptCount > 1 )); then
|
||||
log "Conflicting FTB/CurseForge packages have been installed. Please cleanup ${FTB_BASE_DIR}"
|
||||
exit 2
|
||||
fi
|
||||
else
|
||||
startScriptCount=0
|
||||
fi
|
||||
|
||||
# only download and install if a mod pack isn't already installed
|
||||
# also check for the start script rather than just the folder
|
||||
# this allows saving just the world separate from the rest of the data directory
|
||||
if [[ $startScriptCount = 0 ]]; then
|
||||
downloadModpack
|
||||
srv_modpack=${FTB_SERVER_MOD}
|
||||
|
||||
log "Unpacking FTB server modpack ${srv_modpack} ..."
|
||||
mkdir -p "${FTB_BASE_DIR}"
|
||||
unzip -o "${srv_modpack}" -d "${FTB_BASE_DIR}" | awk '{printf "."} END {print ""}'
|
||||
|
||||
installScript=$(find "${FTB_BASE_DIR}" -maxdepth 2 -type f -name install.sh)
|
||||
if [[ "$installScript" ]]; then
|
||||
(
|
||||
cd "$(dirname "${installScript}")"
|
||||
chmod +x ./install.sh
|
||||
log "Running included install.sh"
|
||||
./install.sh
|
||||
)
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $(find "${FTB_BASE_DIR}" $entryScriptExpr | wc -l) = 0 ]]; then
|
||||
|
||||
# Allow up to 2 levels since some modpacks have a top-level directory named
|
||||
# for the modpack
|
||||
forgeJar=$(find "${FTB_BASE_DIR}" -maxdepth 2 -type f \( -path "/libraries/*" -o -path "/mods/*" \) -prune -o -name "forge*.jar" -not -name "forge*installer.jar" -print)
|
||||
if [[ "$forgeJar" ]]; then
|
||||
FTB_BASE_DIR=$(dirname "${forgeJar}")
|
||||
export FTB_BASE_DIR
|
||||
log "No entry script found, so building one for ${forgeJar}"
|
||||
cat > "${FTB_BASE_DIR}/ServerStart.sh" <<EOF
|
||||
#!/bin/sh
|
||||
. ./settings-local.sh
|
||||
java \${JAVA_PARAMETERS} -Xmx\${MAX_RAM} -jar $(basename "${forgeJar}") nogui
|
||||
EOF
|
||||
chmod +x "${FTB_BASE_DIR}/ServerStart.sh"
|
||||
else
|
||||
log "Please make sure you are using the server version of the FTB modpack!"
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
|
||||
scriptCount=$(find "${FTB_BASE_DIR}" $entryScriptExpr | wc -l)
|
||||
if [[ $scriptCount = 0 ]]; then
|
||||
log "Please make sure you are using the server version of the FTB modpack!"
|
||||
exit 2
|
||||
elif (( scriptCount > 1 )); then
|
||||
log "Ambiguous startup scripts in FTB modpack! Found:"
|
||||
find "${FTB_BASE_DIR}" $entryScriptExpr
|
||||
exit 2
|
||||
fi
|
||||
|
||||
FTB_SERVER_START=$(find "${FTB_BASE_DIR}" $entryScriptExpr)
|
||||
export FTB_SERVER_START
|
||||
|
||||
FTB_DIR=$(dirname "${FTB_SERVER_START}")
|
||||
export FTB_DIR
|
||||
chmod a+x "${FTB_SERVER_START}"
|
||||
grep fml.queryResult=confirm "${FTB_SERVER_START}" > /dev/null || \
|
||||
sed -i 's/-jar/-Dfml.queryResult=confirm -jar/' "${FTB_SERVER_START}"
|
||||
sed -i 's/.*read.*Restart now/#\0/' "${FTB_SERVER_START}"
|
||||
legacyJavaFixerPath="${FTB_DIR}/mods/legacyjavafixer.jar"
|
||||
|
||||
if isTrue "${FTB_LEGACYJAVAFIXER}" && [ ! -e "${legacyJavaFixerPath}" ]; then
|
||||
log "Installing legacy java fixer to ${legacyJavaFixerPath}"
|
||||
if ! get -o "${legacyJavaFixerPath}" ${legacyJavaFixerUrl}; then
|
||||
log "ERROR failed to download legacy java fixer from ${legacyJavaFixerUrl}"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -e "${FTB_DIR}/FTBInstall.sh" ]; then
|
||||
pushd "${FTB_DIR}"
|
||||
sh FTBInstall.sh
|
||||
popd
|
||||
elif [ -e "${FTB_DIR}/Install.sh" ]; then
|
||||
pushd "${FTB_DIR}"
|
||||
sh Install.sh
|
||||
popd
|
||||
fi
|
||||
|
||||
export FAMILY=FORGE
|
||||
exec "${SCRIPTS:-/}start-setupWorld" "$@"
|
||||
49
scripts/start-deployCanyon
Executable file
49
scripts/start-deployCanyon
Executable file
@@ -0,0 +1,49 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
# shellcheck source=start-utils
|
||||
. "${SCRIPTS:-/}start-utils"
|
||||
isDebugging && set -x
|
||||
|
||||
: "${CANYON_BUILD:=lastSuccessfulBuild}"
|
||||
|
||||
if [ "${VERSION}" != "b1.7.3" ]; then
|
||||
log "ERROR: Canyon server type only supports VERSION=b1.7.3"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
canyonJob="https://ci.velocitypowered.com/job/Canyon"
|
||||
|
||||
buildRelPath=$(
|
||||
curl -fsSL "${canyonJob}/${CANYON_BUILD}/api/json" |
|
||||
jq -r '.artifacts[0].relativePath'
|
||||
)
|
||||
buildNumber=$(
|
||||
curl -fsSL "${canyonJob}/${CANYON_BUILD}/api/json" |
|
||||
jq -r '.number'
|
||||
)
|
||||
baseName=$(basename "${buildRelPath}")
|
||||
|
||||
# Add build tag to non-tagged builds for version detection
|
||||
if [ ${baseName%.*} = 'canyon-server' ]; then
|
||||
export SERVER=${baseName%.*}_build${buildNumber}.jar
|
||||
else
|
||||
export SERVER="${baseName}"
|
||||
fi
|
||||
|
||||
if [ ! -f "$SERVER" ]; then
|
||||
downloadUrl="${canyonJob}/${CANYON_BUILD}/artifact/${buildRelPath}"
|
||||
log "Downloading Canyon build ${buildNumber} from $downloadUrl ..."
|
||||
curl -fsSL -o "$SERVER" "$downloadUrl"
|
||||
if [ ! -f "$SERVER" ]; then
|
||||
log "ERROR: failed to download from $downloadUrl (status=$?)"
|
||||
exit 3
|
||||
fi
|
||||
fi
|
||||
|
||||
# Normalize on Spigot for later operations
|
||||
export FAMILY=SPIGOT
|
||||
export SKIP_LOG4J_CONFIG=true
|
||||
|
||||
exec ${SCRIPTS:-/}start-spiget "$@"
|
||||
33
scripts/start-deployCatserver
Executable file
33
scripts/start-deployCatserver
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
set -o pipefail
|
||||
set -e
|
||||
|
||||
latestAsset=$(
|
||||
curl -fsSL https://api.github.com/repos/Luohuayu/CatServer/releases/latest | \
|
||||
jq '.assets[] | select(.name | match(".*-universal.jar"))'
|
||||
)
|
||||
|
||||
if [[ -z "${latestAsset}" ]]; then
|
||||
log "ERROR: latest release of Catserver is missing universal.jar asset"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
isDebugging && log "Latest asset ${latestAsset}"
|
||||
latestJarName=$(echo ${latestAsset} | jq --raw-output '.name')
|
||||
latestJarId=$(echo ${latestAsset} | jq --raw-output '.id')
|
||||
|
||||
|
||||
export SERVER="/data/${latestJarName}"
|
||||
|
||||
if [ ! -f ${SERVER} ]; then
|
||||
log "Downloading ${latestJarName}"
|
||||
curl -H "Accept:application/octet-stream" -o "$SERVER" -fsSL https://api.github.com/repos/Luohuayu/CatServer/releases/assets/${latestJarId}
|
||||
fi
|
||||
|
||||
export SKIP_LOG4J_CONFIG=true
|
||||
|
||||
export FAMILY=HYBRID
|
||||
# Continue to Final Setup
|
||||
exec ${SCRIPTS:-/}start-setupWorld "$@"
|
||||
61
scripts/start-deployCrucible
Executable file
61
scripts/start-deployCrucible
Executable file
@@ -0,0 +1,61 @@
|
||||
#!/bin/bash
|
||||
|
||||
# shellcheck source=start-utils
|
||||
. "${SCRIPTS:-$(dirname "$0")}/start-utils"
|
||||
set -o pipefail
|
||||
set -e
|
||||
isDebugging && set -x
|
||||
|
||||
requireVar VANILLA_VERSION
|
||||
: "${CRUCIBLE_RELEASE:=latest}"
|
||||
|
||||
crucibleReleasesUrl=https://api.github.com/repos/CrucibleMC/Crucible/releases
|
||||
if [[ ${CRUCIBLE_RELEASE^^} = LATEST ]]; then
|
||||
crucibleReleaseUrl=${crucibleReleasesUrl}/latest
|
||||
else
|
||||
crucibleReleaseUrl=${crucibleReleasesUrl}/tags/${CRUCIBLE_RELEASE}
|
||||
fi
|
||||
|
||||
if ! downloadUrl=$(get --json-path "$.assets[?(@.name =~ /Crucible-${VANILLA_VERSION}-.*\.jar/)].browser_download_url" \
|
||||
--accept "application/vnd.github.v3+json" "$crucibleReleaseUrl"); then
|
||||
log "ERROR: failed to access ${CRUCIBLE_RELEASE} release of Crucible"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $downloadUrl = null ]]; then
|
||||
log "ERROR: failed to locate Crucible jar for $VANILLA_VERSION from ${CRUCIBLE_RELEASE}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
log "Downloading Crucible from $downloadUrl"
|
||||
if ! SERVER=$(get --skip-existing --output-filename -o /data "$downloadUrl"); then
|
||||
log "ERROR: failed to download Crucible jar from $downloadUrl"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
librariesDir=/data/libraries
|
||||
if [ ! -d "$librariesDir" ]; then
|
||||
if ! librariesUrl=$(get --json-path "$.assets[?(@.name == 'libraries.zip')].browser_download_url" \
|
||||
--accept "application/vnd.github.v3+json" "$crucibleReleaseUrl"); then
|
||||
log "ERROR: failed to access ${CRUCIBLE_RELEASE} release of Crucible for libraries"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
log "Downloading Crucible libraries"
|
||||
if ! get -o /tmp/libraries.zip "$librariesUrl"; then
|
||||
log "ERROR: failed to download Crucible libraries from $librariesUrl"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! unzip /tmp/libraries.zip -d "$librariesDir"; then
|
||||
log "ERROR: failed to unzip Crucible libraries"
|
||||
exit 1
|
||||
fi
|
||||
rm /tmp/libraries.zip
|
||||
fi
|
||||
|
||||
export SERVER
|
||||
export SKIP_LOG4J_CONFIG=true
|
||||
export FAMILY=HYBRID
|
||||
|
||||
exec "${SCRIPTS:-$(dirname "$0")}/start-setupWorld" "$@"
|
||||
14
start-deployCustom → scripts/start-deployCustom
Normal file → Executable file
14
start-deployCustom → scripts/start-deployCustom
Normal file → Executable file
@@ -1,6 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
. /start-utils
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
isDebugging && set -x
|
||||
|
||||
if isURL ${CUSTOM_SERVER}; then
|
||||
filename=$(basename ${CUSTOM_SERVER})
|
||||
@@ -17,13 +18,18 @@ if isURL ${CUSTOM_SERVER}; then
|
||||
fi
|
||||
|
||||
elif [[ -f ${CUSTOM_SERVER} ]]; then
|
||||
log "Using custom server jar at ${CUSTOM_SERVER} ..."
|
||||
export SERVER=${CUSTOM_SERVER}
|
||||
|
||||
elif [[ ${GENERIC_PACK} ]]; then
|
||||
log "Using custom server jar from generic pack at ${CUSTOM_SERVER} ..."
|
||||
export SERVER=${CUSTOM_SERVER}
|
||||
|
||||
else
|
||||
log "CUSTOM_SERVER is not properly set to a URL or existing jar file"
|
||||
exit 2
|
||||
|
||||
fi
|
||||
|
||||
# Continue to Final Setup
|
||||
exec /start-finalSetup01World $@
|
||||
export SKIP_LOG4J_CONFIG=true
|
||||
export FAMILY=HYBRID
|
||||
exec ${SCRIPTS:-/}start-setupWorld $@
|
||||
83
scripts/start-deployFTBA
Executable file
83
scripts/start-deployFTBA
Executable file
@@ -0,0 +1,83 @@
|
||||
#!/bin/bash
|
||||
|
||||
ftbInstallMarker=".ftb-installed"
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
isDebugging && set -x
|
||||
set -e
|
||||
|
||||
if ! [[ -v FTB_MODPACK_ID ]]; then
|
||||
log "ERROR FTB_MODPACK_ID is required with TYPE=FTB"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! [[ ${FTB_MODPACK_ID} =~ [0-9]+ ]]; then
|
||||
log "ERROR FTB_MODPACK_ID needs to be numeric"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! $FTB_MODPACK_VERSION_ID ]]; then
|
||||
if ! FTB_MODPACK_VERSION_ID=$(curl -fsSL https://api.modpacks.ch/public/modpack/${FTB_MODPACK_ID} | jq -r '.versions | sort_by(.updated)[-1].id'); then
|
||||
log "ERROR unable to resolve latest modpack version ID for modpack ${FTB_MODPACK_ID}"
|
||||
exit 1
|
||||
fi
|
||||
elif ! [[ ${FTB_MODPACK_VERSION_ID} =~ [0-9]+ ]]; then
|
||||
log "ERROR FTB_MODPACK_VERSION_ID needs to be numeric"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! [ -f "${ftbInstallMarker}" ] || [ $(cat "${ftbInstallMarker}") != "${FTB_MODPACK_ID}=${FTB_MODPACK_VERSION_ID}" ]; then
|
||||
ftbInstaller=/data/ftb-installer
|
||||
if ! [[ -f "${ftbInstaller}" ]]; then
|
||||
log "Downloading FTB installer"
|
||||
if [ "$(uname -m)" == "aarch64" ]; then
|
||||
log "Downloading ARM installer"
|
||||
curl -fsSL https://api.modpacks.ch/public/modpack/1/1/server/arm/linux -o "${ftbInstaller}"
|
||||
else
|
||||
log "Downloading x86 installer"
|
||||
curl -fsSL https://api.modpacks.ch/public/modpack/1/1/server/linux -o "${ftbInstaller}"
|
||||
fi
|
||||
chmod +x "${ftbInstaller}"
|
||||
fi
|
||||
|
||||
rm -rf forge*jar mods config libraries defaultconfigs changelogs
|
||||
|
||||
log "Installing modpack ID ${FTB_MODPACK_ID}, version ID ${FTB_MODPACK_VERSION_ID}"
|
||||
${ftbInstaller} ${FTB_MODPACK_ID} ${FTB_MODPACK_VERSION_ID} --noscript --auto
|
||||
rm -f forge*installer.jar
|
||||
|
||||
echo "${FTB_MODPACK_ID}=${FTB_MODPACK_VERSION_ID}" > ${ftbInstallMarker}
|
||||
|
||||
writeEula
|
||||
|
||||
# some modpacks result in --w----r-- permissions
|
||||
chmod a+r version.json
|
||||
else
|
||||
log "FTB modpack ID ${FTB_MODPACK_ID}, version ID ${FTB_MODPACK_VERSION_ID} is ready to go"
|
||||
fi
|
||||
|
||||
isDebugging && cat version.json
|
||||
forgeVersion=$(jq -r '.targets|unique[] | select(.name == "forge") | .version' version.json)
|
||||
fabricVersion=$(jq -r '.targets|unique[] | select(.name == "fabric") | .version' version.json)
|
||||
mcVersion=$(jq -r '.targets|unique[] | select(.name == "minecraft") | .version' version.json)
|
||||
|
||||
variants=(
|
||||
forge-${mcVersion}-${forgeVersion}.jar
|
||||
forge-${mcVersion}-${forgeVersion}-universal.jar
|
||||
forge-${mcVersion}-${forgeVersion}-${mcVersion}-universal.jar
|
||||
fabric-${mcVersion}-${fabricVersion}-server-launch.jar
|
||||
)
|
||||
for f in "${variants[@]}"; do
|
||||
if [ -f $f ]; then
|
||||
export SERVER=$f
|
||||
break
|
||||
fi
|
||||
done
|
||||
if ! [ -v SERVER ]; then
|
||||
log "ERROR unable to locate the installed FTB server jar"
|
||||
ls *.jar
|
||||
exit 2
|
||||
fi
|
||||
|
||||
export FAMILY=FORGE
|
||||
exec ${SCRIPTS:-/}start-setupWorld $@
|
||||
81
scripts/start-deployFabric
Executable file
81
scripts/start-deployFabric
Executable file
@@ -0,0 +1,81 @@
|
||||
#!/bin/bash
|
||||
set -eu
|
||||
|
||||
# shellcheck source=start-utils
|
||||
. "${SCRIPTS:-/}start-utils"
|
||||
|
||||
requireVar VANILLA_VERSION
|
||||
export TYPE=FABRIC
|
||||
: "${FABRIC_INSTALLER_VERSION:=${FABRICVERSION:-LATEST}}"
|
||||
: "${FABRIC_INSTALLER:=}"
|
||||
: "${FABRIC_INSTALLER_URL:=}"
|
||||
: "${FABRIC_LOADER_VERSION:=LATEST}"
|
||||
|
||||
isDebugging && set -x
|
||||
|
||||
log "Checking Fabric version information."
|
||||
if [[ $FABRIC_INSTALLER ]]; then
|
||||
FABRIC_INSTALLER_VERSION=$(echo -n "$FABRIC_INSTALLER" | mc-image-helper hash)
|
||||
elif [[ $FABRIC_INSTALLER_URL ]]; then
|
||||
FABRIC_INSTALLER_VERSION=$(echo -n "$FABRIC_INSTALLER_URL" | mc-image-helper hash)
|
||||
elif [[ ${FABRIC_INSTALLER_VERSION^^} = LATEST ]]; then
|
||||
FABRIC_INSTALLER_VERSION=$(maven-metadata-release https://maven.fabricmc.net/net/fabricmc/fabric-installer/maven-metadata.xml)
|
||||
fi
|
||||
|
||||
export SERVER=fabric-server-${VANILLA_VERSION}-${FABRIC_INSTALLER_VERSION}.jar
|
||||
|
||||
if [ ! \( -e ${SERVER} -a -e "server-${VANILLA_VERSION}.jar" \) ]; then
|
||||
|
||||
if [[ -z $FABRIC_INSTALLER && -z $FABRIC_INSTALLER_URL ]]; then
|
||||
FABRIC_INSTALLER="fabric-installer-${FABRIC_INSTALLER_VERSION}.jar"
|
||||
FABRIC_INSTALLER_URL="https://maven.fabricmc.net/net/fabricmc/fabric-installer/${FABRIC_INSTALLER_VERSION}/fabric-installer-${FABRIC_INSTALLER_VERSION}.jar"
|
||||
elif [[ -z $FABRIC_INSTALLER ]]; then
|
||||
FABRIC_INSTALLER="fabric-installer.jar"
|
||||
elif [[ ! -e $FABRIC_INSTALLER ]]; then
|
||||
log "ERROR: the given Fabric installer doesn't exist : $FABRIC_INSTALLER"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
if [[ -z $FABRIC_LOADER_VERSION || ${FABRIC_LOADER_VERSION^^} = LATEST ]]; then
|
||||
log "Checking Fabric Loader version information."
|
||||
|
||||
FABRIC_LOADER_VERSION=$(maven-metadata-release https://maven.fabricmc.net/net/fabricmc/fabric-loader/maven-metadata.xml)
|
||||
fi
|
||||
|
||||
if [[ ! -e $FABRIC_INSTALLER ]]; then
|
||||
log "Downloading $FABRIC_INSTALLER_URL ..."
|
||||
if ! get -o "$FABRIC_INSTALLER" "$FABRIC_INSTALLER_URL"; then
|
||||
log "Failed to download from given location $FABRIC_INSTALLER_URL"
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
|
||||
log "Installing Fabric ${VANILLA_VERSION} using $FABRIC_INSTALLER with loader version $FABRIC_LOADER_VERSION"
|
||||
|
||||
tries=3
|
||||
set +e
|
||||
while ((--tries >= 0)); do
|
||||
java -jar $FABRIC_INSTALLER server \
|
||||
-mcversion $VANILLA_VERSION \
|
||||
-loader $FABRIC_LOADER_VERSION \
|
||||
-downloadMinecraft \
|
||||
-dir /data
|
||||
if [[ $? == 0 ]]; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
set -e
|
||||
if (($tries < 0)); then
|
||||
log "Fabric failed to install after several tries." >&2
|
||||
exit 10
|
||||
fi
|
||||
|
||||
mv server.jar "server-${VANILLA_VERSION}.jar"
|
||||
mv fabric-server-launch.jar "${SERVER}"
|
||||
fi
|
||||
|
||||
# Specify which server jar to run
|
||||
echo "serverJar=server-${VANILLA_VERSION}.jar" > fabric-server-launcher.properties
|
||||
|
||||
export FAMILY=FABRIC
|
||||
exec "${SCRIPTS:-/}start-setupWorld" "$@"
|
||||
151
scripts/start-deployForge
Executable file
151
scripts/start-deployForge
Executable file
@@ -0,0 +1,151 @@
|
||||
#!/bin/bash
|
||||
|
||||
: "${FORGEVERSION:=RECOMMENDED}"
|
||||
|
||||
# shellcheck source=start-utils
|
||||
. "${SCRIPTS:-$(dirname "$0")}/start-utils"
|
||||
isDebugging && set -x
|
||||
|
||||
get_installer() {
|
||||
if [[ -z $FORGE_INSTALLER_URL ]]; then
|
||||
log "Downloading $normForgeVersion"
|
||||
|
||||
forgeFileNames="
|
||||
$shortForgeVersion/forge-$shortForgeVersion-installer.jar
|
||||
$normForgeVersion/forge-$normForgeVersion-installer.jar
|
||||
"
|
||||
|
||||
for fn in $forgeFileNames; do
|
||||
downloadUrl=https://maven.minecraftforge.net/net/minecraftforge/forge/$fn
|
||||
log "...trying $downloadUrl"
|
||||
if get -o "$FORGE_INSTALLER" "$downloadUrl"; then
|
||||
return
|
||||
fi
|
||||
done
|
||||
log "Unable to locate usable URL for $normForgeVersion"
|
||||
exit 2
|
||||
else
|
||||
log "Downloading $FORGE_INSTALLER_URL ..."
|
||||
if ! get -o "$FORGE_INSTALLER" "$FORGE_INSTALLER_URL"; then
|
||||
log "Failed to download from given location $FORGE_INSTALLER_URL"
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
install() {
|
||||
if [ ! -e "$FORGE_INSTALLER" ]; then
|
||||
get_installer "$normForgeVersion" "$shortForgeVersion"
|
||||
fi
|
||||
|
||||
log "Installing Forge $shortForgeVersion using $FORGE_INSTALLER"
|
||||
mkdir -p mods
|
||||
tries=3
|
||||
while ((--tries >= 0)); do
|
||||
if java -jar "$FORGE_INSTALLER" --installServer; then
|
||||
break
|
||||
fi
|
||||
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
|
||||
log "Finding installed server jar..."
|
||||
unset -v latest
|
||||
# 1.17+ ?
|
||||
if [ -f /data/run.sh ]; then
|
||||
latest=/data/run.sh
|
||||
# else pre 1.17
|
||||
else
|
||||
for file in *forge*.jar; do
|
||||
if ! [[ $file =~ installer ]]; then
|
||||
if [[ -z $latest ]] || [[ $file -nt $latest ]]; then
|
||||
latest=$file
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
if [[ -z $latest ]]; then
|
||||
log "Unable to derive server jar for Forge"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
export SERVER=$latest
|
||||
log "Using server $SERVER"
|
||||
debug "Writing install marker at $installMarker"
|
||||
echo "$SERVER" > "$installMarker"
|
||||
}
|
||||
|
||||
resolve_versions() {
|
||||
if [[ -z $FORGE_INSTALLER && -z $FORGE_INSTALLER_URL ]]; then
|
||||
norm=$VANILLA_VERSION
|
||||
|
||||
case $VANILLA_VERSION in
|
||||
*.*.*)
|
||||
norm=$VANILLA_VERSION ;;
|
||||
*.*)
|
||||
norm=${VANILLA_VERSION}.0 ;;
|
||||
esac
|
||||
|
||||
#################################################################################
|
||||
promosUrl=http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json
|
||||
|
||||
log "Checking Forge version information."
|
||||
case $FORGEVERSION in
|
||||
LATEST)
|
||||
if ! FORGE_VERSION=$(get --json-path ".promos['$VANILLA_VERSION-latest']" "$promosUrl"); then
|
||||
log "ERROR: Version $VANILLA_VERSION is not supported by Forge"
|
||||
log " Refer to http://files.minecraftforge.net/ for supported versions"
|
||||
exit 2
|
||||
fi
|
||||
;;
|
||||
|
||||
RECOMMENDED)
|
||||
if ! FORGE_VERSION=$(get -s --json-path ".promos['$VANILLA_VERSION-recommended']" "$promosUrl"); then
|
||||
if ! FORGE_VERSION=$(get --json-path ".promos['$VANILLA_VERSION-latest']" "$promosUrl"); then
|
||||
log "ERROR: Version $VANILLA_VERSION is not supported by Forge"
|
||||
log " Refer to http://files.minecraftforge.net/ for supported versions"
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
FORGE_VERSION=$FORGEVERSION
|
||||
;;
|
||||
esac
|
||||
|
||||
normForgeVersion=$VANILLA_VERSION-$FORGE_VERSION-$norm
|
||||
shortForgeVersion=$VANILLA_VERSION-$FORGE_VERSION
|
||||
|
||||
FORGE_INSTALLER="/tmp/forge-$shortForgeVersion-installer.jar"
|
||||
elif [[ -z $FORGE_INSTALLER ]]; then
|
||||
FORGE_INSTALLER="/tmp/forge-installer.jar"
|
||||
elif [[ ! -e $FORGE_INSTALLER ]]; then
|
||||
log "ERROR: the given Forge installer doesn't exist : $FORGE_INSTALLER"
|
||||
exit 2
|
||||
else
|
||||
shortForgeVersion=$VANILLA_VERSION-${FORGE_INSTALLER_CUSTOM_VERSION:-custom}
|
||||
fi
|
||||
}
|
||||
|
||||
### main
|
||||
|
||||
resolve_versions
|
||||
|
||||
installMarker="/data/.forge-installed-$shortForgeVersion"
|
||||
|
||||
if [ ! -e "$installMarker" ] || isTrue "${FORCE_REINSTALL:-false}"; then
|
||||
install
|
||||
else
|
||||
SERVER=$(cat "$installMarker")
|
||||
export SERVER
|
||||
if [ ! -e "$SERVER" ]; then
|
||||
rm "$installMarker"
|
||||
install
|
||||
fi
|
||||
fi
|
||||
|
||||
export FAMILY=FORGE
|
||||
exec "${SCRIPTS:-/}start-setupWorld" "$@"
|
||||
64
scripts/start-deployLimbo
Executable file
64
scripts/start-deployLimbo
Executable file
@@ -0,0 +1,64 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
isDebugging && set -x
|
||||
|
||||
: ${LIMBO_BUILD:=LATEST}
|
||||
: ${FORCE_REDOWNLOAD:=false}
|
||||
: ${LIMBO_SCHEMA_FILENAME:=default.schem}
|
||||
: ${LEVEL:=Default;${LIMBO_SCHEMA_FILENAME}}
|
||||
# defaults to localhost, if this is not set
|
||||
: ${SERVER_IP:=0.0.0.0}
|
||||
|
||||
export LEVEL SERVER_IP
|
||||
|
||||
if [[ ${LIMBO_BUILD^^} == LATEST ]]; then
|
||||
LIMBO_BUILD=lastStableBuild
|
||||
fi
|
||||
|
||||
baseUrl="https://ci.loohpjames.com/job/Limbo/${LIMBO_BUILD}"
|
||||
buildInfoUrl="${baseUrl}/api/json"
|
||||
buildJson=$(curl -fsSL "${buildInfoUrl}")
|
||||
if [ $? != 0 ]; then
|
||||
log "ERROR failed to get build info from ${buildInfoUrl} (status=$?)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ${LIMBO_BUILD} = lastStableBuild ]]; then
|
||||
LIMBO_BUILD=$(jq -r '.number' <<<${buildJson})
|
||||
log "Resolved latest Limbo build to ${LIMBO_BUILD}"
|
||||
fi
|
||||
artifactPath=$(jq -r '.artifacts[] | select(.fileName|test("^Limbo-")) | .relativePath' <<<${buildJson})
|
||||
defaultSchemaPath=$(jq -r '.artifacts[] | select(.fileName|test(".*\\.schem")) | .relativePath' <<<${buildJson})
|
||||
|
||||
export SERVER="limbo-${LIMBO_BUILD}.jar"
|
||||
|
||||
if [ ! -f "$SERVER" ] || isTrue "$FORCE_REDOWNLOAD"; then
|
||||
downloadUrl="${baseUrl}/artifact/${artifactPath}"
|
||||
log "Downloading Limbo from $downloadUrl ..."
|
||||
if ! curl -fsSL -o "$SERVER" "$downloadUrl"; then
|
||||
log "ERROR: failed to download from $downloadUrl (status=$?)"
|
||||
exit 3
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
if [ ! -f "${LIMBO_SCHEMA_FILENAME}" ]; then
|
||||
log "Downloading default schem file"
|
||||
if ! curl -o "${LIMBO_SCHEMA_FILENAME}" -fsSL "${baseUrl}/artifact/${defaultSchemaPath}"; then
|
||||
log "ERROR: failed to download schema file $baseUrl (status=$?)"
|
||||
exit 3
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ ${LEVEL} != *\;* ]]; then
|
||||
LEVEL="${LEVEL};${LIMBO_SCHEMA_FILENAME}"
|
||||
fi
|
||||
export LEVEL
|
||||
|
||||
export SKIP_LOG4J_CONFIG=true
|
||||
|
||||
export FAMILY=LIMBO
|
||||
exec ${SCRIPTS:-/}start-setupWorld $@
|
||||
93
scripts/start-deployMagma
Executable file
93
scripts/start-deployMagma
Executable file
@@ -0,0 +1,93 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
export SKIP_LOG4J_CONFIG=true
|
||||
|
||||
isDebugging && set -x
|
||||
|
||||
: ${VANILLA_VERSION?}
|
||||
# stable, dev
|
||||
: ${MAGMA_CHANNEL:=stable}
|
||||
|
||||
|
||||
magmaDownloadServer() {
|
||||
url=${1?}
|
||||
tagName=${2?}
|
||||
markerFile=${3?}
|
||||
|
||||
export SERVER="/data/magma-server-${VANILLA_VERSION}.jar"
|
||||
|
||||
log "Downloading Magma server file for ${VANILLA_VERSION} @ ${tagName}"
|
||||
if ! curl -o /data/magma-server-${VANILLA_VERSION}.jar -fsSL "$url"; then
|
||||
log "ERROR failed to download Magma server from $url (status=$?)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo -n "$SERVER" > "$markerFile"
|
||||
}
|
||||
|
||||
magmaHandleInstaller() {
|
||||
url=${1?}
|
||||
tagName=${2?}
|
||||
markerFile=${3?}
|
||||
|
||||
installerFile="magma-installer-${VANILLA_VERSION}-${tagName}.jar"
|
||||
log "Downloading Magma installer file for ${VANILLA_VERSION} @ ${tagName}"
|
||||
if ! curl -o "$installerFile" -fsSL "$url"; then
|
||||
log "ERROR failed to download Magma installer from $url (status=$?)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "forge" > "$markerFile"
|
||||
|
||||
export FORGE_INSTALLER="$installerFile"
|
||||
export FORGE_INSTALLER_CUSTOM_VERSION="$tagName"
|
||||
|
||||
# now hand off the rest to forge
|
||||
exec ${SCRIPTS:-/}start-deployForge "$@"
|
||||
}
|
||||
|
||||
latestMeta=$(curl -fsSL https://api.magmafoundation.org/api/resources/Magma/${VANILLA_VERSION}/${MAGMA_CHANNEL}/latest || exit $?)
|
||||
if [ $? != 0 ]; then
|
||||
log "ERROR failed to locate latest Magma info for ${VANILLA_VERSION} in channel ${MAGMA_CHANNEL} (error=$?)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
tagName=$(echo "${latestMeta}" | jq -r '.tag_name')
|
||||
markerFile=".magma-installed-${VANILLA_VERSION}-${tagName}"
|
||||
if [ -f "${markerFile}" ]; then
|
||||
installedTagName=$(cat "${markerFile}")
|
||||
fi
|
||||
|
||||
if [ ! -f "${markerFile}" ]; then
|
||||
|
||||
if versionLessThan 1.16; then
|
||||
assetType=server
|
||||
else
|
||||
assetType=installer
|
||||
fi
|
||||
|
||||
assetUrl=$(echo "${latestMeta}" | jq -r ".assets | .[].browser_download_url | select(test(\"${assetType}\"))")
|
||||
if [ $? != 0 ] || [ -z "$assetUrl" ]; then
|
||||
log "ERROR failed to extract ${assetType} asset type for ${VANILLA_VERSION} in channel ${MAGMA_CHANNEL}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ${assetType} = server ]]; then
|
||||
magmaDownloadServer "$assetUrl" "$tagName" "$markerFile"
|
||||
else
|
||||
magmaHandleInstaller "$assetUrl" "$tagName" "$markerFile"
|
||||
fi
|
||||
else
|
||||
export SERVER=$(cat "${markerFile}")
|
||||
|
||||
if [[ $SERVER == "forge" ]]; then
|
||||
export FORGE_INSTALLER="magma-installer-${VANILLA_VERSION}-${tagName}.jar"
|
||||
export FORGE_INSTALLER_CUSTOM_VERSION="$tagName"
|
||||
# now hand off the rest to forge
|
||||
exec ${SCRIPTS:-/}start-deployForge "$@"
|
||||
fi
|
||||
fi
|
||||
|
||||
export FAMILY=HYBRID
|
||||
exec ${SCRIPTS:-/}start-setupWorld "$@"
|
||||
44
scripts/start-deployMohist
Executable file
44
scripts/start-deployMohist
Executable file
@@ -0,0 +1,44 @@
|
||||
#!/bin/bash
|
||||
|
||||
# shellcheck source=start-utils
|
||||
. "${SCRIPTS:-$(dirname "$0")}/start-utils"
|
||||
set -o pipefail
|
||||
set -e
|
||||
isDebugging && set -x
|
||||
|
||||
requireVar VANILLA_VERSION
|
||||
: "${MOHIST_BUILD:=lastSuccessfulBuild}"
|
||||
|
||||
mohistJobs=https://ci.codemc.io/job/MohistMC/job/
|
||||
mohistJob=${mohistJobs}Mohist-${VANILLA_VERSION}/
|
||||
|
||||
if ! get --exists "${mohistJob}"; then
|
||||
log "ERROR: mohist builds do not exist for ${VANILLA_VERSION}"
|
||||
log " check https://ci.codemc.io/job/MohistMC/ for available versions"
|
||||
log " and set VERSION accordingly"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
buildRelPath=$(
|
||||
get --json-path '$.artifacts[0].relativePath' "${mohistJob}${MOHIST_BUILD}/api/json"
|
||||
)
|
||||
|
||||
baseName=$(basename "${buildRelPath}")
|
||||
if [[ ${baseName} != *-server.jar* ]]; then
|
||||
log "ERROR: mohist build for ${VANILLA_VERSION} is not a valid server jar, found ${baseName}"
|
||||
log " check https://ci.codemc.io/job/MohistMC/ for available versions"
|
||||
log " and set VERSION accordingly"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export SERVER="/data/${baseName}"
|
||||
|
||||
if [ ! -f "${SERVER}" ]; then
|
||||
log "Downloading ${baseName}"
|
||||
get -o "${SERVER}" "${mohistJob}${MOHIST_BUILD}/artifact/${buildRelPath}"
|
||||
fi
|
||||
|
||||
export SKIP_LOG4J_CONFIG=true
|
||||
|
||||
export FAMILY=HYBRID
|
||||
exec "${SCRIPTS:-$(dirname "$0")}/start-setupWorld" "$@"
|
||||
79
scripts/start-deployPaper
Executable file
79
scripts/start-deployPaper
Executable file
@@ -0,0 +1,79 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
set -o pipefail
|
||||
isDebugging && set -x
|
||||
|
||||
if [[ $PAPER_DOWNLOAD_URL ]]; then
|
||||
export SERVER=$(getFilenameFromUrl "${PAPER_DOWNLOAD_URL}")
|
||||
|
||||
if [ -f "$SERVER" ]; then
|
||||
zarg=(-z "$SERVER")
|
||||
fi
|
||||
|
||||
echo "Preparing custom PaperMC jar from $PAPER_DOWNLOAD_URL"
|
||||
|
||||
curl -fsSL -o "$SERVER" "${zarg[@]}" "${PAPER_DOWNLOAD_URL}"
|
||||
else
|
||||
# PaperMC API v2 docs : https://papermc.io/api/docs/swagger-ui/index.html?configUrl=/api/openapi/swagger-config
|
||||
|
||||
build=${PAPERBUILD:=$(curl -fsSL "https://papermc.io/api/v2/projects/paper/versions/${VANILLA_VERSION}" -H "accept: application/json" \
|
||||
| jq '.builds[-1]')}
|
||||
case $? in
|
||||
0)
|
||||
;;
|
||||
22)
|
||||
versions=$(curl -fsSL "https://papermc.io/api/v2/projects/paper" -H "accept: application/json")
|
||||
if [[ $VERSION = LATEST ]]; then
|
||||
VANILLA_VERSION=$(echo "$versions" | jq -r '.versions[-1]')
|
||||
log "WARN: using ${VANILLA_VERSION} since that's the latest provided by PaperMC"
|
||||
# re-execute the current script with the newly computed version
|
||||
exec "$0" "$@"
|
||||
fi
|
||||
log "ERROR: ${VANILLA_VERSION} is not published by PaperMC"
|
||||
log " Set VERSION to one of the following: "
|
||||
log " $(echo "$versions" | jq -r '.versions | join(", ")')"
|
||||
exit 1
|
||||
;;
|
||||
*)
|
||||
echo "ERROR: unknown error while looking up PaperMC version=${VANILLA_VERSION}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
if [ $? != 0 ]; then
|
||||
echo "ERROR: failed to lookup PaperMC build from version ${VANILLA_VERSION}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export SERVER=$(curl -fsSL "https://papermc.io/api/v2/projects/paper/versions/${VANILLA_VERSION}/builds/${build}" -H "accept: application/json" \
|
||||
| jq -r '.downloads.application.name')
|
||||
if [ $? != 0 ]; then
|
||||
echo "ERROR: failed to lookup PaperMC download file from version=${VANILLA_VERSION} build=${build}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -f "$SERVER" ]; then
|
||||
zarg=(-z "$SERVER")
|
||||
fi
|
||||
|
||||
log "Removing old PaperMC versions ..."
|
||||
shopt -s nullglob
|
||||
for f in paper-*.jar; do
|
||||
[[ $f != $SERVER ]] && rm $f
|
||||
done
|
||||
|
||||
log "Downloading PaperMC $VANILLA_VERSION (build $build) ..."
|
||||
curl -fsSL -o "$SERVER" "${zarg[@]}" \
|
||||
"https://papermc.io/api/v2/projects/paper/versions/${VANILLA_VERSION}/builds/${build}/downloads/${SERVER}" \
|
||||
-H "accept: application/java-archive"
|
||||
if [ $? != 0 ]; then
|
||||
echo "ERROR: failed to download PaperMC from version=${VANILLA_VERSION} build=${build} download=${SERVER}"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Normalize on Spigot for downstream operations
|
||||
export FAMILY=SPIGOT
|
||||
export SKIP_LOG4J_CONFIG=true
|
||||
|
||||
exec ${SCRIPTS:-/}start-spiget "$@"
|
||||
45
scripts/start-deployPufferfish
Executable file
45
scripts/start-deployPufferfish
Executable file
@@ -0,0 +1,45 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
set -euo pipefail
|
||||
isDebugging && set -x
|
||||
|
||||
IFS=$'\n\t'
|
||||
|
||||
if [ "${VERSION}" != "LATEST" ] && [ "${VERSION}" != "1.18" ] ; then
|
||||
log "ERROR: Pufferfish server type only supports VERSION=LATEST, VERSION=1.18. Note that these are branches, not #.#.# versions."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
: ${PUFFERFISH_BUILD:=lastSuccessfulBuild}
|
||||
|
||||
if [ "${VERSION}" = "LATEST" ] || [ "${VERSION}" = "1.18" ]; then
|
||||
PUFFERFISH_BRANCH="1.18"
|
||||
PUFFERFISH_VERSION="1.18.1-R0.1"
|
||||
fi
|
||||
|
||||
log "Using Pufferfish-${PUFFERFISH_BRANCH} branch"
|
||||
|
||||
export SERVER=pufferfish-${PUFFERFISH_BRANCH}-${PUFFERFISH_BUILD}.jar
|
||||
|
||||
log "Removing old Pufferfish versions ..."
|
||||
shopt -s nullglob
|
||||
for f in pufferfish-*.jar; do
|
||||
[[ $f != $SERVER ]] && rm $f
|
||||
done
|
||||
|
||||
if [ ! -f "$SERVER" ] || isTrue "${FORCE_REDOWNLOAD:-false}"; then
|
||||
artifact="build/libs/pufferfish-paperclip-${PUFFERFISH_VERSION}-SNAPSHOT-reobf.jar"
|
||||
downloadUrl="https://ci.pufferfish.host/job/Pufferfish-${PUFFERFISH_BRANCH}/${PUFFERFISH_BUILD}/artifact/${artifact}"
|
||||
log "Downloading Pufferfish from $downloadUrl ..."
|
||||
if ! get -o "$SERVER" "$downloadUrl"; then
|
||||
log "ERROR: failed to download from $downloadUrl (status=$?)"
|
||||
exit 3
|
||||
fi
|
||||
fi
|
||||
|
||||
# Normalize on Spigot for later operations
|
||||
export FAMILY=SPIGOT
|
||||
export SKIP_LOG4J_CONFIG=true
|
||||
|
||||
exec ${SCRIPTS:-/}start-spiget "$@"
|
||||
36
scripts/start-deployPurpur
Executable file
36
scripts/start-deployPurpur
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
# shellcheck source=start-utils
|
||||
. "${SCRIPTS:-/}start-utils"
|
||||
isDebugging && set -x
|
||||
|
||||
: ${VANILLA_VERSION:?}
|
||||
: ${PURPUR_BUILD:=LATEST}
|
||||
: ${FORCE_REDOWNLOAD:=false}
|
||||
|
||||
if [[ ${PURPUR_BUILD} == LATEST ]]; then
|
||||
if ! PURPUR_BUILD=$(get --json-path=".builds.latest" "https://api.purpurmc.org/v2/purpur/${VANILLA_VERSION}"); then
|
||||
log "ERROR: Failed to locate a Purpur build for ${VANILLA_VERSION}."
|
||||
log " Please check if a download is available at https://purpur.pl3x.net/downloads/"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
export SERVER="purpur-${VANILLA_VERSION}-${PURPUR_BUILD}.jar"
|
||||
|
||||
if [ ! -f "$SERVER" ] || isTrue "$FORCE_REDOWNLOAD"; then
|
||||
downloadUrl="https://api.purpurmc.org/v2/purpur/${VANILLA_VERSION}/${PURPUR_BUILD}/download"
|
||||
log "Downloading Purpur from $downloadUrl ..."
|
||||
if ! get -o "$SERVER" "$downloadUrl"; then
|
||||
log "ERROR: failed to download from $downloadUrl (status=$?)"
|
||||
exit 3
|
||||
fi
|
||||
fi
|
||||
|
||||
# Normalize on Spigot for later operations
|
||||
export FAMILY=SPIGOT
|
||||
export SKIP_LOG4J_CONFIG=true
|
||||
|
||||
exec "${SCRIPTS:-/}start-spiget" "$@"
|
||||
8
start-deploySpongeVanilla → scripts/start-deploySpongeVanilla
Normal file → Executable file
8
start-deploySpongeVanilla → scripts/start-deploySpongeVanilla
Normal file → Executable file
@@ -1,8 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
. /start-utils
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
|
||||
export TYPE=spongevanilla
|
||||
: ${SPONGEBRANCH:=STABLE}
|
||||
: ${SPONGEVERSION:=}
|
||||
|
||||
# Parse branch
|
||||
log "Choosing branch for Sponge"
|
||||
@@ -35,5 +37,5 @@ if [ ! -e $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
||||
curl -sSL -o $SERVER https://repo.spongepowered.org/maven/org/spongepowered/$TYPE/$SPONGEVERSION/$SERVER
|
||||
fi
|
||||
|
||||
# Continue to Final Setup
|
||||
exec /start-finalSetup01World $@
|
||||
export FAMILY=SPONGE
|
||||
exec ${SCRIPTS:-/}start-setupWorld "$@"
|
||||
56
scripts/start-deployVanilla
Executable file
56
scripts/start-deployVanilla
Executable file
@@ -0,0 +1,56 @@
|
||||
#!/bin/bash
|
||||
|
||||
# shellcheck source=start-utils
|
||||
. "${SCRIPTS:-/}start-utils"
|
||||
isDebugging && set -x
|
||||
set -o pipefail
|
||||
|
||||
export SERVER="minecraft_server.${VANILLA_VERSION// /_}.jar"
|
||||
|
||||
if [ ! -e "$SERVER" ] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
||||
log "Downloading $SERVER ..."
|
||||
debug "Finding version manifest for $VANILLA_VERSION"
|
||||
versionManifestUrl=$(get 'https://launchermeta.mojang.com/mc/game/version_manifest.json' | jq --arg VANILLA_VERSION "$VANILLA_VERSION" --raw-output '[.versions[]|select(.id == $VANILLA_VERSION)][0].url')
|
||||
result=$?
|
||||
if [ $result != 0 ]; then
|
||||
log "ERROR failed to obtain version manifest URL ($result)"
|
||||
exit 1
|
||||
fi
|
||||
if [ "$versionManifestUrl" = "null" ]; then
|
||||
log "ERROR couldn't find a matching manifest entry for $VANILLA_VERSION"
|
||||
exit 1
|
||||
fi
|
||||
debug "Found version manifest at $versionManifestUrl"
|
||||
|
||||
serverDownloadUrl=$(get --json-path '$.downloads.server.url' "${versionManifestUrl}")
|
||||
result=$?
|
||||
if [ $result != 0 ]; then
|
||||
log "ERROR failed to obtain version manifest from $versionManifestUrl ($result)"
|
||||
exit 1
|
||||
elif [ "$serverDownloadUrl" = "null" ]; then
|
||||
log "ERROR version $VANILLA_VERSION does not provide a server download"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
debug "Downloading server from $serverDownloadUrl"
|
||||
get -o "$SERVER" "$serverDownloadUrl"
|
||||
result=$?
|
||||
if [ $result != 0 ]; then
|
||||
log "ERROR failed to download server from $serverDownloadUrl ($result)"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if versionLessThan 1.6; then
|
||||
if ! [[ -L /data/minecraft_server.jar && /data/minecraft_server.jar -ef "/data/$SERVER" ]]; then
|
||||
rm -f /data/minecraft_server.jar
|
||||
ln -s "/data/$SERVER" /data/minecraft_server.jar
|
||||
fi
|
||||
SERVER=minecraft_server.jar
|
||||
elif [[ -L /data/minecraft_server.jar ]]; then
|
||||
rm -f /data/minecraft_server.jar
|
||||
fi
|
||||
|
||||
isDebugging && ls -l
|
||||
export FAMILY=VANILLA
|
||||
exec "${SCRIPTS:-/}start-setupWorld" "$@"
|
||||
366
scripts/start-finalExec
Executable file
366
scripts/start-finalExec
Executable file
@@ -0,0 +1,366 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${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
|
||||
|
||||
if [ -n "$ICON" ]; then
|
||||
if [ ! -e server-icon.png ] || [ "${OVERRIDE_ICON}" == "TRUE" ]; then
|
||||
log "Using server icon from $ICON..."
|
||||
# Not sure what it is yet...call it "img"
|
||||
curl -sSL -o /tmp/icon.img $ICON
|
||||
specs=$(identify /tmp/icon.img | awk '{print $2,$3}')
|
||||
if [ "$specs" = "PNG 64x64" ]; then
|
||||
mv /tmp/icon.img /data/server-icon.png
|
||||
else
|
||||
log "Converting image to 64x64 PNG..."
|
||||
convert /tmp/icon.img -resize 64x64! /data/server-icon.png
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
canUseRollingLogs=true
|
||||
|
||||
patchLog4jConfig() {
|
||||
file=${1?}
|
||||
url=${2?}
|
||||
if ! get -o "$file" "$url"; then
|
||||
log "ERROR: failed to download corrected log4j config"
|
||||
exit 1
|
||||
fi
|
||||
JVM_OPTS="-Dlog4j.configurationFile=${file} ${JVM_OPTS}"
|
||||
canUseRollingLogs=false
|
||||
}
|
||||
|
||||
# Patch Log4j remote code execution vulnerability
|
||||
# See https://www.minecraft.net/en-us/article/important-message--security-vulnerability-java-edition
|
||||
if versionLessThan 1.7; then
|
||||
: # No patch required here.
|
||||
elif isFamily VANILLA && versionLessThan 1.12; then
|
||||
patchLog4jConfig log4j2_17-111.xml https://launcher.mojang.com/v1/objects/dd2b723346a8dcd48e7f4d245f6bf09e98db9696/log4j2_17-111.xml
|
||||
elif isFamily VANILLA && versionLessThan 1.17; then
|
||||
patchLog4jConfig log4j2_112-116.xml https://launcher.mojang.com/v1/objects/02937d122c86ce73319ef9975b58896fc1b491d1/log4j2_112-116.xml
|
||||
# See https://purpurmc.org/docs/Log4j/
|
||||
elif isType PURPUR && versionLessThan 1.17; then
|
||||
patchLog4jConfig purpur_log4j2_1141-1165.xml https://purpurmc.org/docs/xml/purpur_log4j2_1141-1165.xml
|
||||
elif isType PURPUR && versionLessThan 1.18.1; then
|
||||
patchLog4jConfig purpur_log4j2_117.xml https://purpurmc.org/docs/xml/purpur_log4j2_117.xml
|
||||
elif versionLessThan 1.18.1; then
|
||||
JVM_OPTS="-Dlog4j2.formatMsgNoLookups=true ${JVM_OPTS}"
|
||||
fi
|
||||
|
||||
if isTrue ${ENABLE_ROLLING_LOGS:-false}; then
|
||||
if ! ${canUseRollingLogs}; then
|
||||
log "ERROR: Using rolling logs is currently not possible in the selected version due to CVE-2021-44228"
|
||||
exit 1
|
||||
fi
|
||||
# Set up log configuration
|
||||
LOGFILE="/data/log4j2.xml"
|
||||
if [ ! -e "$LOGFILE" ]; then
|
||||
log "Creating log4j2.xml in ${LOGFILE}"
|
||||
cp /tmp/log4j2.xml "$LOGFILE"
|
||||
else
|
||||
log "log4j2.xml already created, skipping"
|
||||
fi
|
||||
JVM_OPTS="-Dlog4j.configurationFile=/data/log4j2.xml ${JVM_OPTS}"
|
||||
fi
|
||||
|
||||
# Make sure files exist and are valid JSON (for pre-1.12 to 1.12 upgrades)
|
||||
log "Checking for JSON files."
|
||||
JSON_FILES=$(find /data -maxdepth 1 -name '*.json')
|
||||
for j in $JSON_FILES; do
|
||||
if [[ $(cat "$j" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') == "" ]]; then
|
||||
log "Fixing JSON $j"
|
||||
echo '[]' > $j
|
||||
fi
|
||||
done
|
||||
|
||||
# Optional disable console
|
||||
if versionLessThan 1.14 && [[ ${CONSOLE,,} = false ]]; then
|
||||
EXTRA_ARGS+=" --noconsole"
|
||||
fi
|
||||
|
||||
# Optional disable GUI for headless servers
|
||||
if [[ ${GUI} = false || ${GUI} = FALSE ]]; then
|
||||
EXTRA_ARGS+=" nogui"
|
||||
fi
|
||||
|
||||
: "${INIT_MEMORY:=${MEMORY}}"
|
||||
: "${MAX_MEMORY:=${MEMORY}}"
|
||||
|
||||
expandedDOpts=
|
||||
if [ -n "$JVM_DD_OPTS" ]; then
|
||||
for dopt in $JVM_DD_OPTS
|
||||
do
|
||||
expandedDOpts="${expandedDOpts} -D${dopt/:/=}"
|
||||
done
|
||||
fi
|
||||
|
||||
if isTrue ${ENABLE_JMX}; then
|
||||
: ${JMX_PORT:=7091}
|
||||
JVM_OPTS="${JVM_OPTS}
|
||||
-Dcom.sun.management.jmxremote.local.only=false
|
||||
-Dcom.sun.management.jmxremote.port=${JMX_PORT}
|
||||
-Dcom.sun.management.jmxremote.rmi.port=${JMX_PORT}
|
||||
-Dcom.sun.management.jmxremote.authenticate=false
|
||||
-Dcom.sun.management.jmxremote.ssl=false
|
||||
-Dcom.sun.management.jmxremote.host=${JMX_BINDING:-0.0.0.0}
|
||||
-Djava.rmi.server.hostname=${JMX_HOST:-localhost}"
|
||||
|
||||
log "JMX is enabled. Make sure you have port forwarding for ${JMX_PORT}"
|
||||
fi
|
||||
|
||||
if isTrue "${USE_AIKAR_FLAGS}"; then
|
||||
# From https://mcflags.emc.gs/
|
||||
|
||||
if (( $(normalizeMemSize "${MAX_MEMORY}") >= $(normalizeMemSize 12g) )); then
|
||||
log "Using Aikar's >12GB flags"
|
||||
G1NewSizePercent=40
|
||||
G1MaxNewSizePercent=50
|
||||
G1HeapRegionSize=16M
|
||||
G1ReservePercent=15
|
||||
InitiatingHeapOccupancyPercent=20
|
||||
else
|
||||
log "Using Aikar's flags"
|
||||
G1NewSizePercent=30
|
||||
G1MaxNewSizePercent=40
|
||||
G1HeapRegionSize=8M
|
||||
G1ReservePercent=20
|
||||
InitiatingHeapOccupancyPercent=15
|
||||
fi
|
||||
|
||||
JVM_XX_OPTS="${JVM_XX_OPTS}
|
||||
-XX:+UseG1GC
|
||||
-XX:+ParallelRefProcEnabled
|
||||
-XX:MaxGCPauseMillis=200
|
||||
-XX:+UnlockExperimentalVMOptions
|
||||
-XX:+DisableExplicitGC
|
||||
-XX:+AlwaysPreTouch
|
||||
-XX:G1NewSizePercent=${G1NewSizePercent}
|
||||
-XX:G1MaxNewSizePercent=${G1MaxNewSizePercent}
|
||||
-XX:G1HeapRegionSize=${G1HeapRegionSize}
|
||||
-XX:G1ReservePercent=${G1ReservePercent}
|
||||
-XX:G1HeapWastePercent=5
|
||||
-XX:G1MixedGCCountTarget=4
|
||||
-XX:InitiatingHeapOccupancyPercent=${InitiatingHeapOccupancyPercent}
|
||||
-XX:G1MixedGCLiveThresholdPercent=90
|
||||
-XX:G1RSetUpdatingPauseTimePercent=5
|
||||
-XX:SurvivorRatio=32
|
||||
-XX:+PerfDisableSharedMem
|
||||
-XX:MaxTenuringThreshold=1
|
||||
-Dusing.aikars.flags=https://mcflags.emc.gs
|
||||
-Daikars.new.flags=true
|
||||
"
|
||||
fi
|
||||
|
||||
if isTrue "${USE_FLARE_FLAGS}"; then
|
||||
JVM_XX_OPTS="${JVM_XX_OPTS}
|
||||
-XX:+UnlockDiagnosticVMOptions
|
||||
-XX:+DebugNonSafepoints
|
||||
"
|
||||
fi
|
||||
|
||||
if isTrue "${DEBUG_MEMORY}"; then
|
||||
log "Memory usage and availability (in MB)"
|
||||
uname -a
|
||||
free -m
|
||||
fi
|
||||
|
||||
if [[ ${INIT_MEMORY} || ${MAX_MEMORY} ]]; then
|
||||
log "Setting initial memory to ${INIT_MEMORY:=${MEMORY}} and max to ${MAX_MEMORY:=${MEMORY}}"
|
||||
if [[ ${INIT_MEMORY} ]]; then
|
||||
JVM_OPTS="-Xms${INIT_MEMORY} ${JVM_OPTS}"
|
||||
fi
|
||||
if [[ ${MAX_MEMORY} ]]; then
|
||||
JVM_OPTS="-Xmx${MAX_MEMORY} ${JVM_OPTS}"
|
||||
fi
|
||||
fi
|
||||
|
||||
function copyFilesForCurseForge() {
|
||||
# copy player modification files unconditionally since their
|
||||
# processing into json is additive anyway
|
||||
[ -f /data/ops.txt ] && cp -f /data/ops.txt "${FTB_DIR}/"
|
||||
[ -f /data/white-list.txt ] && cp -f /data/white-list.txt "${FTB_DIR}/"
|
||||
|
||||
if [ ! -e "${FTB_DIR}/server-icon.png" -a -e /data/server-icon.png ]; then
|
||||
cp -f /data/server-icon.png "${FTB_DIR}/"
|
||||
fi
|
||||
|
||||
cp -f /data/eula.txt "${FTB_DIR}/"
|
||||
}
|
||||
|
||||
mcServerRunnerArgs=(
|
||||
--stop-duration "${STOP_DURATION:-60}s"
|
||||
--named-pipe "${CONSOLE_IN_NAMED_PIPE:-/tmp/minecraft-console-in}"
|
||||
)
|
||||
if [[ ${STOP_SERVER_ANNOUNCE_DELAY} ]]; then
|
||||
mcServerRunnerArgs+=(--stop-server-announce-delay "${STOP_SERVER_ANNOUNCE_DELAY}s")
|
||||
fi
|
||||
|
||||
if [[ ${TYPE} == "CURSEFORGE" && "${SERVER}" ]]; then
|
||||
copyFilesForCurseForge
|
||||
|
||||
cd "${FTB_DIR}" || (log "ERROR: can't go into ${FTB_DIR}"; exit 1)
|
||||
log "Starting CurseForge server in ${FTB_DIR}..."
|
||||
if isTrue ${DEBUG_EXEC}; then
|
||||
set -x
|
||||
fi
|
||||
exec mc-server-runner ${bootstrapArgs} "${mcServerRunnerArgs[@]}" java $JVM_XX_OPTS $JVM_OPTS $expandedDOpts -jar $(basename "${SERVER}") "$@" $EXTRA_ARGS
|
||||
elif [[ ${TYPE} == "CURSEFORGE" ]]; then
|
||||
mcServerRunnerArgs+=(--shell bash)
|
||||
|
||||
copyFilesForCurseForge
|
||||
|
||||
cat > "${FTB_DIR}/settings-local.sh" <<EOF
|
||||
export MIN_RAM="${INIT_MEMORY}"
|
||||
export MAX_RAM="${MAX_MEMORY}"
|
||||
export JAVA_PARAMETERS="${JVM_XX_OPTS} ${JVM_OPTS} $expandedDOpts"
|
||||
EOF
|
||||
|
||||
# patch CurseForge cfg file, if present
|
||||
if [ -f "${FTB_DIR}/settings.cfg" ] && [[ ${MAX_MEMORY} ]]; then
|
||||
sed -i "s/MAX_RAM=[^;]*/MAX_RAM=${MAX_MEMORY}/" "${FTB_DIR}/settings.cfg"
|
||||
fi
|
||||
|
||||
cd "${FTB_DIR}" || (log "ERROR: can't go into ${FTB_DIR}"; exit 1)
|
||||
log "Running FTB ${FTB_SERVER_START} in ${FTB_DIR} ..."
|
||||
|
||||
finalArgs="${FTB_SERVER_START}"
|
||||
|
||||
if isTrue "${SETUP_ONLY:=false}"; then
|
||||
echo "SETUP_ONLY: ${finalArgs}"
|
||||
exit
|
||||
fi
|
||||
|
||||
if isTrue ${DEBUG_EXEC}; then
|
||||
set -x
|
||||
fi
|
||||
if isTrue ${EXEC_DIRECTLY:-false}; then
|
||||
"${finalArgs[@]}"
|
||||
else
|
||||
exec mc-server-runner "${mcServerRunnerArgs[@]}" "${finalArgs[@]}"
|
||||
fi
|
||||
elif [[ $SERVER =~ run.sh ]]; then
|
||||
log "Using Forge supplied run.sh script..."
|
||||
echo $JVM_XX_OPTS $JVM_OPTS $expandedDOpts > user_jvm_args.txt
|
||||
exec mc-server-runner "${mcServerRunnerArgs[@]}" --shell bash "${SERVER}"
|
||||
else
|
||||
# If we have a bootstrap.txt file... feed that in to the server stdin
|
||||
if [ -f /data/bootstrap.txt ]; then
|
||||
bootstrapArgs="--bootstrap /data/bootstrap.txt"
|
||||
fi
|
||||
|
||||
log "Starting the Minecraft server..."
|
||||
|
||||
finalArgs=(
|
||||
$JVM_XX_OPTS
|
||||
$JVM_OPTS
|
||||
$expandedDOpts
|
||||
-jar "$SERVER"
|
||||
"$@" $EXTRA_ARGS
|
||||
)
|
||||
|
||||
if isTrue ${SETUP_ONLY:=false}; then
|
||||
echo "SETUP_ONLY: java ${finalArgs[*]}"
|
||||
exit
|
||||
fi
|
||||
|
||||
if isTrue "${DEBUG_EXEC}"; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
if isTrue "${EXEC_DIRECTLY:-false}"; then
|
||||
exec java "${finalArgs[@]}"
|
||||
else
|
||||
exec mc-server-runner ${bootstrapArgs} "${mcServerRunnerArgs[@]}" java "${finalArgs[@]}"
|
||||
fi
|
||||
fi
|
||||
|
||||
77
scripts/start-setupDatapack
Executable file
77
scripts/start-setupDatapack
Executable file
@@ -0,0 +1,77 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e -o pipefail
|
||||
|
||||
: "${REMOVE_OLD_DATAPACKS:=false}"
|
||||
: "${DATAPACKS_FILE:=}"
|
||||
: "${REMOVE_OLD_DATAPACKS_DEPTH:=1} "
|
||||
: "${REMOVE_OLD_DATAPACKS_INCLUDE:=*.zip}"
|
||||
|
||||
# shellcheck source=start-utils
|
||||
. "${SCRIPTS:-/}start-utils"
|
||||
isDebugging && set -x
|
||||
|
||||
out_dir=/data/${LEVEL:-world}/datapacks
|
||||
|
||||
# Remove old datapacks
|
||||
if isTrue "${REMOVE_OLD_DATAPACKS}" && [ -z "${DATAPACKS_FILE}" ]; then
|
||||
if [ -d "$out_dir" ]; then
|
||||
find "$out_dir" -mindepth 1 -maxdepth ${REMOVE_OLD_DATAPACKS_DEPTH:-16} -wholename "${REMOVE_OLD_DATAPACKS_INCLUDE:-*}" -not -wholename "${REMOVE_OLD_DATAPACKS_EXCLUDE:-}" -delete
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "$DATAPACKS" ]]; then
|
||||
mkdir -p "$out_dir"
|
||||
|
||||
for i in ${DATAPACKS//,/ }
|
||||
do
|
||||
if isURL "$i"; then
|
||||
log "Downloading datapack $i ..."
|
||||
if ! get -o "${out_dir}" "$i"; then
|
||||
log "ERROR: failed to download from $i into $out_dir"
|
||||
exit 2
|
||||
fi
|
||||
elif [[ -f "$i" && "$i" =~ .*\.zip ]]; then
|
||||
log "Copying datapack located at $i ..."
|
||||
out_file=$(basename "$i")
|
||||
if ! cp "$i" "${out_dir}/$out_file"; then
|
||||
log "ERROR: failed to copy from $i into $out_dir"
|
||||
exit 2
|
||||
fi
|
||||
elif [[ -d "$i" ]]; then
|
||||
log "Copying datapacks from $i ..."
|
||||
cp "$i"/*.zip "${out_dir}"
|
||||
else
|
||||
log "ERROR Invalid URL or path given in DATAPACKS: $i"
|
||||
exit 2
|
||||
fi
|
||||
done
|
||||
|
||||
elif [[ "$DATAPACKS_FILE" ]]; then
|
||||
if [ ! -f "$DATAPACKS_FILE" ]; then
|
||||
log "ERROR: given DATAPACKS_FILE file does not exist"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
mkdir -p "$out_dir"
|
||||
|
||||
args=(
|
||||
-o "${out_dir}"
|
||||
--log-progress-each
|
||||
--skip-existing
|
||||
--uris-file "${DATAPACKS_FILE}"
|
||||
)
|
||||
if isTrue "${REMOVE_OLD_DATAPACKS}"; then
|
||||
args+=(
|
||||
--prune-others "${REMOVE_OLD_DATAPACKS_INCLUDE}"
|
||||
--prune-depth "${REMOVE_OLD_DATAPACKS_DEPTH}"
|
||||
)
|
||||
fi
|
||||
|
||||
if ! get "${args[@]}" ; then
|
||||
log "ERROR: failed to retrieve one or more datapacks"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
exec "${SCRIPTS:-/}start-setupForgeApiMods" "$@"
|
||||
35
scripts/start-setupEnvVariables
Executable file
35
scripts/start-setupEnvVariables
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/bin/bash
|
||||
|
||||
# shellcheck source=start-utils
|
||||
. "${SCRIPTS:-/}start-utils"
|
||||
|
||||
set -e
|
||||
|
||||
: "${REPLACE_ENV_IN_PLACE:=${REPLACE_ENV_VARIABLES:-false}}"
|
||||
: "${REPLACE_ENV_PATHS:=/data}"
|
||||
: "${REPLACE_ENV_SUFFIXES:=yml,yaml,txt,cfg,conf,properties,hjson,json,tml,toml}"
|
||||
: "${REPLACE_ENV_VARIABLE_PREFIX:=${ENV_VARIABLE_PREFIX:-CFG_}}"
|
||||
: "${REPLACE_ENV_VARIABLES_EXCLUDES:=}"
|
||||
: "${REPLACE_ENV_VARIABLES_EXCLUDE_PATHS:=}"
|
||||
: "${PATCH_DEFINITIONS:=}"
|
||||
: "${DEBUG:=false}"
|
||||
|
||||
if isTrue "${REPLACE_ENV_IN_PLACE}"; then
|
||||
log "Replacing env variables in ${REPLACE_ENV_PATHS} that match the prefix $REPLACE_ENV_VARIABLE_PREFIX ..."
|
||||
|
||||
mc-image-helper --debug=${DEBUG} interpolate \
|
||||
--replace-env-file-suffixes="${REPLACE_ENV_SUFFIXES}" \
|
||||
--replace-env-excludes="${REPLACE_ENV_VARIABLES_EXCLUDES}" \
|
||||
--replace-env-exclude-paths="${REPLACE_ENV_VARIABLES_EXCLUDE_PATHS}" \
|
||||
--replace-env-prefix="${REPLACE_ENV_VARIABLE_PREFIX}" \
|
||||
"${REPLACE_ENV_PATHS[@]}"
|
||||
fi
|
||||
|
||||
if [[ ${PATCH_DEFINITIONS} ]]; then
|
||||
log "Applying patch definitions from ${PATCH_DEFINITIONS}"
|
||||
mc-image-helper --debug=${DEBUG} patch \
|
||||
--patch-env-prefix="${REPLACE_ENV_VARIABLE_PREFIX}" \
|
||||
"${PATCH_DEFINITIONS}"
|
||||
fi
|
||||
|
||||
exec "${SCRIPTS:-/}start-finalExec" "$@"
|
||||
177
scripts/start-setupForgeApiMods
Normal file
177
scripts/start-setupForgeApiMods
Normal file
@@ -0,0 +1,177 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e -o pipefail
|
||||
|
||||
: "${MODS_FORGEAPI_KEY:=}"
|
||||
: "${REMOVE_OLD_FORGEAPI_MODS:=false}"
|
||||
: "${MODS_FORGEAPI_PROJECTIDS:=}"
|
||||
: "${MODS_FORGEAPI_FILE:=}"
|
||||
: "${MODS_FORGEAPI_RELEASES:=RELEASE}"
|
||||
: "${REMOVE_OLD_MODS_DEPTH:=1} "
|
||||
: "${REMOVE_OLD_MODS_INCLUDE:=*.jar}"
|
||||
|
||||
# FORGEAPI_BASE_URL used in manifest downloads below
|
||||
FORGEAPI_BASE_URL=${FORGEAPI_BASE_URL:-https://api.curseforge.com/v1}
|
||||
RELEASE_NUMBER_FILTER=1
|
||||
MINECRAFT_GAME_ID=432
|
||||
out_dir=/data/mods
|
||||
|
||||
# shellcheck source=start-utils
|
||||
. "${SCRIPTS:-/}start-utils"
|
||||
isDebugging && set -x
|
||||
|
||||
# Remove old mods/plugins
|
||||
if isTrue "${REMOVE_OLD_FORGEAPI_MODS}" && [ -z "${MODS_FORGEAPI_FILE}" ]; then
|
||||
removeOldMods /data/mods
|
||||
fi
|
||||
|
||||
ensureModKey(){
|
||||
if [ -z "$MODS_FORGEAPI_KEY" ]; then
|
||||
log "ERROR: MODS_FORGEAPI_KEY REQUIRED to Connect to FORGE API, you supplied: ${MODS_FORGEAPI_KEY}"
|
||||
exit 2
|
||||
fi
|
||||
}
|
||||
|
||||
# Set the global release type per the text.
|
||||
# NOTE: downcasing release type for comparing types.
|
||||
updateReleaseNumber(){
|
||||
releaseType=$1
|
||||
if [ "release" = "${releaseType,,}" ]; then
|
||||
RELEASE_NUMBER_FILTER=1
|
||||
elif [ "beta" = "${releaseType,,}" ]; then
|
||||
RELEASE_NUMBER_FILTER=2
|
||||
elif [ "alpha" = "${releaseType,,}" ]; then
|
||||
RELEASE_NUMBER_FILTER=3
|
||||
fi
|
||||
}
|
||||
|
||||
retrieveVersionTypeNumber(){
|
||||
VERSION_NAME="Minecraft ${VANILLA_VERSION%.*}"
|
||||
minecraft_types=$(curl -X GET -s \
|
||||
"${FORGEAPI_BASE_URL}/games/${MINECRAFT_GAME_ID}/version-types" \
|
||||
-H 'Accept: application/json' -H 'x-api-key: '${MODS_FORGEAPI_KEY}'')
|
||||
|
||||
if [ ! "$minecraft_types" ]; then
|
||||
log "ERROR: unable to retrieve version types for ${VERSION_NAME} from ForgeAPI"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
TYPE_ID=$(jq -n "$minecraft_types" | jq --arg VERSION_NAME "$VERSION_NAME" -jc '
|
||||
.data[] | select(.name==$VERSION_NAME) | .id')
|
||||
|
||||
if [ ! "$TYPE_ID" ]; then
|
||||
log "ERROR: unable to retrieve version types for ${VERSION_NAME} from ForgeAPI"
|
||||
exit 2
|
||||
fi
|
||||
}
|
||||
|
||||
modFileByProjectID(){
|
||||
project_id=$(echo $1 | tr -d '"')
|
||||
project_id_release_type=$2
|
||||
unset PROJECT_FILE
|
||||
|
||||
# if Type id isn't defined use minecraft version to go get it.
|
||||
if [ ! "$TYPE_ID" ]; then
|
||||
retrieveVersionTypeNumber
|
||||
fi
|
||||
|
||||
# JQ is struggling with larger page sizes so having to pagination for mods with a lot of releases
|
||||
pageSize=42
|
||||
index=0
|
||||
total_count=1
|
||||
|
||||
while [ $index -lt $total_count ]; do
|
||||
project_files=$(curl -X GET -s \
|
||||
"${FORGEAPI_BASE_URL}/mods/${project_id}/files?gameVersionTypeId=${TYPE_ID}&index=${index}&pageSize=${pageSize}" \
|
||||
-H 'Accept: application/json' -H 'x-api-key: '${MODS_FORGEAPI_KEY}'')
|
||||
|
||||
if [ ! "$project_files" ]; then
|
||||
log "ERROR: unable to retrieve any project id files for ${project_id} from ForgeAPI"
|
||||
exit 2
|
||||
fi
|
||||
# Use project files to grab out the total count of mods.
|
||||
total_count=$(jq -n "$project_files" | jq -c '.pagination.totalCount' )
|
||||
|
||||
# Checking for a individual release type input, if not use global
|
||||
if [ $project_id_release_type ]; then
|
||||
updateReleaseNumber $project_id_release_type
|
||||
else
|
||||
updateReleaseNumber $MODS_FORGEAPI_RELEASES
|
||||
fi
|
||||
# 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.
|
||||
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]')
|
||||
|
||||
# Logic to grab the latest release over the entire pagination
|
||||
if [ ! "$PROJECT_FILE" ]; then
|
||||
PROJECT_FILE=$current_project_file
|
||||
elif [ "$current_project_file" ]; then
|
||||
current_project_file_id=$(jq -n "$current_project_file" | jq -jc '.id' )
|
||||
PROJECT_FILE_ID=$(jq -n "$PROJECT_FILE" | jq -jc '.id' )
|
||||
if (( current_project_file_id > PROJECT_FILE_ID )); then
|
||||
PROJECT_FILE=$current_project_file
|
||||
fi
|
||||
fi
|
||||
|
||||
# check to see if we have gone to far or lost our index and exit with an error
|
||||
if [ -z "$index" ] || [ -z "$total_count" ] || [ $index -ge $total_count ]; then
|
||||
log "ERROR: Unable to retrieve any files for ${project_id} from ForgeAPI also Validate files have release type associated with no. ${RELEASE_NUMBER_FILTER}"
|
||||
exit 2
|
||||
fi
|
||||
# Increment start index to new set.
|
||||
index=$(($index + $pageSize))
|
||||
done
|
||||
}
|
||||
|
||||
downloadModPackfromModFile() {
|
||||
if [ ! "$PROJECT_FILE" ]; then
|
||||
log "ERROR: Project File not found from the ForgeAPI"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# grabs needed values from our json return
|
||||
file_name=$(jq -n "$PROJECT_FILE" | jq -jc '.fileName' )
|
||||
download_url=$(jq -n "$PROJECT_FILE" | jq -jc '.downloadUrl' )
|
||||
|
||||
# trys to make the output directory incase it doesnt exist.
|
||||
mkdir -p "$out_dir"
|
||||
echo "Downloading ${download_url}"
|
||||
if ! get -o "${out_dir}/${file_name}" $download_url ; then
|
||||
log "ERROR: failed to download from ${download_url}"
|
||||
exit 2
|
||||
fi
|
||||
}
|
||||
|
||||
# Use forge api json file to filter and download the correct mods
|
||||
if [ "$MODS_FORGEAPI_FILE" ] && [ -z "$MODS_FORGEAPI_PROJECTIDS" ]; then
|
||||
ensureModKey
|
||||
if [ ! -f "$MODS_FORGEAPI_FILE" ]; then
|
||||
log "ERROR: given MODS_FORGEAPI_FILE file does not exist"
|
||||
exit 2
|
||||
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.
|
||||
for project_id in ${MODS_FORGEAPI_PROJECTIDS//,/ }; do
|
||||
current_release_type=$(jq --arg PROJECT_ID "$project_id" -jc '
|
||||
.[] | select(.projectId==$PROJECT_ID) | .releaseType' "$MODS_FORGEAPI_FILE")
|
||||
modFileByProjectID $project_id $current_release_type
|
||||
downloadModPackfromModFile
|
||||
done
|
||||
fi
|
||||
|
||||
# Use only project ids and global release data.
|
||||
if [ "$MODS_FORGEAPI_PROJECTIDS" ] && [ -z "$MODS_FORGEAPI_FILE" ]; then
|
||||
ensureModKey
|
||||
for project_id in ${MODS_FORGEAPI_PROJECTIDS//,/ }; do
|
||||
modFileByProjectID $project_id
|
||||
downloadModPackfromModFile
|
||||
done
|
||||
fi
|
||||
|
||||
exec "${SCRIPTS:-/}start-setupModpack" "$@"
|
||||
7
start-finalSetup03Modconfig → scripts/start-setupModconfig
Normal file → Executable file
7
start-finalSetup03Modconfig → scripts/start-setupModconfig
Normal file → Executable file
@@ -1,6 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
. /start-utils
|
||||
# shellcheck source=start-utils
|
||||
. "${SCRIPTS:-/}start-utils"
|
||||
|
||||
# If supplied with a URL for a config (simple zip of configurations), download it and unpack
|
||||
if [[ "$MODCONFIG" ]]; then
|
||||
@@ -9,7 +10,7 @@ case "X$MODCONFIG" in
|
||||
log "Downloading mod/plugin configs via HTTP"
|
||||
log " from $MODCONFIG ..."
|
||||
curl -sSL -o /tmp/modconfig.zip "$MODCONFIG"
|
||||
if [ "$TYPE" = "SPIGOT" ]; then
|
||||
if [ "$FAMILY" = "SPIGOT" ]; then
|
||||
mkdir -p /data/plugins
|
||||
unzip -o -d /data/plugins /tmp/modconfig.zip
|
||||
else
|
||||
@@ -24,4 +25,4 @@ case "X$MODCONFIG" in
|
||||
esac
|
||||
fi
|
||||
|
||||
exec /start-finalSetup04ServerProperties $@
|
||||
exec "${SCRIPTS:-/}start-setupMounts" "$@"
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user