mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-02-17 15:13:55 +00:00
Compare commits
725 Commits
minecraft-
...
1.5.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
092b530537 | ||
|
|
cf691499a1 | ||
|
|
0bb9cccdc6 | ||
|
|
4cb12f6cae | ||
|
|
ecbdeb2096 | ||
|
|
9a7a532f7b | ||
|
|
825833c859 | ||
|
|
c4c3613874 | ||
|
|
3a03156cb3 | ||
|
|
b3780186f8 | ||
|
|
c4654e44d8 | ||
|
|
9c6047e3fc | ||
|
|
260cc7d180 | ||
|
|
bbe930e552 | ||
|
|
a655fe860e | ||
|
|
ddf36aa879 | ||
|
|
34c31c561d | ||
|
|
3cc7d00d71 | ||
|
|
ed214b1382 | ||
|
|
f8405e298c | ||
|
|
539159ba50 | ||
|
|
f2c9d2f905 | ||
|
|
1b11331881 | ||
|
|
b71afff29f | ||
|
|
b4c6950f95 | ||
|
|
ec0329efb1 | ||
|
|
477caa12c3 | ||
|
|
8f82ff9b1d | ||
|
|
7d97fdcbec | ||
|
|
5ee0150154 | ||
|
|
1bcacfc474 | ||
|
|
34603184a4 | ||
|
|
2ee5a25c91 | ||
|
|
60ef1b8867 | ||
|
|
3eaf756aa2 | ||
|
|
bc318fa185 | ||
|
|
f93c42a23f | ||
|
|
f5dde77efe | ||
|
|
2b7f923865 | ||
|
|
80099ad63d | ||
|
|
b273bf2947 | ||
|
|
2241ba8819 | ||
|
|
3cf58e3caf | ||
|
|
450442a916 | ||
|
|
8c866bd17d | ||
|
|
8deaf1850b | ||
|
|
6da2aca975 | ||
|
|
11989d17e3 | ||
|
|
5aa6e5c2a9 | ||
|
|
825398f4d4 | ||
|
|
ccac249c01 | ||
|
|
f2806d9335 | ||
|
|
b11806e341 | ||
|
|
71a7afab17 | ||
|
|
ede58d9159 | ||
|
|
b271b529ea | ||
|
|
d24690ab8c | ||
|
|
89fa3ff8fe | ||
|
|
5c0a3a64ab | ||
|
|
b66629b951 | ||
|
|
de866a322f | ||
|
|
79ac19937f | ||
|
|
08e8fcdc7c | ||
|
|
6941e63a2c | ||
|
|
c68997936a | ||
|
|
40547439b2 | ||
|
|
691fe638e4 | ||
|
|
fbdee6a7a7 | ||
|
|
664f3d7eaa | ||
|
|
c2846fc586 | ||
|
|
e9b1332119 | ||
|
|
757a5146a1 | ||
|
|
f9defda106 | ||
|
|
e6a3ca0a1f | ||
|
|
1cf478f5b3 | ||
|
|
9ff94f9bd5 | ||
|
|
9842a52820 | ||
|
|
dbca9c30b0 | ||
|
|
220f2fbd79 | ||
|
|
8dbbdd8cd2 | ||
|
|
1c2a0c506c | ||
|
|
90a6707280 | ||
|
|
e7cc54092a | ||
|
|
cd70cbcbea | ||
|
|
7910005086 | ||
|
|
b8ace17b7c | ||
|
|
f70814d6b6 | ||
|
|
8440e57118 | ||
|
|
29eda3530c | ||
|
|
558544f1e4 | ||
|
|
56c2f0b466 | ||
|
|
4bbc7d142f | ||
|
|
26cc3943ce | ||
|
|
6521f45f0b | ||
|
|
d62c2ffb42 | ||
|
|
d131941b62 | ||
|
|
98f0b36cfc | ||
|
|
6465bca640 | ||
|
|
4ad447ba6c | ||
|
|
736979c20b | ||
|
|
0c34a61332 | ||
|
|
67d58678a3 | ||
|
|
fb92a74084 | ||
|
|
8b5430ca44 | ||
|
|
f24827f558 | ||
|
|
f49b967d5a | ||
|
|
111ca85c4f | ||
|
|
c73bedc63c | ||
|
|
6f67f76eef | ||
|
|
002ed4bc77 | ||
|
|
9d48e79c64 | ||
|
|
ba7db26157 | ||
|
|
fc6129261b | ||
|
|
7702d98766 | ||
|
|
04ed016175 | ||
|
|
1aaaf95950 | ||
|
|
1e334ca7d5 | ||
|
|
74df4b6a9c | ||
|
|
f63463e654 | ||
|
|
a24b633ccb | ||
|
|
5b8cd8cdcc | ||
|
|
c35c85e9b5 | ||
|
|
2ffc1641a0 | ||
|
|
9d67dceff3 | ||
|
|
c449a31b37 | ||
|
|
efd3427fc0 | ||
|
|
88ed017ca7 | ||
|
|
30ba3a4b78 | ||
|
|
c8380daee5 | ||
|
|
8afb1651fd | ||
|
|
9560903c80 | ||
|
|
e94f6608d2 | ||
|
|
949faf1620 | ||
|
|
5b3259b1ef | ||
|
|
485d7b0612 | ||
|
|
94b037428e | ||
|
|
b401873298 | ||
|
|
1c9bbee3b3 | ||
|
|
5fa33c7813 | ||
|
|
581d5fde1d | ||
|
|
382336d39d | ||
|
|
5bd3a818a3 | ||
|
|
97874f3481 | ||
|
|
135bafefeb | ||
|
|
15b8c5a7e7 | ||
|
|
15990071d4 | ||
|
|
d00f9d3609 | ||
|
|
5ad745de75 | ||
|
|
b67580af2c | ||
|
|
2900062df5 | ||
|
|
67fe8931dd | ||
|
|
e6f593e8c4 | ||
|
|
8924740cfe | ||
|
|
34d4ae0b59 | ||
|
|
62a4541df5 | ||
|
|
401958c0d6 | ||
|
|
8859d223bf | ||
|
|
621962ad9c | ||
|
|
5c238af3df | ||
|
|
8e148095f0 | ||
|
|
3c55a05b1c | ||
|
|
d293a65f5e | ||
|
|
e6bfa01db5 | ||
|
|
4e122a67d3 | ||
|
|
b11863d3b2 | ||
|
|
93197ffb77 | ||
|
|
f02baa8761 | ||
|
|
19e39b84ec | ||
|
|
53800e460f | ||
|
|
e061cc7163 | ||
|
|
e61942f33e | ||
|
|
f8b97bf909 | ||
|
|
ed272da302 | ||
|
|
e8b7975295 | ||
|
|
cae1a20973 | ||
|
|
165150a852 | ||
|
|
ad2674bf8e | ||
|
|
b72266f7bf | ||
|
|
79c864ae19 | ||
|
|
451eec4db5 | ||
|
|
539f7ada70 | ||
|
|
c60156d245 | ||
|
|
281bd3660f | ||
|
|
5ffc37ac80 | ||
|
|
807f4cb32b | ||
|
|
f23925f87f | ||
|
|
511912acc1 | ||
|
|
1531e38ab6 | ||
|
|
4f3789ef96 | ||
|
|
e751369d38 | ||
|
|
3ddbbf41d8 | ||
|
|
47c3cd096a | ||
|
|
df9909a8e4 | ||
|
|
73843ec783 | ||
|
|
ede30188b0 | ||
|
|
b679edbd62 | ||
|
|
fe846d8f28 | ||
|
|
0abb9edad8 | ||
|
|
9ff1b18935 | ||
|
|
67b41bb356 | ||
|
|
77b34f4c2c | ||
|
|
a698c4127c | ||
|
|
35e2448f8e | ||
|
|
da1a3a47cd | ||
|
|
98cec98dd9 | ||
|
|
342907dcba | ||
|
|
0e209eacee | ||
|
|
098888cfc6 | ||
|
|
1148aa3fe3 | ||
|
|
0ca336505d | ||
|
|
be17faf065 | ||
|
|
a73c63f482 | ||
|
|
45d3ef288f | ||
|
|
8b253fe50e | ||
|
|
1f58f59335 | ||
|
|
b48a13ed1d | ||
|
|
5a8f2a7395 | ||
|
|
34b96e0b63 | ||
|
|
6a12c33c33 | ||
|
|
b29e76b128 | ||
|
|
40a26b8caf | ||
|
|
28467d44b6 | ||
|
|
da34a546b5 | ||
|
|
4d45618125 | ||
|
|
4d1a05ccb0 | ||
|
|
03cac08999 | ||
|
|
a316bd8f95 | ||
|
|
73046d7499 | ||
|
|
67cf80d70f | ||
|
|
b51b19b3c0 | ||
|
|
1cc902062a | ||
|
|
36f5857de3 | ||
|
|
aef8f54903 | ||
|
|
fe3df584ef | ||
|
|
a73d99c552 | ||
|
|
72328ca8bc | ||
|
|
f3d5e75c22 | ||
|
|
fff075cc68 | ||
|
|
cca23aa683 | ||
|
|
ae72f9ac70 | ||
|
|
2b2ec51206 | ||
|
|
6135feec56 | ||
|
|
b38c00881b | ||
|
|
301e33f224 | ||
|
|
22417858a3 | ||
|
|
5d55ce2b25 | ||
|
|
a994e67ebf | ||
|
|
57a840b069 | ||
|
|
a273ef1763 | ||
|
|
a63f474109 | ||
|
|
d368978949 | ||
|
|
90d721763d | ||
|
|
6fc9ba4996 | ||
|
|
10e08e172a | ||
|
|
46270f6bd5 | ||
|
|
1c9274ad96 | ||
|
|
542798f7a6 | ||
|
|
bcf95e5799 | ||
|
|
02332ee8cd | ||
|
|
da4911c668 | ||
|
|
829eeebb7e | ||
|
|
20885c6cf7 | ||
|
|
f6465b5dac | ||
|
|
bd084cc261 | ||
|
|
895b7d74f5 | ||
|
|
ddbd88c601 | ||
|
|
7e34cf5ac9 | ||
|
|
8c26947fbc | ||
|
|
091e79c550 | ||
|
|
a31e2a8506 | ||
|
|
52d4cae74d | ||
|
|
cc83007cea | ||
|
|
0d9c2d13f9 | ||
|
|
ccec190cb2 | ||
|
|
c3ac69a030 | ||
|
|
fd4e9d93e0 | ||
|
|
2e353c084a | ||
|
|
9b1272edac | ||
|
|
479be8016a | ||
|
|
3f3a2d8433 | ||
|
|
7be2020879 | ||
|
|
73974d1c40 | ||
|
|
a4a22f3bfc | ||
|
|
491abfc833 | ||
|
|
7dc699ffbb | ||
|
|
3fee3f0f41 | ||
|
|
cf8b6e5d05 | ||
|
|
3bac706b8a | ||
|
|
6e3761ae91 | ||
|
|
b88ae49c3b | ||
|
|
79756d13fd | ||
|
|
44d2081b7b | ||
|
|
e8be7685e9 | ||
|
|
2d6316e6c3 | ||
|
|
009309966b | ||
|
|
d3e64ed56f | ||
|
|
715d9be403 | ||
|
|
ebe0a30c14 | ||
|
|
c8eb0f5874 | ||
|
|
90907f7b1e | ||
|
|
d898796672 | ||
|
|
ed32de76ca | ||
|
|
07fc31b401 | ||
|
|
a0db92cb5e | ||
|
|
f33a94a6e2 | ||
|
|
bab31f1198 | ||
|
|
a5614ec03b | ||
|
|
70f49be4fc | ||
|
|
173f612d74 | ||
|
|
ba4578f451 | ||
|
|
1c5e4b17bf | ||
|
|
f65548894f | ||
|
|
b910a7dbe5 | ||
|
|
1c24dc1def | ||
|
|
d9c2f26506 | ||
|
|
7005f00df0 | ||
|
|
6ec6655280 | ||
|
|
848cd8b994 | ||
|
|
8a26e73dab | ||
|
|
f66e1ff103 | ||
|
|
5215dd569a | ||
|
|
ab5fe2d076 | ||
|
|
92f577e788 | ||
|
|
4c0d53ee92 | ||
|
|
c8cc882a57 | ||
|
|
a95bfdb192 | ||
|
|
2a1fba1b45 | ||
|
|
a44d114176 | ||
|
|
cce473c676 | ||
|
|
5fb09f57e3 | ||
|
|
eeacdc1e20 | ||
|
|
d0577a43fd | ||
|
|
e8b25d20a3 | ||
|
|
4192bea3ab | ||
|
|
4ff14fbf61 | ||
|
|
f0102119b6 | ||
|
|
848e9e40e4 | ||
|
|
a12a258058 | ||
|
|
bfa198de4e | ||
|
|
04b4a3e8ca | ||
|
|
f7d62474e8 | ||
|
|
5bf4a3fd1d | ||
|
|
35ec677446 | ||
|
|
f4631703ca | ||
|
|
767fa4962b | ||
|
|
08ba471710 | ||
|
|
d93f6bad16 | ||
|
|
488e478374 | ||
|
|
e2bf56938b | ||
|
|
5267927c3f | ||
|
|
1f04ca946c | ||
|
|
959bdeef54 | ||
|
|
2627317e03 | ||
|
|
c288557188 | ||
|
|
7f82d3098c | ||
|
|
0a7a666904 | ||
|
|
7bbe2fd28d | ||
|
|
8857abdc05 | ||
|
|
423b45cb7b | ||
|
|
6ef6bc68c2 | ||
|
|
b8e996d3c4 | ||
|
|
345696227d | ||
|
|
66330af708 | ||
|
|
3444d88e4d | ||
|
|
95416a799e | ||
|
|
dc3c93becf | ||
|
|
ce4b4ad208 | ||
|
|
7afa00b72c | ||
|
|
230b575983 | ||
|
|
2f3e93c619 | ||
|
|
59753d8310 | ||
|
|
4fb881a583 | ||
|
|
e42e9ac489 | ||
|
|
f5f20f3563 | ||
|
|
931c27a5ec | ||
|
|
bc100163c2 | ||
|
|
3a64e32184 | ||
|
|
b9787182e6 | ||
|
|
7797bf23fb | ||
|
|
f347f30353 | ||
|
|
eb239bfdb7 | ||
|
|
7047e565fc | ||
|
|
f178c6c0a1 | ||
|
|
ee5a95baa8 | ||
|
|
0c1c6d198c | ||
|
|
a0e605814f | ||
|
|
518986d28e | ||
|
|
2357914b4c | ||
|
|
e5a4428515 | ||
|
|
6b9033318b | ||
|
|
9ee907783d | ||
|
|
463cc62b75 | ||
|
|
5afd98edd8 | ||
|
|
8b9051d72e | ||
|
|
d6392f3aa9 | ||
|
|
fe808be91b | ||
|
|
2cab10e906 | ||
|
|
7f39d1f22e | ||
|
|
a9184368c1 | ||
|
|
caf2fc2ab6 | ||
|
|
5dd8141e5e | ||
|
|
2ff28675d4 | ||
|
|
519bd986b5 | ||
|
|
e41efba176 | ||
|
|
0502813496 | ||
|
|
932a6828f9 | ||
|
|
d176ef3f6a | ||
|
|
deb98268f6 | ||
|
|
e1531c3237 | ||
|
|
47af45a430 | ||
|
|
0195b42eea | ||
|
|
f875af5cdb | ||
|
|
32a918b902 | ||
|
|
d09a56075f | ||
|
|
e261fae348 | ||
|
|
5b8668d73f | ||
|
|
123292b56b | ||
|
|
0e0828f47f | ||
|
|
532c9fa69a | ||
|
|
e509563b10 | ||
|
|
899f31917c | ||
|
|
e6ca9a1c6d | ||
|
|
24c68b9c2c | ||
|
|
2891e1ac3e | ||
|
|
da9618c08b | ||
|
|
cb6643a345 | ||
|
|
71527b87c1 | ||
|
|
df25a22634 | ||
|
|
5c6a2cf44f | ||
|
|
536a7f6095 | ||
|
|
df9e725baf | ||
|
|
156716a7d8 | ||
|
|
0876ef7704 | ||
|
|
5c3ea25ff3 | ||
|
|
bd8e0cf5d2 | ||
|
|
1d5c4e3b0b | ||
|
|
6a565692a0 | ||
|
|
cf68446a00 | ||
|
|
c4a92f6706 | ||
|
|
7bb397a031 | ||
|
|
d86f034e96 | ||
|
|
20385507d8 | ||
|
|
91def1176d | ||
|
|
2e03ee4197 | ||
|
|
e8dd60a831 | ||
|
|
dc15094b8a | ||
|
|
fc807429e4 | ||
|
|
5ec21fc0ba | ||
|
|
3a0a8a9ced | ||
|
|
b9b05dbdfc | ||
|
|
179e72cda0 | ||
|
|
2b9514ab0b | ||
|
|
8a04a9f72e | ||
|
|
3a7af8e8d6 | ||
|
|
615d12bce3 | ||
|
|
72d055ac19 | ||
|
|
80c18004c1 | ||
|
|
97e9b2901c | ||
|
|
027d94cc77 | ||
|
|
66261af03d | ||
|
|
290e2c734a | ||
|
|
54d19715c7 | ||
|
|
bbe1533f91 | ||
|
|
97040f61ed | ||
|
|
55801ac11c | ||
|
|
07c32d8ee4 | ||
|
|
2e631bcbd9 | ||
|
|
c96c630fe5 | ||
|
|
f69e75cfc1 | ||
|
|
6157a693f1 | ||
|
|
854a158d3d | ||
|
|
18919ef33c | ||
|
|
32b0737e70 | ||
|
|
79eb164e90 | ||
|
|
e3296c3cc0 | ||
|
|
f5dbbcc2c6 | ||
|
|
134eaedf23 | ||
|
|
4a89f3c579 | ||
|
|
17420ed590 | ||
|
|
2125fa0855 | ||
|
|
5c14c30a78 | ||
|
|
788d06c086 | ||
|
|
1a88c96beb | ||
|
|
b8d69278e4 | ||
|
|
4a7ecffcbb | ||
|
|
9fe0021a7a | ||
|
|
262816bd2d | ||
|
|
e44d27c00a | ||
|
|
5062bc91ab | ||
|
|
dde4132d2c | ||
|
|
9bb3628792 | ||
|
|
03a5bb1ab0 | ||
|
|
3a9a1dc043 | ||
|
|
36ced1c630 | ||
|
|
2d8b3d7275 | ||
|
|
f48eedee78 | ||
|
|
08d459c373 | ||
|
|
0cb0755739 | ||
|
|
3e8eca6e28 | ||
|
|
a179f5f7ba | ||
|
|
f2955bcc2f | ||
|
|
a0c1ed88d1 | ||
|
|
de6d7a64ac | ||
|
|
3bf560bfbe | ||
|
|
f1b58323d3 | ||
|
|
d4a888073b | ||
|
|
54844930bb | ||
|
|
b26714c9c1 | ||
|
|
f03a8f0edc | ||
|
|
048beefadc | ||
|
|
de3545e8d9 | ||
|
|
e766301d1e | ||
|
|
3348083424 | ||
|
|
1e0183a3b1 | ||
|
|
fd0500feb2 | ||
|
|
e86138cdf2 | ||
|
|
ddb69ced3b | ||
|
|
c48f85cc4f | ||
|
|
aa13deecdb | ||
|
|
4c0f24613c | ||
|
|
b5bcea7d61 | ||
|
|
76d4fd1bbc | ||
|
|
f7523eef4e | ||
|
|
c38bfb22cc | ||
|
|
8cea619c13 | ||
|
|
e570ac8715 | ||
|
|
d14d666e24 | ||
|
|
8956d43c47 | ||
|
|
911fcf8b42 | ||
|
|
3e61c8084f | ||
|
|
fe6e8c04ff | ||
|
|
f1293ff979 | ||
|
|
5c5b8cd999 | ||
|
|
074424a5bd | ||
|
|
99b1de0bbd | ||
|
|
47c3350c10 | ||
|
|
84bb96ef38 | ||
|
|
ada4a1fab5 | ||
|
|
ea78bdd559 | ||
|
|
fa790ab787 | ||
|
|
281c044999 | ||
|
|
b9dcdee34b | ||
|
|
87b2ce1c24 | ||
|
|
55e38181bd | ||
|
|
ac3cbe75a9 | ||
|
|
d89de80db8 | ||
|
|
1e1a572227 | ||
|
|
379905c6ff | ||
|
|
ec1dd96a7c | ||
|
|
413de37568 | ||
|
|
3147c5638f | ||
|
|
0832bb0c43 | ||
|
|
b97348d703 | ||
|
|
4cff161deb | ||
|
|
b1c0e598ad | ||
|
|
63035c347b | ||
|
|
c806c425fd | ||
|
|
0defd266a6 | ||
|
|
dd5a21067b | ||
|
|
2d48bcb1a0 | ||
|
|
5617936f10 | ||
|
|
b5e459ab0a | ||
|
|
ae9109e2bf | ||
|
|
b9f247728f | ||
|
|
3052cd1155 | ||
|
|
46c865a123 | ||
|
|
cf5d194b14 | ||
|
|
0ea4ea7d0c | ||
|
|
a6580b3fe3 | ||
|
|
a4835ec331 | ||
|
|
21c9be4ec1 | ||
|
|
786192e4b7 | ||
|
|
8610e7d621 | ||
|
|
a195583990 | ||
|
|
a1ead0634e | ||
|
|
b23fb93366 | ||
|
|
68d731c096 | ||
|
|
a4bd241be6 | ||
|
|
5f104a32db | ||
|
|
03d9064b35 | ||
|
|
b15ad9e799 | ||
|
|
17bfedd137 | ||
|
|
afa25e582d | ||
|
|
7651cc658e | ||
|
|
dd0bcda23c | ||
|
|
afa710455d | ||
|
|
70a55e3be1 | ||
|
|
13ee106dac | ||
|
|
6253d5ddc0 | ||
|
|
63e3123ab0 | ||
|
|
1be18346ce | ||
|
|
9a90acab23 | ||
|
|
edd69c40f6 | ||
|
|
582c60cd03 | ||
|
|
13a6d91295 | ||
|
|
d0263f31d6 | ||
|
|
4ab31a049b | ||
|
|
4b74d13f08 | ||
|
|
2afbdc959e | ||
|
|
9fa27b9a3d | ||
|
|
16b3f18400 | ||
|
|
79f9e02446 | ||
|
|
a313c03fff | ||
|
|
e76068e63e | ||
|
|
2427cae5a2 | ||
|
|
e902c6f40f | ||
|
|
ef34025dd8 | ||
|
|
0acedd04b9 | ||
|
|
2f5402195c | ||
|
|
764ae807e0 | ||
|
|
32cb5f44e4 | ||
|
|
a6e32f0ea9 | ||
|
|
111883e0d5 | ||
|
|
847f403bd3 | ||
|
|
39bb0d75e2 | ||
|
|
01473c4e43 | ||
|
|
b3a79d6b08 | ||
|
|
5484f50659 | ||
|
|
53e727298e | ||
|
|
a4aa177d6e | ||
|
|
a412cfddad | ||
|
|
594c9873c4 | ||
|
|
94442458e3 | ||
|
|
f75d735540 | ||
|
|
fec75cb117 | ||
|
|
007fca149c | ||
|
|
ac608b7abb | ||
|
|
7f048c5e8b | ||
|
|
53932e64f2 | ||
|
|
19b77ba18b | ||
|
|
f911230c1b | ||
|
|
1c7469bb8c | ||
|
|
b5abb012db | ||
|
|
64b428f920 | ||
|
|
9ffdc49c1b | ||
|
|
3f5fa1642b | ||
|
|
6570028c06 | ||
|
|
ed19d745cb | ||
|
|
f2e6696368 | ||
|
|
83c31483f7 | ||
|
|
b077b3fcf2 | ||
|
|
81ab299419 | ||
|
|
53a0d0cf7a | ||
|
|
99b884f18a | ||
|
|
ebc0405e72 | ||
|
|
b86370295c | ||
|
|
7e624b90dd | ||
|
|
6ba5fe29c1 | ||
|
|
f9c7dddb19 | ||
|
|
ea32f70dd7 | ||
|
|
0f466e2146 | ||
|
|
128dd8950a | ||
|
|
5c947fd4ab | ||
|
|
5792b2996a | ||
|
|
57ca565d64 | ||
|
|
63925a794c | ||
|
|
d4d070018a | ||
|
|
8594054047 | ||
|
|
6f62af7d85 | ||
|
|
b1f9d1c7c6 | ||
|
|
8c3b0a720d | ||
|
|
cc3730e5a9 | ||
|
|
7b58d59cef | ||
|
|
84c3ea2465 | ||
|
|
78d9add46c | ||
|
|
2f18e7be04 | ||
|
|
011108cd7e | ||
|
|
1600b75513 | ||
|
|
9962d28f41 | ||
|
|
ea08a6b496 | ||
|
|
a61d44ff30 | ||
|
|
5e14d3fbdd | ||
|
|
eb28c2c980 | ||
|
|
024800201f | ||
|
|
32e5f94a87 | ||
|
|
88032acbfb | ||
|
|
22e1abe628 | ||
|
|
01d9c54575 | ||
|
|
fab9669b42 | ||
|
|
df09adbfd7 | ||
|
|
9e373d8b4d | ||
|
|
2f4b73d862 | ||
|
|
a252d794f9 | ||
|
|
79438e14de | ||
|
|
ddbc7e9618 | ||
|
|
87140179f2 | ||
|
|
14a1e5fb2a | ||
|
|
2e8704a311 | ||
|
|
b1741cab7b | ||
|
|
d63bc698d8 | ||
|
|
574fc53a55 | ||
|
|
b75379a980 | ||
|
|
086d9fb4ae | ||
|
|
214fcda183 | ||
|
|
4dff67e03b | ||
|
|
78d82b334b | ||
|
|
3059282c7a | ||
|
|
88509c66a6 | ||
|
|
307a9b119f | ||
|
|
6c58660a73 | ||
|
|
b7f5088b13 | ||
|
|
abee16a143 | ||
|
|
8319b336c7 | ||
|
|
6ea862859b | ||
|
|
88a796bb44 | ||
|
|
a8c3afbe88 | ||
|
|
60b6eea1e2 | ||
|
|
bc9afcd659 | ||
|
|
052f80d849 | ||
|
|
7e847829ee | ||
|
|
44c0eee0f9 | ||
|
|
0337f9fac1 | ||
|
|
287185919a | ||
|
|
b895e07e82 | ||
|
|
6396e58d3c | ||
|
|
4de10e1ba8 | ||
|
|
1a364ae733 | ||
|
|
9ffa2daeaa | ||
|
|
8973e7dc7b | ||
|
|
3c8db58c7e | ||
|
|
ee9f27546b | ||
|
|
8a2199a890 | ||
|
|
b4be1b37bd | ||
|
|
d590bc62c1 | ||
|
|
9349ca6d04 |
5
.dockerignore
Normal file
5
.dockerignore
Normal file
@@ -0,0 +1,5 @@
|
||||
data
|
||||
examples
|
||||
k8s-examples
|
||||
.idea
|
||||
.git
|
||||
2
.editorconfig
Normal file
2
.editorconfig
Normal file
@@ -0,0 +1,2 @@
|
||||
[start-*]
|
||||
indent_size = 2
|
||||
17
.gitattributes
vendored
Normal file
17
.gitattributes
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
# Auto detect text files and perform LF normalization
|
||||
* text=auto
|
||||
|
||||
# Custom for Visual Studio
|
||||
*.cs diff=csharp
|
||||
|
||||
# Standard to msysgit
|
||||
*.doc diff=astextplain
|
||||
*.DOC diff=astextplain
|
||||
*.docx diff=astextplain
|
||||
*.DOCX diff=astextplain
|
||||
*.dot diff=astextplain
|
||||
*.DOT diff=astextplain
|
||||
*.pdf diff=astextplain
|
||||
*.PDF diff=astextplain
|
||||
*.rtf diff=astextplain
|
||||
*.RTF diff=astextplain
|
||||
6
.github/no-response.yml
vendored
Normal file
6
.github/no-response.yml
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
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.
|
||||
35
.github/workflows/main.yml
vendored
Normal file
35
.github/workflows/main.yml
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
name: Build and Publish
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- openj9
|
||||
- openj9-nightly
|
||||
- adopt11
|
||||
- adopt13
|
||||
tags:
|
||||
- "[0-9]+.[0-9]+.[0-9]+"
|
||||
- "[0-9]+.[0-9]+.[0-9]+-openj9"
|
||||
- "[0-9]+.[0-9]+.[0-9]+-openj9-nightly"
|
||||
- "[0-9]+.[0-9]+.[0-9]+-adopt11"
|
||||
- "[0-9]+.[0-9]+.[0-9]+-adopt13"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Build and push Docker images
|
||||
uses: docker/build-push-action@v1.1.0
|
||||
with:
|
||||
repository: itzg/minecraft-server
|
||||
username: ${{ secrets.DOCKER_USER }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
tag_with_ref: true
|
||||
tag_with_sha: false
|
||||
cache_froms: itzg/minecraft-server:latest
|
||||
add_git_labels: true
|
||||
push: true
|
||||
19
.github/workflows/pr.yml
vendored
Normal file
19
.github/workflows/pr.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
name: Validate PR
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Build Docker image
|
||||
uses: docker/build-push-action@v1.1.0
|
||||
with:
|
||||
tag_with_sha: true
|
||||
cache_froms: itzg/minecraft-server:latest
|
||||
push: false
|
||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1 +1,3 @@
|
||||
.idea/
|
||||
/data/
|
||||
/.idea/
|
||||
*.iml
|
||||
74
DEVELOPMENT.md
Normal file
74
DEVELOPMENT.md
Normal file
@@ -0,0 +1,74 @@
|
||||
## Adding a server type
|
||||
|
||||
Adding a new server `TYPE` can vary due to the complexity of obtaining and configuring each type; however, the addition of any server type includes at least the following steps:
|
||||
|
||||
1. Copy an existing "start-deploy*" script, such as [start-deployMohist](start-deployMohist) and rename it accordingly making sure to retain the "start-deploy" prefix
|
||||
2. Modify the type-specific behavior between the "start-utils" preamble and the hand-off to `start-finalSetupWorld` at the end of the script
|
||||
3. Develop and test the changes using the [iterative process described below](#iterative-script-development)
|
||||
4. Add a case-entry to the `case "${TYPE^^}"` in [start-configuration](start-configuration)
|
||||
5. Add a section to the [README](README.md). It is recommended to copy-modify an existing section to retain a similar wording and level of detail
|
||||
6. [Submit a pull request](https://github.com/itzg/docker-minecraft-server/pulls)
|
||||
|
||||
## Iterative script development
|
||||
|
||||
Individual scripts can be iteratively developed, debugged, and tested using the following procedure.
|
||||
|
||||
First, build a baseline of the image to include the packages needed by existing or new scripts:
|
||||
|
||||
```shell script
|
||||
docker build -t mc-dev .
|
||||
```
|
||||
|
||||
Using the baseline image, an interactive container can be started to iteratively run the scripts to be developed. By attaching the current workspace directory, you can use the local editor of your choice to iteratively modify scripts while using the container to run them.
|
||||
|
||||
```shell script
|
||||
docker run -it --rm -v ${PWD}:/scripts -e SCRIPTS=/scripts/ --entrypoint bash mc-dev
|
||||
```
|
||||
|
||||
From within the container you can run individual scripts via the attached `/scripts/` path; however, be sure to set any environment variables expected by the scripts by either `export`ing them manually:
|
||||
|
||||
```shell script
|
||||
export VANILLA_VERSION=1.12.2
|
||||
/scripts/start-magma
|
||||
```
|
||||
|
||||
...or pre-pending script execution:
|
||||
|
||||
```shell script
|
||||
VANILLA_VERSION=1.12.2 /scripts/start-magma
|
||||
```
|
||||
|
||||
> NOTE: You may want to temporarily add an `exit` statement near the end of your script to isolate execution to just the script you're developing.
|
||||
|
||||
## Multi-base-image variants
|
||||
|
||||
Several base-image variants are maintained in order to offer choices in JDK provider and version. The variants are maintained in their respective branches:
|
||||
- openj9
|
||||
- openj9-nightly
|
||||
- adopt11
|
||||
- adopt13
|
||||
- multiarch
|
||||
|
||||
The [docker-versions-create.sh](docker-versions-create.sh) script is configured with the branches to maintain and is used to merge changes from the master branch into the mulit-base variant branches. The script also manages git tagging the master branch along with the merged branches. So a typical use of the script would be like:
|
||||
|
||||
```shell script
|
||||
./docker-versions-create.sh -s -t 1.2.0
|
||||
```
|
||||
|
||||
> Most often the major version will be bumped unless a bug or hotfix needs to be published in which case the patch version should be incremented.
|
||||
|
||||
> The build and publishing of those branches and their tags is currently performed within Docker Hub.
|
||||
|
||||
## multiarch support
|
||||
|
||||
The [multiarch branch](https://github.com/itzg/docker-minecraft-server/tree/multiarch) supports running the image on amd64, arm64, and armv7 (aka RaspberryPi). Unlike the mainline branches, it is based on Ubuntu 18.04 since the openjdk package provided by Ubuntu includes full JIT support on all of the processor types.
|
||||
|
||||
The multiarch images are built and published by [a Github action](https://github.com/itzg/docker-minecraft-server/actions?query=workflow%3A%22Build+and+publish+multiarch%22), which [is configured in that branch](https://github.com/itzg/docker-minecraft-server/blob/multiarch/.github/workflows/build-multiarch.yml).
|
||||
|
||||
## Generating release notes
|
||||
|
||||
The following git command can be used to provide the bulk of release notes content:
|
||||
|
||||
```shell script
|
||||
git log --invert-grep --grep "^ci:" --grep "^misc:" --grep "^docs:" --pretty="- %s" 1.1.0..1.2.0
|
||||
```
|
||||
85
Dockerfile
Normal file
85
Dockerfile
Normal file
@@ -0,0 +1,85 @@
|
||||
FROM openjdk:8u212-jre-alpine
|
||||
|
||||
LABEL maintainer "itzg"
|
||||
|
||||
RUN apk add --no-cache -U \
|
||||
openssl \
|
||||
imagemagick \
|
||||
lsof \
|
||||
su-exec \
|
||||
shadow \
|
||||
bash \
|
||||
curl iputils wget \
|
||||
git \
|
||||
jq \
|
||||
mysql-client \
|
||||
tzdata \
|
||||
rsync \
|
||||
nano \
|
||||
sudo \
|
||||
knock \
|
||||
ttf-dejavu
|
||||
|
||||
RUN addgroup -g 1000 minecraft \
|
||||
&& adduser -Ss /bin/false -u 1000 -G minecraft -h /home/minecraft minecraft \
|
||||
&& mkdir -m 777 /data \
|
||||
&& chown minecraft:minecraft /data /home/minecraft
|
||||
|
||||
COPY 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 EASY_ADD_VER=0.7.1
|
||||
ADD https://github.com/itzg/easy-add/releases/download/${EASY_ADD_VER}/easy-add_${TARGETOS}_${TARGETARCH}${TARGETVARIANT} /usr/bin/easy-add
|
||||
RUN chmod +x /usr/bin/easy-add
|
||||
|
||||
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
||||
--var version=1.2.0 --var app=restify --file {{.app}} \
|
||||
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
||||
--var version=1.4.3 --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
|
||||
|
||||
COPY mcstatus /usr/local/bin
|
||||
|
||||
VOLUME ["/data"]
|
||||
COPY server.properties /tmp/server.properties
|
||||
COPY log4j2.xml /tmp/log4j2.xml
|
||||
WORKDIR /data
|
||||
|
||||
ENV UID=1000 GID=1000 \
|
||||
JVM_XX_OPTS="-XX:+UseG1GC" MEMORY="1G" \
|
||||
TYPE=VANILLA VERSION=LATEST FORGEVERSION=RECOMMENDED SPONGEBRANCH=STABLE SPONGEVERSION= FABRICVERSION=LATEST LEVEL=world \
|
||||
PVP=true DIFFICULTY=easy ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \
|
||||
LEVEL_TYPE=DEFAULT SERVER_PORT=25565 ONLINE_MODE=TRUE SERVER_NAME="Dedicated Server" \
|
||||
ENABLE_AUTOPAUSE=false AUTOPAUSE_TIMEOUT_EST=3600 AUTOPAUSE_TIMEOUT_KN=120 AUTOPAUSE_TIMEOUT_INIT=600 AUTOPAUSE_PERIOD=10
|
||||
|
||||
COPY start* /
|
||||
COPY health.sh /
|
||||
ADD files/autopause /autopause
|
||||
|
||||
RUN dos2unix /start* && chmod +x /start*
|
||||
RUN dos2unix /health.sh && chmod +x /health.sh
|
||||
RUN dos2unix /autopause/* && chmod +x /autopause/*.sh
|
||||
|
||||
ENTRYPOINT [ "/start" ]
|
||||
HEALTHCHECK --start-period=1m CMD /health.sh
|
||||
1
Minecraft server containment.xml
Normal file
1
Minecraft server containment.xml
Normal file
@@ -0,0 +1 @@
|
||||
<mxfile userAgent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36" version="6.4.4" editor="www.draw.io" type="github"><diagram name="Page-1">1VVNc5swEP01HDMDUiDOMbGd5pK2Ux96VkGAxgJRIRvcX9+VWD40ODOZ1j0Uz9jS2w+t3ts1Ad1W/SfNmvJNZVwGJMz6gO4CQjZRCN8WuAxA8vgwAIUW2QBFM3AQvziCGFecRMZbz9EoJY1ofDBVdc1T42FMa9X5brmS/qkNK/gKOKRMrtHvIjMlolEYzoZXLooSj97EaPjB0mOh1anG8wJCc/cM5oqNudC/LVmmugVE9wHdaqXMsKr6LZeW2pG2Ie7lHetUt+a1+UgAGQLOTJ74WHEiIfQ5E2dbn7kgJ8nPky3q2fDe3DEpijqgT+AheW5mK6wK/HVZ2obVI7ZT6ZFrCHlVrRkdoLSlzwJ2BYwo8WohXSkMPzQstfsOWhCcSlNJ2EX21JFVu8mFlFsllXahdJ/YD+Bnro0AyZ+Gu+yMslnwZjt3LVd/KurCpgptLlWbA5aBXNs0vH+X/mgSFWaFq4obfQEXDKDYBhd/2809RzeIlYt2mxwZ9nkxZZ61hgXKfV16upK+EjBMmuXmruX67KSCATMMYL2SwDU5z5DkvxAE52NNvdHqyBeOoXs8UWIbplP8A3ES3UCVja/K41oVEl5RJYpuoMr9SpU34B+Qr0rD0ITD0JE4TuI/nopwLcKLexYi6OFet6CT3Pt8TjwtCI3IFUJv0eXxis9v2y+fr/D58P/yGf87PmE7v4ycbfHCp/vf</diagram></mxfile>
|
||||
7
build
7
build
@@ -1,7 +0,0 @@
|
||||
pkgs="ubuntu-openjdk-7 gvm spring-boot"
|
||||
|
||||
for p in $pkgs
|
||||
do
|
||||
docker build -t itzg/$p $p
|
||||
done
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
FROM itzg/ubuntu-openjdk-7
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get install -yq git curl wget unzip openjdk-7-jdk
|
||||
|
||||
ENV MAVEN_VER 3.2.2
|
||||
ENV NODEJS_VER 0.10.29
|
||||
|
||||
WORKDIR /opt
|
||||
|
||||
RUN wget -O /tmp/maven.tgz http://apache.mirrors.pair.com/maven/maven-3/$MAVEN_VER/binaries/apache-maven-$MAVEN_VER-bin.tar.gz
|
||||
RUN tar xvf /tmp/maven.tgz && rm /tmp/maven.tgz
|
||||
ENV M2_HOME /opt/apache-maven-$MAVEN_VER
|
||||
ENV PATH $PATH:$M2_HOME/bin
|
||||
|
||||
RUN curl -s https://raw.githubusercontent.com/isaacs/nave/master/nave.sh > /usr/local/bin/nave
|
||||
RUN chmod +x /usr/local/bin/nave
|
||||
RUN nave usemain latest
|
||||
|
||||
WORKDIR /root
|
||||
env HOME /root
|
||||
|
||||
VOLUME ["/shared"]
|
||||
|
||||
RUN curl -s get.gvmtool.net | bash
|
||||
|
||||
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
CMD bash
|
||||
@@ -1,25 +0,0 @@
|
||||
Provides a development/build environment for Java, Groovy, and NodeJS.
|
||||
|
||||
* Provides 'gvm' for Groovy (and more) installation management
|
||||
* Provides 'nave' for NodeJS installation management
|
||||
* Pre-installs the latest NodeJS via nave
|
||||
|
||||
## Using the persistent/shared workarea
|
||||
|
||||
Since devbox containers are intended to be disposable, the image is configured
|
||||
with a "volume" at `/shared`.
|
||||
|
||||
There are a couple of ways you can leverage that volume. Either attach it to
|
||||
a host-local directory:
|
||||
|
||||
docker run -it -v $(pwd)/workarea:/shared --rm itzg/devbox
|
||||
|
||||
or run a "base" container and mounts the `/shared` from that onto any
|
||||
subsequent containers:
|
||||
|
||||
docker run --name devbox-base itzg/devbox touch /shared/READY
|
||||
...later...
|
||||
docker run -it --volumes-from devbox-base --rm itzg/devbox
|
||||
|
||||
**NOTE** I am using the `--rm` option so the devbox containers will be truly
|
||||
"burn after use".
|
||||
16
docker-compose.yml
Normal file
16
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: {}
|
||||
124
docker-versions-create.sh
Executable file
124
docker-versions-create.sh
Executable file
@@ -0,0 +1,124 @@
|
||||
#!/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')
|
||||
|
||||
function TrapExit {
|
||||
echo "Checking out back in master"
|
||||
git checkout master
|
||||
}
|
||||
|
||||
batchMode=false
|
||||
|
||||
while getopts "hbt:s" arg
|
||||
do
|
||||
case $arg in
|
||||
b)
|
||||
batchMode=true
|
||||
;;
|
||||
t)
|
||||
tag=${OPTARG}
|
||||
;;
|
||||
s)
|
||||
tagArgs="-s -m 'Signed during docker-versions-create"
|
||||
;;
|
||||
h)
|
||||
echo "
|
||||
Usage $0 [options]
|
||||
|
||||
Options:
|
||||
-b enable batch mode, which avoids interactive prompts and causes script to fail immediately
|
||||
when any merge fails
|
||||
-t TAG tag and push the current revision on master with the given tag
|
||||
and apply respective tags to each branch
|
||||
-s enable signed tags
|
||||
-h display this help and exit
|
||||
"
|
||||
exit
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported arg $arg"
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
${batchMode} && echo "Using batch mode"
|
||||
|
||||
trap TrapExit EXIT SIGTERM
|
||||
|
||||
test -d ./.git || { echo ".git folder was not found. Please start this script from root directory of the project!";
|
||||
exit 1; }
|
||||
|
||||
# Making sure we are in master
|
||||
git checkout master
|
||||
git pull --all || { echo "Can't pull the repo!"; \
|
||||
exit 1; }
|
||||
if [[ $tag ]]; then
|
||||
git tag $tag
|
||||
git push origin $tag
|
||||
fi
|
||||
|
||||
git_branches=$(git branch -a)
|
||||
|
||||
for branch in "${branches_list[@]}"; do
|
||||
if [[ "$git_branches" != *"$branch"* ]]; then
|
||||
echo "Can't update $branch because I can't find it in the list of branches."
|
||||
exit 1
|
||||
else
|
||||
echo "Branch $branch found. Working with it."
|
||||
git checkout "$branch" || { echo "Can't checkout into the branch. Don't know the cause."; \
|
||||
exit 1; }
|
||||
proceed='False'
|
||||
while [[ "$proceed" == "False" ]]; do
|
||||
# Ensure local branch is aligned with remote since docker-versions-create may have been run elsewhere
|
||||
git pull
|
||||
|
||||
if git merge -m 'Auto-merging via docker-versions-create' master; then
|
||||
proceed="True"
|
||||
echo "Branch $branch updated to current master successfully"
|
||||
# pushing changes to remote for this branch
|
||||
git commit -m "Auto merge branch with master" -a
|
||||
# push may fail if remote doesn't have this branch yet. In this case - sending branch
|
||||
git push || git push -u origin "$branch" || { echo "Can't push changes to the origin."; exit 1; }
|
||||
if [[ $tag ]]; then
|
||||
git tag "$tag-$branch"
|
||||
git push origin "$tag-$branch"
|
||||
fi
|
||||
elif ${batchMode}; then
|
||||
status=$?
|
||||
echo "Git merge failed in batch mode"
|
||||
exit ${status}
|
||||
# and trap exit gets us back to master
|
||||
else
|
||||
cat<<EOL
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
Master merge in the branch $branch encountered an error!
|
||||
You may try to fix the error and merge again. (Commit changes)
|
||||
Or skip this branch merge completely.
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
EOL
|
||||
printf "Should we try again? (y):"
|
||||
read -r answer
|
||||
if [[ "$answer" == '' ]] || [[ "$answer" == 'y' ]] || [[ "$answer" == 'Y' ]]; then
|
||||
# If you use non-local editor or files are changed in repo
|
||||
cat <<EOL
|
||||
|
||||
The following commands may encounter an error!
|
||||
This is completely fine if the changes were made locally and remote branch doesn't know about them.
|
||||
|
||||
EOL
|
||||
# Updating branch from remote before trying again
|
||||
git checkout master
|
||||
git fetch --all
|
||||
git pull -a
|
||||
git checkout "$branch"
|
||||
continue
|
||||
else
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
done
|
||||
@@ -1,5 +0,0 @@
|
||||
FROM dockerfile/elasticsearch
|
||||
|
||||
MAINTAINER itzg
|
||||
|
||||
RUN /elasticsearch/bin/plugin -i elasticsearch/marvel/latest
|
||||
@@ -1,11 +0,0 @@
|
||||
This image extends the official elasticsearch image by adding the Marvel Sense plugin. This will get you a system ready to use with the [ElasticSearch Getting Started Guide](http://www.elasticsearch.org/guide/en/elasticsearch/guide/current).
|
||||
|
||||
Start the container with a command-line such as
|
||||
|
||||
docker run -d --name es -p 9200:9200 -p 9300:9300 itzg/elasticsearch-marvel
|
||||
|
||||
and now with Marvel Sense installed you can access it using a URL like:
|
||||
|
||||
http://192.168.59.103:9200/_plugin/marvel/sense/index.html
|
||||
|
||||
(replacing the IP address shown here with your Docker host's)
|
||||
3
examples/README.md
Normal file
3
examples/README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# Deployment Examples
|
||||
|
||||
This directory contains various deployment examples of the [itzg/minecraft-server](https://hub.docker.com/r/itzg/minecraft-server/) Docker image.
|
||||
18
examples/docker-compose-autopause.yml
Normal file
18
examples/docker-compose-autopause.yml
Normal file
@@ -0,0 +1,18 @@
|
||||
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"
|
||||
restart: always
|
||||
|
||||
volumes:
|
||||
mc: {}
|
||||
29
examples/docker-compose-big.yml
Normal file
29
examples/docker-compose-big.yml
Normal file
@@ -0,0 +1,29 @@
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
minecraft:
|
||||
ports:
|
||||
- "25565:25565"
|
||||
volumes:
|
||||
- "mcbig:/data"
|
||||
environment:
|
||||
EULA: "TRUE"
|
||||
MAX_MEMORY: 32G
|
||||
MAX_BUILD_HEIGHT: 256
|
||||
VIEW_DISTANCE: 15
|
||||
LEVEL_TYPE: LARGEBIOMES
|
||||
MAX_PLAYERS: 100
|
||||
CONSOLE: "false"
|
||||
image: itzg/minecraft-server
|
||||
restart: always
|
||||
rcon:
|
||||
image: itzg/rcon
|
||||
ports:
|
||||
- "4326:4326"
|
||||
- "4327:4327"
|
||||
volumes:
|
||||
- "rcon:/opt/rcon-web-admin/db"
|
||||
|
||||
volumes:
|
||||
mcbig:
|
||||
rcon:
|
||||
13
examples/docker-compose-curseforge.yml
Normal file
13
examples/docker-compose-curseforge.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
version: '3.2'
|
||||
|
||||
services:
|
||||
mc:
|
||||
image: itzg/minecraft-server
|
||||
volumes:
|
||||
- ./modpacks:/modpacks:ro
|
||||
environment:
|
||||
EULA: "true"
|
||||
TYPE: CURSEFORGE
|
||||
CF_SERVER_MOD: /modpacks/SkyFactory_4_Server_4.1.0.zip
|
||||
ports:
|
||||
- 25565:25565
|
||||
20
examples/docker-compose-curseinstance.yml
Normal file
20
examples/docker-compose-curseinstance.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
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
|
||||
23
examples/docker-compose-forge.yml
Normal file
23
examples/docker-compose-forge.yml
Normal file
@@ -0,0 +1,23 @@
|
||||
version: "3.7"
|
||||
|
||||
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
|
||||
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: {}
|
||||
23
examples/docker-compose-ftba.yml
Normal file
23
examples/docker-compose-ftba.yml
Normal file
@@ -0,0 +1,23 @@
|
||||
version: "3.7"
|
||||
|
||||
services:
|
||||
mc:
|
||||
# FTBA support is only available in multiarch image tag
|
||||
image: itzg/minecraft-server:multiarch
|
||||
ports:
|
||||
# expose the Minecraft server port outside of container
|
||||
- 25565:25565
|
||||
environment:
|
||||
# REQUIRED for all types
|
||||
EULA: "TRUE"
|
||||
# Set server type (vs the default of vanilla)
|
||||
TYPE: FTBA
|
||||
# Use Pack ID from https://ftb.neptunepowered.org/pack/ftb-presents-direwolf20-1-12/
|
||||
FTB_MODPACK_ID: "31"
|
||||
volumes:
|
||||
# use a named, managed volume for data volume
|
||||
- mc_ftb:/data
|
||||
|
||||
volumes:
|
||||
# declared the named volume, but use default/local storage engine
|
||||
mc_ftb: {}
|
||||
18
examples/docker-compose-paper.yml
Normal file
18
examples/docker-compose-paper.yml
Normal file
@@ -0,0 +1,18 @@
|
||||
version: '3.7'
|
||||
|
||||
services:
|
||||
mc:
|
||||
image: itzg/minecraft-server
|
||||
environment:
|
||||
EULA: "true"
|
||||
TYPE: PAPER
|
||||
VERSION: 1.9.4
|
||||
# needed for Paper versions before 1.14
|
||||
CONSOLE: "false"
|
||||
ports:
|
||||
- 25565:25565
|
||||
volumes:
|
||||
- mc-paper:/data
|
||||
|
||||
volumes:
|
||||
mc-paper:
|
||||
16
examples/docker-compose-proxied.yml
Normal file
16
examples/docker-compose-proxied.yml
Normal file
@@ -0,0 +1,16 @@
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
mc:
|
||||
# build: .
|
||||
image: itzg/minecraft-server
|
||||
ports:
|
||||
- 25565:25565
|
||||
environment:
|
||||
EULA: "TRUE"
|
||||
# TYPE: SPIGOT
|
||||
# VERSION: 1.11.2
|
||||
PROXY: proxy:3128
|
||||
proxy:
|
||||
image: sameersbn/squid
|
||||
|
||||
34
examples/docker-compose-spongeforge.yml
Normal file
34
examples/docker-compose-spongeforge.yml
Normal file
@@ -0,0 +1,34 @@
|
||||
version: '3'
|
||||
# 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
|
||||
ports:
|
||||
- "25565:25565"
|
||||
volumes:
|
||||
- "mc:/data"
|
||||
environment:
|
||||
EULA: "TRUE"
|
||||
#VERSION: "1.12.2" (Ensure this is compatbile with the version of SpongeForge you are using!)
|
||||
TYPE: "FORGE"
|
||||
FORGEVERSION: "RECOMMENDED"
|
||||
#FORGEVERSION: "14.23.5.2807"
|
||||
CONSOLE: "false"
|
||||
ENABLE_RCON: "true"
|
||||
RCON_PASSWORD: "testing"
|
||||
RCON_PORT: 28016
|
||||
restart: unless-stopped
|
||||
rcon:
|
||||
image: itzg/rcon
|
||||
ports:
|
||||
- "4326:4326"
|
||||
- "4327:4327"
|
||||
volumes:
|
||||
- "rcon:/opt/rcon-web-admin/db"
|
||||
|
||||
volumes:
|
||||
mc:
|
||||
rcon:
|
||||
11
examples/docker-compose-world-download.yml
Normal file
11
examples/docker-compose-world-download.yml
Normal file
@@ -0,0 +1,11 @@
|
||||
version: "3.7"
|
||||
|
||||
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
|
||||
50
examples/k8s/using-statefulset.yml
Normal file
50
examples/k8s/using-statefulset.yml
Normal file
@@ -0,0 +1,50 @@
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
labels:
|
||||
app: example
|
||||
name: example
|
||||
spec:
|
||||
replicas: 1
|
||||
serviceName: example
|
||||
selector:
|
||||
matchLabels:
|
||||
app: example
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: example
|
||||
spec:
|
||||
containers:
|
||||
- name: mc
|
||||
image: itzg/minecraft-server
|
||||
env:
|
||||
- name: EULA
|
||||
value: "TRUE"
|
||||
volumeMounts:
|
||||
- mountPath: /data
|
||||
name: data
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: data
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
labels:
|
||||
service: example
|
||||
name: example
|
||||
spec:
|
||||
ports:
|
||||
- port: 25565
|
||||
targetPort: 25565
|
||||
selector:
|
||||
app: example
|
||||
type: LoadBalancer
|
||||
57
examples/k8s/vanilla-deployment.yml
Normal file
57
examples/k8s/vanilla-deployment.yml
Normal file
@@ -0,0 +1,57 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: mc-vanilla
|
||||
spec:
|
||||
type: NodePort
|
||||
ports:
|
||||
- port: 25565
|
||||
nodePort: 30000
|
||||
selector:
|
||||
app: mc-vanilla
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: mc-vanilla
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: mc-vanilla
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: mc-vanilla
|
||||
spec:
|
||||
containers:
|
||||
- image: itzg/minecraft-server
|
||||
name: mc-vanilla
|
||||
env:
|
||||
# Use secret in real usage
|
||||
- name: EULA
|
||||
value: "true"
|
||||
ports:
|
||||
- containerPort: 25565
|
||||
name: main
|
||||
readinessProbe:
|
||||
exec:
|
||||
command:
|
||||
- mcstatus
|
||||
- localhost
|
||||
- ping
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 5
|
||||
livenessProbe:
|
||||
exec:
|
||||
command:
|
||||
- mcstatus
|
||||
- localhost
|
||||
- ping
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 5
|
||||
volumeMounts:
|
||||
- name: mc-data
|
||||
mountPath: /data
|
||||
volumes:
|
||||
- name: mc-data
|
||||
emptyDir: {}
|
||||
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 @@
|
||||
Please 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/2787018>.
|
||||
5
examples/paper-build-plugins/Dockerfile
Normal file
5
examples/paper-build-plugins/Dockerfile
Normal file
@@ -0,0 +1,5 @@
|
||||
FROM itzg/minecraft-server
|
||||
|
||||
ENV TYPE=PAPER
|
||||
|
||||
COPY plugins/*.jar /plugins/
|
||||
11
examples/paper-build-plugins/docker-compose.yml
Normal file
11
examples/paper-build-plugins/docker-compose.yml
Normal file
@@ -0,0 +1,11 @@
|
||||
version: '3.7'
|
||||
|
||||
services:
|
||||
mc:
|
||||
build: .
|
||||
environment:
|
||||
EULA: "TRUE"
|
||||
ports:
|
||||
- 25565:25565
|
||||
stdin_open: true
|
||||
tty: true
|
||||
1
examples/paper-build-plugins/plugins/.gitignore
vendored
Normal file
1
examples/paper-build-plugins/plugins/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
*.jar
|
||||
1
examples/paper-build-plugins/plugins/README.md
Normal file
1
examples/paper-build-plugins/plugins/README.md
Normal file
@@ -0,0 +1 @@
|
||||
Download Bukkit/Spigot plugin jars, such as [WorldEdit](https://dev.bukkit.org/projects/worldedit/files) and place them here. At image build time the `COPY` step will place those jars in `/plugins`. At container startup, the contents of `/plugins` are sync'ed into `/data/plugins` for use with Bukkit/Spigot/Paper server types.
|
||||
97
files/autopause/autopause-daemon.sh
Normal file
97
files/autopause/autopause-daemon.sh
Normal file
@@ -0,0 +1,97 @@
|
||||
#!/bin/bash
|
||||
|
||||
. /autopause/autopause-fcns.sh
|
||||
|
||||
. /start-utils
|
||||
|
||||
sudo /usr/sbin/knockd -c /autopause/knockd-config.cfg -d
|
||||
if [ $? -ne 0 ] ; then
|
||||
while :
|
||||
do
|
||||
if [[ -n $(ps -o comm | grep java) ]] ; then
|
||||
break
|
||||
fi
|
||||
sleep 0.1
|
||||
done
|
||||
logAutopause "Failed to start knockd daemon."
|
||||
logAutopause "Possible cause: docker's host network mode."
|
||||
logAutopause "Recreate without host mode or disable autopause functionality."
|
||||
logAutopause "Stopping server."
|
||||
killall -SIGTERM java
|
||||
exit 1
|
||||
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
|
||||
38
files/autopause/autopause-fcns.sh
Normal file
38
files/autopause/autopause-fcns.sh
Normal file
@@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
|
||||
current_uptime() {
|
||||
echo $(awk '{print $1}' /proc/uptime | cut -d . -f 1)
|
||||
}
|
||||
|
||||
java_running() {
|
||||
[[ $( ps -a -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]]
|
||||
}
|
||||
|
||||
rcon_client_exists() {
|
||||
[[ -n "$(ps -a -o comm | grep 'rcon-cli')" ]]
|
||||
}
|
||||
|
||||
mc_server_listening() {
|
||||
[[ -n $(netstat -tln | grep "0.0.0.0:$SERVER_PORT" | grep LISTEN) ]]
|
||||
}
|
||||
|
||||
java_clients_connected() {
|
||||
local connections
|
||||
connections=$(netstat -tn | grep ":$SERVER_PORT" | grep ESTABLISHED)
|
||||
if [[ -z "$connections" ]] ; then
|
||||
return 1
|
||||
fi
|
||||
IFS=$'\n'
|
||||
connections=($connections)
|
||||
unset IFS
|
||||
# check that at least one external address is not localhost
|
||||
# remember, that the host network mode does not work with autopause because of the knockd utility
|
||||
for (( i=0; i<${#connections[@]}; i++ ))
|
||||
do
|
||||
if [[ ! $(echo "${connections[$i]}" | awk '{print $5}') =~ ^\s*127\.0\.0\.1:.*$ ]] ; then
|
||||
# not localhost
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
return 1
|
||||
}
|
||||
12
files/autopause/knockd-config.cfg
Normal file
12
files/autopause/knockd-config.cfg
Normal file
@@ -0,0 +1,12 @@
|
||||
[options]
|
||||
logfile = /dev/null
|
||||
[unpauseMCServer-server]
|
||||
sequence = 25565
|
||||
seq_timeout = 1
|
||||
command = /sbin/su-exec minecraft:minecraft /autopause/resume.sh
|
||||
tcpflags = syn
|
||||
[unpauseMCServer-rcon]
|
||||
sequence = 25575
|
||||
seq_timeout = 1
|
||||
command = /sbin/su-exec minecraft:minecraft /autopause/resume.sh
|
||||
tcpflags = syn
|
||||
21
files/autopause/pause.sh
Executable file
21
files/autopause/pause.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
. /start-utils
|
||||
|
||||
if [[ $( ps -a -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]] ; then
|
||||
# save world
|
||||
rcon-cli save-all >/dev/null
|
||||
|
||||
# wait until mc-monitor is no longer connected to the server
|
||||
while :
|
||||
do
|
||||
if [[ -z "$(netstat -nt | grep "127.0.0.1:$SERVER_PORT" | grep 'ESTABLISHED')" ]]; then
|
||||
break
|
||||
fi
|
||||
sleep 0.1
|
||||
done
|
||||
|
||||
# finally pause the process
|
||||
logAutopauseAction "Pausing Java process"
|
||||
killall -q -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 -a -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^T.*$ ]] ; then
|
||||
logAutopauseAction "Knocked, resuming Java process"
|
||||
killall -q -CONT java
|
||||
fi
|
||||
2
files/sudoers-mc
Normal file
2
files/sudoers-mc
Normal file
@@ -0,0 +1,2 @@
|
||||
%minecraft ALL=(ALL) NOPASSWD:/usr/bin/killall
|
||||
%minecraft ALL=(ALL) NOPASSWD:/usr/sbin/knockd
|
||||
@@ -1,30 +0,0 @@
|
||||
FROM itzg/ubuntu-openjdk-7
|
||||
|
||||
MAINTAINER itzg
|
||||
|
||||
ENV APT_GET_UPDATE 2014-07-19
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get -y install wget tar
|
||||
|
||||
ENV GITBLIT_VERSION 1.6.0
|
||||
|
||||
RUN wget -O /tmp/gitblit.tgz http://dl.bintray.com/gitblit/releases/gitblit-$GITBLIT_VERSION.tar.gz
|
||||
|
||||
RUN mkdir /opt/gitblit
|
||||
RUN tar -C /opt/gitblit -xvf /tmp/gitblit.tgz
|
||||
RUN rm /tmp/gitblit.tgz
|
||||
|
||||
VOLUME ["/data"]
|
||||
|
||||
ADD start.sh /start
|
||||
|
||||
WORKDIR /opt/gitblit
|
||||
ENV GITBLIT_PATH /opt/gitblit
|
||||
ENV GITBLIT_HTTPS_PORT 443
|
||||
ENV GITBLIT_HTTP_PORT 80
|
||||
ENV GITBLIT_BASE_FOLDER /data
|
||||
|
||||
EXPOSE 80 443
|
||||
|
||||
CMD ["/start"]
|
||||
@@ -1,5 +0,0 @@
|
||||
Provides a ready-to-use instance of [GitBlit](http://gitblit.com/). In order to allow for
|
||||
future upgrades run the container with a volume mount of `/data`, such as:
|
||||
|
||||
docker run -d -p 80:80 p 443:443 -v /tmp/gitblit-data:/data --name gitblit itzg/gitblit
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
contents=`ls $GITBLIT_BASE_FOLDER|wc -l`
|
||||
|
||||
if [ $contents = "0" ]; then
|
||||
cp -r $GITBLIT_PATH/data/* $GITBLIT_BASE_FOLDER
|
||||
fi
|
||||
|
||||
$JAVA_HOME/bin/java -jar $GITBLIT_PATH/gitblit.jar --httpsPort $GITBLIT_HTTPS_PORT --httpPort $GITBLIT_HTTP_PORT --baseFolder $GITBLIT_BASE_FOLDER
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
FROM itzg/ubuntu-openjdk-7
|
||||
|
||||
MAINTAINER itzg
|
||||
|
||||
RUN apt-get install -y curl unzip
|
||||
|
||||
RUN curl -s get.gvmtool.net | bash
|
||||
|
||||
ADD run /run
|
||||
ONBUILD RUN ["/run", "selfupdate"]
|
||||
|
||||
ENTRYPOINT ["/run"]
|
||||
14
health.sh
Normal file
14
health.sh
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
|
||||
if isTrue "${DISABLE_HEALTHCHECK}"; then
|
||||
echo "Healthcheck disabled"
|
||||
exit 0
|
||||
elif isTrue "${ENABLE_AUTOPAUSE}" && [[ "$( ps -a -o stat,comm | grep 'java' | awk '{ print $1 }')" =~ ^T.*$ ]]; then
|
||||
echo "Java process suspended by Autopause function"
|
||||
exit 0
|
||||
else
|
||||
mc-monitor status --host localhost --port $SERVER_PORT
|
||||
exit $?
|
||||
fi
|
||||
1
jekyll-github-pages/.gitignore
vendored
1
jekyll-github-pages/.gitignore
vendored
@@ -1 +0,0 @@
|
||||
/site
|
||||
@@ -1,24 +0,0 @@
|
||||
FROM ubuntu:trusty
|
||||
|
||||
MAINTAINER itzg
|
||||
|
||||
ENV APT_GET_UPDATE 2014-09-18
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get -y upgrade
|
||||
|
||||
RUN apt-get -y install ruby ruby-dev make patch nodejs
|
||||
RUN gem install bundler
|
||||
|
||||
ADD Gemfile /tmp/Gemfile
|
||||
WORKDIR /tmp
|
||||
RUN bundle install
|
||||
|
||||
ADD template /site-template
|
||||
|
||||
VOLUME ["/site"]
|
||||
EXPOSE 4000
|
||||
|
||||
ADD start.sh /start
|
||||
CMD ["/start"]
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
source 'https://rubygems.org'
|
||||
gem 'github-pages'
|
||||
@@ -1,14 +0,0 @@
|
||||
This container is pre-configured according to the
|
||||
[GitHub Pages use of Jekyll](https://help.github.com/articles/using-jekyll-with-pages).
|
||||
|
||||
It serves up the generated content on port 4000 and the site is generated from
|
||||
the container's `/site` volume. You can either bring your own site content or
|
||||
let it generate some VERY simple content along with the standard Jekyll directory
|
||||
layout.
|
||||
|
||||
A typical way to run this:
|
||||
|
||||
docker run -it -p 4000:4000 -v $(pwd)/site:/site itzg/jekyll-github-pages
|
||||
|
||||
where either it will load your content or initialize the content under
|
||||
`site` in your current working directory.
|
||||
@@ -1,13 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ `ls /site/index.* 2> /dev/null | wc -l` = 0 ]; then
|
||||
echo "Preparing /site with default content..."
|
||||
cp -r /site-template/* /site
|
||||
fi
|
||||
|
||||
if [ ! -e /site/Gemfile ]; then
|
||||
cp /tmp/Gemfile /site/Gemfile
|
||||
fi
|
||||
|
||||
cd /site
|
||||
bundle exec jekyll serve
|
||||
@@ -1 +0,0 @@
|
||||
highlighter: pygments
|
||||
@@ -1,3 +0,0 @@
|
||||
<footer>
|
||||
<i>Goodbye</i>
|
||||
</footer>
|
||||
@@ -1,3 +0,0 @@
|
||||
<header>
|
||||
<h1>{{ page.title }}</h1>
|
||||
</header>
|
||||
@@ -1,18 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<title>{{ page.title }}</title>
|
||||
|
||||
<!-- Latest compiled and minified CSS -->
|
||||
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
|
||||
|
||||
<!-- Optional theme -->
|
||||
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css">
|
||||
|
||||
<!-- Latest compiled and minified JavaScript -->
|
||||
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
|
||||
</head>
|
||||
@@ -1,12 +0,0 @@
|
||||
{% include top.html %}
|
||||
|
||||
<body>
|
||||
|
||||
{% include header.html %}
|
||||
|
||||
{{ content }}
|
||||
|
||||
{% include footer.html %}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
layout: default
|
||||
title: Powered by Jekyll
|
||||
overview: true
|
||||
---
|
||||
This is where the content goes.
|
||||
34
log4j2.xml
Normal file
34
log4j2.xml
Normal file
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Configuration status="WARN" packages="com.mojang.util">
|
||||
<Appenders>
|
||||
<Console name="SysOut" target="SYSTEM_OUT">
|
||||
<PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level]: %msg%n" />
|
||||
</Console>
|
||||
<Queue name="ServerGuiConsole">
|
||||
<PatternLayout pattern="[%d{HH:mm:ss} %level]: %msg%n" />
|
||||
</Queue>
|
||||
<RollingRandomAccessFile name="File" fileName="logs/latest.log" filePattern="logs/%d{yyyy-MM-dd}-%i.log.gz">
|
||||
<PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level]: %msg%n" />
|
||||
<Policies>
|
||||
<TimeBasedTriggeringPolicy />
|
||||
<OnStartupTriggeringPolicy />
|
||||
</Policies>
|
||||
<DefaultRolloverStrategy>
|
||||
<Delete basePath="logs">
|
||||
<IfFileName glob="*.log.gz" />
|
||||
<IfLastModified age="7d" />
|
||||
</Delete>
|
||||
</DefaultRolloverStrategy>
|
||||
</RollingRandomAccessFile>
|
||||
</Appenders>
|
||||
<Loggers>
|
||||
<Root level="info">
|
||||
<filters>
|
||||
<MarkerFilter marker="NETWORK_PACKETS" onMatch="DENY" onMismatch="NEUTRAL" />
|
||||
</filters>
|
||||
<AppenderRef ref="SysOut"/>
|
||||
<AppenderRef ref="File"/>
|
||||
<AppenderRef ref="ServerGuiConsole"/>
|
||||
</Root>
|
||||
</Loggers>
|
||||
</Configuration>
|
||||
18
mcstatus
Executable file
18
mcstatus
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "WARNING: mcstatus is deprecated; calling mc-monitor instead"
|
||||
|
||||
##### mcstatus shim for mc-monitor
|
||||
# handles translating calls to
|
||||
# mcstatus (host:port) (command)
|
||||
# where the actual command is ignore, but is typically ping or status
|
||||
|
||||
addr="$1"
|
||||
|
||||
IFS=':'
|
||||
read -a parts <<< "${addr}"
|
||||
if [[ ${#parts[*]} -gt 1 ]]; then
|
||||
exec mc-monitor status --host ${parts[0]} --port ${parts[1]}
|
||||
else
|
||||
exec mc-monitor status --host ${parts[0]}
|
||||
fi
|
||||
1
minecraft-server/.gitignore
vendored
1
minecraft-server/.gitignore
vendored
@@ -1 +0,0 @@
|
||||
/data/
|
||||
@@ -1,29 +0,0 @@
|
||||
FROM itzg/ubuntu-openjdk-7
|
||||
|
||||
MAINTAINER itzg
|
||||
|
||||
RUN apt-get install -y wget libmozjs-24-bin imagemagick && apt-get clean
|
||||
RUN update-alternatives --install /usr/bin/js js /usr/bin/js24 100
|
||||
|
||||
RUN wget -O /usr/bin/jsawk https://github.com/micha/jsawk/raw/master/jsawk
|
||||
RUN chmod +x /usr/bin/jsawk
|
||||
RUN useradd -M -s /bin/false minecraft \
|
||||
&& mkdir /data \
|
||||
&& chown minecraft:minecraft /data
|
||||
|
||||
EXPOSE 25565
|
||||
|
||||
ADD start.sh /start
|
||||
ADD start-minecraft.sh /start-minecraft
|
||||
|
||||
USER minecraft
|
||||
VOLUME ['/data']
|
||||
ADD server.properties /tmp/server.properties
|
||||
WORKDIR /data
|
||||
|
||||
CMD [ "/start-minecraft" ]
|
||||
|
||||
ENV MOTD A Minecraft Server Powered by Docker
|
||||
ENV LEVEL world
|
||||
ENV JVM_OPTS -Xmx1024M -Xms1024M
|
||||
ENV VERSION 1.8
|
||||
@@ -1,93 +1,4 @@
|
||||
This docker image provides a Minecraft Server that will automatically download the latest stable,
|
||||
latest snapshot, or any specific version.
|
||||
# Moved to top-level
|
||||
|
||||
To simply use the latest stable version, run
|
||||
|
||||
docker run -d -p 25565:25565 itzg/minecraft-server
|
||||
|
||||
where the default server port, 25565, will be exposed on your host machine. If you want to serve up multiple
|
||||
Minecraft servers or just use an alternate port, change the host-side port mapping such as
|
||||
|
||||
docker run -p 25566:25565 ...
|
||||
|
||||
will serve your Minecraft server on your host's port 25566 since the `-p` syntax is
|
||||
`host-port`:`container-port`.
|
||||
|
||||
Speaking of multiple servers, it's handy to give your containers explicit names using `--name`, such as
|
||||
|
||||
docker run -d -p 25565:25565 --name minecraft-default itzg/minecraft-server
|
||||
|
||||
With that you can easily view the logs, stop, or re-start the container:
|
||||
|
||||
docker logs -f minecraft-default
|
||||
( Ctrl-C to exit logs action )
|
||||
|
||||
docker stop minecraft-default
|
||||
|
||||
docker start minecraft-default
|
||||
|
||||
## EULA Support
|
||||
|
||||
Mojang now requires accepting the [Minecraft EULA](https://account.mojang.com/documents/minecraft_eula). To accept add
|
||||
|
||||
-e EULA=TRUE
|
||||
|
||||
such as
|
||||
|
||||
docker run -e EULA=TRUE -d -p 25565:25565 itzg/minecraft-server
|
||||
|
||||
## Attaching data directory to host filesystem
|
||||
|
||||
In order to persist the Minecraft data, which you *probably want to do for a real server setup*, use the `-v` argument
|
||||
to map a directory on your host machine to the container's `/data` directory, such as:
|
||||
|
||||
docker run -d -v /path/on/host:/data ...
|
||||
|
||||
When attached in this way you can stop the server, edit the configuration under your attached `/path/on/host` and start the server again with `docker start CONTAINERID` to pick up the new configuration.
|
||||
|
||||
## Versions
|
||||
|
||||
To use a different Minecraft version, pass the `VERSION` environment variable, which can have the value
|
||||
|
||||
* LATEST
|
||||
* SNAPSHOT
|
||||
* (or a specific version, such as "1.7.9")
|
||||
|
||||
For example, to use the latest snapshot:
|
||||
|
||||
docker run -d -e VERSION=SNAPSHOT ...
|
||||
|
||||
or a specific version:
|
||||
|
||||
docker run -d -e VERSION=1.7.9 ...
|
||||
|
||||
## Server configuration
|
||||
|
||||
You can either switch between world saves or run multiple containers with different saves by using the `LEVEL` option,
|
||||
where the default is "world":
|
||||
|
||||
docker run -d -e LEVEL=bonus ...
|
||||
|
||||
**NOTE:** if running multiple containers be sure to either specify a different `-v` host directory for each
|
||||
`LEVEL` in use or don't use `-v` and the container's filesystem will keep things encapsulated.
|
||||
|
||||
The message of the day, shown below each server entry in the UI, can be changed with the `MOTD` environment variable, such as
|
||||
|
||||
docker run -d -e 'MOTD=My Server' ...
|
||||
|
||||
If you leave it off, the last used or default message will be used. _The example shows how to specify a server
|
||||
message of the day that contains spaces by putting quotes around the whole thing._
|
||||
|
||||
To add more "op" (aka adminstrator) users to your Minecraft server, pass the Minecraft usernames separated by commas via the `OPS` environment variable, such as
|
||||
|
||||
docker run -d -e OPS=user1,user2 ...
|
||||
|
||||
A server icon can be configured using the `ICON` variable. The image will be automatically
|
||||
downloaded, scaled, and converted from any other image format:
|
||||
|
||||
docker run -d -e ICON=http://..../some/image.png
|
||||
|
||||
The Java memory limit can be adjusted using the `JVM_OPTS` environment variable, where the default is
|
||||
the setting shown in the example (max and min at 1024 MB):
|
||||
|
||||
docker run -e 'JVM_OPTS=-Xmx1024M -Xms1024M' ...
|
||||
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).
|
||||
@@ -1,61 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
case $VERSION in
|
||||
LATEST)
|
||||
export VERSION=`wget -O - https://s3.amazonaws.com/Minecraft.Download/versions/versions.json | jsawk -n 'out(this.latest.release)'`
|
||||
;;
|
||||
|
||||
SNAPSHOT)
|
||||
export VERSION=`wget -O - https://s3.amazonaws.com/Minecraft.Download/versions/versions.json | jsawk -n 'out(this.latest.snapshot)'`
|
||||
;;
|
||||
esac
|
||||
|
||||
cd /data
|
||||
|
||||
if [ ! -e minecraft_server.$VERSION.jar ]; then
|
||||
echo "Downloading minecraft_server.$VERSION.jar ..."
|
||||
wget -q https://s3.amazonaws.com/Minecraft.Download/versions/$VERSION/minecraft_server.$VERSION.jar
|
||||
fi
|
||||
|
||||
if [ ! -e server.properties ]; then
|
||||
cp /tmp/server.properties .
|
||||
fi
|
||||
|
||||
if [ -n "$MOTD" ]; then
|
||||
sed -i "/motd\s*=/ c motd=$MOTD" /data/server.properties
|
||||
fi
|
||||
if [ -n "$LEVEL" ]; then
|
||||
sed -i "/level-name\s*=/ c level-name=$LEVEL" /data/server.properties
|
||||
fi
|
||||
if [ -n "$OPS" ]; then
|
||||
echo $OPS | awk -v RS=, '{print}' >> ops.txt
|
||||
fi
|
||||
if [ -n "$ICON" ]; then
|
||||
echo "Using server icon from $ICON..."
|
||||
# Not sure what it is yet...call it "img"
|
||||
wget -q -O /tmp/icon.img $ICON
|
||||
specs=$(identify /tmp/icon.img | awk '{print $2,$3}')
|
||||
if [ "$specs" = "PNG 64x64" ]; then
|
||||
mv /tmp/icon.img /data/server-icon.png
|
||||
else
|
||||
echo "Converting image to 64x64 PNG..."
|
||||
convert /tmp/icon.img -resize 64x64! /data/server-icon.png
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -e /data/eula.txt ]; then
|
||||
if [ "$EULA" != "" ]; then
|
||||
echo "# Generated via Docker on $(date)" > eula.txt
|
||||
echo "eula=$EULA" >> eula.txt
|
||||
else
|
||||
echo ""
|
||||
echo "Please accept the Minecraft EULA at"
|
||||
echo " https://account.mojang.com/documents/minecraft_eula"
|
||||
echo "by adding the following immediately after 'docker run':"
|
||||
echo " -e EULA=TRUE"
|
||||
echo ""
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
java $JVM_OPTS -jar minecraft_server.$VERSION.jar
|
||||
@@ -1,4 +0,0 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
chown -R minecraft:minecraft /data
|
||||
exec su -s /bin/bash -c /start-minecraft minecraft
|
||||
@@ -5,11 +5,14 @@ enable-query=false
|
||||
allow-flight=false
|
||||
announce-player-achievements=true
|
||||
server-port=25565
|
||||
rcon.port=25575
|
||||
query.port=25565
|
||||
level-type=DEFAULT
|
||||
enable-rcon=false
|
||||
force-gamemode=false
|
||||
level-seed=
|
||||
server-ip=
|
||||
max-tick-time=60000
|
||||
max-build-height=256
|
||||
spawn-npcs=true
|
||||
white-list=false
|
||||
@@ -19,9 +22,10 @@ snooper-enabled=true
|
||||
texture-pack=
|
||||
online-mode=true
|
||||
resource-pack=
|
||||
resource-pack-sha1=
|
||||
pvp=true
|
||||
difficulty=1
|
||||
enable-command-block=false
|
||||
enable-command-block=true
|
||||
player-idle-timeout=0
|
||||
gamemode=0
|
||||
max-players=20
|
||||
@@ -30,4 +34,18 @@ generate-structures=true
|
||||
view-distance=10
|
||||
spawn-protection=16
|
||||
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
|
||||
@@ -1,16 +0,0 @@
|
||||
FROM itzg/gvm
|
||||
|
||||
MAINTAINER itzg
|
||||
|
||||
RUN ["/run", "install", "springboot"]
|
||||
|
||||
ADD run /run
|
||||
ENTRYPOINT ["/run"]
|
||||
|
||||
VOLUME ["/home/spring"]
|
||||
ADD app.groovy /home/spring/app.groovy
|
||||
EXPOSE 8080
|
||||
|
||||
WORKDIR /home/spring
|
||||
|
||||
CMD ["run", "app.groovy"]
|
||||
@@ -1,9 +0,0 @@
|
||||
@RestController
|
||||
class ThisWillActuallyRun {
|
||||
|
||||
@RequestMapping("/")
|
||||
String home() {
|
||||
"Hello World!"
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
. /.gvm/bin/gvm-init.sh
|
||||
|
||||
spring $*
|
||||
51
start
Normal file
51
start
Normal file
@@ -0,0 +1,51 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
|
||||
umask 0002
|
||||
chmod g+w /data
|
||||
|
||||
if [ $(id -u) = 0 ]; then
|
||||
runAsUser=minecraft
|
||||
runAsGroup=minecraft
|
||||
|
||||
if [[ -v UID ]]; then
|
||||
if [[ $UID != 0 ]]; then
|
||||
if [[ $UID != $(id -u minecraft) ]]; then
|
||||
log "Changing uid of minecraft to $UID"
|
||||
usermod -u $UID minecraft
|
||||
fi
|
||||
else
|
||||
runAsUser=root
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -v GID ]]; then
|
||||
if [[ $GID != 0 ]]; then
|
||||
if [[ $GID != $(id -g minecraft) ]]; then
|
||||
log "Changing gid of minecraft to $GID"
|
||||
groupmod -o -g $GID minecraft
|
||||
fi
|
||||
else
|
||||
runAsGroup=root
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $(stat -c "%u" /data) != $UID ]]; then
|
||||
log "Changing ownership of /data to $UID ..."
|
||||
chown -R ${runAsUser}:${runAsGroup} /data
|
||||
fi
|
||||
|
||||
if [[ $(stat -c "%u" /autopause) != $UID ]]; then
|
||||
log "Changing ownership of /autopause to $UID ..."
|
||||
chown -R ${runAsUser}:${runAsGroup} /autopause
|
||||
fi
|
||||
|
||||
if [[ ${SKIP_NSSWITCH_CONF^^} != TRUE ]]; then
|
||||
echo 'hosts: files dns' > /etc/nsswitch.conf
|
||||
fi
|
||||
|
||||
exec su-exec ${runAsUser}:${runAsGroup} ${SCRIPTS:-/}start-configuration $@
|
||||
else
|
||||
exec ${SCRIPTS:-/}start-configuration $@
|
||||
fi
|
||||
60
start-autopause
Executable file
60
start-autopause
Executable file
@@ -0,0 +1,60 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
|
||||
log "Autopause functionality enabled"
|
||||
|
||||
# update server port to listen to
|
||||
regseq="^\s*sequence\s*=\s*$SERVER_PORT\s*$"
|
||||
linenum=$(grep -nm1 sequence /autopause/knockd-config.cfg | cut -d : -f 1 | tail -n1)
|
||||
if ! [[ $(awk "NR==$linenum" /autopause/knockd-config.cfg) =~ $regseq ]]; then
|
||||
sed -i "${linenum}s/sequence.*/sequence = $SERVER_PORT/" /autopause/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 /autopause/knockd-config.cfg | cut -d : -f 1 | tail -n1)
|
||||
if ! [[ $(awk "NR==$linenum" /autopause/knockd-config.cfg) =~ $regseq ]]; then
|
||||
sed -i "${linenum}s/sequence.*/sequence = $RCON_PORT/" /autopause/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 [[ -n $MAX_TICK_TIME ]] ; 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)"
|
||||
else
|
||||
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 &
|
||||
137
start-configuration
Normal file
137
start-configuration
Normal file
@@ -0,0 +1,137 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
|
||||
shopt -s nullglob
|
||||
|
||||
#umask 002
|
||||
export HOME=/data
|
||||
|
||||
if [ ! -e /data/eula.txt ]; then
|
||||
EULA="${EULA,,}"
|
||||
if [ "$EULA" != "true" ]; 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
|
||||
|
||||
echo "# Generated via Docker on $(date)" > /data/eula.txt
|
||||
|
||||
if ! echo "eula=$EULA" >> /data/eula.txt; then
|
||||
log "ERROR: unable to write eula to /data. Please make sure attached directory is writable by uid=${UID}"
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
log "Running as uid=$(id -u) gid=$(id -g) with /data as '$(ls -lnd /data)'"
|
||||
|
||||
if ! touch /data/.verify_access; then
|
||||
log "ERROR: /data doesn't seem to be writable. Please make sure attached directory is writable by uid=$(id -u)"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
rm /data/.verify_access || true
|
||||
|
||||
if [[ $PROXY ]]; then
|
||||
export http_proxy="$PROXY"
|
||||
export https_proxy="$PROXY"
|
||||
export JAVA_TOOL_OPTIONS+="-Djava.net.useSystemProxies=true"
|
||||
log "INFO: Giving proxy time to startup..."
|
||||
sleep 5
|
||||
fi
|
||||
|
||||
export SERVER_PROPERTIES=/data/server.properties
|
||||
export VERSIONS_JSON=https://launchermeta.mojang.com/mc/game/version_manifest.json
|
||||
|
||||
case "X$VERSION" in
|
||||
X|XLATEST|Xlatest)
|
||||
VANILLA_VERSION=$(curl -fsSL $VERSIONS_JSON | jq -r '.latest.release')
|
||||
;;
|
||||
XSNAPSHOT|Xsnapshot)
|
||||
VANILLA_VERSION=$(curl -fsSL $VERSIONS_JSON | jq -r '.latest.snapshot')
|
||||
;;
|
||||
X[1-9]*)
|
||||
VANILLA_VERSION=$VERSION
|
||||
;;
|
||||
*)
|
||||
VANILLA_VERSION=$(curl -fsSL $VERSIONS_JSON | jq -r '.latest.release')
|
||||
;;
|
||||
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
|
||||
|
||||
log "Resolving type given ${TYPE}"
|
||||
case "${TYPE^^}" in
|
||||
*BUKKIT|SPIGOT)
|
||||
exec ${SCRIPTS:-/}start-deployBukkitSpigot "$@"
|
||||
;;
|
||||
|
||||
PAPER)
|
||||
exec ${SCRIPTS:-/}start-deployPaper "$@"
|
||||
;;
|
||||
|
||||
TUINITY)
|
||||
exec ${SCRIPTS:-/}start-deployTuinity "$@"
|
||||
;;
|
||||
|
||||
FORGE)
|
||||
exec ${SCRIPTS:-/}start-deployForge "$@"
|
||||
;;
|
||||
|
||||
FABRIC)
|
||||
exec ${SCRIPTS:-/}start-deployFabric "$@"
|
||||
;;
|
||||
|
||||
FTB|CURSEFORGE)
|
||||
exec ${SCRIPTS:-/}start-deployFTB "$@"
|
||||
;;
|
||||
|
||||
VANILLA)
|
||||
exec ${SCRIPTS:-/}start-deployVanilla "$@"
|
||||
;;
|
||||
|
||||
SPONGEVANILLA)
|
||||
exec ${SCRIPTS:-/}start-deploySpongeVanilla "$@"
|
||||
;;
|
||||
|
||||
CUSTOM)
|
||||
exec ${SCRIPTS:-/}start-deployCustom "$@"
|
||||
;;
|
||||
|
||||
CURSE_INSTANCE)
|
||||
exec ${SCRIPTS:-/}start-validateCurseInstance "$@"
|
||||
;;
|
||||
|
||||
MAGMA)
|
||||
exec ${SCRIPTS:-/}start-deployMagma "$@"
|
||||
;;
|
||||
|
||||
MOHIST)
|
||||
exec ${SCRIPTS:-/}start-deployMohist "$@"
|
||||
;;
|
||||
|
||||
CATSERVER)
|
||||
exec ${SCRIPTS:-/}start-deployCatserver "$@"
|
||||
;;
|
||||
|
||||
*)
|
||||
log "Invalid type: '$TYPE'"
|
||||
log "Must be: VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, FTBA, CURSEFORGE, SPONGEVANILLA,"
|
||||
log " CUSTOM, CURSE_INSTANCE, MAGMA, MOHIST, CATSERVER"
|
||||
exit 1
|
||||
;;
|
||||
|
||||
esac
|
||||
105
start-deployBukkitSpigot
Normal file
105
start-deployBukkitSpigot
Normal file
@@ -0,0 +1,105 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
|
||||
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 [[ -z $downloadUrl ]]; then
|
||||
downloadUrl="https://cdn.getbukkit.org/${getbukkitFlavor}/${getbukkitFlavor}-${VANILLA_VERSION}.jar"
|
||||
fi
|
||||
|
||||
log "Downloading $match from $downloadUrl ..."
|
||||
curl -fsSL -o $SERVER "$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
|
||||
|
||||
EOF
|
||||
exit 3
|
||||
fi
|
||||
|
||||
JVM_OPTS="${JVM_OPTS} -DIReallyKnowWhatIAmDoingISwear"
|
||||
export JVM_OPTS
|
||||
}
|
||||
|
||||
|
||||
case "$TYPE" in
|
||||
*BUKKIT|*bukkit)
|
||||
export SERVER=craftbukkit_server-${VANILLA_VERSION}.jar
|
||||
;;
|
||||
*)
|
||||
export SERVER=spigot_server-${VANILLA_VERSION}.jar
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ ! -f $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
||||
if isTrue "$BUILD_SPIGOT_FROM_SOURCE" || isTrue "$BUILD_FROM_SOURCE"; then
|
||||
buildSpigotFromSource
|
||||
else
|
||||
downloadSpigot
|
||||
fi
|
||||
fi
|
||||
|
||||
# Normalize on Spigot for operations below
|
||||
export TYPE=SPIGOT
|
||||
export SKIP_LOG4J_CONFIG=true
|
||||
|
||||
# Continue to Final Setup
|
||||
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
||||
32
start-deployCatserver
Normal file
32
start-deployCatserver
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
set -o pipefail
|
||||
set -e
|
||||
|
||||
latestAsset=$(
|
||||
curl -fsSL https://api.github.com/repos/Luohuayu/CatServer/releases/latest | \
|
||||
jq '.assets[] | select(.name | match(".*-universal.jar"))'
|
||||
)
|
||||
|
||||
if [[ -z "${latestAsset}" ]]; then
|
||||
log "ERROR: latest release of Catserver is missing universal.jar asset"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
isDebugging && log "Latest asset ${latestAsset}"
|
||||
latestJarName=$(echo ${latestAsset} | jq --raw-output '.name')
|
||||
latestJarId=$(echo ${latestAsset} | jq --raw-output '.id')
|
||||
|
||||
|
||||
export SERVER="/data/${latestJarName}"
|
||||
|
||||
if [ ! -f ${SERVER} ]; then
|
||||
log "Downloading ${latestJarName}"
|
||||
curl -H "Accept:application/octet-stream" -o "$SERVER" -fsSL https://api.github.com/repos/Luohuayu/CatServer/releases/assets/${latestJarId}
|
||||
fi
|
||||
|
||||
export SKIP_LOG4J_CONFIG=true
|
||||
|
||||
# Continue to Final Setup
|
||||
exec ${SCRIPTS:-/}start-finalSetupWorld "$@"
|
||||
31
start-deployCustom
Normal file
31
start-deployCustom
Normal file
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
|
||||
if isURL ${CUSTOM_SERVER}; then
|
||||
filename=$(basename ${CUSTOM_SERVER})
|
||||
export SERVER=/data/${filename}
|
||||
|
||||
if [[ -f ${SERVER} ]] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
||||
log "Using previously downloaded jar at ${SERVER}"
|
||||
else
|
||||
log "Downloading custom server jar from ${CUSTOM_SERVER} ..."
|
||||
if ! curl -sSL -o ${SERVER} ${CUSTOM_SERVER}; then
|
||||
log "Failed to download from ${CUSTOM_SERVER}"
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
|
||||
elif [[ -f ${CUSTOM_SERVER} ]]; then
|
||||
log "Using custom server jar 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
|
||||
|
||||
export SKIP_LOG4J_CONFIG=true
|
||||
|
||||
# Continue to Final Setup
|
||||
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
||||
138
start-deployFTB
Normal file
138
start-deployFTB
Normal file
@@ -0,0 +1,138 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
|
||||
export FTB_BASE_DIR=/data/FeedTheBeast
|
||||
legacyJavaFixerUrl=http://ftb.cursecdn.com/FTB2/maven/net/minecraftforge/lex/legacyjavafixer/1.0/legacyjavafixer-1.0.jar
|
||||
export TYPE=FEED-THE-BEAST
|
||||
|
||||
FTB_SERVER_MOD=${FTB_SERVER_MOD:-$CF_SERVER_MOD}
|
||||
|
||||
log "Looking for Feed-The-Beast / CurseForge server modpack."
|
||||
if [[ -z $FTB_SERVER_MOD ]]; then
|
||||
log "Environment variable FTB_SERVER_MOD not set."
|
||||
log "Set FTB_SERVER_MOD to the file name of the FTB server modpack."
|
||||
log "(And place the modpack in the /data directory.)"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
entryScriptExpr="
|
||||
-name ServerStart.sh
|
||||
-o -name ServerStartLinux.sh
|
||||
-o -name LaunchServer.sh
|
||||
-o -name server-start.sh
|
||||
"
|
||||
|
||||
if [[ -d ${FTB_BASE_DIR} ]]; then
|
||||
startScriptCount=$(find ${FTB_BASE_DIR} $entryScriptExpr |wc -l)
|
||||
if [[ $startScriptCount > 1 ]]; then
|
||||
log "Conflicting FTB/CurseForge packages have been installed. Please cleanup ${FTB_BASE_DIR}"
|
||||
exit 2
|
||||
fi
|
||||
else
|
||||
startScriptCount=0
|
||||
fi
|
||||
|
||||
# only download and install if a mod pack isn't already installed
|
||||
# also check for the start script rather than just the folder
|
||||
# this allows saving just the world separate from the rest of the data directory
|
||||
if [[ $startScriptCount = 0 ]]; then
|
||||
srv_modpack=${FTB_SERVER_MOD}
|
||||
if isURL ${srv_modpack}; then
|
||||
case $srv_modpack in
|
||||
https://www.feed-the-beast.com/*/download|https://www.curseforge.com/minecraft/modpacks/*/download/*/file)
|
||||
;;
|
||||
https://www.curseforge.com/minecraft/modpacks/*/download/*)
|
||||
srv_modpack=${srv_modpack}/file;;
|
||||
https://www.feed-the-beast.com/*)
|
||||
srv_modpack=${srv_modpack}/download;;
|
||||
esac
|
||||
file=$(basename $(dirname $srv_modpack))
|
||||
downloaded=/data/${file}.zip
|
||||
if [ ! -e $downloaded ]; then
|
||||
log "Downloading FTB modpack...
|
||||
$srv_modpack -> $downloaded"
|
||||
curl -sSL -o $downloaded $srv_modpack
|
||||
fi
|
||||
srv_modpack=$downloaded
|
||||
fi
|
||||
if [[ ${srv_modpack:0:5} == "data/" ]]; then
|
||||
# Prepend with "/"
|
||||
srv_modpack=/${srv_modpack}
|
||||
fi
|
||||
if [[ ! ${srv_modpack:0:1} == "/" ]]; then
|
||||
# If not an absolute path, assume file is in "/data"
|
||||
srv_modpack=/data/${srv_modpack}
|
||||
fi
|
||||
if [[ ! -f ${srv_modpack} ]]; then
|
||||
log "FTB server modpack ${srv_modpack} not found."
|
||||
exit 2
|
||||
fi
|
||||
if [[ ! ${srv_modpack: -4} == ".zip" ]]; then
|
||||
log "FTB server modpack ${srv_modpack} is not a zip archive."
|
||||
log "Please set FTB_SERVER_MOD to a file with a .zip extension."
|
||||
exit 2
|
||||
fi
|
||||
|
||||
log "Unpacking FTB server modpack ${srv_modpack} ..."
|
||||
mkdir -p ${FTB_BASE_DIR}
|
||||
unzip -o ${srv_modpack} -d ${FTB_BASE_DIR} | awk '{printf "."} END {print ""}'
|
||||
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 -name 'forge*.jar' -a -not -name 'forge*installer')
|
||||
if [[ "$forgeJar" ]]; then
|
||||
export FTB_BASE_DIR=$(dirname "${forgeJar}")
|
||||
log "No entry script found, so building one for ${forgeJar}"
|
||||
cat > "${FTB_BASE_DIR}/ServerStart.sh" <<EOF
|
||||
#!/bin/sh
|
||||
. ./settings-local.sh
|
||||
java \${JAVA_PARAMETERS} -Xmx\${MAX_RAM} -jar $(basename "${forgeJar}") nogui
|
||||
EOF
|
||||
chmod +x "${FTB_BASE_DIR}/ServerStart.sh"
|
||||
else
|
||||
log "Please make sure you are using the server version of the FTB modpack!"
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
|
||||
scriptCount=$(find "${FTB_BASE_DIR}" $entryScriptExpr | wc -l)
|
||||
if [[ $scriptCount = 0 ]]; then
|
||||
log "Please make sure you are using the server version of the FTB modpack!"
|
||||
exit 2
|
||||
elif [[ $scriptCount > 1 ]]; then
|
||||
log "Ambigous startup scripts in FTB modpack!"
|
||||
log "found:"
|
||||
find ${FTB_BASE_DIR} $entryScriptExpr
|
||||
exit 2
|
||||
fi
|
||||
|
||||
export FTB_SERVER_START=$(find "${FTB_BASE_DIR}" $entryScriptExpr)
|
||||
|
||||
export FTB_DIR=$(dirname "${FTB_SERVER_START}")
|
||||
chmod a+x "${FTB_SERVER_START}"
|
||||
grep fml.queryResult=confirm ${FTB_SERVER_START} > /dev/null || \
|
||||
sed -i 's/-jar/-Dfml.queryResult=confirm -jar/' "${FTB_SERVER_START}"
|
||||
sed -i 's/.*read.*Restart now/#\0/' "${FTB_SERVER_START}"
|
||||
legacyJavaFixerPath="${FTB_DIR}/mods/legacyjavafixer.jar"
|
||||
|
||||
if isTrue ${FTB_LEGACYJAVAFIXER} && [ ! -e "${legacyJavaFixerPath}" ]; then
|
||||
log "Installing legacy java fixer to ${legacyJavaFixerPath}"
|
||||
curl -sSL -o "${legacyJavaFixerPath}" ${legacyJavaFixerUrl}
|
||||
fi
|
||||
|
||||
if [ -e "${FTB_DIR}/FTBInstall.sh" ]; then
|
||||
pushd "${FTB_DIR}"
|
||||
sh FTBInstall.sh
|
||||
popd
|
||||
elif [ -e "${FTB_DIR}/Install.sh" ]; then
|
||||
pushd "${FTB_DIR}"
|
||||
sh Install.sh
|
||||
popd
|
||||
fi
|
||||
|
||||
# Continue to Final Setup
|
||||
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
||||
78
start-deployFabric
Normal file
78
start-deployFabric
Normal file
@@ -0,0 +1,78 @@
|
||||
#!/bin/bash
|
||||
set -eu
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
|
||||
export TYPE=FABRIC
|
||||
|
||||
FABRIC_INSTALLER=${FABRIC_INSTALLER:-}
|
||||
FABRIC_INSTALLER_URL=${FABRIC_INSTALLER_URL:-}
|
||||
FABRICVERSION=${FABRICVERSION:-LATEST}
|
||||
if [[ -z $FABRIC_INSTALLER && -z $FABRIC_INSTALLER_URL ]]; then
|
||||
log "Checking Fabric version information."
|
||||
case $FABRICVERSION in
|
||||
LATEST)
|
||||
FABRIC_VERSION=$(maven-metadata-release https://maven.fabricmc.net/net/fabricmc/fabric-installer/maven-metadata.xml)
|
||||
;;
|
||||
|
||||
*)
|
||||
FABRIC_VERSION=$FABRICVERSION
|
||||
;;
|
||||
esac
|
||||
|
||||
FABRIC_INSTALLER="/tmp/fabric-installer-$FABRIC_VERSION.jar"
|
||||
|
||||
elif [[ -z $FABRIC_INSTALLER ]]; then
|
||||
FABRIC_INSTALLER="/tmp/fabric-installer.jar"
|
||||
elif [[ ! -e $FABRIC_INSTALLER ]]; then
|
||||
log "ERROR: the given Fabric installer doesn't exist : $FABRIC_INSTALLER"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
installMarker="/data/.fabric-installed-${VANILLA_VERSION}-${FABRIC_VERSION:-manual}"
|
||||
|
||||
debug Checking for installMarker ${installMarker}
|
||||
if [[ ! -e $installMarker ]]; then
|
||||
if [[ ! -e $FABRIC_INSTALLER ]]; then
|
||||
if [[ -z $FABRIC_INSTALLER_URL ]]; then
|
||||
log "Downloading $FABRIC_VERSION"
|
||||
downloadUrl="https://maven.fabricmc.net/net/fabricmc/fabric-installer/$FABRIC_VERSION/fabric-installer-$FABRIC_VERSION.jar"
|
||||
log "...trying $downloadUrl"
|
||||
curl -o $FABRIC_INSTALLER -fsSL $downloadUrl
|
||||
else
|
||||
log "Downloading $FABRIC_INSTALLER_URL ..."
|
||||
if ! curl -o $FABRIC_INSTALLER -fsSL $FABRIC_INSTALLER_URL; then
|
||||
log "Failed to download from given location $FABRIC_INSTALLER_URL"
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if isDebugging; then
|
||||
debug "Installing Fabric $FABRIC_VERSION using $FABRIC_INSTALLER with mcversion ${VANILLA_VERSION}"
|
||||
else
|
||||
log "Installing Fabric $FABRIC_VERSION using $FABRIC_INSTALLER"
|
||||
fi
|
||||
tries=3
|
||||
set +e
|
||||
while ((--tries >= 0)); do
|
||||
java -jar $FABRIC_INSTALLER server -mcversion $VANILLA_VERSION -downloadMinecraft
|
||||
if [[ $? == 0 ]]; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
set -e
|
||||
if (($tries < 0)); then
|
||||
log "Fabric failed to install after several tries." >&2
|
||||
exit 10
|
||||
fi
|
||||
export SERVER=fabric-server-launch.jar
|
||||
log "Using server $SERVER"
|
||||
echo $SERVER > $installMarker
|
||||
|
||||
else
|
||||
export SERVER=$(< $installMarker)
|
||||
fi
|
||||
|
||||
# Contineut to Final Setup
|
||||
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
||||
116
start-deployForge
Normal file
116
start-deployForge
Normal file
@@ -0,0 +1,116 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
|
||||
export TYPE=FORGE
|
||||
|
||||
if [[ -z $FORGE_INSTALLER && -z $FORGE_INSTALLER_URL ]]; then
|
||||
norm=$VANILLA_VERSION
|
||||
|
||||
case $VANILLA_VERSION in
|
||||
*.*.*)
|
||||
norm=$VANILLA_VERSION ;;
|
||||
*.*)
|
||||
norm=${VANILLA_VERSION}.0 ;;
|
||||
esac
|
||||
|
||||
#################################################################################
|
||||
|
||||
log "Checking Forge version information."
|
||||
case $FORGEVERSION in
|
||||
RECOMMENDED)
|
||||
curl -fsSL -o /tmp/forge.json http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json
|
||||
FORGE_VERSION=$(cat /tmp/forge.json | jq -r ".promos[\"$VANILLA_VERSION-recommended\"]")
|
||||
if [ $FORGE_VERSION = null ]; then
|
||||
FORGE_VERSION=$(cat /tmp/forge.json | jq -r ".promos[\"$VANILLA_VERSION-latest\"]")
|
||||
if [ $FORGE_VERSION = null ]; then
|
||||
log "ERROR: Version $VANILLA_VERSION is not supported by Forge"
|
||||
log " Refer to http://files.minecraftforge.net/ for supported versions"
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
FORGE_VERSION=$FORGEVERSION
|
||||
;;
|
||||
esac
|
||||
|
||||
normForgeVersion=$VANILLA_VERSION-$FORGE_VERSION-$norm
|
||||
shortForgeVersion=$VANILLA_VERSION-$FORGE_VERSION
|
||||
|
||||
FORGE_INSTALLER="/tmp/forge-$shortForgeVersion-installer.jar"
|
||||
elif [[ -z $FORGE_INSTALLER ]]; then
|
||||
FORGE_INSTALLER="/tmp/forge-installer.jar"
|
||||
elif [[ ! -e $FORGE_INSTALLER ]]; then
|
||||
log "ERROR: the given Forge installer doesn't exist : $FORGE_INSTALLER"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
installMarker="/data/.forge-installed-$shortForgeVersion"
|
||||
|
||||
if [ ! -e $installMarker ]; then
|
||||
if [ ! -e $FORGE_INSTALLER ]; then
|
||||
|
||||
if [[ -z $FORGE_INSTALLER_URL ]]; then
|
||||
log "Downloading $normForgeVersion"
|
||||
|
||||
forgeFileNames="
|
||||
$normForgeVersion/forge-$normForgeVersion-installer.jar
|
||||
$shortForgeVersion/forge-$shortForgeVersion-installer.jar
|
||||
END
|
||||
"
|
||||
for fn in $forgeFileNames; do
|
||||
if [ $fn == END ]; then
|
||||
log "Unable to compute URL for $normForgeVersion"
|
||||
exit 2
|
||||
fi
|
||||
downloadUrl=http://files.minecraftforge.net/maven/net/minecraftforge/forge/$fn
|
||||
log "...trying $downloadUrl"
|
||||
if curl -o $FORGE_INSTALLER -fsSL $downloadUrl; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
else
|
||||
log "Downloading $FORGE_INSTALLER_URL ..."
|
||||
if ! curl -o $FORGE_INSTALLER -fsSL $FORGE_INSTALLER_URL; then
|
||||
log "Failed to download from given location $FORGE_INSTALLER_URL"
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
log "Installing Forge $shortForgeVersion using $FORGE_INSTALLER"
|
||||
mkdir -p mods
|
||||
tries=3
|
||||
while ((--tries >= 0)); do
|
||||
java -jar $FORGE_INSTALLER --installServer
|
||||
if [ $? == 0 ]; 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
|
||||
for file in *forge*.jar; do
|
||||
[[ $file =~ installer ]] || [[ $file -nt $latest ]] && latest=$file
|
||||
done
|
||||
if [[ -z $latest ]]; then
|
||||
log "Unable to derive server jar for Forge"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
export SERVER=$latest
|
||||
log "Using server $SERVER"
|
||||
echo $SERVER > $installMarker
|
||||
|
||||
else
|
||||
export SERVER=$(cat $installMarker)
|
||||
fi
|
||||
|
||||
# Continue to Final Setup
|
||||
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
||||
18
start-deployMagma
Normal file
18
start-deployMagma
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
|
||||
export SERVER="/data/magma-server-${VANILLA_VERSION}.jar"
|
||||
|
||||
# Always download since new updates of each base version are published frequently
|
||||
if ! curl -o /data/magma-server-${VANILLA_VERSION}.jar -fsSL \
|
||||
https://api.magmafoundation.org/api/resources/Magma/${VANILLA_VERSION}/stable/latest/download; then
|
||||
log "ERROR unable to download version ${VANILLA_VERSION} of Magma"
|
||||
log " Check https://magmafoundation.org/ for available versions"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export SKIP_LOG4J_CONFIG=true
|
||||
|
||||
# Continue to Final Setup
|
||||
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
||||
43
start-deployMohist
Normal file
43
start-deployMohist
Normal file
@@ -0,0 +1,43 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
set -o pipefail
|
||||
set -e
|
||||
isDebugging && set -x
|
||||
|
||||
requireVar VANILLA_VERSION
|
||||
|
||||
mohistJobs=https://ci.codemc.io/job/Mohist-Community/job/
|
||||
mohistJob=${mohistJobs}Mohist-${VANILLA_VERSION}/
|
||||
|
||||
if ! curl -X HEAD -o /dev/null -fsSL "${mohistJob}"; then
|
||||
log "ERROR: mohist builds do not exist for ${VANILLA_VERSION}"
|
||||
log " check https://ci.codemc.io/job/Mohist-Community/ for available versions"
|
||||
log " and set VERSION accordingly"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
latestBuildRelPath=$(
|
||||
curl -fsSL "${mohistJob}lastSuccessfulBuild/api/json" |
|
||||
jq -r '.artifacts[0].relativePath'
|
||||
)
|
||||
|
||||
baseName=$(basename "${latestBuildRelPath}")
|
||||
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/Mohist-Community/ for available versions"
|
||||
log " and set VERSION accordingly"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export SERVER="/data/${baseName}"
|
||||
|
||||
if [ ! -f ${SERVER} ]; then
|
||||
log "Downloading ${baseName}"
|
||||
curl -o "${SERVER}" -fsSL "${mohistJob}lastSuccessfulBuild/artifact/${latestBuildRelPath}"
|
||||
fi
|
||||
|
||||
export SKIP_LOG4J_CONFIG=true
|
||||
|
||||
# Continue to Final Setup
|
||||
exec ${SCRIPTS:-/}start-finalSetupWorld "$@"
|
||||
23
start-deployPaper
Normal file
23
start-deployPaper
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
|
||||
: ${PAPERBUILD:=latest}
|
||||
export SERVER=paper_server-${VANILLA_VERSION}-${PAPERBUILD}.jar
|
||||
|
||||
if [ ! -f "$SERVER" ] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
||||
downloadUrl=${PAPER_DOWNLOAD_URL:-https://papermc.io/api/v1/paper/${VANILLA_VERSION}/${PAPERBUILD}/download}
|
||||
log "Downloading Paper $VANILLA_VERSION (build $PAPERBUILD) 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 operations below
|
||||
export TYPE=SPIGOT
|
||||
export SKIP_LOG4J_CONFIG=true
|
||||
|
||||
# Continue to Final Setup
|
||||
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
||||
39
start-deploySpongeVanilla
Normal file
39
start-deploySpongeVanilla
Normal file
@@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
|
||||
export TYPE=spongevanilla
|
||||
|
||||
# Parse branch
|
||||
log "Choosing branch for Sponge"
|
||||
case "$SPONGEBRANCH" in
|
||||
|
||||
EXPERIMENTAL|experimental|BLEEDING|bleeding)
|
||||
SPONGEBRANCH=bleeding
|
||||
;;
|
||||
|
||||
*)
|
||||
SPONGEBRANCH=stable
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
# If not SPONGEVERSION selected, detect last version on selected branch
|
||||
if [ -z $SPONGEVERSION ]; then
|
||||
log "Choosing Version for Sponge"
|
||||
if [ "$SPONGEBRANCH" == "stable" ]; then
|
||||
export SPONGEVERSION=`curl -fsSL https://dl-api.spongepowered.org/v1/org.spongepowered/$TYPE | jq -r '.buildTypes.stable.latest.version'`
|
||||
else
|
||||
export SPONGEVERSION=`curl -fsSL https://dl-api.spongepowered.org/v1/org.spongepowered/$TYPE | jq -r '.buildTypes.bleeding.latest.version'`
|
||||
fi
|
||||
fi
|
||||
|
||||
export SERVER="spongevanilla-$SPONGEVERSION.jar"
|
||||
|
||||
if [ ! -e $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
||||
log "Downloading $SERVER ..."
|
||||
curl -sSL -o $SERVER https://repo.spongepowered.org/maven/org/spongepowered/$TYPE/$SPONGEVERSION/$SERVER
|
||||
fi
|
||||
|
||||
# Continue to Final Setup
|
||||
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
||||
27
start-deployTuinity
Normal file
27
start-deployTuinity
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
|
||||
if [ "${VERSION}" != "LATEST" ]; then
|
||||
log "ERROR: Tunity server type only supports VERSION=LATEST"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
: ${TUNITY_BUILD:=lastSuccessfulBuild}
|
||||
export SERVER=tunity-${VANILLA_VERSION}-${TUNITY_BUILD}.jar
|
||||
|
||||
if [ ! -f "$SERVER" ] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
||||
downloadUrl="https://ci.codemc.io/job/Spottedleaf/job/Tuinity/${TUNITY_BUILD}/artifact/tuinity-paperclip.jar"
|
||||
log "Downloading Tunity (build $TUNITY_BUILD) 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 operations below
|
||||
export TYPE=SPIGOT
|
||||
|
||||
# Continue to Final Setup
|
||||
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
||||
46
start-deployVanilla
Normal file
46
start-deployVanilla
Normal file
@@ -0,0 +1,46 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${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=$(curl -fsSL 'https://launchermeta.mojang.com/mc/game/version_manifest.json' | jq --arg VANILLA_VERSION "$VANILLA_VERSION" --raw-output '[.versions[]|select(.id == $VANILLA_VERSION)][0].url')
|
||||
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=$(curl -fsSL ${versionManifestUrl} | jq --raw-output '.downloads.server.url')
|
||||
result=$?
|
||||
if [ $result != 0 ]; then
|
||||
log "ERROR failed to obtain version manifest from $versionManifestUrl ($result)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
debug "Downloading server from $serverDownloadUrl"
|
||||
if isDebugging; then
|
||||
verbose=-v
|
||||
fi
|
||||
curl $verbose -fsSL -o $SERVER $serverDownloadUrl
|
||||
result=$?
|
||||
if [ $result != 0 ]; then
|
||||
log "ERROR failed to download server from $serverDownloadUrl ($result)"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
isDebugging && ls -l
|
||||
|
||||
# Continue to Final Setup
|
||||
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
||||
41
start-finalSetupEnvVariables
Normal file
41
start-finalSetupEnvVariables
Normal file
@@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
|
||||
: ${ENV_VARIABLE_PREFIX:=CFG_}
|
||||
|
||||
if isTrue "${REPLACE_ENV_VARIABLES}"; then
|
||||
log "Replacing env variables in configs that match the prefix $ENV_VARIABLE_PREFIX..."
|
||||
|
||||
findExcludes=
|
||||
for f in ${REPLACE_ENV_VARIABLES_EXCLUDES}; do
|
||||
findExcludes="${findExcludes} -not -name $f"
|
||||
done
|
||||
for p in ${REPLACE_ENV_VARIABLES_EXCLUDE_PATHS}; do
|
||||
findExcludes="${findExcludes} -not -path \"*$p*\""
|
||||
done
|
||||
isDebugging && echo "Using find exclusion: $findExcludes"
|
||||
|
||||
while IFS='=' read -r name value ; do
|
||||
# check if name of env variable matches the prefix
|
||||
# sanity check environment variables to avoid code injections
|
||||
if [[ "$name" = $ENV_VARIABLE_PREFIX* ]] \
|
||||
&& [[ $value =~ ^[0-9a-zA-Z_:/=?.+\-]*$ ]] \
|
||||
&& [[ $name =~ ^[0-9a-zA-Z_\-]*$ ]]; then
|
||||
# Read content from file environment
|
||||
if [[ $name = *"_FILE" ]] && [[ -f $value ]]; then
|
||||
name="${name/_FILE/}"
|
||||
value=$(<$value)
|
||||
fi
|
||||
|
||||
log "Replacing $name with $value ..."
|
||||
find /data/ -type f \
|
||||
\( -name "*.yml" -or -name "*.yaml" -or -name "*.txt" -or -name "*.cfg" \
|
||||
-or -name "*.conf" -or -name "*.properties" \) \
|
||||
$findExcludes \
|
||||
-exec sed -i 's#${'"$name"'}#'"$value"'#g' {} \;
|
||||
fi
|
||||
done < <(env)
|
||||
fi
|
||||
|
||||
exec ${SCRIPTS:-/}start-minecraftFinalSetup $@
|
||||
27
start-finalSetupModconfig
Normal file
27
start-finalSetupModconfig
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
|
||||
# If supplied with a URL for a config (simple zip of configurations), download it and unpack
|
||||
if [[ "$MODCONFIG" ]]; then
|
||||
case "X$MODCONFIG" in
|
||||
X[Hh][Tt][Tt][Pp]*[Zz][iI][pP])
|
||||
log "Downloading mod/plugin configs via HTTP"
|
||||
log " from $MODCONFIG ..."
|
||||
curl -sSL -o /tmp/modconfig.zip "$MODCONFIG"
|
||||
if [ "$TYPE" = "SPIGOT" ]; then
|
||||
mkdir -p /data/plugins
|
||||
unzip -o -d /data/plugins /tmp/modconfig.zip
|
||||
else
|
||||
mkdir -p /data/config
|
||||
unzip -o -d /data/config /tmp/modconfig.zip
|
||||
fi
|
||||
rm -f /tmp/modconfig.zip
|
||||
;;
|
||||
*)
|
||||
log "Invalid URL given for modconfig: Must be HTTP or HTTPS and a ZIP file"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
exec ${SCRIPTS:-/}start-finalSetupPlugins $@
|
||||
157
start-finalSetupModpack
Normal file
157
start-finalSetupModpack
Normal file
@@ -0,0 +1,157 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
|
||||
# CURSE_URL_BASE used in manifest downloads below
|
||||
CURSE_URL_BASE=${CURSE_URL_BASE:-https://minecraft.curseforge.com/projects}
|
||||
|
||||
# Remove old mods/plugins
|
||||
if [ "$REMOVE_OLD_MODS" = "TRUE" ]; then
|
||||
if [ "$TYPE" = "SPIGOT" ]; then
|
||||
rm -rf /data/plugins/*
|
||||
else
|
||||
rm -rf /data/mods/*
|
||||
fi
|
||||
fi
|
||||
|
||||
# If supplied with a URL for a modpack (simple zip of jars), download it and unpack
|
||||
if [[ "$MODPACK" ]]; then
|
||||
EFFECTIVE_MODPACK_URL=$(curl -Ls -o /dev/null -w %{url_effective} $MODPACK)
|
||||
case "X$EFFECTIVE_MODPACK_URL" in
|
||||
X[Hh][Tt][Tt][Pp]*.zip)
|
||||
log "Downloading mod/plugin pack via HTTP"
|
||||
log " from $EFFECTIVE_MODPACK_URL ..."
|
||||
if ! curl -sSL -o /tmp/modpack.zip "$EFFECTIVE_MODPACK_URL"; then
|
||||
log "ERROR: failed to download from $EFFECTIVE_MODPACK_URL"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
if [ "$TYPE" = "SPIGOT" ]; then
|
||||
mkdir -p /data/plugins
|
||||
if ! unzip -o -d /data/plugins /tmp/modpack.zip; then
|
||||
log "ERROR: failed to unzip the modpack from $EFFECTIVE_MODPACK_URL"
|
||||
fi
|
||||
else
|
||||
mkdir -p /data/mods
|
||||
if ! unzip -o -d /data/mods /tmp/modpack.zip; then
|
||||
log "ERROR: failed to unzip the modpack from $EFFECTIVE_MODPACK_URL"
|
||||
fi
|
||||
fi
|
||||
rm -f /tmp/modpack.zip
|
||||
;;
|
||||
*)
|
||||
log "Invalid URL given for modpack: Must be HTTP or HTTPS and a ZIP file"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# If supplied with a URL for a plugin download it.
|
||||
if [[ "$MODS" ]]; then
|
||||
for i in ${MODS//,/ }
|
||||
do
|
||||
EFFECTIVE_MOD_URL=$(curl -Ls -o /dev/null -w %{url_effective} $i)
|
||||
case "X$EFFECTIVE_MOD_URL" in
|
||||
X[Hh][Tt][Tt][Pp]*.jar)
|
||||
log "Downloading mod/plugin via HTTP"
|
||||
log " from $EFFECTIVE_MOD_URL ..."
|
||||
if ! curl -sSL -o /tmp/${EFFECTIVE_MOD_URL##*/} $EFFECTIVE_MOD_URL; then
|
||||
log "ERROR: failed to download from $EFFECTIVE_MOD_URL to /tmp/${EFFECTIVE_MOD_URL##*/}"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
if [ "$TYPE" = "SPIGOT" ]; then
|
||||
mkdir -p /data/plugins
|
||||
mv /tmp/${EFFECTIVE_MOD_URL##*/} /data/plugins/${EFFECTIVE_MOD_URL##*/}
|
||||
else
|
||||
mkdir -p /data/mods
|
||||
mv /tmp/${EFFECTIVE_MOD_URL##*/} /data/mods/${EFFECTIVE_MOD_URL##*/}
|
||||
fi
|
||||
rm -f /tmp/${EFFECTIVE_MOD_URL##*/}
|
||||
;;
|
||||
*)
|
||||
log "Invalid URL given for modpack: Must be HTTP or HTTPS and a JAR file"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
|
||||
if [[ "$MANIFEST" ]]; then
|
||||
if [[ -e "$MANIFEST" ]]; then
|
||||
EFFECTIVE_MANIFEST_FILE=$MANIFEST
|
||||
elif isURL "$MANIFEST"; then
|
||||
EFFECTIVE_MANIFEST_FILE=/tmp/manifest.json
|
||||
EFFECTIVE_MANIFEST_URL=$(curl -Ls -o /dev/null -w %{url_effective} $MANIFEST)
|
||||
curl -Ls -o $EFFECTIVE_MANIFEST_FILE "$EFFECTIVE_MANIFEST_URL"
|
||||
else
|
||||
log "MANIFEST='$MANIFEST' is not a valid manifest url or location"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
case "X$EFFECTIVE_MANIFEST_FILE" in
|
||||
X*.json)
|
||||
if [ -f "${EFFECTIVE_MANIFEST_FILE}" ]; then
|
||||
MOD_DIR=${FTB_BASE_DIR:-/data}/mods
|
||||
if [ ! -d "$MOD_DIR" ]
|
||||
then
|
||||
log "Creating mods dir $MOD_DIR"
|
||||
mkdir -p "$MOD_DIR"
|
||||
fi
|
||||
log "Starting manifest download..."
|
||||
cat "${EFFECTIVE_MANIFEST_FILE}" | jq -r '.files[] | (.projectID|tostring) + " " + (.fileID|tostring)'| while read -r p f
|
||||
do
|
||||
if [ ! -f $MOD_DIR/${p}_${f}.jar ]
|
||||
then
|
||||
redirect_url="$(curl -Ls -o /dev/null -w %{url_effective} ${CURSE_URL_BASE}/${p})"
|
||||
url="$redirect_url/download/${f}/file"
|
||||
log Downloading curseforge mod $url
|
||||
# Manifest usually doesn't have mod names. Using id should be fine, tho
|
||||
curl -sSL "${url}" -o $MOD_DIR/${p}_${f}.jar
|
||||
fi
|
||||
done
|
||||
else
|
||||
log "Could not find manifest file, unsufficient privs, or malformed path."
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
log "Invalid manifest file for modpack. Please make sure it is a .json file."
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if [[ "${GENERIC_PACK}" ]]; then
|
||||
if isURL "${GENERIC_PACK}"; then
|
||||
generic_pack_url=${GENERIC_PACK}
|
||||
GENERIC_PACK=/tmp/$(basename ${generic_pack_url})
|
||||
log "Downloading generic pack from ${generic_pack_url} ..."
|
||||
curl -fsSL -o ${GENERIC_PACK} ${generic_pack_url}
|
||||
fi
|
||||
|
||||
sum_file=/data/.generic_pack.sum
|
||||
if ! sha256sum -c ${sum_file} -s 2> /dev/null; then
|
||||
base_dir=/tmp/generic_pack_base
|
||||
mkdir -p ${base_dir}
|
||||
unzip -q -d ${base_dir} ${GENERIC_PACK}
|
||||
if [ -f /data/manifest.txt ]; then
|
||||
log "Manifest exists from older generic pack, cleaning up ..."
|
||||
while read f; do
|
||||
rm -rf "/data/${f}"
|
||||
done < /data/manifest.txt
|
||||
find /data/* -type d -exec rmdir --ignore-fail-on-non-empty {} +
|
||||
rm -f /data/manifest.txt
|
||||
fi
|
||||
log "Writing generic pack manifest ... "
|
||||
find ${base_dir} -type f -print0 | xargs -0 -I {} echo "{}" | sed "s#${base_dir}/##" > /data/manifest.txt
|
||||
log "Applying generic pack ..."
|
||||
IFS='
|
||||
'
|
||||
set -f
|
||||
for d in $(find ${base_dir} -type d); do mkdir -p "$(sed "s#${base_dir}#/data#" <<< $d)"; done
|
||||
for f in $(find ${base_dir} -type f); do cp -f "$f" "$(sed "s#${base_dir}#/data#" <<< $f)"; done
|
||||
rm -rf ${base_dir}
|
||||
sha256sum ${GENERIC_PACK} > ${sum_file}
|
||||
fi
|
||||
fi
|
||||
|
||||
exec ${SCRIPTS:-/}start-finalSetupModconfig $@
|
||||
23
start-finalSetupPlugins
Executable file
23
start-finalSetupPlugins
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
|
||||
: ${PLUGINS_SYNC_UPDATE:=true}
|
||||
|
||||
isDebugging && set -x
|
||||
|
||||
if [ -d /plugins ]; then
|
||||
case ${TYPE} in
|
||||
SPIGOT|BUKKIT|PAPER)
|
||||
mkdir -p /data/plugins
|
||||
log "Copying plugins over..."
|
||||
if isTrue ${PLUGINS_SYNC_UPDATE}; then
|
||||
updateArg="--update"
|
||||
fi
|
||||
# Copy plugins over using rsync to allow deeply nested updates of plugins
|
||||
rsync -a --out-format="update:%f:Last Modified %M" --prune-empty-dirs $updateArg /plugins /data
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
exec ${SCRIPTS:-/}start-finalSetupServerProperties $@
|
||||
209
start-finalSetupServerProperties
Normal file
209
start-finalSetupServerProperties
Normal file
@@ -0,0 +1,209 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
|
||||
# FUNCTIONS
|
||||
function setServerProp {
|
||||
local prop=$1
|
||||
local var=$2
|
||||
if [ -n "$var" ]; then
|
||||
# normalize booleans
|
||||
case ${var^^} in
|
||||
TRUE|FALSE)
|
||||
var=${var,,} ;;
|
||||
esac
|
||||
log "Setting ${prop} to '${var}' in ${SERVER_PROPERTIES}"
|
||||
sed -i "/^${prop}\s*=/ c ${prop}=${var}" "$SERVER_PROPERTIES"
|
||||
else
|
||||
log "Skip setting ${prop}"
|
||||
fi
|
||||
}
|
||||
|
||||
function customizeServerProps {
|
||||
if [ -n "$WHITELIST" ]; then
|
||||
log "Creating whitelist"
|
||||
setServerProp "whitelist" "true"
|
||||
setServerProp "white-list" "true"
|
||||
fi
|
||||
|
||||
# If not provided, generate a reasonable default message-of-the-day,
|
||||
# which shows up in the server listing in the client
|
||||
if [ -z "$MOTD" ]; then
|
||||
# snapshot is the odd case where we have to look at version to identify that label
|
||||
if [[ ${ORIGINAL_TYPE} == "VANILLA" && ${VERSION} == "SNAPSHOT" ]]; then
|
||||
label=SNAPSHOT
|
||||
else
|
||||
label=${ORIGINAL_TYPE}
|
||||
fi
|
||||
|
||||
# Convert label to title-case
|
||||
label=${label,,}
|
||||
label=${label^}
|
||||
MOTD="A ${label} Minecraft Server powered by Docker"
|
||||
fi
|
||||
|
||||
setServerProp "server-name" "$SERVER_NAME"
|
||||
setServerProp "server-ip" "$SERVER_IP"
|
||||
setServerProp "server-port" "$SERVER_PORT"
|
||||
setServerProp "motd" "$MOTD"
|
||||
setServerProp "allow-nether" "$ALLOW_NETHER"
|
||||
setServerProp "announce-player-achievements" "$ANNOUNCE_PLAYER_ACHIEVEMENTS"
|
||||
setServerProp "enable-command-block" "$ENABLE_COMMAND_BLOCK"
|
||||
setServerProp "spawn-animals" "$SPAWN_ANIMALS"
|
||||
setServerProp "spawn-monsters" "$SPAWN_MONSTERS"
|
||||
setServerProp "spawn-npcs" "$SPAWN_NPCS"
|
||||
setServerProp "spawn-protection" "$SPAWN_PROTECTION"
|
||||
setServerProp "generate-structures" "$GENERATE_STRUCTURES"
|
||||
setServerProp "view-distance" "$VIEW_DISTANCE"
|
||||
setServerProp "hardcore" "$HARDCORE"
|
||||
setServerProp "snooper-enabled" "$SNOOPER_ENABLED"
|
||||
setServerProp "max-build-height" "$MAX_BUILD_HEIGHT"
|
||||
setServerProp "force-gamemode" "$FORCE_GAMEMODE"
|
||||
setServerProp "max-tick-time" "$MAX_TICK_TIME"
|
||||
setServerProp "enable-query" "$ENABLE_QUERY"
|
||||
setServerProp "query.port" "$QUERY_PORT"
|
||||
setServerProp "enable-rcon" "$ENABLE_RCON"
|
||||
setServerProp "rcon.password" "$RCON_PASSWORD"
|
||||
setServerProp "rcon.port" "$RCON_PORT"
|
||||
setServerProp "max-players" "$MAX_PLAYERS"
|
||||
setServerProp "max-world-size" "$MAX_WORLD_SIZE"
|
||||
setServerProp "level-name" "$LEVEL"
|
||||
setServerProp "level-seed" "$SEED"
|
||||
setServerProp "pvp" "$PVP"
|
||||
setServerProp "generator-settings" "$GENERATOR_SETTINGS"
|
||||
setServerProp "online-mode" "$ONLINE_MODE"
|
||||
setServerProp "allow-flight" "$ALLOW_FLIGHT"
|
||||
setServerProp "level-type" "${LEVEL_TYPE^^}"
|
||||
setServerProp "resource-pack" "$RESOURCE_PACK"
|
||||
setServerProp "resource-pack-sha1" "$RESOURCE_PACK_SHA1"
|
||||
setServerProp "player-idle-timeout" "$PLAYER_IDLE_TIMEOUT"
|
||||
setServerProp "broadcast-console-to-ops" "$BROADCAST_CONSOLE_TO_OPS"
|
||||
setServerProp "broadcast-rcon-to-ops" "$BROADCAST_RCON_TO_OPS"
|
||||
setServerProp "enable-jmx-monitoring" "$ENABLE_JMX"
|
||||
setServerProp "sync-chunk-writes" "$SYNC_CHUNK_WRITES"
|
||||
setServerProp "enable-status" "$ENABLE_STATUS"
|
||||
setServerProp "entity-broadcast-range-percentage" "$ENTITY_BROADCAST_RANGE_PERCENTAGE"
|
||||
setServerProp "function-permission-level" "$FUNCTION_PERMISSION_LEVEL"
|
||||
setServerProp "network-compression-threshold" "$NETWORK_COMPRESSION_THRESHOLD"
|
||||
setServerProp "op-permission-level" "$OP_PERMISSION_LEVEL"
|
||||
setServerProp "prevent-proxy-connections" "$PREVENT_PROXY_CONNECTIONS"
|
||||
setServerProp "use-native-transport" "$USE_NATIVE_TRANSPORT"
|
||||
setServerProp "enforce-whitelist" "$ENFORCE_WHITELIST"
|
||||
|
||||
if [ -n "$DIFFICULTY" ]; then
|
||||
case $DIFFICULTY in
|
||||
peaceful|0)
|
||||
if versionLessThan 1.13; then
|
||||
DIFFICULTY=0
|
||||
else
|
||||
DIFFICULTY=peaceful
|
||||
fi
|
||||
;;
|
||||
easy|1)
|
||||
if versionLessThan 1.13; then
|
||||
DIFFICULTY=1
|
||||
else
|
||||
DIFFICULTY=easy
|
||||
fi
|
||||
;;
|
||||
normal|2)
|
||||
if versionLessThan 1.13; then
|
||||
DIFFICULTY=2
|
||||
else
|
||||
DIFFICULTY=normal
|
||||
fi
|
||||
;;
|
||||
hard|3)
|
||||
if versionLessThan 1.13; then
|
||||
DIFFICULTY=3
|
||||
else
|
||||
DIFFICULTY=hard
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
log "DIFFICULTY must be peaceful, easy, normal, or hard."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
setServerProp "difficulty" "$DIFFICULTY"
|
||||
fi
|
||||
|
||||
if [ -n "$MODE" ]; then
|
||||
log "Setting mode"
|
||||
MODE_LC=$( echo $MODE | tr '[:upper:]' '[:lower:]' )
|
||||
case $MODE_LC in
|
||||
su*|0)
|
||||
if versionLessThan 1.13; then
|
||||
MODE=0
|
||||
else
|
||||
MODE=survival
|
||||
fi
|
||||
;;
|
||||
c*|1)
|
||||
if versionLessThan 1.13; then
|
||||
MODE=1
|
||||
else
|
||||
MODE=creative
|
||||
fi
|
||||
;;
|
||||
a*|2)
|
||||
if versionLessThan 1.13; then
|
||||
MODE=2
|
||||
else
|
||||
MODE=adventure
|
||||
fi
|
||||
;;
|
||||
sp*|3)
|
||||
if versionLessThan 1.13; then
|
||||
MODE=3
|
||||
else
|
||||
MODE=spectator
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
log "ERROR: Invalid game mode: $MODE"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
setServerProp "gamemode" "$MODE"
|
||||
fi
|
||||
}
|
||||
|
||||
# Deploy server.properties file
|
||||
if [[ ${TYPE} == "FEED-THE-BEAST" ]]; then
|
||||
export SERVER_PROPERTIES=${FTB_DIR}/server.properties
|
||||
log "detected FTB, changing properties path to ${SERVER_PROPERTIES}"
|
||||
fi
|
||||
|
||||
if [ ! -e "$SERVER_PROPERTIES" ]; then
|
||||
log "Creating server.properties in ${SERVER_PROPERTIES}"
|
||||
cp /tmp/server.properties "$SERVER_PROPERTIES"
|
||||
customizeServerProps
|
||||
elif [ -n "${OVERRIDE_SERVER_PROPERTIES}" ]; then
|
||||
case ${OVERRIDE_SERVER_PROPERTIES^^} in
|
||||
TRUE|1)
|
||||
customizeServerProps
|
||||
;;
|
||||
*)
|
||||
log "server.properties already created, skipping"
|
||||
;;
|
||||
esac
|
||||
else
|
||||
log "server.properties already created, skipping"
|
||||
fi
|
||||
|
||||
if isTrue "${ENABLE_AUTOPAUSE}"; then
|
||||
current_max_tick=$( grep 'max-tick-time' "$SERVER_PROPERTIES" | sed -r 's/( )+//g' | awk -F= '{print $2}' )
|
||||
if (( $current_max_tick > 0 && $current_max_tick < 86400000 )); then
|
||||
log "Warning: The server.properties for the server doesn't have the Server Watchdog (effectively) disabled."
|
||||
log "Warning (cont): Autopause functionality resuming the process might trigger the Watchdog and restart the server completely."
|
||||
log "Warning (cont): Set the max-tick-time property to a high value (or disable the Watchdog with value -1 for versions 1.8.1+)."
|
||||
fi
|
||||
fi
|
||||
|
||||
if isDebugging; then
|
||||
log "DEBUG Dumping server.properties"
|
||||
cat /data/server.properties
|
||||
fi
|
||||
|
||||
exec ${SCRIPTS:-/}start-finalSetupEnvVariables $@
|
||||
54
start-finalSetupWorld
Normal file
54
start-finalSetupWorld
Normal file
@@ -0,0 +1,54 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
set -e
|
||||
isDebugging && set -x
|
||||
|
||||
if [ $TYPE = "FEED-THE-BEAST" ]; then
|
||||
worldDest=$FTB_DIR/$LEVEL
|
||||
else
|
||||
worldDest=/data/$LEVEL
|
||||
fi
|
||||
|
||||
if [[ "$WORLD" ]] && isTrue "${FORCE_WORLD_COPY}" || [ ! -d "$worldDest" ]; then
|
||||
if isURL $WORLD; then
|
||||
curl -fsSL "$WORLD" -o /tmp/world.zip
|
||||
zipSrc=/tmp/world.zip
|
||||
elif [[ "$WORLD" =~ .*\.zip ]]; then
|
||||
zipSrc="$WORLD"
|
||||
fi
|
||||
|
||||
if [[ "$zipSrc" ]]; then
|
||||
log "Unzipping world"
|
||||
|
||||
# Stage contents so that the correct subdirectory can be picked off
|
||||
mkdir -p /tmp/world-data
|
||||
(cd /tmp/world-data && unzip -o -q "$zipSrc")
|
||||
|
||||
baseDirs=$(find /tmp/world-data -name "level.dat" -exec dirname "{}" \;)
|
||||
count=$(echo "$baseDirs" | wc -l)
|
||||
if [[ $count -gt 1 ]]; then
|
||||
baseDir="$(echo "$baseDirs" | sed -n ${WORLD_INDEX:-1}p)"
|
||||
baseName=$(basename "$baseDir")
|
||||
log "WARN multiple levels found, picking: $baseName"
|
||||
elif [[ $count -gt 0 ]]; then
|
||||
baseDir="$baseDirs"
|
||||
else
|
||||
log "ERROR invalid world content"
|
||||
exit 1
|
||||
fi
|
||||
rsync --remove-source-files --recursive --delete "$baseDir/" "$worldDest"
|
||||
else
|
||||
log "Cloning world directory from $WORLD ..."
|
||||
rsync --recursive --delete "${WORLD%/}"/ "$worldDest"
|
||||
fi
|
||||
|
||||
if [ "$TYPE" = "SPIGOT" ]; then
|
||||
# Reorganise if a Spigot server
|
||||
log "Moving End and Nether maps to Spigot location"
|
||||
[ -d "$worldDest/DIM1" ] && mv -f "$worldDest/DIM1" "/data/${LEVEL}_the_end"
|
||||
[ -d "$worldDest/DIM-1" ] && mv -f "$worldDest/DIM-1" "/data/${LEVEL}_nether"
|
||||
fi
|
||||
fi
|
||||
|
||||
exec ${SCRIPTS:-/}start-finalSetupModpack $@
|
||||
216
start-minecraftFinalSetup
Normal file
216
start-minecraftFinalSetup
Normal file
@@ -0,0 +1,216 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
|
||||
if [ -n "$OPS" ]; then
|
||||
log "Setting/adding ops"
|
||||
rm -rf /data/ops.txt.converted
|
||||
echo $OPS | awk -v RS=, '{print}' > /data/ops.txt
|
||||
fi
|
||||
|
||||
if [ -n "$WHITELIST" ]; then
|
||||
log "Setting whitelist"
|
||||
rm -rf /data/white-list.txt.converted
|
||||
echo $WHITELIST | awk -v RS=, '{print}' > /data/white-list.txt
|
||||
fi
|
||||
|
||||
if [ -n "$ICON" -a ! -e server-icon.png ]; 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
|
||||
|
||||
if ! isTrue ${SKIP_LOG4J_CONFIG}; then
|
||||
# Set up log configuration
|
||||
LOGFILE="/data/log4j2.xml"
|
||||
if [ ! -e "$LOGFILE" ]; then
|
||||
log "Creating log4j2.xml in ${LOGFILE}"
|
||||
cp /tmp/log4j2.xml "$LOGFILE"
|
||||
else
|
||||
log "log4j2.xml already created, skipping"
|
||||
fi
|
||||
JVM_OPTS="-Dlog4j.configurationFile=/data/log4j2.xml ${JVM_OPTS}"
|
||||
fi
|
||||
|
||||
# Make sure files exist and are valid JSON (for pre-1.12 to 1.12 upgrades)
|
||||
log "Checking for JSON files."
|
||||
JSON_FILES=$(find /data -maxdepth 1 -name '*.json')
|
||||
for j in $JSON_FILES; do
|
||||
if [[ $(cat "$j" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') == "" ]]; then
|
||||
log "Fixing JSON $j"
|
||||
echo '[]' > $j
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
# If any modules have been provided, copy them over
|
||||
if [ -d /mods ]; then
|
||||
log "Copying any mods over..."
|
||||
mkdir -p /data/mods
|
||||
rsync -a --out-format="update:%f:Last Modified %M" --prune-empty-dirs --update /mods /data
|
||||
fi
|
||||
|
||||
[ -d /data/config ] || mkdir /data/config
|
||||
for c in /config/*
|
||||
do
|
||||
if [ -f "$c" ]; then
|
||||
log Copying configuration $(basename "$c")
|
||||
cp -rf "$c" /data/config
|
||||
fi
|
||||
done
|
||||
|
||||
EXTRA_ARGS=""
|
||||
# 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="${EXTRA_ARGS} nogui"
|
||||
fi
|
||||
|
||||
# put these prior JVM_OPTS at the end to give any memory settings there higher precedence
|
||||
log "Setting initial memory to ${INIT_MEMORY:=${MEMORY}} and max to ${MAX_MEMORY:=${MEMORY}}"
|
||||
|
||||
expandedDOpts=
|
||||
if [ -n "$JVM_DD_OPTS" ]; then
|
||||
for dopt in $JVM_DD_OPTS
|
||||
do
|
||||
expandedDOpts="${expandedDOpts} -D${dopt/:/=}"
|
||||
done
|
||||
fi
|
||||
|
||||
if isTrue ${ENABLE_JMX}; then
|
||||
: ${JMX_HOST:=0.0.0.0}
|
||||
: ${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_HOST}
|
||||
-Djava.rmi.server.hostname=${JMX_HOST}"
|
||||
|
||||
log "JMX is enabled. Make sure you have port forwarding for ${JMX_PORT}"
|
||||
fi
|
||||
|
||||
if isTrue "${USE_AIKAR_FLAGS}"; then
|
||||
# From https://mcflags.emc.gs/
|
||||
|
||||
if (( $(normalizeMemSize "${MAX_MEMORY}") >= $(normalizeMemSize 12g) )); then
|
||||
log "Using Aikar's >12GB flags"
|
||||
G1NewSizePercent=40
|
||||
G1MaxNewSizePercent=50
|
||||
G1HeapRegionSize=16M
|
||||
G1ReservePercent=15
|
||||
InitiatingHeapOccupancyPercent=20
|
||||
else
|
||||
log "Using Aikar's flags"
|
||||
G1NewSizePercent=30
|
||||
G1MaxNewSizePercent=40
|
||||
G1HeapRegionSize=8M
|
||||
G1ReservePercent=20
|
||||
InitiatingHeapOccupancyPercent=15
|
||||
fi
|
||||
|
||||
JVM_XX_OPTS="${JVM_XX_OPTS}
|
||||
-XX:+UseG1GC
|
||||
-XX:+ParallelRefProcEnabled
|
||||
-XX:MaxGCPauseMillis=200
|
||||
-XX:+UnlockExperimentalVMOptions
|
||||
-XX:+DisableExplicitGC
|
||||
-XX:+AlwaysPreTouch
|
||||
-XX:G1NewSizePercent=${G1NewSizePercent}
|
||||
-XX:G1MaxNewSizePercent=${G1MaxNewSizePercent}
|
||||
-XX:G1HeapRegionSize=${G1HeapRegionSize}
|
||||
-XX:G1ReservePercent=${G1ReservePercent}
|
||||
-XX:G1HeapWastePercent=5
|
||||
-XX:G1MixedGCCountTarget=4
|
||||
-XX:InitiatingHeapOccupancyPercent=${InitiatingHeapOccupancyPercent}
|
||||
-XX:G1MixedGCLiveThresholdPercent=90
|
||||
-XX:G1RSetUpdatingPauseTimePercent=5
|
||||
-XX:SurvivorRatio=32
|
||||
-XX:+PerfDisableSharedMem
|
||||
-XX:MaxTenuringThreshold=1
|
||||
-Dusing.aikars.flags=https://mcflags.emc.gs
|
||||
-Daikars.new.flags=true
|
||||
"
|
||||
fi
|
||||
|
||||
if isTrue "${USE_LARGE_PAGES}"; then
|
||||
JVM_XX_OPTS="${JVM_XX_OPTS}
|
||||
-XX:+UseLargePagesInMetaspace
|
||||
"
|
||||
fi
|
||||
|
||||
if isTrue "${DEBUG_MEMORY}"; then
|
||||
log "Memory usage and availability (in MB)"
|
||||
uname -a
|
||||
free -m
|
||||
fi
|
||||
|
||||
mcServerRunnerArgs="--stop-duration 60s"
|
||||
if [[ ${TYPE} == "CURSE_INSTANCE" ]]; then
|
||||
JVM_OPTS="-Xms${INIT_MEMORY} -Xmx${MAX_MEMORY} ${JVM_OPTS}"
|
||||
if isTrue ${DEBUG_EXEC}; then
|
||||
set -x
|
||||
fi
|
||||
exec mc-server-runner ${mcServerRunnerArgs} \
|
||||
--cf-instance-file "${CURSE_INSTANCE_JSON}" \
|
||||
java $JVM_XX_OPTS $JVM_OPTS $expandedDOpts -jar _SERVERJAR_ "$@" $EXTRA_ARGS
|
||||
elif [[ ${TYPE} == "FEED-THE-BEAST" ]]; then
|
||||
mcServerRunnerArgs="${mcServerRunnerArgs} --shell bash"
|
||||
|
||||
if [ ! -e "${FTB_DIR}/ops.json" -a -e /data/ops.txt ]; then
|
||||
cp -f /data/ops.txt ${FTB_DIR}/
|
||||
fi
|
||||
|
||||
if [ ! -e "${FTB_DIR}/whitelist.json" -a -e /data/white-list.txt ]; then
|
||||
cp -f /data/white-list.txt ${FTB_DIR}/
|
||||
fi
|
||||
|
||||
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}/"
|
||||
|
||||
cat > "${FTB_DIR}/settings-local.sh" <<EOF
|
||||
export MIN_RAM="${INIT_MEMORY}"
|
||||
export MAX_RAM="${MAX_MEMORY}"
|
||||
export JAVA_PARAMETERS="${JVM_XX_OPTS} -Xms${INIT_MEMORY} ${JVM_OPTS} $expandedDOpts"
|
||||
EOF
|
||||
|
||||
# patch CurseForge cfg file, if present
|
||||
if [ -f "${FTB_DIR}/settings.cfg" ]; then
|
||||
sed -i "s/MAX_RAM=[^;]*/MAX_RAM=${MAX_MEMORY}/" "${FTB_DIR}/settings.cfg"
|
||||
fi
|
||||
|
||||
cd "${FTB_DIR}"
|
||||
log "Running FTB ${FTB_SERVER_START} in ${FTB_DIR} ..."
|
||||
if isTrue ${DEBUG_EXEC}; then
|
||||
set -x
|
||||
fi
|
||||
exec mc-server-runner ${mcServerRunnerArgs} "${FTB_SERVER_START}"
|
||||
else
|
||||
# If we have a bootstrap.txt file... feed that in to the server stdin
|
||||
if [ -f /data/bootstrap.txt ]; then
|
||||
bootstrapArgs="--bootstrap /data/bootstrap.txt"
|
||||
fi
|
||||
|
||||
log "Starting the Minecraft server..."
|
||||
JVM_OPTS="-Xms${INIT_MEMORY} -Xmx${MAX_MEMORY} ${JVM_OPTS}"
|
||||
if isTrue ${DEBUG_EXEC}; then
|
||||
set -x
|
||||
fi
|
||||
exec mc-server-runner ${bootstrapArgs} ${mcServerRunnerArgs} java $JVM_XX_OPTS $JVM_OPTS $expandedDOpts -jar $SERVER "$@" $EXTRA_ARGS
|
||||
fi
|
||||
109
start-utils
Normal file
109
start-utils
Normal file
@@ -0,0 +1,109 @@
|
||||
#!/bin/bash
|
||||
|
||||
function isURL {
|
||||
local value=$1
|
||||
|
||||
if [[ ${value:0:8} == "https://" || ${value:0:7} == "http://" ]]; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
function isTrue {
|
||||
local value=${1,,}
|
||||
|
||||
result=
|
||||
|
||||
case ${value} in
|
||||
true|on)
|
||||
result=0
|
||||
;;
|
||||
*)
|
||||
result=1
|
||||
;;
|
||||
esac
|
||||
|
||||
return ${result}
|
||||
}
|
||||
|
||||
function isDebugging {
|
||||
if [[ -v DEBUG ]] && [[ ${DEBUG^^} = TRUE ]]; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
function debug {
|
||||
if isDebugging; then
|
||||
log "DEBUG: $*"
|
||||
fi
|
||||
}
|
||||
|
||||
function logn {
|
||||
echo -n "[init] $*"
|
||||
}
|
||||
|
||||
function log {
|
||||
echo "[init] $*"
|
||||
}
|
||||
|
||||
function logAutopause {
|
||||
echo "[Autopause loop] $*"
|
||||
}
|
||||
|
||||
function logAutopauseAction {
|
||||
echo "[$(date -Iseconds)] [Autopause] $*"
|
||||
}
|
||||
|
||||
function normalizeMemSize {
|
||||
local scale=1
|
||||
case ${1,,} in
|
||||
*k)
|
||||
scale=1024;;
|
||||
*m)
|
||||
scale=1048576;;
|
||||
*g)
|
||||
scale=1073741824;;
|
||||
esac
|
||||
|
||||
val=${1:0: -1}
|
||||
echo $(( val * scale ))
|
||||
}
|
||||
|
||||
function versionLessThan {
|
||||
local activeParts
|
||||
IFS=. read -ra activeParts <<< "${VANILLA_VERSION}"
|
||||
|
||||
local givenParts
|
||||
IFS=. read -ra givenParts <<< "$1"
|
||||
|
||||
if (( ${#activeParts[@]} < 2 )); then
|
||||
return 1
|
||||
fi
|
||||
|
||||
if (( ${#activeParts[@]} == 2 )); then
|
||||
if (( activeParts[0] < givenParts[0] )) || \
|
||||
(( activeParts[0] == givenParts[0] && activeParts[1] < givenParts[1] )); then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
else
|
||||
if (( activeParts[0] < givenParts[0] )) || \
|
||||
(( activeParts[0] == givenParts[0] && activeParts[1] < givenParts[1] )) || \
|
||||
(( activeParts[0] == givenParts[0] && activeParts[1] == givenParts[1] && activeParts[2] < givenParts[2] )); then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
requireVar() {
|
||||
if [ ! -v $1 ]; then
|
||||
log "ERROR: $1 is required to be set"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
18
start-validateCurseInstance
Executable file
18
start-validateCurseInstance
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
|
||||
if ! [[ -v CURSE_INSTANCE_JSON ]]; then
|
||||
log "ERROR: CURSE_INSTANCE_JSON needs to be set"
|
||||
exit 2
|
||||
elif ! [ -f "${CURSE_INSTANCE_JSON}" ] && [ -f "${CURSE_INSTANCE_JSON}/minecraftinstance.json" ]; then
|
||||
CURSE_INSTANCE_JSON="${CURSE_INSTANCE_JSON}/minecraftinstance.json"
|
||||
elif ! [ -f "${CURSE_INSTANCE_JSON}" ]; then
|
||||
log "ERROR: CURSE_INSTANCE_JSON file does not exist: ${CURSE_INSTANCE_JSON}"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
log "Resolved CURSE_INSTANCE_JSON as ${CURSE_INSTANCE_JSON}"
|
||||
|
||||
# Continue to Final Setup
|
||||
exec ${SCRIPTS:-/}start-finalSetupWorld "$@"
|
||||
@@ -1,17 +0,0 @@
|
||||
FROM itzg/ubuntu-openjdk-7
|
||||
|
||||
MAINTAINER itzg
|
||||
|
||||
RUN apt-get install -y wget unzip
|
||||
|
||||
RUN wget -q -O /tmp/titan.zip http://s3.thinkaurelius.com/downloads/titan/titan-0.5.0-hadoop2.zip
|
||||
RUN unzip /tmp/titan.zip -d /opt && rm /tmp/titan.zip
|
||||
|
||||
ENV TITAN_HOME /opt/titan-0.5.0-hadoop2
|
||||
WORKDIR $TITAN_HOME
|
||||
|
||||
VOLUME ["/conf","/data"]
|
||||
ADD start-gremlin.sh /opt/start-gremlin.sh
|
||||
|
||||
CMD ["/bin/bash", "-e", "/opt/start-gremlin.sh"]
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
Runs the Gremlin console from the Titan Graph Database "all" distribution.
|
||||
|
||||
To start the Gremlin console with the default configuration files available:
|
||||
|
||||
docker run -it itzg/titan-gremlin
|
||||
|
||||
In order to adjust or further define property files to use within Gremlin,
|
||||
attach a host directory to the container's `/conf` such as
|
||||
|
||||
docker run -it -v $(pwd)/conf:/conf itzg/titan-gremlin
|
||||
|
||||
After running once your host directory will be populated with the distribution-default
|
||||
configuration files. Modify those or add to them and they will available during
|
||||
the next use of gremlin.
|
||||
@@ -1,7 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ $(ls /conf|wc -l) = 0 ]; then
|
||||
cp -r $TITAN_HOME/conf/* /conf
|
||||
fi
|
||||
|
||||
$TITAN_HOME/bin/gremlin.sh
|
||||
@@ -1,54 +0,0 @@
|
||||
FROM itzg/ubuntu-openjdk-7
|
||||
|
||||
MAINTAINER itzg
|
||||
|
||||
ENV APT_GET_UPDATE 2014-07-19
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y wget unzip
|
||||
|
||||
ENV TITAN_VER 0.4.4
|
||||
ENV TITAN_STORAGE all
|
||||
ENV REXSTER_VER 2.4.0
|
||||
|
||||
RUN wget -O /tmp/titan.zip http://s3.thinkaurelius.com/downloads/titan/titan-$TITAN_STORAGE-$TITAN_VER.zip
|
||||
RUN wget -O /tmp/rexster.zip http://tinkerpop.com/downloads/rexster/rexster-server-$REXSTER_VER.zip
|
||||
|
||||
WORKDIR /opt
|
||||
|
||||
RUN unzip /tmp/titan.zip
|
||||
RUN rm /tmp/titan.zip
|
||||
|
||||
RUN unzip /tmp/rexster.zip
|
||||
RUN rm /tmp/rexster.zip
|
||||
|
||||
RUN ln -s titan-$TITAN_STORAGE-$TITAN_VER titan
|
||||
RUN ln -s rexster-server-$REXSTER_VER rexster-server
|
||||
|
||||
RUN mkdir /opt/rexster-server/ext/titan
|
||||
RUN ln -s /opt/titan-$TITAN_STORAGE-$TITAN_VER/lib/* /opt/rexster-server/ext/titan
|
||||
RUN wget -O /opt/rexster-server/ext/titan/titan-rexter-$TITAN_VER.jar \
|
||||
http://central.maven.org/maven2/com/thinkaurelius/titan/titan-rexster/$TITAN_VER/titan-rexster-$TITAN_VER.jar
|
||||
|
||||
# Clean up distro area
|
||||
RUN rm /opt/rexster-server/ext/titan/log4j* /opt/rexster-server/ext/titan/slf4j*
|
||||
RUN rm /opt/rexster-server/lib/lucene-core*
|
||||
|
||||
ADD gremlin /usr/local/bin/gremlin
|
||||
ADD rexster /usr/local/bin/rexster
|
||||
|
||||
WORKDIR titan
|
||||
|
||||
ADD titan.properties /opt/titan/conf/titan.properties
|
||||
ADD init-graph-storage.groovy /tmp/init-graph-storage.groovy
|
||||
|
||||
VOLUME ["/data", "/config", "/scripts"]
|
||||
RUN ln -s /data /opt/titan/db
|
||||
|
||||
RUN gremlin -e /tmp/init-graph-storage.groovy && rm /tmp/init-graph-storage.groovy
|
||||
|
||||
EXPOSE 8182 8184
|
||||
|
||||
ADD rexster.xml /config/rexster.xml
|
||||
|
||||
CMD ["/usr/local/bin/rexster", "-s", "-c", "/config/rexster.xml"]
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
/opt/titan/bin/gremlin.sh $*
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user