Compare commits

...

264 Commits

Author SHA1 Message Date
Geoff Bourne
0be8968e7e Auto-merging via docker-versions-create 2020-12-19 08:25:11 -06:00
Geoff Bourne
f613228619 Restored support for PAPER_DOWNLOAD_URL
Fixes #687
2020-12-15 20:40:00 -06:00
Geoff Bourne
a5e756c86f Auto-merging via docker-versions-create 2020-12-15 14:00:07 -06:00
Silthus
ca9f883352 feat: add COPY_CONFIG_DEST option (#689) 2020-12-15 13:31:51 -06:00
Silthus
9d68fa3b88 feat: improvde REMOVE_OLD_MODS option (#688) 2020-12-13 20:00:06 -06:00
Geoff Bourne
d3a5885d95 Fixed handling of query parameters in MODS url
For #684
2020-12-12 15:22:07 -06:00
Geoff Bourne
c1db13c1f6 Fixed dirname handling in find for SPIGOT WORLD handling
For #685
2020-12-12 11:10:13 -06:00
Mike Wilson
31b0f711b8 Fixing some spigot world import issues (#683)
* Fixing adding an existing spigot world and removing incorrectly identifying spigot worlds as multiple worlds

* Update start-finalSetupWorld

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

Co-authored-by: Geoff Bourne <itzgeoff@gmail.com>
2020-12-12 08:26:32 -06:00
Geoff Bourne
59ca1ce3a6 Improved URL handling for GENERIC_PACK
For #684
2020-12-11 21:12:44 -06:00
Geoff Bourne
0f7bd5f4fd ci: Added adopt15 branch releases 2020-12-07 10:54:36 -06:00
Geoff Bourne
957d11655b Auto-merging via docker-versions-create 2020-11-25 15:56:43 -06:00
Geoff Bourne
a368f4cf57 misc: Added multiarch-latest to versions to release 2020-11-25 15:52:07 -06:00
Geoff Bourne
08a4bde6c1 Switched to PaperMC v2 API
Fixes #670
2020-11-25 15:42:27 -06:00
Geoff Bourne
f68e979229 docs: Improved appearance of Discord badge
For #481
2020-11-06 14:47:04 -06:00
Geoff Bourne
544b1f243d Removed invalid spigot/bukkit download along with debug of content
For #655
2020-11-04 17:04:57 -06:00
Geoff Bourne
391e807c78 Added debug logging of bukkit/spigot curl download
For #655
2020-11-03 16:49:38 -06:00
Geoff Bourne
4099cde737 Revert "Improved handling of bad spigot/bukkit downloads via temp file For #655"
This reverts commit e56a74dc
2020-11-03 16:47:46 -06:00
Geoff Bourne
e56a74dc81 Improved handling of bad spigot/bukkit downloads via temp file
For #655
2020-11-02 20:31:01 -06:00
Geoff Bourne
31b8535854 Added debug output for bukkit/sigot type
For #655
2020-10-30 17:03:13 -05:00
stevoh6
ed1bb73c22 Update deprecated LegacyJavaFixer path. (#648) 2020-10-14 21:21:40 -05:00
Paul1365972
b7ac28e902 IPv6 support for autopause (#646) 2020-10-11 13:27:59 -05:00
vatertime
3cb72797b6 Added AWS blurb to readme (#644)
* Added AWS blurb to readme

* moved section in readme

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

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

* Update README.md

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

* Update README.md

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

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

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

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

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

* Convert EULA value to upper case to allow lower case `true` as value
2019-09-15 17:15:33 -05:00
Geoff Bourne
62a4541df5 Fix upgrade support for Paper
For #361
2019-09-15 14:09:27 -05:00
Geoff Bourne
401958c0d6 Add debugs for Fabric setup
For #361
2019-09-15 09:54:13 -05:00
Geoff Bourne
8859d223bf Track Minecraft version also in Fabric install marker
For #361
2019-09-14 22:29:54 -05:00
Geoff Bourne
621962ad9c Always populate ops.txt to allow for additive config
For #283
2019-09-08 17:22:20 -05:00
Aurélien Bertron
5c238af3df Add spawn protection setting (#386) 2019-09-08 16:40:45 -05:00
Geoff Bourne
8e148095f0 Adding link for github README 2019-08-24 11:12:41 -05:00
DocQuantum
3c55a05b1c Added ability to add resource-pack from environment vars (#379) 2019-08-24 10:38:59 -05:00
Geoff Bourne
d293a65f5e Add MEMORY example
Fixes #377
2019-08-17 14:40:51 -05:00
Geoff Bourne
e6bfa01db5 Revert "Switch to OpenJ9 base image (#360)"
This reverts commit 93197ffb
2019-08-10 17:47:46 -05:00
Geoff Bourne
4e122a67d3 Added description of CONSOLE=FALSE option (#80) 2019-08-10 17:47:26 -05:00
Geoff Bourne
b11863d3b2 Delegate ToF buildtools inclusion to extending images (#331) 2019-08-10 17:05:23 -05:00
Geoff Bourne
93197ffb77 Switch to OpenJ9 base image (#360) 2019-08-10 17:04:38 -05:00
Tyler Page
f02baa8761 fix duplicate projects subpath (#371)
`CURSE_URL_BASE` already had `/projects` appended to it, missed it by mistake
2019-08-03 07:47:41 -05:00
Michael Vorburger ⛑️
19e39b84ec add readinessProbe & livenessProbe to k8s-examples/vanilla-deployment.yml (#370) 2019-08-02 13:21:47 -05:00
Tyler Page
53800e460f fix settings.cfg and preserve semicolons if present (#369) 2019-08-02 11:29:22 -05:00
Tyler Page
e061cc7163 Update start-finalSetup02Modpack (#368)
Fixed curseforge redirect so it actually downloads the JAR file, not an HTML page
2019-08-02 11:28:35 -05:00
Geoff Bourne
e61942f33e Revert "Update start-minecraftFinalSetup (#365)"
This reverts commit f8b97bf9
2019-08-01 18:03:11 -05:00
Tyler Page
f8b97bf909 Update start-minecraftFinalSetup (#365) 2019-07-31 18:58:13 -05:00
Geoff Bourne
ed272da302 Add script to update multiarch manifest 2019-07-26 12:25:47 -05:00
Geoff Bourne
e8b7975295 Configure no-reponse github app 2019-07-26 10:47:01 -05:00
Geoff Bourne
cae1a20973 Purge /data/temp before each Spigot build
Fixes #354
2019-07-22 21:33:54 -05:00
Alan
165150a852 Fix -version => -mcversion (#352)
Fabric's installer uses `-mcversion` to specify the Minecraft version (https://fabricmc.net/wiki/install). The way the command is written right now it will always use the latest version of MC and ignore the `VERSION` specification.
2019-07-21 09:05:54 -05:00
Geoff Bourne
ad2674bf8e misc: putting gitter reference back to "dockerfiles" 2019-07-20 16:14:27 -05:00
Geoff Bourne
b72266f7bf Add a README in old location 2019-07-20 16:09:03 -05:00
Geoff Bourne
79c864ae19 Fixed repo references 2019-07-20 16:04:23 -05:00
Geoff Bourne
451eec4db5 Update repo references 2019-07-20 16:02:46 -05:00
Geoff Bourne
539f7ada70 Exclude examples and IDE metadata directories from docker build 2019-07-20 15:58:41 -05:00
Geoff Bourne
c60156d245 Moved Minecraft server files to top-level 2019-07-20 15:51:40 -05:00
Geoff Bourne
281bd3660f Remove archived image definitions 2019-07-20 14:34:08 -05:00
122 changed files with 3715 additions and 2758 deletions

View File

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

6
.dockerignore Normal file
View File

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

View File

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

6
.github/no-response.yml vendored Normal file
View 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.

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

@@ -0,0 +1,51 @@
name: Build and Publish
on:
push:
branches:
- master
- openj9
- openj9-nightly
- adopt11
- adopt13
- adopt14
- adopt15
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"
- "[0-9]+.[0-9]+.[0-9]+-adopt14"
- "[0-9]+.[0-9]+.[0-9]+-adopt15"
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run tests
run: |
tests/test.sh
build:
needs:
- test
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
labels: org.opencontainers.image.url=https://github.com/itzg/docker-minecraft-server,org.opencontainers.image.documentation=https://github.com/itzg/docker-minecraft-server
push: true

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

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

5
.gitignore vendored
View File

@@ -1,2 +1,3 @@
*.iml
.idea
/data/
/.idea/
*.iml

74
DEVELOPMENT.md Normal file
View File

@@ -0,0 +1,74 @@
## Adding a server type
Adding a new server `TYPE` can vary due to the complexity of obtaining and configuring each type; however, the addition of any server type includes at least the following steps:
1. Copy an existing "start-deploy*" script, such as [start-deployMohist](start-deployMohist) and rename it accordingly making sure to retain the "start-deploy" prefix
2. Modify the type-specific behavior between the "start-utils" preamble and the hand-off to `start-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
```

88
Dockerfile Normal file
View File

@@ -0,0 +1,88 @@
FROM adoptopenjdk/openjdk13:alpine-jre
LABEL org.opencontainers.image.authors="Geoff Bourne <itzgeoff@gmail.com>"
# upgrade all packages since alpine jre8 base image tops out at 8u212
RUN apk -U --no-cache upgrade
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.5.0 --var app=mc-server-runner --file {{.app}} \
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=0.1.1 --var app=maven-metadata-release --file {{.app}} \
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
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 \
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

1129
README.md

File diff suppressed because it is too large Load Diff

10
build
View File

@@ -1,10 +0,0 @@
#!/bin/bash
pkgs=ubuntu-openjdk-7
pkgs="$pkgs minecraft-server"
pkgs="$pkgs titan-gremlin"
for p in $pkgs
do
docker build -t itzg/$p $p
done

View File

@@ -1,11 +0,0 @@
machine:
services:
- docker
test:
override:
- ./build
notify:
webhooks:
- url: https://webhooks.gitter.im/e/4726bb683d8aed018486

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

3
examples/README.md Normal file
View File

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

View File

@@ -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: {}

View 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

View 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

View 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: {}

View 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: {}

View File

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

View File

@@ -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

View File

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

View File

@@ -33,6 +33,22 @@ spec:
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

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

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

View 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>.

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,97 @@
#!/bin/bash
. /autopause/autopause-fcns.sh
. /start-utils
sudo /usr/sbin/knockd -c /tmp/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

View 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 -e "0.0.0.0:$SERVER_PORT" -e ":::$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}') =~ ^localhost$|^127(?:\.[0-9]+){0,2}\.[0-9]+$|^(?:0*\:)*?:?0*1$ ]] ; then
# not localhost
return 0
fi
done
return 1
}

View 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
View File

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

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

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

2
files/sudoers-mc Normal file
View File

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

View File

@@ -1,26 +0,0 @@
FROM java:8
LABEL maintainer "itzg"
ENV GITBLIT_VERSION 1.7.1
RUN wget -qO /tmp/gitblit.tgz http://dl.bintray.com/gitblit/releases/gitblit-$GITBLIT_VERSION.tar.gz
RUN tar -C /opt -xvf /tmp/gitblit.tgz && \
rm /tmp/gitblit.tgz
VOLUME ["/data"]
ADD start.sh /start
ENV GITBLIT_PATH=/opt/gitblit-${GITBLIT_VERSION} \
GITBLIT_HTTPS_PORT=443 \
GITBLIT_HTTP_PORT=80 \
GITBLIT_BASE_FOLDER=/data \
GITBLIT_ADMIN_USER=admin \
GITBLIT_INITIAL_REPO=
WORKDIR $GITBLIT_PATH
EXPOSE 80 443
ENTRYPOINT ["/start"]

View File

@@ -1,46 +0,0 @@
Provides a ready-to-use instance of [GitBlit](http://gitblit.com/).
## Basic usage
Start the GitBlit container using
docker run -d -p 80:80 -p 443:443 --name gitblit itzg/gitblit
Access its web interface at the mapped HTTP (80) or HTTPS (443) port of the
Docker host. Login with the default credentials __admin__ / __admin__ .
## Data volume
In order to allow for future upgrades, run the container with a volume mount of `/data`, such as:
-v /tmp/gitblit-data:/data
## Initial repository creation
As a convenience for cluster configuration management with git
(such as with [Spring Cloud Config](https://cloud.spring.io/spring-cloud-config/)),
you may specify the name of an initial repository to be owned by the 'admin' user.
This can be enabled by passing the name of that repository via the environment
variable `GITBLIT_INITIAL_REPO`, such as
-e GITBLIT_INITIAL_REPO=default
## Create repositories with content
In addition to the approach above, you can push repostories with existing
content by attaching them to sub-directories of `/repos`, such as
docker run -v $HOME/git/example:/repos/example ...
## Custom configuration
You can add or override any of the `*.properties` files for configuring GitBlit,
typically `gitblit.properties`, by placing those files in a volume attached at
`/config`, such as
-v $(pwd)/extra-config:/config
The property files in that configuration directory will be renamed with the
suffix `.applied` to avoid overwriting manually modified configuration on
the next container startup.

View File

@@ -1,103 +0,0 @@
#!/bin/bash
apply_base_data() {
contents=`ls $GITBLIT_BASE_FOLDER|wc -l`
if [ $contents = "0" ]; then
cp -r $GITBLIT_PATH/data/* $GITBLIT_BASE_FOLDER
fi
}
apply_config() {
cp -rf /config/* $GITBLIT_BASE_FOLDER
}
create_repo() {
local repo_dir=$GITBLIT_BASE_FOLDER/git/$1.git
mkdir -p $repo_dir
cd $repo_dir
git init --bare
echo "
[gitblit]
description =
originRepository =
owner = $GITBLIT_ADMIN_USER
acceptNewPatchsets = true
acceptNewTickets = true
mergeTo = master
useIncrementalPushTags = false
allowForks = true
accessRestriction = PUSH
authorizationControl = AUTHENTICATED
verifyCommitter = false
showRemoteBranches = false
isFrozen = false
skipSizeCalculation = false
skipSummaryMetrics = false
federationStrategy = FEDERATE_THIS
isFederated = false
gcThreshold =
gcPeriod = 0
" >> config
git config --replace-all core.logallrefupdates false
echo "
CREATING repository '$1' with:
* read/clone access for all
* push access for authenticated users"
RET="file://$repo_dir"
}
apply_repos() {
for rdir in /repos/*; do
if [ -e $rdir/.git ]; then
r=$(basename $rdir)
create_repo $r
local url=$RET
cd $rdir
echo "* pushed existing content"
git push --all $url
fi
done
}
create_initial_repo() {
if [ -d $GITBLIT_INITIAL_REPO ]; then
return
fi
create_repo $GITBLIT_INITIAL_REPO
}
shopt -s nullglob
if [ ! -f /var/local/gitblit_firststart ]; then
FIRSTSTART=1
else
FIRSTSTART=0
fi
if [ $FIRSTSTART = 1 ]; then
apply_base_data
echo "
Applying configuration from /config
"
apply_config
touch /var/local/gitblit_firststart
fi
if [[ -n $GITBLIT_INITIAL_REPO ]]; then
create_initial_repo
fi
apply_repos
cd $GITBLIT_PATH
$JAVA_HOME/bin/java -jar $GITBLIT_PATH/gitblit.jar \
--httpsPort $GITBLIT_HTTPS_PORT --httpPort $GITBLIT_HTTP_PORT \
--baseFolder $GITBLIT_BASE_FOLDER

14
health.sh Normal file
View 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

View File

@@ -1 +0,0 @@
/site

View File

@@ -1,23 +0,0 @@
FROM ubuntu:trusty
LABEL 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"]

View File

@@ -1,2 +0,0 @@
source 'https://rubygems.org'
gem 'github-pages'

View File

@@ -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.

View File

@@ -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

View File

@@ -1 +0,0 @@
highlighter: pygments

View File

@@ -1,3 +0,0 @@
<footer>
<i>Goodbye</i>
</footer>

View File

@@ -1,3 +0,0 @@
<header>
<h1>{{ page.title }}</h1>
</header>

View File

@@ -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>

View File

@@ -1,12 +0,0 @@
{% include top.html %}
<body>
{% include header.html %}
{{ content }}
{% include footer.html %}
</body>
</html>

View File

@@ -1,6 +0,0 @@
---
layout: default
title: Powered by Jekyll
overview: true
---
This is where the content goes.

View File

@@ -1,17 +0,0 @@
FROM java:openjdk-8u102-jdk
LABEL maintainer "itzg"
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
graphviz \
&& apt-get clean
ENV JENKINS_HOME=/data
VOLUME ["/data", "/root", "/opt/jenkins"]
EXPOSE 8080 38252
COPY download-and-start.sh /opt/download-and-start
CMD ["/opt/download-and-start"]

View File

@@ -1,51 +0,0 @@
A self-upgrading [Jenkins CI](http://jenkins-ci.org/) server
# Basic Usage
To start Jenkins with the latest version:
ID=$(docker run -d -p 8080:8080 itzg/jenkins)
At a later time, you can upgrade by restarting the container:
docker stop $ID
docker start $ID
# Attaching host directory to Jenkins home directory
The Jenkins home directory is attachable at `/data`, so attaching to a host volume
would be:
ID=$(docker run -d -p 8080:8080 -v /SOME_HOST_DIR:/data itzg/jenkins
# Enabling Jenkins slave agents
By default, Jenkins will pick a random port to allow slave nodes launched
by JNLP. Since Docker networking is basically a firewall, a random port
won't work for us. Instead the fixed port **38252** was chosen (arbitrarily)
to be exposed by the container.
Launch your Jenkins container using
ID=$(docker run -d -p 8080:8080 -p 38252:38252 itzg/jenkins)
and configure the port in the Global Security settings:
![](http://i.imgur.com/PhQiEHy.png)
# Image Parameters
## Volumes
* `/data` - a majority of the Jenkins content is maintained here, such as workspaces
* `/root` - some tools, such as Maven, utilize the home directory for default repository storage
* `/opt/jenkins` - the installed distribution is expanded here
## Ports
* `8080` - for the web UI
* `38252` - for slave incoming JMX access
## Environment Variables
* `JENKINS_OPTS` - passed to the initial Java invocation of Jenkins

View File

@@ -1,29 +0,0 @@
#!/bin/bash
mirrorUrl=http://mirrors.jenkins-ci.org/war/latest/jenkins.war
url=$(curl -s --head $mirrorUrl|awk -F': ' '$1 == "Location" { print $2 }' | sed 's/[[:space:]]*$//')
version=$(echo $url | sed 's#.*/war/\(.*\)/jenkins.war#\1#')
mkdir -p /opt/jenkins
trackingFile=/opt/jenkins/INSTALLED
installed=
if [ -f $trackingFile ]; then
installed=$(cat $trackingFile)
echo "Version installed is $installed"
fi
if [ $version != "$installed" ]; then
echo "Downloading $version from '$url'"
while ! curl -s -o /opt/jenkins/jenkins.war "$url"
do
echo "Trying again in 5 seconds"
sleep 5
done
echo $version > $trackingFile
fi
cd /opt/jenkins
exec java $JENKINS_OPTS -jar jenkins.war

34
log4j2.xml Normal file
View File

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

18
mcstatus Executable file
View File

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

View File

@@ -1 +0,0 @@
data

View File

@@ -1,2 +0,0 @@
[start-*]
indent_size = 2

View File

@@ -1 +0,0 @@
/data/

View File

@@ -1,85 +0,0 @@
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 \
python python-dev py2-pip
RUN pip install mcstatus yq
HEALTHCHECK CMD mcstatus localhost:$SERVER_PORT ping
RUN addgroup -g 1000 minecraft \
&& adduser -Ss /bin/false -u 1000 -G minecraft -h /home/minecraft minecraft \
&& mkdir -m 777 /data /mods /config /plugins \
&& chown minecraft:minecraft /data /config /mods /plugins /home/minecraft
EXPOSE 25565 25575
RUN echo 'hosts: files dns' > /etc/nsswitch.conf
ARG RESTIFY_VER=1.1.6
ARG RCON_CLI_VER=1.4.6
ARG MC_SERVER_RUNNER_VER=1.3.2
ARG TOF_BUILDTOOLS_VER=1.2.0
ARG ARCH=amd64
ADD https://github.com/itzg/restify/releases/download/${RESTIFY_VER}/restify_${RESTIFY_VER}_linux_${ARCH}.tar.gz /tmp/restify.tgz
RUN tar -x -C /usr/local/bin -f /tmp/restify.tgz restify && \
rm /tmp/restify.tgz
ADD https://github.com/itzg/rcon-cli/releases/download/${RCON_CLI_VER}/rcon-cli_${RCON_CLI_VER}_linux_${ARCH}.tar.gz /tmp/rcon-cli.tgz
RUN tar -x -C /usr/local/bin -f /tmp/rcon-cli.tgz rcon-cli && \
rm /tmp/rcon-cli.tgz
ADD https://github.com/itzg/mc-server-runner/releases/download/${MC_SERVER_RUNNER_VER}/mc-server-runner_${MC_SERVER_RUNNER_VER}_linux_${ARCH}.tar.gz /tmp/mc-server-runner.tgz
RUN tar -x -C /usr/local/bin -f /tmp/mc-server-runner.tgz mc-server-runner && \
rm /tmp/mc-server-runner.tgz
ADD https://git.faldoria.de/tof/server/build-tools/-/jobs/artifacts/buildtools-${TOF_BUILDTOOLS_VER}/raw/target/ToF-BuildTools.jar?job=release-artifact /tmp/tof-buildtools/BuildTools.jar
ONBUILD ARG BUILDTOOLS_OUTPUT=/plugins
ONBUILD COPY *Dockerfile* *plugins.yml /tmp/tof-buildtools/
ONBUILD RUN \
[ -d /tmp/tof-buildtools ] && \
[ $(find /tmp/tof-buildtools -type f -name plugins.yml | wc -l) -gt 0 ] && \
java -jar /tmp/tof-buildtools/BuildTools.jar \
--config "/tmp/tof-buildtools/plugins.yml" \
--configs "plugins.yml" \
--dir "/tmp/tof-buildtools/" \
--output ${BUILDTOOLS_OUTPUT} && \
chown -R minecraft:minecraft ${BUILDTOOLS_OUTPUT} && \
rm -fR /tmp/tof-buildtools/ || \
true
COPY mcadmin.jq /usr/share
RUN chmod +x /usr/local/bin/*
VOLUME ["/data","/mods","/config"]
COPY server.properties /tmp/server.properties
WORKDIR /data
ENTRYPOINT [ "/start" ]
ENV UID=1000 GID=1000 \
JVM_XX_OPTS="-XX:+UseG1GC" MEMORY="1G" \
TYPE=VANILLA VERSION=LATEST FORGEVERSION=RECOMMENDED SPONGEBRANCH=STABLE SPONGEVERSION= FABRICVERSION=LATEST LEVEL=world \
PVP=true DIFFICULTY=easy ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \
LEVEL_TYPE=DEFAULT GENERATOR_SETTINGS= WORLD= MODPACK= MODS= SERVER_PORT=25565 ONLINE_MODE=TRUE CONSOLE=true SERVER_NAME="Dedicated Server" \
REPLACE_ENV_VARIABLES="FALSE" ENV_VARIABLE_PREFIX="CFG_"
COPY start* /
RUN dos2unix /start* && chmod +x /start*

File diff suppressed because it is too large Load Diff

View File

@@ -1,28 +0,0 @@
version: '3'
# Other docker-compose examples in /examples
services:
minecraft:
image: itzg/minecraft-server
ports:
- "25565:25565"
volumes:
- "mc:/data"
environment:
EULA: "TRUE"
CONSOLE: "false"
ENABLE_RCON: "true"
RCON_PASSWORD: "testing"
RCON_PORT: 28016
restart: always
rcon:
image: itzg/rcon
ports:
- "4326:4326"
- "4327:4327"
volumes:
- "rcon:/opt/rcon-web-admin/db"
volumes:
mc:
rcon:

View File

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

View File

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

View File

@@ -1,11 +0,0 @@
version: '3.2'
services:
mc:
image: itzg/minecraft-server
environment:
EULA: "true"
TYPE: FTB
FTB_SERVER_MOD: https://minecraft.curseforge.com/projects/all-the-mods-expert-remastered/files/2493900/download
ports:
- 25565:25565

View File

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

View File

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

View File

@@ -1,22 +0,0 @@
#!/bin/bash
umask 0002
chmod g+w /data
if [ $(id -u) = 0 ]; then
if [[ -v UID && $UID != $(id -u) ]]; then
usermod -u $UID minecraft
fi
if [[ -v GID ]]; then
groupmod -o -g $GID minecraft
fi
if [[ $(stat -c "%u" /data) != $UID ]]; then
echo "Changing ownership of /data to $UID ..."
chown -R minecraft:minecraft /data
fi
exec su-exec minecraft:minecraft /start-configuration $@
else
exec /start-configuration $@
fi

View File

@@ -1,106 +0,0 @@
#!/bin/bash
shopt -s nullglob
#umask 002
export HOME=/data
if [ ! -e /data/eula.txt ]; then
if [ "$EULA" != "" ]; then
echo "# Generated via Docker on $(date)" > eula.txt
echo "eula=$EULA" >> eula.txt
if [ $? != 0 ]; then
echo "ERROR: unable to write eula to /data. Please make sure attached directory is writable by uid=${UID}"
exit 2
fi
else
echo ""
echo "Please accept the Minecraft EULA at"
echo " https://account.mojang.com/documents/minecraft_eula"
echo "by adding the following immediately after 'docker run':"
echo " -e EULA=TRUE"
echo ""
exit 1
fi
fi
echo "Running as uid=$(id -u) gid=$(id -g) with /data as '$(ls -lnd /data)'"
if ! touch /data/.verify_access; then
echo "ERROR: /data doesn't seem to be writable. Please make sure attached directory is writable by uid=$(id -u)"
exit 2
fi
rm /data/.verify_access || true
if [[ $PROXY ]]; then
export http_proxy="$PROXY"
export https_proxy="$PROXY"
echo "INFO: Giving proxy time to startup..."
sleep 5
fi
export SERVER_PROPERTIES=/data/server.properties
export VERSIONS_JSON=https://launchermeta.mojang.com/mc/game/version_manifest.json
echo "Checking version information."
case "X$VERSION" in
X|XLATEST|Xlatest)
export VANILLA_VERSION=`curl -fsSL $VERSIONS_JSON | jq -r '.latest.release'`
;;
XSNAPSHOT|Xsnapshot)
export VANILLA_VERSION=`curl -fsSL $VERSIONS_JSON | jq -r '.latest.snapshot'`
;;
X[1-9]*)
export VANILLA_VERSION=$VERSION
;;
*)
export VANILLA_VERSION=`curl -fsSL $VERSIONS_JSON | jq -r '.latest.release'`
;;
esac
cd /data
export ORIGINAL_TYPE=${TYPE^^}
echo "Checking type information."
case "${TYPE^^}" in
*BUKKIT|SPIGOT)
exec /start-deployBukkitSpigot $@
;;
PAPER)
exec /start-deployPaper $@
;;
FORGE)
exec /start-deployForge $@
;;
FABRIC)
exec /start-deployFabric $@
;;
FTB|CURSEFORGE)
exec /start-deployFTB $@
;;
VANILLA)
exec /start-deployVanilla $@
;;
SPONGEVANILLA)
exec /start-deploySpongeVanilla $@
;;
CUSTOM)
exec /start-deployCustom $@
;;
*)
echo "Invalid type: '$TYPE'"
echo "Must be: VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, FTB, CURSEFORGE, SPONGEVANILLA"
exit 1
;;
esac

View File

@@ -1,87 +0,0 @@
#!/bin/bash
set -e
function buildSpigotFromSource {
echo "Building Spigot $VANILLA_VERSION from source, might take a while, get some coffee"
mkdir /data/temp
cd /data/temp
jvmOpts="-Xms${INIT_MEMORY:-$MEMORY} -Xmx${MAX_MEMORY:-$MEMORY}"
curl -sSL -o /data/temp/BuildTools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar && \
java $jvmOpts -jar /data/temp/BuildTools.jar --rev $VANILLA_VERSION 2>&1 |tee /data/spigot_build.log| while read l; do echo -n .; done; echo "done"
if ! mv spigot-*.jar /data/spigot_server.jar; then
echo "ERR failed to build Spigot"
cat /data/spigot_build.log
exit 1
fi
mv craftbukkit-*.jar /data/craftbukkit_server.jar
echo "Cleaning up"
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
local downloadVersion
if [[ ${VERSION} == LATEST ]]; then
downloadVersion=${VANILLA_VERSION}
else
downloadVersion=${VERSION}
fi
if [[ -z $downloadUrl ]]; then
downloadUrl="https://cdn.getbukkit.org/${getbukkitFlavor}/${getbukkitFlavor}-${downloadVersion}.jar"
fi
echo "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
}
case "$TYPE" in
*BUKKIT|*bukkit)
export SERVER=craftbukkit_server.jar
;;
*)
export SERVER=spigot_server.jar
;;
esac
if [ ! -f $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then
if [[ "$BUILD_SPIGOT_FROM_SOURCE" = TRUE || "$BUILD_SPIGOT_FROM_SOURCE" = true || "$BUILD_FROM_SOURCE" = TRUE || "$BUILD_FROM_SOURCE" = true ]]; then
buildSpigotFromSource
else
downloadSpigot
fi
fi
# Normalize on Spigot for operations below
export TYPE=SPIGOT
# Continue to Final Setup
exec /start-finalSetup01World $@

View File

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

View File

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

View File

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

View File

@@ -1,18 +0,0 @@
#!/bin/bash
export SERVER=paper_server.jar
if [ ! -f $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then
downloadUrl=${PAPER_DOWNLOAD_URL:-https://papermc.io/api/v1/paper/${VANILLA_VERSION}/latest/download}
echo "Downloading Paper $VANILLA_VERSION from $downloadUrl ..."
curl -fsSL -o $SERVER "$downloadUrl"
if [ ! -f $SERVER ]; then
echo "ERROR: failed to download from $downloadUrl (status=$?)"
exit 3
fi
fi
# Normalize on Spigot for operations below
export TYPE=SPIGOT
# Continue to Final Setup
exec /start-finalSetup01World $@

View File

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

View File

@@ -1,108 +0,0 @@
#!/bin/bash
# CURSE_URL_BASE used in manifest downloads below
CURSE_URL_BASE=${CURSE_URL_BASE:-https://minecraft.curseforge.com/projects}
# Remove old mods/plugins
if [ "$REMOVE_OLD_MODS" = "TRUE" ]; then
if [ "$TYPE" = "SPIGOT" ]; then
rm -rf /data/plugins/*
else
rm -rf /data/mods/*
fi
fi
# If supplied with a URL for a modpack (simple zip of jars), download it and unpack
if [[ "$MODPACK" ]]; then
EFFECTIVE_MODPACK_URL=$(curl -Ls -o /dev/null -w %{url_effective} $MODPACK)
case "X$EFFECTIVE_MODPACK_URL" in
X[Hh][Tt][Tt][Pp]*.zip)
echo "Downloading mod/plugin pack via HTTP"
echo " from $EFFECTIVE_MODPACK_URL ..."
if ! curl -sSL -o /tmp/modpack.zip "$EFFECTIVE_MODPACK_URL"; then
echo "ERROR: failed to download from $EFFECTIVE_MODPACK_URL"
exit 2
fi
if [ "$TYPE" = "SPIGOT" ]; then
mkdir -p /data/plugins
if ! unzip -o -d /data/plugins /tmp/modpack.zip; then
echo "ERROR: failed to unzip the modpack from $EFFECTIVE_MODPACK_URL"
fi
else
mkdir -p /data/mods
if ! unzip -o -d /data/mods /tmp/modpack.zip; then
echo "ERROR: failed to unzip the modpack from $EFFECTIVE_MODPACK_URL"
fi
fi
rm -f /tmp/modpack.zip
;;
*)
echo "Invalid URL given for modpack: Must be HTTP or HTTPS and a ZIP file"
;;
esac
fi
# If supplied with a URL for a plugin download it.
if [[ "$MODS" ]]; then
for i in ${MODS//,/ }
do
EFFECTIVE_MOD_URL=$(curl -Ls -o /dev/null -w %{url_effective} $i)
case "X$EFFECTIVE_MOD_URL" in
X[Hh][Tt][Tt][Pp]*.jar)
echo "Downloading mod/plugin via HTTP"
echo " from $EFFECTIVE_MOD_URL ..."
if ! curl -sSL -o /tmp/${EFFECTIVE_MOD_URL##*/} $EFFECTIVE_MOD_URL; then
echo "ERROR: failed to download from $EFFECTIVE_MOD_URL to /tmp/${EFFECTIVE_MOD_URL##*/}"
exit 2
fi
if [ "$TYPE" = "SPIGOT" ]; then
mkdir -p /data/plugins
mv /tmp/${EFFECTIVE_MOD_URL##*/} /data/plugins/${EFFECTIVE_MOD_URL##*/}
else
mkdir -p /data/mods
mv /tmp/${EFFECTIVE_MOD_URL##*/} /data/mods/${EFFECTIVE_MOD_URL##*/}
fi
rm -f /tmp/${EFFECTIVE_MOD_URL##*/}
;;
*)
echo "Invalid URL given for modpack: Must be HTTP or HTTPS and a JAR file"
;;
esac
done
fi
if [[ "$MANIFEST" ]]; then
EFFECTIVE_MANIFEST_URL=$(curl -Ls -o /dev/null -w %{url_effective} $MANIFEST)
case "X$EFFECTIVE_MANIFEST_URL" in
X*.json)
if [ -f "${EFFECTIVE_MANIFEST_URL}" ]; then
MOD_DIR=${FTB_BASE_DIR:-/data}/mods
if [ ! -d "$MOD_DIR" ]
then
echo "Creating mods dir $MOD_DIR"
mkdir -p "$MOD_DIR"
fi
echo "Starting manifest download..."
cat "${EFFECTIVE_MANIFEST_URL}" | jq -r '.files[] | (.projectID|tostring) + " " + (.fileID|tostring)'| while read -r p f
do
if [ ! -f $MOD_DIR/${p}_${f}.jar ]
then
url="${CURSE_URL_BASE}/${p}/files/${f}/download"
echo Downloading curseforge mod $url
# Manifest usually doesn't have mod names. Using id should be fine, tho
curl -sSL "${url}" -o $MOD_DIR/${p}_${f}.jar
fi
done
else
echo "Could not find manifest file, unsufficient privs, or malformed path."
fi
;;
*)
echo "Invalid manifest file for modpack. Please make sure it is a .json file."
;;
esac
fi
exec /start-finalSetup03Modconfig $@

View File

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

View File

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

View File

@@ -1,42 +0,0 @@
#!/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 [[ ${DEBUG^^} = TRUE ]]; then
return 0
else
return 1
fi
}
function debug {
if isDebugging; then
echo "DEBUG: $*"
fi
}

View File

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

46
start Normal file
View File

@@ -0,0 +1,46 @@
#!/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 [[ ${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

62
start-autopause Executable file
View File

@@ -0,0 +1,62 @@
#!/bin/bash
. ${SCRIPTS:-/}start-utils
log "Autopause functionality enabled"
cp /autopause/knockd-config.cfg /tmp/knockd-config.cfg
# update server port to listen to
regseq="^\s*sequence\s*=\s*$SERVER_PORT\s*$"
linenum=$(grep -nm1 sequence /tmp/knockd-config.cfg | cut -d : -f 1 | tail -n1)
if ! [[ $(awk "NR==$linenum" /tmp/knockd-config.cfg) =~ $regseq ]]; then
sed -i "${linenum}s/sequence.*/sequence = $SERVER_PORT/" /tmp/knockd-config.cfg
log "Updated server port in knockd config"
fi
# update rcon port to listen to
regseq="^\s*sequence\s*=\s*$RCON_PORT\s*$"
linenum=$(grep -nm2 sequence /tmp/knockd-config.cfg | cut -d : -f 1 | tail -n1)
if ! [[ $(awk "NR==$linenum" /tmp/knockd-config.cfg) =~ $regseq ]]; then
sed -i "${linenum}s/sequence.*/sequence = $RCON_PORT/" /tmp/knockd-config.cfg
log "Updated rcon port in knockd config"
fi
if ! [[ $AUTOPAUSE_PERIOD =~ ^[0-9]+$ ]]; then
AUTOPAUSE_PERIOD=10
export AUTOPAUSE_PERIOD
log "Warning: AUTOPAUSE_PERIOD is not numeric, set to 10 (seconds)"
fi
if [ "$AUTOPAUSE_PERIOD" -eq "0" ] ; then
AUTOPAUSE_PERIOD=10
export AUTOPAUSE_PERIOD
log "Warning: AUTOPAUSE_PERIOD must not be 0, set to 10 (seconds)"
fi
if ! [[ $AUTOPAUSE_TIMEOUT_KN =~ ^[0-9]+$ ]] ; then
AUTOPAUSE_TIMEOUT_KN=120
export AUTOPAUSE_TIMEOUT_KN
log "Warning: AUTOPAUSE_TIMEOUT_KN is not numeric, set to 120 (seconds)"
fi
if ! [[ $AUTOPAUSE_TIMEOUT_EST =~ ^[0-9]+$ ]] ; then
AUTOPAUSE_TIMEOUT_EST=3600
export AUTOPAUSE_TIMEOUT_EST
log "Warning: AUTOPAUSE_TIMEOUT_EST is not numeric, set to 3600 (seconds)"
fi
if ! [[ $AUTOPAUSE_TIMEOUT_INIT =~ ^[0-9]+$ ]] ; then
AUTOPAUSE_TIMEOUT_INIT=600
export AUTOPAUSE_TIMEOUT_INIT
log "Warning: AUTOPAUSE_TIMEOUT_INIT is not numeric, set to 600 (seconds)"
fi
if [[ -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 &

145
start-configuration Normal file
View File

@@ -0,0 +1,145 @@
#!/bin/bash
. ${SCRIPTS:-/}start-utils
shopt -s nullglob
#umask 002
export HOME=/data
if [ ! -e /data/eula.txt ]; then
if ! isTrue "$EULA"; then
log ""
log "Please accept the Minecraft EULA at"
log " https://account.mojang.com/documents/minecraft_eula"
log "by adding the following immediately after 'docker run':"
log " -e EULA=TRUE"
log ""
exit 1
fi
writeEula
fi
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
if [[ $RCON_PASSWORD_FILE ]]; then
log ""
if [ ! -e ${RCON_PASSWORD_FILE} ]; then
log "Initial RCON password file ${RCON_PASSWORD_FILE} does not seems to exist."
log "Please ensure your configuration."
log "If you are using Docker Secrets feature, please check this for further information: "
log " https://docs.docker.com/engine/swarm/secrets"
log ""
exit 1
else
RCON_PASSWORD=$(cat ${RCON_PASSWORD_FILE})
export RCON_PASSWORD
fi
log ""
fi
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')
;;
*)
VANILLA_VERSION=$VERSION
;;
esac
export VANILLA_VERSION
log "Resolved version given ${VERSION} into ${VANILLA_VERSION}"
cd /data || exit 1
export ORIGINAL_TYPE=${TYPE^^}
if isTrue "${ENABLE_AUTOPAUSE}"; then
${SCRIPTS:-/}start-autopause
fi
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-deployCF "$@"
;;
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 (multiarch-only),"
log " CURSE_INSTANCE, CURSEFORGE, SPONGEVANILLA,"
log " CUSTOM, MAGMA, MOHIST, CATSERVER"
exit 1
;;
esac

127
start-deployBukkitSpigot Normal file
View File

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

193
start-deployCF Normal file
View File

@@ -0,0 +1,193 @@
#!/bin/bash
set -e
. ${SCRIPTS:-/}start-utils
isDebugging && set -x
export FTB_BASE_DIR=/data/FeedTheBeast
legacyJavaFixerUrl=https://ftb.forgecdn.net/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."
requireVar FTB_SERVER_MOD
if ! isTrue ${USE_MODPACK_START_SCRIPT:-true}; then
if ! [ -f "${FTB_SERVER_MOD}" ]; then
log "ERROR unable to find requested modpack file ${FTB_SERVER_MOD}"
exit 2
fi
needsInstall=true
installMarker=/data/.curseforge-installed
if [ -f $installMarker ]; then
if [ "$(cat $installMarker)" != "${FTB_SERVER_MOD}" ]; then
log "Upgrading modpack"
serverJar=$(find ${FTB_BASE_DIR} -not -name "forge*installer.jar" -name "forge*.jar")
if [[ "${serverJar}" ]]; then
rm -rf $(dirname "${serverJar}")/{mods,*.jar,libraries,resources,scripts,config}
fi
else
needsInstall=false
fi
fi
if $needsInstall; then
log "Unpacking FTB server modpack ${FTB_SERVER_MOD} ..."
mkdir -p ${FTB_BASE_DIR}
unzip -o "${FTB_SERVER_MOD}" -d ${FTB_BASE_DIR} | awk '{printf "."} END {print ""}'
serverJar=$(find ${FTB_BASE_DIR} -path "*/libraries/*" -prune -type f -o -not -name "forge*installer.jar" -name "forge*.jar")
if [[ -z "$serverJar" ]]; then
forgeInstallerJar=$(find ${FTB_BASE_DIR} -name "forge*installer.jar")
if [[ -z "${forgeInstallerJar}" ]]; then
log "ERROR Unable to find forge installer in modpack."
log " Make sure you downloaded the server files."
exit 2
fi
log "Installing forge server"
(cd $(dirname "${forgeInstallerJar}"); java -jar $(basename "${forgeInstallerJar}") --installServer) | awk '{printf "."} END {print ""}'
fi
echo "${FTB_SERVER_MOD}" > $installMarker
fi
export SERVER=$(find ${FTB_BASE_DIR} -path "*/libraries/*" -prune -type f -o -not -name "forge*installer.jar" -name "forge*.jar")
if [[ -z "${SERVER}" || ! -f "${SERVER}" ]]; then
log "ERROR unable to locate installed forge server jar"
isDebugging && find ${FTB_BASE_DIR} -name "forge*.jar"
exit 2
fi
export FTB_DIR=$(dirname "${SERVER}")
exec ${SCRIPTS:-/}start-finalSetupWorld $@
fi
entryScriptExpr="
-name ServerStart.sh
-o -name serverstart.sh
-o -name ServerStartLinux.sh
-o -name LaunchServer.sh
-o -name server-start.sh
-o -name startserver.sh
-o -name StartServer.sh
"
if [[ -d ${FTB_BASE_DIR} ]]; then
startScriptCount=$(find ${FTB_BASE_DIR} $entryScriptExpr |wc -l)
if [[ $startScriptCount > 1 ]]; then
log "Conflicting FTB/CurseForge packages have been installed. Please cleanup ${FTB_BASE_DIR}"
exit 2
fi
else
startScriptCount=0
fi
# only download and install if a mod pack isn't already installed
# also check for the start script rather than just the folder
# this allows saving just the world separate from the rest of the data directory
if [[ $startScriptCount = 0 ]]; then
srv_modpack=${FTB_SERVER_MOD}
if isURL "${srv_modpack}"; then
case $srv_modpack in
https://www.feed-the-beast.com/*/download|https://www.curseforge.com/minecraft/modpacks/*/download/*/file)
;;
https://www.curseforge.com/minecraft/modpacks/*/download/*)
srv_modpack=${srv_modpack}/file;;
https://www.feed-the-beast.com/*)
srv_modpack=${srv_modpack}/download;;
esac
file=$(basename $(dirname $srv_modpack))
downloaded=/data/${file}.zip
if [ ! -e $downloaded ]; then
log "Downloading FTB modpack...
$srv_modpack -> $downloaded"
curl -sSL -o $downloaded $srv_modpack
fi
srv_modpack=$downloaded
fi
if [[ "${srv_modpack:0:5}" == "data/" ]]; then
# Prepend with "/"
srv_modpack="/${srv_modpack}"
fi
if [[ ! "${srv_modpack:0:1}" == "/" ]]; then
# If not an absolute path, assume file is in "/data"
srv_modpack=/data/${srv_modpack}
fi
if [[ ! -f "${srv_modpack}" ]]; then
log "FTB server modpack ${srv_modpack} not found."
exit 2
fi
if [[ ! "${srv_modpack: -4}" == ".zip" ]]; then
log "FTB server modpack ${srv_modpack} is not a zip archive."
log "Please set FTB_SERVER_MOD to a file with a .zip extension."
exit 2
fi
log "Unpacking FTB server modpack ${srv_modpack} ..."
mkdir -p ${FTB_BASE_DIR}
unzip -o "${srv_modpack}" -d ${FTB_BASE_DIR} | awk '{printf "."} END {print ""}'
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 $@

32
start-deployCatserver Normal file
View File

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

31
start-deployCustom Normal file
View 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 $@

76
start-deployFabric Normal file
View File

@@ -0,0 +1,76 @@
#!/bin/bash
set -eu
. ${SCRIPTS:-/}start-utils
export TYPE=FABRIC
FABRIC_INSTALLER=${FABRIC_INSTALLER:-}
FABRIC_INSTALLER_URL=${FABRIC_INSTALLER_URL:-}
FABRIC_INSTALLER_VERSION=${FABRIC_INSTALLER_VERSION:-${FABRICVERSION:-LATEST}}
if [[ -z $FABRIC_INSTALLER && -z $FABRIC_INSTALLER_URL ]]; then
log "Checking Fabric version information."
case $FABRIC_INSTALLER_VERSION in
LATEST)
FABRIC_INSTALLER_VERSION=$(maven-metadata-release https://maven.fabricmc.net/net/fabricmc/fabric-installer/maven-metadata.xml)
;;
esac
FABRIC_INSTALLER="/tmp/fabric-installer-${FABRIC_INSTALLER_VERSION}.jar"
markerVersion=$FABRIC_INSTALLER_VERSION
elif [[ -z $FABRIC_INSTALLER ]]; then
FABRIC_INSTALLER="/tmp/fabric-installer.jar"
markerVersion=custom
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}-${markerVersion}"
debug Checking for installMarker ${installMarker}
if [[ ! -e $installMarker ]]; then
if [[ ! -e $FABRIC_INSTALLER ]]; then
if [[ -z $FABRIC_INSTALLER_URL ]]; then
log "Downloading installer version $FABRIC_INSTALLER_VERSION"
downloadUrl="https://maven.fabricmc.net/net/fabricmc/fabric-installer/${FABRIC_INSTALLER_VERSION}/fabric-installer-${FABRIC_INSTALLER_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 ${VANILLA_VERSION} using $FABRIC_INSTALLER"
else
log "Installing Fabric 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 $@

View File

@@ -1,5 +1,7 @@
#!/bin/bash
. ${SCRIPTS:-/}start-utils
export TYPE=FORGE
if [[ -z $FORGE_INSTALLER && -z $FORGE_INSTALLER_URL ]]; then
@@ -14,7 +16,7 @@ if [[ -z $FORGE_INSTALLER && -z $FORGE_INSTALLER_URL ]]; then
#################################################################################
echo "Checking Forge version information."
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
@@ -22,8 +24,8 @@ if [[ -z $FORGE_INSTALLER && -z $FORGE_INSTALLER_URL ]]; then
if [ $FORGE_VERSION = null ]; then
FORGE_VERSION=$(cat /tmp/forge.json | jq -r ".promos[\"$VANILLA_VERSION-latest\"]")
if [ $FORGE_VERSION = null ]; then
echo "ERROR: Version $VANILLA_VERSION is not supported by Forge"
echo " Refer to http://files.minecraftforge.net/ for supported versions"
log "ERROR: Version $VANILLA_VERSION is not supported by Forge"
log " Refer to http://files.minecraftforge.net/ for supported versions"
exit 2
fi
fi
@@ -41,17 +43,17 @@ if [[ -z $FORGE_INSTALLER && -z $FORGE_INSTALLER_URL ]]; then
elif [[ -z $FORGE_INSTALLER ]]; then
FORGE_INSTALLER="/tmp/forge-installer.jar"
elif [[ ! -e $FORGE_INSTALLER ]]; then
echo "ERROR: the given Forge installer doesn't exist : $FORGE_INSTALLER"
log "ERROR: the given Forge installer doesn't exist : $FORGE_INSTALLER"
exit 2
fi
installMarker=".forge-installed-$shortForgeVersion"
installMarker="/data/.forge-installed-$shortForgeVersion"
if [ ! -e $installMarker ]; then
if [ ! -e $FORGE_INSTALLER ]; then
if [[ -z $FORGE_INSTALLER_URL ]]; then
echo "Downloading $normForgeVersion"
log "Downloading $normForgeVersion"
forgeFileNames="
$normForgeVersion/forge-$normForgeVersion-installer.jar
@@ -60,25 +62,25 @@ if [ ! -e $installMarker ]; then
"
for fn in $forgeFileNames; do
if [ $fn == END ]; then
echo "Unable to compute URL for $normForgeVersion"
log "Unable to compute URL for $normForgeVersion"
exit 2
fi
downloadUrl=http://files.minecraftforge.net/maven/net/minecraftforge/forge/$fn
echo "...trying $downloadUrl"
log "...trying $downloadUrl"
if curl -o $FORGE_INSTALLER -fsSL $downloadUrl; then
break
fi
done
else
echo "Downloading $FORGE_INSTALLER_URL ..."
log "Downloading $FORGE_INSTALLER_URL ..."
if ! curl -o $FORGE_INSTALLER -fsSL $FORGE_INSTALLER_URL; then
echo "Failed to download from given location $FORGE_INSTALLER_URL"
log "Failed to download from given location $FORGE_INSTALLER_URL"
exit 2
fi
fi
fi
echo "Installing Forge $shortForgeVersion using $FORGE_INSTALLER"
log "Installing Forge $shortForgeVersion using $FORGE_INSTALLER"
mkdir -p mods
tries=3
while ((--tries >= 0)); do
@@ -88,22 +90,22 @@ if [ ! -e $installMarker ]; then
fi
done
if (($tries < 0)); then
echo "Forge failed to install after several tries." >&2
log "Forge failed to install after several tries." >&2
exit 10
fi
# NOTE $shortForgeVersion will be empty if installer location was given to us
echo "Finding installed server jar..."
log "Finding installed server jar..."
unset -v latest
for file in *forge*.jar; do
[[ $file =~ installer ]] || [[ $file -nt $latest ]] && latest=$file
done
if [[ -z $latest ]]; then
echo "Unable to derive server jar for Forge"
log "Unable to derive server jar for Forge"
exit 2
fi
export SERVER=$latest
echo "Using server $SERVER"
log "Using server $SERVER"
echo $SERVER > $installMarker
else
@@ -111,4 +113,4 @@ else
fi
# Continue to Final Setup
exec /start-finalSetup01World $@
exec ${SCRIPTS:-/}start-finalSetupWorld $@

18
start-deployMagma Normal file
View 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
View 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 "$@"

74
start-deployPaper Normal file
View File

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

View File

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

27
start-deployTuinity Normal file
View 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 $@

View File

@@ -1,21 +1,22 @@
#!/bin/bash
. /start-utils
. ${SCRIPTS:-/}start-utils
isDebugging && set -x
set -o pipefail
export SERVER="minecraft_server.${VANILLA_VERSION// /_}.jar"
if [ ! -e $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then
echo "Downloading $SERVER ..."
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
echo "ERROR failed to obtain version manifest URL ($result)"
log "ERROR failed to obtain version manifest URL ($result)"
exit 1
fi
if [ $versionManifestUrl = "null" ]; then
echo "ERROR couldn't find a matching manifest entry for $VANILLA_VERSION"
log "ERROR couldn't find a matching manifest entry for $VANILLA_VERSION"
exit 1
fi
debug "Found version manifest at $versionManifestUrl"
@@ -23,7 +24,10 @@ if [ ! -e $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then
serverDownloadUrl=$(curl -fsSL ${versionManifestUrl} | jq --raw-output '.downloads.server.url')
result=$?
if [ $result != 0 ]; then
echo "ERROR failed to obtain version manifest from $versionManifestUrl ($result)"
log "ERROR failed to obtain version manifest from $versionManifestUrl ($result)"
exit 1
elif [ $serverDownloadUrl = null ]; then
log "ERROR version $VANILLA_VERSION does not provide a server download"
exit 1
fi
@@ -34,10 +38,12 @@ if [ ! -e $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then
curl $verbose -fsSL -o $SERVER $serverDownloadUrl
result=$?
if [ $result != 0 ]; then
echo "ERROR failed to download server from $serverDownloadUrl ($result)"
log "ERROR failed to download server from $serverDownloadUrl ($result)"
exit 1
fi
fi
isDebugging && ls -l
# Continue to Final Setup
exec /start-finalSetup01World $@
exec ${SCRIPTS:-/}start-finalSetupWorld $@

View File

@@ -0,0 +1,49 @@
#!/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..."
# File excludes
fileExcludes=
for f in ${REPLACE_ENV_VARIABLES_EXCLUDES}; do
fileExcludes="${fileExcludes} -not -name $f"
done
# Directory excludes (recursive)
dirExcludes=$(join_by " -o -path " ${REPLACE_ENV_VARIABLES_EXCLUDE_PATHS})
if [[ $dirExcludes ]]; then
dirExcludes=" -type d ( -path ${dirExcludes} ) -prune -o"
fi
isDebugging && echo "Using find file exclusions: $fileExcludes"
isDebugging && echo "Using find directory exclusions: $dirExcludes"
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/ \
$dirExcludes \
-type f \
\( -name "*.yml" -or -name "*.yaml" -or -name "*.txt" -or -name "*.cfg" \
-or -name "*.conf" -or -name "*.properties" \) \
$fileExcludes \
-exec sed -i 's#${'"$name"'}#'"$value"'#g' {} \;
fi
done < <(env)
fi
exec ${SCRIPTS:-/}start-minecraftFinalSetup $@

Some files were not shown because too many files have changed in this diff Show More