Compare commits

..

270 Commits

Author SHA1 Message Date
Geoff Bourne
822bf929c9 auto-cf: properly handle mod URLs with unicode (#1950) 2023-02-04 13:16:16 -06:00
Geoff Bourne
b400dfbb74 autopause: improve network interface lookup (#1949) 2023-02-04 10:57:06 -06:00
Geoff Bourne
1c670815d2 auto-cf: correctly handle modpack slug that clashes with mod slug (#1947) 2023-02-03 13:54:50 -06:00
Geoff Bourne
184d5b50d2 Handle installation of older Fabric versions (#1945) 2023-02-02 21:05:54 -06:00
Nguyen Hoang Tuan
5624faebe7 Modrinth per project version type declaration (#1939) 2023-01-31 08:00:58 -06:00
Just Mango
104eac4e14 Upgrade image helper to allow modrinth specific version id declaration (#1938) 2023-01-29 14:54:28 -06:00
Geoff Bourne
e0069692e0 Upgrade image helper to debug log file download duration and rate (#1936) 2023-01-28 12:56:09 -06:00
Geoff Bourne
03aaf45879 Fix handling of CF modpack overrides when files before directories (#1932) 2023-01-27 08:22:04 -06:00
Geoff Bourne
08b5303bd8 Improve docs for file reference options for AUTO_CURSEFORGE (#1931) 2023-01-26 17:52:57 -06:00
Geoff Bourne
8efb486c56 For AUTO_CURSEFORGE, can auto-set LEVEL from world save provided by modpack (#1929) 2023-01-26 13:46:48 -06:00
Geoff Bourne
2701fe5add docs: fixed volumes typo in docker-compose-paper.yml example (#1928) 2023-01-26 09:24:36 -06:00
Geoff Bourne
906e6787ae build: disable provenance on image build (#1922) 2023-01-24 08:02:21 -06:00
Geoff Bourne
a08bf868c8 docs: Added examples of AUTO_CURSEFORGE and MEMORY info (#1920) 2023-01-23 20:21:08 -06:00
LeaderbotX400
b90f980d3b Add more rubidium mods to AUTO_CURSEFORGE exclusions (#1919) 2023-01-23 10:52:29 -06:00
Geoff Bourne
1e0d12869f Upgrade image helper to fix Forge 1.7.x downloads (#1917) 2023-01-20 09:08:13 -06:00
Geoff Bourne
1c73b818fd Add legendary-tooltips to exclusions (#1915) 2023-01-18 21:50:11 -06:00
Geoff Bourne
5bc6b4e12b Upgrade rcon-cli to 1.6.1 (#1913) 2023-01-17 15:09:13 -06:00
Geoff Bourne
7b1bd0bdb2 docs: Added a diagram showing docker run to compose (#1912) 2023-01-17 13:29:26 -06:00
dependabot[bot]
a701723cc1 build(deps): bump docker/build-push-action from 3.2.0 to 3.3.0 (#1911)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 3.2.0 to 3.3.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v3.2.0...v3.3.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-16 21:51:23 -06:00
Geoff Bourne
2cde42b96e Fix usage when given forge installer is in data directory (#1909) 2023-01-15 14:58:44 -06:00
Geoff Bourne
81571483e7 AUTO_CURSEFORGE ensure modloader up to date even when modpack is (#1907) 2023-01-14 20:59:48 -06:00
Geoff Bourne
3f23c67098 AUTO_CURSEFORGE by default use exclude/include from latest in repo (#1906) 2023-01-14 15:17:12 -06:00
Geoff Bourne
b23593aec6 Use slugs or IDs for include/excludes with AUTO_CURSEFORGE and option for file declaration (#1905) 2023-01-14 12:52:35 -06:00
Geoff Bourne
14cf300e82 Add image tag/variant for Java 19 JRE (#1902) 2023-01-13 08:44:13 -06:00
Geoff Bourne
f8ea9d49f5 For AUTO_CURSEFORGE, fixed typo with CF_EXCLUDE_MODS (#1901) 2023-01-12 21:46:04 -06:00
Geoff Bourne
c0be7dbb95 For AUTO_CURSEFORGE, provide the option to force include mods (#1900) 2023-01-12 20:37:20 -06:00
Geoff Bourne
8017379723 Use parallel downloads for AUTO_CURSEFORGE (#1899) 2023-01-12 18:59:12 -06:00
Geoff Bourne
df0c57d111 Correct AUTO_CURSEFORGE to also include library mods and ability to exclude specific mods (#1897) 2023-01-12 08:39:28 -06:00
Geoff Bourne
8d3ec29a44 Correct AUTO_CURSEFORGE to only grab server mods (#1896) 2023-01-11 20:53:58 -06:00
Geoff Bourne
c15b13d07d docs: adjusted auto CurseForge section (#1890) 2023-01-09 08:22:11 -06:00
Geoff Bourne
48367b7c1f Support automatically downloading and upgrading CurseForge modpacks (#1889) 2023-01-08 19:15:24 -06:00
Geoff Bourne
dd6cda1ae5 Add Modrinth plugins support for Spigot/Paper (#1885) 2023-01-02 13:29:20 -06:00
Geoff Bourne
877486802c Emphasize cause analysis when minecraft server fails (#1883) 2023-01-01 09:24:17 -06:00
Geoff Bourne
7be36cc2cf Restore FORGE_INSTALLER (again) using mc-image-helper (#1880) 2023-01-01 09:12:39 -06:00
Geoff Bourne
c9341ec125 Added FORCE_REDOWNLOAD support for Bukkit/Spigot (#1879) 2022-12-28 14:05:31 -06:00
dependabot[bot]
95da3c52bc build(deps): bump actions/stale from 6 to 7 (#1877) 2022-12-26 08:10:12 -06:00
Geoff Bourne
6bab6766d4 Noted not using quotes in environment list syntax (#1875) 2022-12-23 21:35:52 -06:00
Torge Rosendahl
93f31f5ddc Fixed format as code for MOTD newline escape (#1873) 2022-12-23 11:37:07 -06:00
Geoff Bourne
ef9318f22e Allow DEBUG env var to enable mc-image-helper debug logs (#1870) 2022-12-20 10:11:54 -06:00
Geoff Bourne
ef141af30b Clarify whitelist variables (enable vs enforce) (#1860) 2022-12-11 08:51:26 -06:00
Jordy Hulck
d0c6143c0c Add launch.sh start script to support multiple classic Technic modpacks (#1859) 2022-12-09 18:26:16 -06:00
Geoff Bourne
e41ea3d1c8 Logs when downloading vanilla server jar were confusing (#1856)
Also:
- added info for multi-line MOTD
2022-12-07 08:27:43 -06:00
Geoff Bourne
940323f1b3 Bump mc-image-helper to 1.22.11 (#1854) 2022-12-05 07:05:50 -06:00
Geoff Bourne
bc572bd523 Let FTB installer manage file removal during version change (#1851) 2022-12-01 07:52:14 -06:00
Geoff Bourne
144e5c2a93 Revert "Use HTTP accept when downloading CF modpack (#1837)" (#1850)
This reverts commit d36bece851.
2022-11-27 09:19:28 -06:00
ThomWilhelm
5e20684b2b Added nfs client support packages. (#1843) 2022-11-26 21:49:21 -06:00
xyqyear
ff1e76c82c Fix typo in README: "has does" -> "has done" (#1846) 2022-11-25 09:51:05 -06:00
Geoff Bourne
a7d44f61bb Allow for commas in mc-image-helper lists (#1840)
Bumped mc-image-helper to 1.22.8
2022-11-23 11:45:39 -06:00
Geoff Bourne
d36bece851 Use HTTP accept when downloading CF modpack (#1837) 2022-11-23 09:32:25 -06:00
Pascal Sthamer
70c826e546 Add SERVER-START.sh as a possible entry script file name (#1838) 2022-11-23 08:21:03 -06:00
Geoff Bourne
ec4f3ab740 Add a lot of clarification to RCON documentation (#1835) 2022-11-21 13:55:39 -06:00
Kyle Stang
2fc45d6650 Add .paused file when server is paused (#1830) 2022-11-17 08:45:15 -06:00
Geoff Bourne
8b5a3f2077 Removed pre-1.12 empty JSON file conversion (#1826) 2022-11-13 20:59:13 -06:00
Geoff Bourne
e22acf63e9 Added multi-project example (#1824)
Also
* Adjusted spiget wordings
2022-11-13 16:48:30 -06:00
Geoff Bourne
26368810e7 Bump mc-server-runner to 1.8.2 (#1823) 2022-11-13 15:41:46 -06:00
Chip Wolf ‮
46a09ed331 Add option to skip generic pack checksum (#1816) 2022-11-10 07:05:47 -06:00
Geoff Bourne
0d9bfa6478 Document command to find host path of anonymous volume (#1811) 2022-10-30 09:08:58 -05:00
kylekrejci
885a921b08 Remove duplicate VIEW_DISTANCE env variable (#1808) 2022-10-29 14:04:47 -05:00
Geoff Bourne
5e2553274f Added kustomize base files (#1800) 2022-10-23 22:00:16 -05:00
Geoff Bourne
1769f28015 Added example of INITIAL_ENABLED_PACKS (#1799) 2022-10-22 20:52:36 -05:00
Geoff Bourne
17cf058aa4 Added support for datapack enable/disable properties for feature flags (#1798) 2022-10-22 15:30:08 -05:00
Phongsakorn Wisetthon
ad912fe7bf Using spiget, if REMOVE_OLD_MODS = true redownload plugins (#1792) 2022-10-22 15:04:28 -05:00
dependabot[bot]
c46890f9b1 build(deps): bump docker/build-push-action from 3.1.1 to 3.2.0 (#1790) 2022-10-17 09:10:02 -05:00
dependabot[bot]
c4015f4ccb build(deps): bump docker/setup-qemu-action from 2.0.0 to 2.1.0 (#1789) 2022-10-17 07:47:36 -05:00
Geoff Bourne
c1d8dc9bb0 Improved naming of FORGE_FORCE_REINSTALL and FORGE_VERSION (#1788) 2022-10-16 17:49:25 -05:00
Geoff Bourne
2e69966a6a Emphasize java 8 requirement for Forge < 1.18 (#1787) 2022-10-15 15:19:23 -05:00
Geoff Bourne
ec06e3bfeb Added more description of DATAPACKS variables (#1784) 2022-10-14 15:36:53 -05:00
Geoff Bourne
1c9e31c630 Only default MOTD and WHITELIST when first creating server.properties (#1780) 2022-10-12 22:09:56 -05:00
Geoff Bourne
8f5cc315d9 Setup MEMORY variables earlier to allow use in Spigot build (#1779) 2022-10-12 19:23:01 -05:00
Geoff Bourne
61592d5c3e Prevent generic modpack overwriting eula file (#1773) 2022-10-08 18:25:42 -05:00
Geoff Bourne
57dc84e204 Auto-manage server properties by default (#1769) 2022-10-08 18:11:43 -05:00
Geoff Bourne
c61df8d32e Updated docs for finding FTB modpack ID (#1766) 2022-10-07 21:44:18 -05:00
Geoff Bourne
c228465ff1 Added ARMv7 build for java8-multiarch (#1765) 2022-10-07 21:19:08 -05:00
J Thompson
1b44fc87dd Remove packwiz 403 readme documentation (#1763) 2022-10-07 07:12:06 -05:00
J Thompson
7076fb83da BetterMC Plus Example (#1762) 2022-10-06 07:44:12 -05:00
J Thompson
5338f1e0f4 Create docker-compose-curseforge-atm7.yaml (#1761) 2022-10-05 21:44:13 -05:00
dependabot[bot]
8ab5542c82 build(deps): bump actions/stale from 5 to 6 (#1751) 2022-09-26 08:06:01 -05:00
Geoff Bourne
96a21ff6e6 Upgrade mc-monitor to allow option to use mcutils for long FML2 listings (#1746) 2022-09-22 20:44:51 -05:00
Geoff Bourne
a57d678fdd Allow image helper get to use user info (#1735) 2022-09-17 10:45:41 -05:00
Ceci
d4692d2d07 fix(packwiz): provide side argument to packwiz (#1734) 2022-09-15 11:43:11 -05:00
Geoff Bourne
a1e4657e62 Fixed bug causing isTrue to fail (#1727) 2022-09-10 14:39:44 -05:00
Geoff Bourne
fabe14db49 Download and use packwiz from Maven repository (#1725)
Also
* Added github actions debug support
* added use of fileNotExists
2022-09-10 12:58:32 -05:00
Geoff Bourne
4d3464f3f1 Change versionLessThan to work in strict mode (#1723) 2022-09-08 20:23:34 -05:00
Geoff Bourne
d6de14123b Corrected Modrinth usage with TYPE=FORGE (#1719) 2022-09-05 18:21:11 -05:00
Geoff Bourne
247855c2cf Upgrade mc-image-helper to 1.22.4 (#1715) 2022-09-04 22:50:00 -05:00
Geoff Bourne
364f73c9d9 Adjusted mc-image-helper to use logback for java8 (#1713) 2022-09-04 18:14:33 -05:00
Geoff Bourne
7723cb0a41 Correctly parse modrinth dependencies declared as embedded (#1710) 2022-09-03 17:46:08 -05:00
Geoff Bourne
0e0bb09533 Show IP address that caused auto-pause to resume (#1709)
Also
* Refactored auto files, server.properties, and rcon-cmds
2022-09-03 16:48:14 -05:00
Geoff Bourne
417a65a3af Fixed issue with GENERIC_PACK where it exits after saving checksum (#1708) 2022-09-03 10:11:58 -05:00
Dov Alperin
3c131f853d Use pkill by default for autostop feature (#1707) 2022-09-02 18:14:10 -05:00
Geoff Bourne
cca9b3e21d docs: clarify placeholder usage with _FILE suffix (#1704) 2022-09-01 08:39:04 -05:00
J Thompson
e81cddd108 Added example for GENERIC_PACK TNP5 (#1698) 2022-08-28 17:43:57 -05:00
Geoff Bourne
1bc566c69a docs: Corrected versions required for FTBA (#1689) 2022-08-21 15:41:05 -05:00
Nolan Rosen
4f8104737e Updated GH_TOKEN usage (#1688) 2022-08-21 15:31:54 -05:00
Nolan Rosen
de43778eb9 Updates for GH_TOKEN addition for packwiz support (#1687) 2022-08-21 14:06:50 -05:00
Geoff Bourne
3310f0a069 Fix FORGEVERSION and FORGE_INSTALLER support (#1677) 2022-08-15 08:23:16 -05:00
Geoff Bourne
05b8899de6 Don't show server properties by default and obscure passwords (#1670) 2022-08-14 14:14:57 -05:00
Geoff Bourne
7a85cb5f39 Perform clean Forge version changes (#1669)
Switched to mc-image-helper
2022-08-14 13:34:08 -05:00
Gustave Abel Michel III
380ea202dc Updated LegacyJavaFixer Download URL (#1667) 2022-08-13 10:49:33 -05:00
dependabot[bot]
83d99f35f9 build(deps): bump docker/build-push-action from 3.1.0 to 3.1.1 (#1660)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 3.1.0 to 3.1.1.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v3.1.0...v3.1.1)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-12 15:51:09 -05:00
Geoff Bourne
0f85646c69 Output expected files when FTBA prep fails (#1656) 2022-08-06 16:24:47 -05:00
Geoff Bourne
75afcc2fce build: corrected name of PR workflow 2022-08-05 21:45:18 -05:00
Geoff Bourne
94b2d8996d FTBA installer on Alpine fails gracefully (#1655) 2022-08-05 21:42:58 -05:00
Geoff Bourne
72b6eeba75 build: only login to DockerHub when credentials available (#1645) 2022-08-02 22:47:35 -05:00
Noa Himesaka
68a514e589 Install procps-ng on Oracle Linux-based images for autopause (#1644) 2022-08-02 22:04:13 -05:00
Geoff Bourne
2df678e96a Added debug options for autopause/stop (#1638) 2022-07-30 12:06:22 -05:00
Geoff Bourne
8dbfff1873 Allow for multiple patterns in REMOVE_OLD_MODS_INCLUDE/EXCLUDE (#1637) 2022-07-29 21:28:04 -05:00
dependabot[bot]
c83705157c build(deps): bump docker/build-push-action from 3.0.0 to 3.1.0 (#1629) 2022-07-25 06:18:12 -05:00
Geoff Bourne
c5d4e4d8ca Added top-level docker compose file (#1628) 2022-07-24 21:26:34 -05:00
Geoff Bourne
e70525b2ff Added jdk image tags to java versions table (#1626) 2022-07-24 09:07:35 -05:00
Khoo Hao Yit
c5e91ff823 fix typo in README.md (#1623) 2022-07-22 11:38:09 -05:00
Geoff Bourne
5cec41319d Download and use Magma server jar rather than installer (#1618) 2022-07-20 21:14:38 -05:00
Geoff Bourne
eb22d4cadc build: perform validation on all base images for PRs (#1610) 2022-07-20 20:24:05 -05:00
Jawa_Juice
a0a046f9f6 Remove Airplane as discontinued (#1615) 2022-07-19 08:23:01 -05:00
Cayce House
9210044b8d fix #1612 (#1614) 2022-07-19 07:28:58 -05:00
Noa Himesaka
df203d4b4b Fix GraalVM images error on AArch64 systems (#1609) 2022-07-17 10:06:33 -05:00
Cayce House
16a958d129 Choose shortest path for generic pack base (#1608)
Co-authored-by: Cayce House <cayce@house.email>
2022-07-16 17:05:44 -05:00
Noa Himesaka
76628e8ccc Fixing zstd uncompression for Oracle Linux (#1607) 2022-07-16 11:05:32 -05:00
Noa Himesaka
e8f3fd2d71 Add GraalVM CE support (#1601) 2022-07-16 10:11:11 -05:00
Geoff Bourne
fac72eac9d TYPE=CURSEFORGE also looks for start.sh (#1605) 2022-07-16 10:01:08 -05:00
Gabriel Simmer
f4eac20ff8 Default -> default in limbo world name (#1604)
See #994 - Limbo will pass along the world name verbatim, but Minecraft (doesn't appear to) allow uppercase letters in world names.
2022-07-16 09:33:18 -05:00
Geoff Bourne
e3a29180fd Handle packwiz bootstrap installer already being present (#1595) 2022-07-11 22:27:07 -05:00
Geoff Bourne
51f1a08f6e docs: Updated readiness and liveness probes in k8s example (#1592) 2022-07-09 17:30:08 -05:00
Geoff Bourne
5a507f800f VanillaTweaks uses mc-image-helper and auto-cleans old files (#1581) 2022-06-29 22:17:23 -05:00
Mikkel D
ab47b06ba9 Update Magma API to V2 (#1580) 2022-06-28 07:15:32 -05:00
Geoff Bourne
7001f2bcba Added support for downloading mods from Modrinth (#1577) 2022-06-27 09:08:21 -05:00
Geoff Bourne
8d7a5275a8 docs: Updated description of LEVEL_TYPE (#1575) 2022-06-22 13:04:27 -05:00
Geoff Bourne
30fa6d02c7 build: output time spent on each setuponly test (#1569) 2022-06-18 09:56:53 -05:00
Davide A
a18cf3348a packwiz manually download bootstrap and skip update when initial download fails 2022-06-17 09:21:41 -05:00
Mathéo CIMBARO
a84cdaf355 Added support for optimized SIMD operations (#1570) 2022-06-16 18:19:15 -05:00
Mathéo CIMBARO
23c8fc65a4 Added support for Pufferfish 1.19 (#1566)
* Added support for Pufferfish 1.19

* Update scripts/start-deployPufferfish

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

* Removed wrong negation

Co-authored-by: Geoff Bourne <itzgeoff@gmail.com>
2022-06-16 15:19:04 -05:00
Geoff Bourne
f8acb832f1 Ensure PURPUR_DOWNLOAD_URL has a default (#1568) 2022-06-16 08:39:25 -05:00
Bensuperpc
b6dbcbde02 Add custom download URL for Purpur (#1563) 2022-06-15 06:51:41 -05:00
Geoff Bourne
f5f09302b2 docs: added itzg/rcon to related projects 2022-06-12 08:39:46 -05:00
Caden Kriese
512fa7fbd4 Add 1.19 server properties (#1558) 2022-06-11 19:31:26 -05:00
Geoff Bourne
9458005b5b Resolve latest Paper version when no published builds (#1555) 2022-06-08 11:12:49 -05:00
Geoff Bourne
b1be888dd4 docs: Clarify the volume mounting example (#1549) 2022-06-05 16:05:57 -05:00
chblodg
4f9de809f8 updating forgeapi tests and adding is false (#1548)
Co-authored-by: christopher blodgett <christopher.blodgett@gmail.com>
2022-06-05 15:16:12 -05:00
Geoff Bourne
1fb04c069c Place EULA file into subdir managed by ServerSetup (#1543) 2022-05-30 13:07:25 -05:00
Geoff Bourne
fd2431046c misc: Removed 88135 from spiget test (#1541) 2022-05-30 13:07:06 -05:00
Geoff Bourne
19ee3f58f8 build: alpine build needed sh not bash (#1540) 2022-05-30 12:10:14 -05:00
Geoff Bourne
8d0bdb60f0 For CurseForge, avoid conflicting start script error when run.sh present (#1539) 2022-05-30 08:41:21 -05:00
Geoff Bourne
0f23414198 Provide clearer log when minecraft server process fails (#1538) 2022-05-29 21:57:39 -05:00
Geoff Bourne
40ebddadff Pin base images to focal until netty epoll support is fixed (#1536) 2022-05-28 20:06:23 -05:00
Geoff Bourne
08556a63b8 CurseForge modpacks use run.sh when present (#1534)
* CurseForge modpacks use run.sh when present

* Added lbzip2
2022-05-26 22:02:26 -05:00
Bensuperpc
ea7046f93d Fixed older purpur versions not being removed (#1531) 2022-05-24 07:21:30 -05:00
Geoff Bourne
6768795594 docs: Corrected image tag in FTB example (#1530) 2022-05-22 15:25:44 -05:00
Skyler Spaeth
e7236212d8 Add jarfile options and custom worlds directory path (Multiverse) to docs (#1527) 2022-05-22 12:00:38 -05:00
Geoff Bourne
3e3abda71e Constrain GENERIC_PACK base detection depth (#1528) 2022-05-22 11:35:52 -05:00
Geoff Bourne
f67d3948d2 docs: Cleanup RCON_CMDS examples (#1526) 2022-05-21 11:04:00 -05:00
SeanWcom
bc3c3db080 Adding 'run.sh' as a variant for FTBA server types (#1521) 2022-05-19 07:29:52 -05:00
Felix
691be801d8 Add initial support for Quilt server (#1514) 2022-05-13 07:31:36 -05:00
Geoff Bourne
56b9326c09 docs: Embedded table of contents is redundant and makes it hard to see top part of docs (#1516) 2022-05-11 11:20:39 -05:00
md5nake
b6ea33dce1 Fix memory env vars being overridden if set to "" (#1512) 2022-05-11 08:15:53 -05:00
dependabot[bot]
367876e8b8 build(deps): bump docker/metadata-action from 3 to 4 (#1510) 2022-05-10 21:34:15 -05:00
dependabot[bot]
eb096142d6 build(deps): bump docker/setup-qemu-action from 1.2.0 to 2.0.0 (#1507) 2022-05-10 18:01:05 -05:00
dependabot[bot]
9ccd5bdee7 build(deps): bump docker/login-action from 1 to 2 (#1508) 2022-05-10 17:19:53 -05:00
dependabot[bot]
dc05029ef5 build(deps): bump docker/setup-buildx-action from 1 to 2 (#1509) 2022-05-10 12:41:28 -05:00
dependabot[bot]
926a3a5688 build(deps): bump docker/build-push-action from 2.10.0 to 3.0.0 (#1511) 2022-05-09 21:39:34 -05:00
Geoff Bourne
b27556e1eb Fix invalid -s arg with TYPE=FORGE (#1501) 2022-05-03 17:42:13 -05:00
Geoff Bourne
64521f7a39 Disable forgeapi tests for now (#1499) 2022-05-02 13:39:10 -05:00
Dessa Simpson
b4ca00bd3b Download spiget resources to tempdir under plugins (#1486) 2022-05-01 17:56:54 -05:00
Geoff Bourne
bca7b79f77 Avoid brittle testing of Loliserver due to download site (#1489) 2022-04-25 09:38:04 -05:00
itzg
2e0c8901a1 docs: Auto update markdown TOC 2022-04-24 22:11:22 +00:00
Sylensky
3e6ef1a605 Added Loliserver support (#1483)
* added Loliserver support

* added 'setup only' test for loliserver
2022-04-24 17:11:03 -05:00
Dario Crosa
d9a55ae938 remove isUrl check (#1488) 2022-04-24 15:51:12 -05:00
Bartosz Stefańczyk
7e843ea100 Fix alpine incompatibility (#1481) 2022-04-19 17:42:40 -05:00
dependabot[bot]
b241f74615 build(deps): bump stefanzweifel/git-auto-commit-action (#1479) 2022-04-18 07:33:56 -05:00
Geoff Bourne
c5460941c4 Updated rolling logs config to also be size based (#1478) 2022-04-17 21:36:12 -05:00
Geoff Bourne
890425a8b6 Updated rcon-cli to support variables cleanup (#1476) 2022-04-15 07:56:04 -05:00
Bartosz Stefańczyk
8c5c4664ea Fix forge using 1.17+ version after downgrade (#1474) 2022-04-14 22:03:34 -05:00
Geoff Bourne
901b889f2d Fixed running as uid=0 even with UID unset (#1475) 2022-04-14 11:41:43 -05:00
Geoff Bourne
cf1dd9f9e1 Corrected default of UID/GID via start script (#1471)
Fixes #1469
2022-04-11 18:00:16 -05:00
Geoff Bourne
8ef3fe199f Allow ICON to reference a local file (#1466) 2022-04-10 11:39:58 -05:00
Geoff Bourne
97fe6b1f14 Corrected autopause's resume to work with alpine images (#1464) 2022-04-10 10:58:18 -05:00
Geoff Bourne
4af80debe2 Correct spiget handling of jars that contain jars (#1462) 2022-04-09 22:02:20 -05:00
itzg
513492192b docs: Auto update markdown TOC 2022-04-02 20:38:29 +00:00
Geoff Bourne
e0b4a819b1 Fixed version comparisons when using SPONGEVANILLA (#1455)
Fixes #1452
2022-04-02 15:38:13 -05:00
itzg
5c0cf11bfe docs: Auto update markdown TOC 2022-04-02 19:02:45 +00:00
Michael Vorburger ⛑️
63a884ea75 Add hint that SPONGEVANILLA requires VERSION to README (#1452) (#1453) 2022-04-02 14:02:29 -05:00
chblodg
7c7090a582 ForgeAPI fixed lower sub version with a higher ID number (#1451)
Co-authored-by: christopher blodgett <christopher.blodgett@gmail.com>
2022-04-01 18:26:12 -05:00
dependabot[bot]
fc70a976bd build(deps): bump docker/build-push-action from 2.9.0 to 2.10.0 (#1438) 2022-03-22 20:52:32 -05:00
itzg
0de90b134c docs: Auto update markdown TOC 2022-03-23 00:23:06 +00:00
Nick Martin
6eca74698b Update README.md (#1442) 2022-03-22 19:22:49 -05:00
dependabot[bot]
7c85f0926c build(deps): bump stefanzweifel/git-auto-commit-action (#1437) 2022-03-21 06:54:40 -05:00
Geoff Bourne
4ff158266a Use file content to detect spiget resource type (#1432)
For #1426
2022-03-17 22:07:34 -05:00
Geoff Bourne
fda8981028 Silence content type error for external spiget resources (#1431) 2022-03-15 20:56:25 -05:00
itzg
7f44a04490 docs: Auto update markdown TOC 2022-03-16 00:48:32 +00:00
chblodg
818ab46b73 fixing readme example for Vt (#1430)
Fixes #1429 

Co-authored-by: christopher blodgett <christopher.blodgett@gmail.com>
2022-03-15 19:48:20 -05:00
Geoff Bourne
5ae5733741 Determine SPIGET file type from API (#1427) 2022-03-14 21:07:06 -05:00
Geoff Bourne
2042450f9b When ICON is GIF, extract only first frame (#1420) 2022-03-14 20:28:41 -05:00
Geoff Bourne
676b0f88cf mc-send-to-console skips user change when non-root (#1419)
Fixes #1393
2022-03-11 14:34:10 -06:00
Geoff Bourne
65d6c5bb32 Verify content type when downloading SPIGET_RESOURCES entry (#1413)
For #1378
2022-03-10 16:16:18 -06:00
dependabot[bot]
5168698498 build(deps): bump actions/stale from 4.1.0 to 5 (#1408) 2022-03-07 08:17:48 -06:00
dependabot[bot]
f512b9510c build(deps): bump actions/checkout from 2.4.0 to 3 (#1409) 2022-03-07 08:17:30 -06:00
Geoff Bourne
ba71a7f5a2 Re-fixed pufferfish tests (#1406) 2022-03-06 15:54:25 -06:00
chblodg
1ebe9d3f47 adding major version for pufferfish (#1405)
* adding major version for pufferfish

* fixing test as well as fixing a quote that was added due to linter recommendation

* Changing get major version to using a simple cut command

Co-authored-by: christopher blodgett <christopher.blodgett@gmail.com>
2022-03-06 14:57:00 -06:00
Geoff Bourne
d9bddabbf8 Provide better debug logs with mc-image-helper get (#1404) 2022-03-05 20:50:28 -06:00
Geoff Bourne
3c3aea9c86 ci: adjusted pufferfish test (#1403) 2022-03-05 20:22:08 -06:00
Geoff Bourne
3806364197 ci: added build variants to main list 2022-03-05 15:53:00 -06:00
Bram
e9d3512383 Pufferfish: Remove regex processing (#1402)
Fixes #1401
2022-03-05 15:49:36 -06:00
itzg
09cc5003cd docs: Auto update markdown TOC 2022-03-05 01:53:09 +00:00
chblodg
1781ca282a added variables for pufferfish, also added setup only test (#1399) 2022-03-04 19:52:55 -06:00
chblodg
ba08a5d8f1 Fixing missing export, fixed run order, added real world working example (#1397) 2022-03-04 16:52:00 -06:00
itzg
b1e00b43be docs: Auto update markdown TOC 2022-03-04 02:47:47 +00:00
chblodg
a2499a8713 RCON: Adding on last disconnect (#1395) 2022-03-03 20:47:30 -06:00
itzg
07665d7571 docs: Auto update markdown TOC 2022-03-02 17:29:33 +00:00
chblodg
4587b32480 RCON commands feature (#1391)
Co-authored-by: christopher blodgett <christopher.blodgett@gmail.com>
2022-03-02 11:29:12 -06:00
Geoff Bourne
15869fd774 docs: added tty and stdin_open to example file 2022-02-28 21:40:47 -06:00
Geoff Bourne
2e24bdfff8 Restored error handling when missing vanilla version (#1389) 2022-02-26 21:28:30 -06:00
itzg
1f8a3d85d1 docs: Auto update markdown TOC 2022-02-26 20:58:31 +00:00
Geoff Bourne
f359324bea docs: added mc-backup to related projects
#1385
2022-02-26 14:58:17 -06:00
itzg
e0ff1365cf docs: Auto update markdown TOC 2022-02-26 19:29:53 +00:00
Geoff Bourne
b347a7d0bf docs: added Related Projects section (#1387)
Fixes #1385
2022-02-26 13:29:39 -06:00
itzg
977ac22df9 docs: Auto update markdown TOC 2022-02-26 19:15:03 +00:00
Geoff Bourne
323d41603c docs: updated info to find FTB identifiers (#1386)
Fixes #612
2022-02-26 13:14:50 -06:00
chblodg
8dadfecf28 ForgeAPI: Random failure fix (#1384)
* Fix for Random forge api failure, removing dependency duplication messages

* pushing array test for review

* Fixing while loops that were causing downloaded modids to reset

Co-authored-by: christopher blodgett <christopher.blodgett@gmail.com>
2022-02-24 16:47:22 -06:00
chblodg
5f1d7c6d31 Changing builds to JRE, and moving Java8 to pinned version for forge (#1382) 2022-02-24 12:18:49 -06:00
Geoff Bourne
7ba6ef9ad8 ci: MODS_FORGEAPI_KEY was missing from tests step 2022-02-24 07:26:04 -06:00
Geoff Bourne
eb1170408f Pin java8-multiarch to 8u312 due to Forge (#1383) 2022-02-24 07:08:06 -06:00
Geoff Bourne
c50c9988fc Fix PATH for annoying docker providers (#1371)
Fixes #1365
2022-02-19 11:34:13 -06:00
Geoff Bourne
d46384f68a Removing unused ttf-dejavu package (#1362) 2022-02-19 09:38:49 -06:00
Michael Kirsch
b7f8239235 use user instead of group in sudoers file (#1367) 2022-02-15 17:28:05 -06:00
itzg
f31c57b897 docs: Auto update markdown TOC 2022-02-14 00:02:27 +00:00
Geoff Bourne
5d68a57910 Added procps to alpine image to resolve autopause compatibility (#1361) 2022-02-13 18:02:09 -06:00
itzg
3886bca93f docs: Auto update markdown TOC 2022-02-13 15:02:50 +00:00
Daschi1
48f79f54bf Added an example for JVM_OPTS (#1359) 2022-02-13 09:02:37 -06:00
Geoff Bourne
179bb267fb build: add alpine support to matrix builds (#1349) 2022-02-11 21:00:24 -06:00
itzg
1458329e97 docs: Auto update markdown TOC 2022-02-12 02:37:54 +00:00
StealthCT
fdddece984 Migrate Fabric server to launcher method (#1351) 2022-02-11 20:37:39 -06:00
chblodg
700703fe8c Adding notifications for on close, reopen, and delete (#1355) 2022-02-10 17:49:08 -06:00
itzg
3131a340d4 docs: Auto update markdown TOC 2022-02-09 01:24:56 +00:00
chblodg
a57adc04ff Add GameType filter, and add ForgeAPI Verify Files to validate Mod Downloads (#1337)
Co-authored-by: christopher blodgett <christopher.blodgett@gmail.com>
2022-02-08 19:24:38 -06:00
Jordy Hulck
4cb227629f Distro aware checksum (#1345) 2022-02-08 19:17:26 -06:00
dependabot[bot]
932cd8f89e build(deps): bump docker/build-push-action from 2.8.0 to 2.9.0 (#1339) 2022-02-07 06:54:56 -06:00
Geoff Bourne
f2f8d58d3b Only skip up-to-date files with MODS and MODS_FILE (#1338)
Fixes #1254
2022-02-06 17:46:17 -06:00
Luc Ritchie
b7bbe1b0a6 Support Spigot-style and vanilla-style world zips, for any server type (#1305) 2022-02-06 15:51:28 -06:00
itzg
1dd9a2e6e0 docs: Auto update markdown TOC 2022-02-06 18:45:40 +00:00
chblodg
aa7b997697 Adding support for crafting tweaks and resource packs (#1336)
Co-authored-by: christopher blodgett <christopher.blodgett@gmail.com>
Co-authored-by: Geoff Bourne <itzgeoff@gmail.com>
Co-authored-by: Floyd Everest <me@floydeverest.com>
2022-02-06 12:45:25 -06:00
Geoff Bourne
eb6c7c98f0 build: adjusted discord workflow name 2022-02-05 22:40:42 -06:00
Geoff Bourne
3472c67ca8 build: give issue-label workflow a name 2022-02-05 16:10:12 -06:00
Geoff Bourne
8995e63b72 build: fixed typo in push condition 2022-02-05 16:03:40 -06:00
Geoff Bourne
b65f108917 build: also push git tag builds 2022-02-05 16:02:27 -06:00
itzg
2b374a2073 docs: Auto update markdown TOC 2022-02-05 18:38:46 +00:00
Geoff Bourne
b5b164d5d3 feat: added SKIP_GENERIC_PACK_UPDATE_CHECK and FORCE_GENERIC_PACK_UPDATE (#1333) 2022-02-05 12:38:33 -06:00
itzg
0cde40604e docs: Auto update markdown TOC 2022-02-05 18:27:33 +00:00
Geoff Bourne
22f2eb7308 feat: add option to include timestamp with init logs (#1332) 2022-02-05 12:27:17 -06:00
Geoff Bourne
4a1d2d2b80 build: adjusted for eclipse-temurin:8-jdk not being on armv7 2022-02-02 22:27:38 -06:00
Geoff Bourne
10922b261b build: build-multiarch tags were too broad 2022-02-02 22:18:54 -06:00
itzg
de0188de3d docs: Auto update markdown TOC 2022-02-02 02:53:20 +00:00
Geoff Bourne
2b093ad421 docs: fixed Forge homepage link
Fixes #1244
2022-02-01 20:53:05 -06:00
itzg
0ec73b141f docs: Auto update markdown TOC 2022-02-01 21:08:27 +00:00
Geoff Bourne
de0bb14abd docs: added inspect command to see anonymous volume path 2022-02-01 15:08:09 -06:00
Geoff Bourne
26809ef1f0 build: enable exit on failure for verify in setuponlytests
Related to #1305
2022-01-31 21:44:18 -06:00
itzg
dca4f86fa6 docs: Auto update markdown TOC 2022-01-31 01:50:07 +00:00
Geoff Bourne
eb0c30d134 feat: added prefix/suffix support for GENERIC_PACKS (#1321)
For #1315
2022-01-30 19:49:54 -06:00
Geoff Bourne
c55cce628d fix: bumped mc-image-helper to 1.16.3 to use specific user agent (#1320) 2022-01-30 14:05:50 -06:00
Alexandre Boucey
240238013b Use Log4J2 JVM flag when file download fail (#1316) 2022-01-30 13:46:09 -06:00
Geoff Bourne
18f0f0ceee fix: speedup generic pack update check (#1317)
#1281
2022-01-30 11:17:21 -06:00
Geoff Bourne
c424fe1c7b build: corrected issue-label to use issue.number 2022-01-29 22:09:18 -06:00
Geoff Bourne
eb694463c5 build: switch to matrix builds for Debian based variant builds (#1313) 2022-01-29 14:53:34 -06:00
Geoff Bourne
469afb3200 build: fixed issue.id reference in issue-label workflow 2022-01-28 22:44:37 -06:00
itzg
8f8acc40f5 docs: Auto update markdown TOC 2022-01-28 00:42:48 +00:00
chblodg
7dbd8256ea Adding ForgeAPI version pinning and dependency download. (#1308)
Co-authored-by: christopher blodgett <christopher.blodgett@gmail.com>
Co-authored-by: Geoff Bourne <itzgeoff@gmail.com>
2022-01-27 18:42:33 -06:00
Geoff Bourne
66468975e0 build: added id to labelled issue discord message 2022-01-27 15:03:00 -06:00
Geoff Bourne
6d27ce8461 build: updated issue label workflow with more labels 2022-01-27 14:47:03 -06:00
Geoff Bourne
b0817f2a83 build: updated issues workflow with 'help wanted'
See #1310
2022-01-27 14:44:44 -06:00
Geoff Bourne
21602a79e7 Refactored ops and whitelist processing into its own file (#1306) 2022-01-26 20:25:52 -06:00
Luc Ritchie
8a42dfe232 Fix loading world from compressed tar archives (#1304) 2022-01-25 16:19:15 -06:00
dependabot[bot]
d02bbb798e build(deps): bump docker/build-push-action from 2.7.0 to 2.8.0 (#1300) 2022-01-24 07:35:03 -06:00
231 changed files with 5015 additions and 1973 deletions

19
.gitattributes vendored
View File

@@ -1,17 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
# Custom for Visual Studio
*.cs diff=csharp
# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
# Auto detect text files and perform LF normalization
* text=lf

3
.github/FUNDING.yml vendored
View File

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

View File

@@ -10,9 +10,9 @@ body:
Thanks for taking the time to report a bug.
Please double check some things first:
- Do you just have a question about something? If so, asking in the [Q&A Discussions](https://github.com/itzg/docker-minecraft-server/discussions/categories/q-a) or asking on [the Discord server](https://discord.gg/DXfKpjB) would be best.
- Is this bug happening after the `[init]` prefixed logs and after the log that says "Starting the Minecraft server"? If so, please report the bug with Mojang or the respective server provider.
- Are you seeing a performance problem? If so, that is typically outside the scope of the image setup mechanims. Ask a question as above or contact the respective server provider.
1. Do you just have a question about something? If so, asking in the [Q&A Discussions](https://github.com/itzg/docker-minecraft-server/discussions/categories/q-a) or asking on [the Discord server](https://discord.gg/DXfKpjB) would be best.
2. Is this bug happening after the `[init]` prefixed logs and after the log that says "Starting the Minecraft server"? If so, please report the bug with Mojang or the respective server provider.
3. Are you seeing a performance problem? If so, that is typically outside the scope of the image setup mechanims. Ask a question as above or contact the respective server provider.
- type: textarea
id: problem
attributes:

13
.github/release.yml vendored
View File

@@ -2,3 +2,16 @@ changelog:
exclude:
authors:
- dependabot
categories:
- title: Enhancements
labels:
- enhancement
- title: Bug Fixes
labels:
- bug
- title: Documentation
labels:
- documentation
- title: Other Changes
labels:
- "*"

View File

@@ -1,93 +1,188 @@
name: Build and publish multiarch
name: Test and Build multi-architecture
on:
push:
branches:
- master
- java8-multiarch
- java8-openj9
- java11*
- java16*
- java17*
- test/**
tags:
- "[0-9]+.[0-9]+.[0-9]+"
- "[0-9]+.[0-9]+.[0-9]+-java8-multiarch"
- "[0-9]+.[0-9]+.[0-9]+-java8-openj9"
- "[0-9]+.[0-9]+.[0-9]+-java11*"
- "[0-9]+.[0-9]+.[0-9]+-java16*"
paths-ignore:
- "*.md"
- "docs/**"
- "examples/**"
env:
IMAGE_TO_TEST: itzg/minecraft-server:test-${{ github.repository_owner }}-${{ github.run_id }}
jobs:
build:
if: github.repository == 'itzg/docker-minecraft-server'
strategy:
fail-fast: false
matrix:
# NOTE: the "latest" variant is identified in the Docker meta step's 'latest' config
variant:
- java19
- java17
- java17-graalvm-ce
- java17-jdk
- java17-openj9
- java17-alpine
- java8
- java8-graalvm-ce
- java8-multiarch
- java8-openj9
- java8-jdk
- java11
- java11-openj9
- java11-jdk
include:
# JAVA 19:
- variant: java19
baseImage: eclipse-temurin:19-jre-jammy
platforms: linux/amd64,linux/arm/v7,linux/arm64
mcVersion: 1.19.3
# JAVA 17:
- variant: java17
# jammy doesn't work until minecraft updates to https://github.com/netty/netty/issues/12343
baseImage: eclipse-temurin:17-jre-focal
platforms: linux/amd64,linux/arm/v7,linux/arm64
mcVersion: 1.18.2
- variant: java17-graalvm-ce
baseImage: ghcr.io/graalvm/graalvm-ce:ol8-java17
platforms: linux/amd64,linux/arm64
mcVersion: 1.18.2
- variant: java17-jdk
baseImage: eclipse-temurin:17-focal
platforms: linux/amd64,linux/arm/v7,linux/arm64
mcVersion: 1.18.2
- variant: java17-openj9
baseImage: ibm-semeru-runtimes:open-17-jre
platforms: linux/amd64,linux/arm64
mcVersion: 1.18.2
- variant: java17-alpine
baseImage: eclipse-temurin:17-jre-alpine
platforms: linux/amd64
mcVersion: 1.18.2
# JAVA 11:
- variant: java11
baseImage: adoptopenjdk:11-jre-hotspot
platforms: linux/amd64,linux/arm/v7,linux/arm64
mcVersion: 1.16.5
- variant: java11-jdk
baseImage: adoptopenjdk:11-jdk-hotspot
platforms: linux/amd64,linux/arm/v7,linux/arm64
mcVersion: 1.16.5
- variant: java11-openj9
baseImage: ibm-semeru-runtimes:open-11-jre
platforms: linux/amd64,linux/arm64
mcVersion: 1.16.5
# JAVA 8: NOTE: Unable to go past 8u312 because of Forge dependencies
- variant: java8
baseImage: openjdk:8-jre-alpine3.9
platforms: linux/amd64
mcVersion: 1.12.2
- variant: java8-graalvm-ce
baseImage: ghcr.io/graalvm/graalvm-ce:java8
platforms: linux/amd64
mcVersion: 1.12.2
- variant: java8-multiarch
baseImage: eclipse-temurin:8u312-b07-jre-focal
platforms: linux/amd64,linux/arm/v7,linux/arm64
mcVersion: 1.12.2
- variant: java8-jdk
baseImage: eclipse-temurin:8u312-b07-jdk-focal
platforms: linux/amd64,linux/arm64
mcVersion: 1.12.2
- variant: java8-openj9
baseImage: ibm-semeru-runtimes:open-8u312-b07-jre
platforms: linux/amd64,linux/arm64
mcVersion: 1.12.2
env:
IMAGE_TO_TEST: ${{ github.repository_owner }}/minecraft-server:test-${{ matrix.variant }}-${{ github.run_id }}
HAS_IMAGE_REPO_ACCESS: ${{ secrets.DOCKER_USER != '' && secrets.DOCKER_PASSWORD != '' }}
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2.4.0
uses: actions/checkout@v3
with:
# for build-files step
fetch-depth: 0
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
uses: docker/metadata-action@v4
with:
# NOTE for forks: if your Docker Hub organization doesn't match your Github repo's,
# then the use of ${{ github.repository_owner }} will need to be replaced.
images: |
itzg/minecraft-server
${{ github.repository_owner }}/minecraft-server
tags: |
type=ref,event=branch
type=ref,event=tag
type=ref,event=tag,enable=${{ matrix.variant == 'java17' }}
type=ref,event=tag,suffix=-${{ matrix.variant }}
type=raw,value=${{ matrix.variant }}
# NOTE this identifies which variant will be published as "latest", which isn't
# necessarily the newest version of Java
flavor: |
latest=${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
latest=${{ matrix.variant == 'java17' }}
labels: |
org.opencontainers.image.authors=Geoff Bourne <itzgeoff@gmail.com>
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1.2.0
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
uses: docker/setup-qemu-action@v2.1.0
- name: Build for test
uses: docker/build-push-action@v2.7.0
if: github.ref_name == 'master' || startsWith(github.ref_name, 'test/')
uses: docker/build-push-action@v3.3.0
with:
context: .
platforms: linux/amd64
tags: ${{ env.IMAGE_TO_TEST }}
# ensure latest base image is used
pull: true
# load into daemon for test usage in next step
load: true
push: false
cache-from: type=gha
build-args: |
BASE_IMAGE=${{ matrix.baseImage }}
cache-from: type=gha,scope=${{ matrix.variant }}
# no cache-to to avoid cross-cache update from next build step
- name: Run tests
# It is assumed that image variants are merged from master and tested there
if: github.ref_name == 'master' || startsWith(github.ref_name, 'test/')
env:
MINECRAFT_VERSION: ${{ matrix.mcVersion }}
VARIANT: ${{ matrix.variant }}
MODS_FORGEAPI_KEY: ${{ secrets.MODS_FORGEAPI_KEY }}
run: |
tests/test.sh
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2.7.0
- name: Login to DockerHub
uses: docker/login-action@v2
if: env.HAS_IMAGE_REPO_ACCESS
with:
context: .
platforms: linux/amd64
push: true
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v3.3.0
if: github.actor == github.repository_owner
with:
platforms: ${{ matrix.platforms }}
push: >
${{
github.ref_type == 'tag'
|| github.ref_name == 'master'
|| ( github.event_name == 'pull_request'
&& env.HAS_IMAGE_REPO_ACCESS
&& contains(github.event.pull_request.labels.*.name, 'ci/push-image')
)
}}
tags: ${{ steps.meta.outputs.tags }}
# ensure latest base image is used
pull: true
cache-from: type=gha
cache-to: type=gha,mode=max
labels: ${{ steps.meta.outputs.labels }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
# Since some consumers, like Watchtower are broken https://github.com/containrrr/watchtower/discussions/1529
# Also refer to https://github.com/docker/build-push-action/releases/tag/v3.3.0
provenance: false
build-args: |
BASE_IMAGE=${{ matrix.baseImage }}
BUILD_FILES_REV=${{ steps.build-files-rev.outputs.REV }}
cache-from: type=gha,scope=${{ matrix.variant }}
cache-to: type=gha,mode=max,scope=${{ matrix.variant }}

View File

@@ -1,43 +0,0 @@
name: ContinuousIntegration
on:
push:
branches:
- 'dev*'
- '!master'
- '!java*'
- '!multi*'
paths-ignore:
- "*.md"
- "docs/**"
- "examples/**"
env:
IMAGE_TO_TEST: ${{ secrets.IMAGE_ORG }}/minecraft-server:test-${{ github.repository_owner }}-${{ github.run_id }}
MODS_FORGEAPI_KEY: ${{ secrets.MODS_FORGEAPI_KEY }}
jobs:
test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2.4.0
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build
uses: docker/build-push-action@v2.7.0
with:
context: .
platforms: linux/amd64
tags: ${{ env.IMAGE_TO_TEST }}
load: true
cache-from: type=gha
- name: Run Setup Only Tests
run: sh tests/setuponlytests/test.sh
# - name: Run Full Minecraft Service Tests
# run: |
# tests/fulltests/test.sh

View File

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

View File

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

View File

@@ -1,17 +1,33 @@
name: Issue labels
on:
issues:
types: [labeled]
types: [labeled, reopened, closed, deleted]
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
DISCORD_WEBHOOK: ${{ secrets.DISCORD_ISSUES_WEBHOOK }}
jobs:
labelNotify:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: notify
if: github.event.label.name == 'enhancement' || github.event.label.name == 'bug'
- name: notify on label
if: >
github.event.label.name == 'enhancement'
|| github.event.label.name == 'bug'
|| github.event.label.name == 'help wanted'
|| github.event.label.name == 'priority/high'
|| github.event.label.name == 'question'
|| github.event.label.name == 'status/waiting on upstream'
uses: Ilshidur/action-discord@master
with:
args: "[${{ github.event.issue.title }}](<${{ github.event.issue.html_url }}>) added `${{ github.event.label.name }}` label"
args: "[${{ github.event.issue.title }} (#${{ github.event.issue.number }})](<${{ github.event.issue.html_url }}>) added `${{ github.event.label.name }}` label"
- name: notify on action change
if: >
github.event.action == 'closed'
|| github.event.action == 'reopened'
|| github.event.action == 'deleted'
uses: Ilshidur/action-discord@master
with:
args: "[${{ github.event.issue.title }} (#${{ github.event.issue.number }})](<${{ github.event.issue.html_url }}>) has been `${{ github.event.action }}` by `${{ github.event.sender.login }}`"

View File

@@ -1,97 +0,0 @@
name: Build and Publish
on:
push:
branches:
- java8
- openj9
- openj9-11
- adopt11
- test/alpine/*
tags:
- "[0-9]+.[0-9]+.[0-9]+-java8"
- "[0-9]+.[0-9]+.[0-9]+-openj9"
- "[0-9]+.[0-9]+.[0-9]+-openj9-11"
- "[0-9]+.[0-9]+.[0-9]+-openj9-nightly"
- "[0-9]+.[0-9]+.[0-9]+-adopt11"
env:
IMAGE_TO_TEST: itzg/minecraft-server:test-${{ github.repository_owner }}-${{ github.run_id }}
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2.4.0
- name: Prepare
id: prep
run: |
DOCKER_IMAGE=itzg/minecraft-server
VERSION=edge
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
fi
if [[ $GITHUB_REF == refs/heads/* ]]; then
VERSION=${GITHUB_REF#refs/heads/}
if [[ $VERSION == master ]]; then
VERSION=latest
fi
fi
TAGS="${DOCKER_IMAGE}:${VERSION//\//-}"
echo ::set-output name=tags::${TAGS}
echo ::set-output name=version::${VERSION//\//-}
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build for test
uses: docker/build-push-action@v2.7.0
if: github.ref_name == 'java8'
with:
context: .
platforms: linux/amd64
tags: ${{ env.IMAGE_TO_TEST }}
# ensure latest base image is used
pull: true
load: true
push: false
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Run tests
if: github.ref_name == 'java8'
run: |
tests/test.sh
env:
MINECRAFT_VERSION: 1.12.2
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2.7.0
with:
context: .
file: ./Dockerfile
# ensure latest base image is used
pull: true
# publish
push: true
# tags determined by prep step
tags: ${{ steps.prep.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max
labels: |
org.opencontainers.image.documentation=https://github.com/itzg/docker-minecraft-server
org.opencontainers.image.version=${{ steps.prep.outputs.version }}
org.opencontainers.image.source=https://github.com/itzg/docker-minecraft-server
org.opencontainers.image.revision=${{ github.sha }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}

View File

@@ -1,64 +0,0 @@
name: PullRequest
on:
pull_request:
branches: [ master ]
types: [assigned, opened, synchronize, labeled]
paths-ignore:
- "*.md"
- "docs/**"
- "examples/**"
env:
IMAGE_TO_TEST: itzg/minecraft-server:test-${{ github.repository_owner }}-${{ github.run_id }}
MODS_FORGEAPI_KEY: ${{ secrets.MODS_FORGEAPI_KEY }}
jobs:
test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2.4.0
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build
uses: docker/build-push-action@v2.7.0
with:
context: .
platforms: linux/amd64
tags: ${{ env.IMAGE_TO_TEST }}
load: true
cache-from: type=gha
- name: Run tests
run: |
tests/test.sh
- name: Gather Docker metadata
if: contains(github.event.pull_request.labels.*.name, 'ci/push-image')
id: meta
uses: docker/metadata-action@v3
with:
images: |
itzg/minecraft-server
- name: Login to DockerHub
if: contains(github.event.pull_request.labels.*.name, 'ci/push-image')
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Push
if: contains(github.event.pull_request.labels.*.name, 'ci/push-image')
uses: docker/build-push-action@v2.7.0
with:
context: .
platforms: linux/amd64,linux/arm/v7,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
pull: true
push: true
cache-from: type=gha
labels: ${{ steps.meta.outputs.labels }}

View File

@@ -12,7 +12,7 @@ jobs:
pull-requests: write
steps:
- name: Process Stale Issues
uses: actions/stale@v4.1.0
uses: actions/stale@v7
with:
stale-issue-label: status/stale
stale-pr-label: status/stale

69
.github/workflows/verify-pr.yml vendored Normal file
View File

@@ -0,0 +1,69 @@
name: Verify PR
on:
pull_request:
branches: [ master ]
types: [assigned, opened, synchronize, labeled]
paths-ignore:
- "*.md"
- "docs/**"
- "examples/**"
jobs:
build:
strategy:
fail-fast: false
matrix:
variant:
- java17
- java17-alpine
- java8-multiarch
include:
# JAVA 17:
- variant: java17
# jammy doesn't work until minecraft updates to https://github.com/netty/netty/issues/12343
baseImage: eclipse-temurin:17-jre-focal
platforms: linux/amd64
mcVersion: 1.18.2
- variant: java17-alpine
baseImage: eclipse-temurin:17-jre-alpine
platforms: linux/amd64
mcVersion: 1.18.2
- variant: java8-multiarch
baseImage: eclipse-temurin:8u312-b07-jre-focal
platforms: linux/amd64
mcVersion: 1.12.2
env:
IMAGE_TO_TEST: ${{ github.repository_owner }}/minecraft-server:test-${{ matrix.variant }}-${{ github.run_id }}
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
# for build-files step
fetch-depth: 0
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build for test
uses: docker/build-push-action@v3.3.0
with:
platforms: linux/amd64
tags: ${{ env.IMAGE_TO_TEST }}
# ensure latest base image is used
pull: true
# load into daemon for test usage in next step
load: true
push: false
build-args: |
BASE_IMAGE=${{ matrix.baseImage }}
cache-from: type=gha,scope=${{ matrix.variant }}
- name: Run tests
env:
MINECRAFT_VERSION: ${{ matrix.mcVersion }}
VARIANT: ${{ matrix.variant }}
MODS_FORGEAPI_KEY: ${{ secrets.MODS_FORGEAPI_KEY }}
DEBUG: ${{ runner.debug }}
run: |
tests/test.sh

1
.gitignore vendored
View File

@@ -3,3 +3,4 @@
/.idea/
*.iml
/gh-md-toc
personal-build-and-develop.*

View File

@@ -15,8 +15,35 @@ Individual scripts can be iteratively developed, debugged, and tested using the
First, build a baseline of the image to include the packages needed by existing or new scripts:
```shell script
docker build -t mc-dev .
PowerShell: (Example of building and testing ForgeAPI)
```powershell
$env:MODS_FORGEAPI_KEY='$2a$...'
$env:FOLDER_TO_TEST="forgeapimods_projectids"
$env:IMAGE_TO_TEST="mc-dev"
docker build -t $env:IMAGE_TO_TEST .
pushd "tests/setuponlytests/$env:FOLDER_TO_TEST/"
docker-compose run mc
docker-compose down -v --remove-orphans
popd
```
PowerShell: Building different images of Java for testing
```powershell
$env:BASE_IMAGE='eclipse-temurin:8u312-b07-jre'
$env:IMAGE_TO_TEST="mc-dev"
docker build --build-arg BASE_IMAGE=$env:BASE_IMAGE -t $env:IMAGE_TO_TEST .
```
Bash: (Example of building and testing ForgeAPI)
```bash
export MODS_FORGEAPI_KEY='$2a$...'
export FOLDER_TO_TEST="forgeapimods_file"
export IMAGE_TO_TEST="mc-dev"
docker build -t $IMAGE_TO_TEST .
pushd tests/setuponlytests/$FOLDER_TO_TEST/
docker-compose run mc
docker-compose down -v --remove-orphans
popd
```
Using the baseline image, an interactive container can be started to iteratively run the scripts to be developed. By attaching the current workspace directory, you can use the local editor of your choice to iteratively modify scripts while using the container to run them.
@@ -51,7 +78,7 @@ In the cloned copy of [`mc-image-helper`](https://github.com/itzg/mc-image-helpe
Assuming [http-server](https://www.npmjs.com/package/http-server) is installed globally, start a static web server using:
```shell
http-server ./build/distributions -p 0
http-server ./build/distributions -p 8080
```
Note the port that was selected by http-server and pass the build arguments, such as:
@@ -61,32 +88,7 @@ Note the port that was selected by http-server and pass the build arguments, suc
--build-arg MC_HELPER_BASE_URL=http://host.docker.internal:8080
```
Now the image can be built like normal and it will install mc-image-helper from the locally built copy.
## Multi-base-image variants
Several base-image variants are maintained in order to offer choices in JDK provider and version. The variants are maintained in their respective branches:
- openj9
- openj9-nightly
- adopt11
- adopt13
- multiarch
The [docker-versions-create.sh](docker-versions-create.sh) script is configured with the branches to maintain and is used to merge changes from the master branch into the mulit-base variant branches. The script also manages git tagging the master branch along with the merged branches. So a typical use of the script would be like:
```shell script
./docker-versions-create.sh -s -t 1.2.0
```
> Most often the major version will be bumped unless a bug or hotfix needs to be published in which case the patch version should be incremented.
> The build and publishing of those branches and their tags is currently performed within Docker Hub.
## multiarch support
The [multiarch branch](https://github.com/itzg/docker-minecraft-server/tree/multiarch) supports running the image on amd64, arm64, and armv7 (aka RaspberryPi). Unlike the mainline branches, it is based on Ubuntu 18.04 since the openjdk package provided by Ubuntu includes full JIT support on all of the processor types.
The multiarch images are built and published by [a Github action](https://github.com/itzg/docker-minecraft-server/actions?query=workflow%3A%22Build+and+publish+multiarch%22), which [is configured in that branch](https://github.com/itzg/docker-minecraft-server/blob/multiarch/.github/workflows/build-multiarch.yml).
Now the image can be built like normal, and it will install mc-image-helper from the locally built copy.
## Generating release notes
@@ -95,25 +97,3 @@ The following git command can be used to provide the bulk of release notes conte
```shell script
git log --invert-grep --grep "^ci:" --grep "^misc:" --grep "^docs:" --pretty="* %s" 1.1.0..1.2.0
```
## Tracking changes from master without content
The following script uses the [ours](https://git-scm.com/docs/merge-strategies#Documentation/merge-strategies.txt-ours) merging strategy to track the history from master into the other branches without actually bringing the changes over. It is useful when a change is specific to master only, such as bumping the base Java version for the `latest` image tag.
```shell
branches=(
java8
java8-multiarch
java8-openj9
java11
java11-openj9
java16
java16-openj9
java17
)
for b in "${branches[@]}"; do
git checkout "$b"
git merge -s ours -m "Track latest from master" master
git push origin
done
```

View File

@@ -1,94 +1,74 @@
FROM adoptopenjdk:8-jdk-openj9
LABEL org.opencontainers.image.authors="Geoff Bourne <itzgeoff@gmail.com>"
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive \
apt-get install -y \
imagemagick \
file \
gosu \
sudo \
net-tools \
iputils-ping \
curl \
git \
jq \
dos2unix \
mysql-client \
tzdata \
rsync \
nano \
unzip \
knockd \
ttf-dejavu \
&& apt-get clean
RUN addgroup --gid 1000 minecraft \
&& adduser --system --shell /bin/false --uid 1000 --ingroup minecraft --home /data minecraft
COPY --chmod=644 files/sudoers* /etc/sudoers.d
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
ARG TARGETARCH
ARG TARGETVARIANT
ARG EASY_ADD_VER=0.7.1
ADD https://github.com/itzg/easy-add/releases/download/${EASY_ADD_VER}/easy-add_${TARGETOS}_${TARGETARCH}${TARGETVARIANT} /usr/bin/easy-add
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.5.1 --var app=rcon-cli --file {{.app}} \
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=0.10.3 --var app=mc-monitor --file {{.app}} \
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=1.8.0 --var app=mc-server-runner --file {{.app}} \
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=0.1.1 --var app=maven-metadata-release --file {{.app}} \
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
ARG MC_HELPER_VERSION=1.16.0
ARG MC_HELPER_BASE_URL=https://github.com/itzg/mc-image-helper/releases/download/v${MC_HELPER_VERSION}
RUN curl -fsSL ${MC_HELPER_BASE_URL}/mc-image-helper-${MC_HELPER_VERSION}.tgz \
| tar -C /usr/share -zxf - \
&& ln -s /usr/share/mc-image-helper-${MC_HELPER_VERSION}/bin/mc-image-helper /usr/bin
VOLUME ["/data"]
WORKDIR /data
STOPSIGNAL SIGTERM
ENV UID=1000 GID=1000 \
MEMORY="1G" \
TYPE=VANILLA VERSION=LATEST \
ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \
ENABLE_AUTOPAUSE=false AUTOPAUSE_TIMEOUT_EST=3600 AUTOPAUSE_TIMEOUT_KN=120 AUTOPAUSE_TIMEOUT_INIT=600 \
AUTOPAUSE_PERIOD=10 AUTOPAUSE_KNOCK_INTERFACE=eth0 \
ENABLE_AUTOSTOP=false AUTOSTOP_TIMEOUT_EST=3600 AUTOSTOP_TIMEOUT_INIT=1800 AUTOSTOP_PERIOD=10
COPY --chmod=755 scripts/start* /
COPY --chmod=755 bin/ /usr/local/bin/
COPY --chmod=755 bin/mc-health /health.sh
COPY --chmod=644 files/server.properties /tmp/server.properties
COPY --chmod=644 files/log4j2.xml /tmp/log4j2.xml
COPY --chmod=755 files/autopause /autopause
COPY --chmod=755 files/autostop /autostop
RUN dos2unix /start* /autopause/* /autostop/*
ENTRYPOINT [ "/start" ]
HEALTHCHECK --start-period=1m CMD mc-health
# syntax = docker/dockerfile:1.3
ARG BASE_IMAGE=eclipse-temurin:17-jre-focal
FROM ${BASE_IMAGE}
# CI system should set this to a hash or git revision of the build directory and it's contents to
# ensure consistent cache updates.
ARG BUILD_FILES_REV=1
RUN --mount=target=/build,source=build \
REV=${BUILD_FILES_REV} /build/run.sh install-packages
RUN --mount=target=/build,source=build \
REV=${BUILD_FILES_REV} /build/run.sh setup-user
COPY --chmod=644 files/sudoers* /etc/sudoers.d
EXPOSE 25565 25575
# hook into docker BuildKit --platform support
# see https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
ARG TARGETOS
ARG TARGETARCH
ARG TARGETVARIANT
ARG EASY_ADD_VER=0.7.1
ADD https://github.com/itzg/easy-add/releases/download/${EASY_ADD_VER}/easy-add_${TARGETOS}_${TARGETARCH}${TARGETVARIANT} /usr/bin/easy-add
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.6.1 --var app=rcon-cli --file {{.app}} \
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=0.11.0 --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.8.3 --var app=mc-server-runner --file {{.app}} \
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=0.1.1 --var app=maven-metadata-release --file {{.app}} \
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
ARG MC_HELPER_VERSION=1.24.23
ARG MC_HELPER_BASE_URL=https://github.com/itzg/mc-image-helper/releases/download/${MC_HELPER_VERSION}
RUN curl -fsSL ${MC_HELPER_BASE_URL}/mc-image-helper-${MC_HELPER_VERSION}.tgz \
| tar -C /usr/share -zxf - \
&& ln -s /usr/share/mc-image-helper-${MC_HELPER_VERSION}/bin/mc-image-helper /usr/bin
VOLUME ["/data"]
WORKDIR /data
STOPSIGNAL SIGTERM
# End user MUST set EULA and change RCON_PASSWORD
ENV TYPE=VANILLA VERSION=LATEST EULA="" UID=1000 GID=1000 RCON_PASSWORD=minecraft
COPY --chmod=755 scripts/start* /
COPY --chmod=755 bin/ /usr/local/bin/
COPY --chmod=755 bin/mc-health /health.sh
COPY --chmod=644 files/log4j2.xml /image/log4j2.xml
# By default this file gets retrieved from repo, but bundle in image as potential fallback
COPY --chmod=644 files/cf-exclude-include.json /image/cf-exclude-include.json
COPY --chmod=755 files/auto /auto
RUN dos2unix /start* /auto/*
ENTRYPOINT [ "/start" ]
HEALTHCHECK --start-period=1m --interval=5s --retries=24 CMD mc-health

798
README.md

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
#!/bin/bash
. "/start-utils"
: "${CONSOLE_IN_NAMED_PIPE:=/tmp/minecraft-console-in}"
if [ $# = 0 ]; then
@@ -12,4 +12,12 @@ if [ ! -p "${CONSOLE_IN_NAMED_PIPE}" ]; then
exit 1
fi
gosu minecraft bash -c "echo $* > '${CONSOLE_IN_NAMED_PIPE:-/tmp/minecraft-console-in}'"
if [ "$(id -u)" = 0 ]; then
if [[ $(getDistro) == alpine ]]; then
exec su-exec minecraft bash -c "echo $* > '${CONSOLE_IN_NAMED_PIPE:-/tmp/minecraft-console-in}'"
else
exec gosu minecraft bash -c "echo $* > '${CONSOLE_IN_NAMED_PIPE:-/tmp/minecraft-console-in}'"
fi
else
echo "$@" >"${CONSOLE_IN_NAMED_PIPE:-/tmp/minecraft-console-in}"
fi

101
bin/rcon-cmds-daemon.sh Normal file
View File

@@ -0,0 +1,101 @@
#!/bin/bash
: "${RCON_CMDS_STARTUP:=}"
: "${RCON_CMDS_ON_CONNECT:=}"
: "${RCON_CMDS_ON_DISCONNECT:=}"
: "${RCON_CMDS_FIRST_CONNECT:=}"
: "${RCON_CMDS_LAST_DISCONNECT:=}"
: "${RCON_CMDS_PERIOD:=10}"
# needed for the clients connected function residing in autopause
# shellcheck source=../auto/autopause-fcns.sh
. /auto/autopause-fcns.sh
# shellcheck source=start-utils
. ${SCRIPTS:-/}start-utils
run_command(){
rcon_cmd="$1"
logRcon "running - $rcon_cmd"
output=$(rcon-cli "$rcon_cmd")
logRcon "$output"
}
# wait for java process to be started
while :
do
if java_process_exists ; then
break
fi
sleep 0.1
done
CLIENTCONNECTIONS=0
STATE=INIT
while :
do
case X$STATE in
XINIT)
# Server startup
if mc_server_listening ; then
logRcon "MCServer is listening, running startup"
if [[ "$RCON_CMDS_STARTUP" ]]; then
while read -r cmd; do
run_command "$cmd"
done <<< "$RCON_CMDS_STARTUP"
fi
if
[[ -z "$RCON_CMDS_ON_CONNECT" ]] &&
[[ -z "$RCON_CMDS_ON_DISCONNECT" ]] &&
[[ -z "$RCON_CMDS_FIRST_CONNECT" ]] &&
[[ -z "$RCON_CMDS_LAST_DISCONNECT" ]]
then
logRcon "No addition rcon commands are given, stopping rcon cmd service"
exit 0
fi
STATE=II
fi
;;
XII)
CURR_CLIENTCONNECTIONS=$(java_clients_connections)
# First client connection
# Setting priority run order: on first client connection is usually to STOP maintence, aka DO THIS FIRST
if (( CURR_CLIENTCONNECTIONS > 0 )) && (( CLIENTCONNECTIONS == 0 )) && [[ "$RCON_CMDS_FIRST_CONNECT" ]]; then
logRcon "First Clients has Connected, running first connect cmds"
while read -r cmd; do
run_command "$cmd"
done <<< "$RCON_CMDS_FIRST_CONNECT"
fi
# When a client joins
if (( CURR_CLIENTCONNECTIONS > CLIENTCONNECTIONS )) && [[ "$RCON_CMDS_ON_CONNECT" ]]; then
logRcon "Clients have Connected, running connect cmds"
while read -r cmd; do
run_command "$cmd"
done <<< "$RCON_CMDS_ON_CONNECT"
# When a client leaves
elif (( CURR_CLIENTCONNECTIONS < CLIENTCONNECTIONS )) && [[ "$RCON_CMDS_ON_DISCONNECT" ]]; then
logRcon "Clients have Disconnected, running disconnect cmds"
while read -r cmd; do
run_command "$cmd"
done <<< "$RCON_CMDS_ON_DISCONNECT"
fi
# Last client connection
# Setting priority run order: on last client connection is usually to START maintence, aka DO THIS LAST
if (( CURR_CLIENTCONNECTIONS == 0 )) && (( CLIENTCONNECTIONS > 0 )) && [[ "$RCON_CMDS_LAST_DISCONNECT" ]]; then
logRcon "ALL Clients have Disconnected, running last disconnect cmds"
while read -r cmd; do
run_command "$cmd"
done <<< "$RCON_CMDS_LAST_DISCONNECT"
fi
CLIENTCONNECTIONS=$CURR_CLIENTCONNECTIONS
;;
*)
logRcon "Error: invalid state: $STATE"
;;
esac
sleep "$RCON_CMDS_PERIOD"
done

View File

@@ -0,0 +1,27 @@
#!/bin/sh
set -e
apk add --no-cache -U \
openssl \
imagemagick \
file \
lsof \
su-exec \
coreutils \
findutils \
procps \
shadow \
bash \
curl iputils \
git \
jq \
mysql-client \
tzdata \
rsync \
nano \
sudo \
knock \
tar \
zstd \
nfs-utils

6
build/alpine/setup-user.sh Executable file
View File

@@ -0,0 +1,6 @@
#!/bin/sh
set -e
addgroup -g 1000 minecraft
adduser -Ss /bin/false -u 1000 -G minecraft -h /home/minecraft minecraft

12
build/ol/install-gosu.sh Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/bash
if [[ $(uname -m) == "aarch64" ]]; then
curl -sL -o /bin/gosu https://github.com/tianon/gosu/releases/download/1.14/gosu-arm64
chmod +x /bin/gosu
elif [[ $(uname -m) == "x86_64" ]]; then
curl -sL -o /bin/gosu https://github.com/tianon/gosu/releases/download/1.14/gosu-amd64
chmod +x /bin/gosu
else
echo "Not supported!"
exit 1
fi

38
build/ol/install-packages.sh Executable file
View File

@@ -0,0 +1,38 @@
#!/bin/bash
set -e
microdnf install dnf -y
dnf install 'dnf-command(config-manager)' -y
dnf config-manager --set-enabled ol8_codeready_builder
tee /etc/yum.repos.d/ol8-epel.repo<<EOF
[ol8_developer_EPEL]
name= Oracle Linux \$releasever EPEL (\$basearch)
baseurl=https://yum.oracle.com/repo/OracleLinux/OL8/developer/EPEL/\$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1
EOF
dnf update -y
dnf install -y ImageMagick \
file \
sudo \
net-tools \
iputils \
curl \
git \
jq \
dos2unix \
mysql \
procps-ng \
tzdata \
rsync \
nano \
unzip \
zstd \
lbzip2 \
knock
bash /build/ol/install-gosu.sh

2
build/ol/setup-user.sh Executable file
View File

@@ -0,0 +1,2 @@
groupadd --gid 1000 minecraft
useradd --system --shell /bin/false --uid 1000 -g minecraft --home /data minecraft

7
build/run.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/sh
set -e
distro=$(cat /etc/os-release | grep -E "^ID=" | cut -d= -f2 | sed -e 's/"//g')
"$(dirname "$0")/${distro}/$1".sh

View File

@@ -0,0 +1,29 @@
#!/bin/sh
set -e
apt-get update
DEBIAN_FRONTEND=noninteractive \
apt-get install -y \
imagemagick \
file \
gosu \
sudo \
net-tools \
iputils-ping \
curl \
git \
jq \
dos2unix \
mysql-client \
tzdata \
rsync \
nano \
unzip \
zstd \
lbzip2 \
knockd \
nfs-common
apt-get clean

6
build/ubuntu/setup-user.sh Executable file
View File

@@ -0,0 +1,6 @@
#!/bin/sh
set -e
addgroup --gid 1000 minecraft
adduser --system --shell /bin/false --uid 1000 --ingroup minecraft --home /data minecraft

16
docker-compose.yml Normal file
View File

@@ -0,0 +1,16 @@
version: "3.8"
services:
mc:
image: itzg/minecraft-server
environment:
EULA: "true"
ports:
- "25565:25565"
volumes:
- data:/data
stdin_open: true
tty: true
restart: unless-stopped
volumes:
data: {}

View File

@@ -1,157 +0,0 @@
#!/bin/bash
#set -x
# Use this variable to indicate a list of branches that docker hub is watching
branches_list=(
'java8'
'java8-multiarch'
'java8-openj9'
'java11'
'java11-openj9'
'java17'
'java17-openj9'
)
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
if [[ $tag ]]; then
if [ -f "$HOME/.github.env" ]; then
source "$HOME/.github.env"
if [[ $GITHUB_TOKEN ]]
then
auth=(-u ":$GITHUB_TOKEN")
base=https://api.github.com
: "${owner:=itzg}"
: "${repo:=docker-minecraft-server}"
read -r -d '' releaseBody << EOF
{
"tag_name": "$tag",
"name": "$tag",
"generate_release_notes": true
}
EOF
if ! curl "${auth[@]}" -H "Accept: application/vnd.github.v3+json" \
"${base}/repos/${owner}/${repo}/releases" -d "$releaseBody"; then
echo "ERROR failed to create github release $tag"
exit 1
fi
fi
fi
fi

1
docs/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
/.*.bkp

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

BIN
docs/cf-file-id.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

BIN
docs/cf-project-id.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

BIN
docs/cf-slug.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 72 KiB

3
examples/.gitignore vendored
View File

@@ -1 +1,2 @@
/data/
data/
modpacks/

View File

@@ -0,0 +1,18 @@
version: "3.8"
services:
mc:
image: itzg/minecraft-server
ports:
- "25565:25565"
environment:
EULA: "true"
TYPE: AUTO_CURSEFORGE
CF_PAGE_URL: https://www.curseforge.com/minecraft/modpacks/all-the-mods-8
CF_FILENAME_MATCHER: "1.0.6"
MEMORY: 4G
volumes:
- mc-data:/data
volumes:
mc-data: {}

View File

@@ -0,0 +1,150 @@
version: '3.8'
####################################################################
# CURSEFORGE #
# #
# Date: 20221005 #
# #
# Mod: All The Mods 7 0.4.32 #
# #
# Notes: Verify that there is no EULA file in the modpack.zip #
# if you do not delete it the EULA flag below will be #
# overwritten when the modpack is copied. #
# #
####################################################################
services:
####################################################################
# Service Name #
# #
# Define Service Name here. If using RCON this name will be #
# referenced again as RWA_RCON_HOST below. #
# #
# Example: 'name:' or 'mc_atm6:' #
####################################################################
mc_atm7:
####################################################################
# Image & Container Name #
# #
# Specify Image Name and Java Version. The 'image' will always be #
# 'itzg/minecraft-server' however the tag added to the end is #
# where you can specify the java version or container architecture.#
# See readme.md for a full list. #
# #
# 'container_name:' This can be anything you like. This is the name#
# that will show when you run 'docker ps' commands. #
####################################################################
image: itzg/minecraft-server
container_name: mc_atm7
####################################################################
# Server Ports #
# #
# Specify external port. #
####################################################################
ports:
- 25565:25565
####################################################################
# Automatic Server Restart #
# #
# Define a restart policy here. #
# - 'no' = Do not restart. #
# - 'on-failure' = Restart if container exits because an error. #
# - 'always' = Regardless of stop reason. #
# - 'unless-stopped' = Similar to always except if stopped. #
####################################################################
restart: unless-stopped
####################################################################
# Volume and Folder Access #
# #
# This section defines what folders and volumes you want to give #
# this container access to. It is recommended to leaves these set #
# to the default values unless you know what you are doing. #
# #
# Place your mod zip file in a folder called 'modpacks' in the #
# same directory you place this docker-compose file. #
# #
# Specify the data volume name or directory here as well. #
# In this example the volume name is 'data'. When docker creates #
# the volume it will add what ever name you give it here to the #
# end of the container name specified above. In this example it #
# would be named 'mc_atm6_data'. If you change this be sure to #
# update the volume name at the bottom of this config. #
####################################################################
volumes:
- ./modpacks:/modpacks:ro
- data:/data
####################################################################
# EULA #
# #
# Accept EULA by setting to "true" #
####################################################################
environment:
EULA: "true"
####################################################################
# CURSEFORGE INSTALL #
# #
# Sets install type to FORGE and specifys the zip folder name #
# and location of your mod pack. #
# #
# TYPE: Defines the install type as CURSEFORGE #
# #
# CF_SERVER_MOD: Define where the modpack.zip is located. #
# #
# Place your mod zip file in a folder called 'modpacks' in the #
# same directory you place this docker-compose file. #
####################################################################
TYPE: CURSEFORGE
CF_SERVER_MOD: /modpacks/ATM7-0.4.32-server.zip
####################################################################
# Server Memory #
# #
# Set Maximum amount of memory allowed for your server. #
####################################################################
MEMORY: "8G"
####################################################################
# Logging Options #
# #
# Set to "true" to delete old logs #
####################################################################
ENABLE_ROLLING_LOGS: "true"
####################################################################
# Server Timezone #
# #
# Specify server Timezone #
####################################################################
TZ: "America/New_York"
####################################################################
# Minecraft Game Options #
# #
# List any game options you want to define here. A full list can #
# be found on the readme.md page on github. #
####################################################################
OVERRIDE_SERVER_PROPERTIES: "true"
DIFFICULTY: "easy"
MAX_TICK_TIME: "-1"
ALLOW_FLIGHT: "true"
OPS: ""
VIEW_DISTANCE: 10
MAX_PLAYERS: 10
PVP: "false"
LEVEL_TYPE: "biomesoplenty"
MOTD: "Welcome Home"
####################################################################
# Volumes #
# #
# Define data volume name here. You should leave this set to the #
# default. #
####################################################################
volumes:
data:

View File

@@ -9,7 +9,9 @@ services:
environment:
EULA: "true"
TYPE: CURSEFORGE
CF_SERVER_MOD: https://media.forgecdn.net/files/3482/169/Valhelsia+3-3.4.4-SERVER.zip
CF_SERVER_MOD: /modpacks/SIMPLE-SERVER-FILES-0.3.20.zip
# CF_SERVER_MOD: /modpacks/createlive3serverfiles+1.4.2.zip
# CF_SERVER_MOD: /modpacks/Valhelsia+3-3.5.1-SERVER.zip
# CF_SERVER_MOD: https://media.forgecdn.net/files/3012/800/SkyFactory-4_Server_4.2.2.zip
# CF_SERVER_MOD: /modpacks/${MODPACK:-SkyFactory_4_Server_4.1.0.zip}
ports:

View File

@@ -0,0 +1,161 @@
version: '3.8'
####################################################################
# FORGE_GENERIC_PACK #
# #
# Date: 20221005 #
# #
# Mod: Better Minecraft Plus v40 #
# #
# Game Version: 1.16.5 #
# #
# Notes: Verify that there is no EULA file in the modpack.zip #
# if you do not delete it the EULA flag below will be #
# overwritten when the modpack is copied. #
# #
####################################################################
services:
####################################################################
# Service Name #
# #
# Define Service Name here. If using RCON this name will be #
# referenced again as RWA_RCON_HOST below. #
# #
# Example: 'name:' or 'mc_atm6:' #
####################################################################
mc_bmp:
####################################################################
# Image & Container Name #
# #
# Specify Image Name and Java Version. The 'image' will always be #
# 'itzg/minecraft-server' however the tag added to the end is #
# where you can specify the java version or container architecture.#
# See readme.md for a full list. #
# #
# 'container_name:' This can be anything you like. This is the name#
# that will show when you run 'docker ps' commands. #
####################################################################
image: itzg/minecraft-server:java8
container_name: mc_bmp
####################################################################
# Server Ports #
# #
# Specify external port. #
####################################################################
ports:
- 25565:25565
####################################################################
# Automatic Server Restart #
# #
# Define a restart policy here. #
# - 'no' = Do not restart. #
# - 'on-failure' = Restart if container exits because an error. #
# - 'always' = Regardless of stop reason. #
# - 'unless-stopped' = Similar to always except if stopped. #
####################################################################
restart: unless-stopped
####################################################################
# Volume and Folder Access #
# #
# This section defines what folders and volumes you want to give #
# this container access to. It is recommended to leaves these set #
# to the default values unless you know what you are doing. #
# #
# Place your mod zip file in a folder called 'modpacks' in the #
# same directory you place this docker-compose file. #
# #
# Specify the data volume name or directory here as well. #
# In this example the volume name is 'data'. When docker creates #
# the volume it will add what ever name you give it here to the #
# end of the container name specified above. In this example it #
# would be named 'mc_atm6_data'. If you change this be sure to #
# update the volume name at the bottom of this config. #
####################################################################
volumes:
- ./modpacks:/modpacks:ro
- data:/data
####################################################################
# EULA #
# #
# Accept EULA by setting to "true" #
####################################################################
environment:
EULA: "true"
####################################################################
# FORGE INSTALL #
# #
# Sets install type to FORGE and specifys the zip folder name #
# and location of your mod pack. #
# #
# TYPE: Defines the install type as FORGE #
# #
# VERSION: Defines the version of MC the modpack is based on. #
# #
# FORGE_VERSION: Defines the version of FORGE the modpack uses. #
# This can usually be found in the modpack.zip as #
# installer.jar #
# #
# GENERIC_PACK: Define where the modpack.zip is located. #
# #
# Place your mod zip file in a folder called 'modpacks' in the #
# same directory you place this docker-compose file. #
####################################################################
TYPE: FORGE
VERSION: 1.16.5
FORGE_VERSION: 36.2.39
GENERIC_PACK: /modpacks/Better+MC+Server+Pack+PLUS+1.16.5+v40+HF.zip
####################################################################
# Server Memory #
# #
# Set Maximum amount of memory allowed for your server. #
####################################################################
MEMORY: "8G"
####################################################################
# Logging Options #
# #
# Set to "true" to delete old logs #
####################################################################
ENABLE_ROLLING_LOGS: "true"
####################################################################
# Server Timezone #
# #
# Specify server Timezone #
####################################################################
TZ: "America/New_York"
####################################################################
# Minecraft Game Options #
# #
# List any game options you want to define here. A full list can #
# be found on the readme.md page on github. #
####################################################################
OVERRIDE_SERVER_PROPERTIES: "true"
DIFFICULTY: "easy"
MAX_TICK_TIME: "-1"
VIEW_DISTANCE: "6"
ALLOW_FLIGHT: "true"
OPS: ""
VIEW_DISTANCE: 10
MAX_PLAYERS: 10
PVP: "false"
LEVEL_TYPE: "biomesoplenty"
MOTD: "Welcome Home"
####################################################################
# Volumes #
# #
# Define data volume name here. You should leave this set to the #
# default. #
####################################################################
volumes:
data:

View File

@@ -0,0 +1,159 @@
version: '3.8'
####################################################################
# FORGE GENERIC_PACK #
# #
# Date: 20220828 #
# #
# Mod: TNP Limitless 5 v2.19.0 #
# #
# Notes: Verify that there is no EULA file in the modpack.zip #
# if you do not delete it the EULA flag below will be #
# overwritten when the modpack is copied and the server #
# will not start. #
# #
####################################################################
services:
####################################################################
# Service Name #
# #
# Define Service Name here. If using RCON this name will be #
# referenced again as RWA_RCON_HOST below. #
# #
# Example: 'name:' or 'mc_atm6:' #
####################################################################
mc_tnp5:
####################################################################
# Image & Container Name #
# #
# Specify Image Name and Java Version. The 'image' will always be #
# 'itzg/minecraft-server' however the tag added to the end is #
# where you can specify the java version or container architecture.#
# See readme.md for a full list. #
# #
# 'container_name:' This can be anything you like. This is the name#
# that will show when you run 'docker ps' commands. #
####################################################################
image: itzg/minecraft-server
container_name: mc_tnp5
####################################################################
# Server Ports #
# #
# Specify external port. #
####################################################################
ports:
- 25565:25565
####################################################################
# Automatic Server Restart #
# #
# Define a restart policy here. #
# - 'no' = Do not restart. #
# - 'on-failure' = Restart if container exits because an error. #
# - 'always' = Regardless of stop reason. #
# - 'unless-stopped' = Similar to always except if stopped. #
####################################################################
restart: unless-stopped
####################################################################
# Volume and Folder Access #
# #
# This section defines what folders and volumes you want to give #
# this container access to. It is recommended to leaves these set #
# to the default values unless you know what you are doing. #
# #
# Place your mod zip file in a folder called 'modpacks' in the #
# same directory you place this docker-compose file. #
# #
# Specify the data volume name or directory here as well. #
# In this example the volume name is 'data'. When docker creates #
# the volume it will add what ever name you give it here to the #
# end of the container name specified above. In this example it #
# would be named 'mc_atm6_data'. If you change this be sure to #
# update the volume name at the bottom of this config. #
####################################################################
volumes:
- ./modpacks:/modpacks:ro
- data:/data
####################################################################
# EULA #
# #
# Accept EULA by setting to "true" #
####################################################################
environment:
EULA: "true"
####################################################################
# FORGE INSTALL #
# #
# Sets install type to FORGE and specifys the zip folder name #
# and location of your mod pack. #
# #
# TYPE: Defines the install type as FORGE #
# #
# VERSION: Defines the version of MC the modpack is based on. #
# #
# FORGE_VERSION: Defines the version of FORGE the modpack uses. #
# This can usually be found in the modpack.zip as #
# installer.jar #
# #
# GENERIC_PACK: Define where the modpack.zip is located. #
# #
# Place your mod zip file in a folder called 'modpacks' in the #
# same directory you place this docker-compose file. #
####################################################################
TYPE: FORGE
VERSION: 1.18.2
FORGE_VERSION: 40.1.73
GENERIC_PACK: /modpacks/tnp5.zip
####################################################################
# Server Memory #
# #
# Set Maximum amount of memory allowed for your server. #
####################################################################
MEMORY: "8G"
####################################################################
# Logging Options #
# #
# Set to "true" to delete old logs #
####################################################################
ENABLE_ROLLING_LOGS: "true"
####################################################################
# Server Timezone #
# #
# Specify server Timezone #
####################################################################
TZ: "America/New_York"
####################################################################
# Minecraft Game Options #
# #
# List any game options you want to define here. A full list can #
# be found on the readme.md page on github. #
####################################################################
OVERRIDE_SERVER_PROPERTIES: "true"
DIFFICULTY: "easy"
MAX_TICK_TIME: "-1"
VIEW_DISTANCE: "6"
ALLOW_FLIGHT: "true"
OPS: ""
MAX_PLAYERS: 10
PVP: "false"
LEVEL_TYPE: "biomesoplenty"
MOTD: "Welcome Home"
####################################################################
# Volumes #
# #
# Define data volume name here. You should leave this set to the #
# default. #
####################################################################
volumes:
data:

View File

@@ -11,7 +11,7 @@ services:
TYPE: FORGE
DEBUG: "${DEBUG:-false}"
VERSION: ${VERSION:-1.17.1}
FORGEVERSION: ${FORGEVERSION:-37.0.90}
FORGE_VERSION: ${FORGE_VERSION:-37.0.90}
GENERIC_PACK: /modpacks/${MODPACK:-Server-Files-0.0.21.zip}
REMOVE_OLD_MODS: "${REMOVE_OLD_MODS:-false}"
ports:

View File

@@ -0,0 +1,17 @@
version: "3.8"
services:
mc:
image: itzg/minecraft-server:java8
tty: true
stdin_open: true
ports:
- "25565:25565"
environment:
EULA: "TRUE"
TYPE: MAGMA
VERSION: 1.16.5
volumes:
- data:/data
volumes:
data: {}

View File

@@ -0,0 +1,18 @@
version: "3.8"
services:
mc:
image: itzg/minecraft-server
tty: true
stdin_open: true
ports:
- "25565:25565"
environment:
EULA: "TRUE"
TYPE: FABRIC
MODRINTH_PROJECTS: fallingtree
volumes:
- data:/data
volumes:
data: {}

View File

@@ -0,0 +1,21 @@
version: '3.8'
services:
minecraft:
image: itzg/minecraft-server
volumes:
- data:/data
- ./mods:/mods
ports:
- "25565:25565"
environment:
EULA: "true"
TYPE: "FORGE"
VERSION: "1.19.2"
DEBUG: "true"
SETUP_ONLY: "true"
tty: True
stdin_open: True
volumes:
data: {}

View File

@@ -5,15 +5,13 @@ services:
container_name: paper
environment:
EULA: "true"
ENABLE_RCON: "true"
TYPE: PAPER
VIEW_DISTANCE: 10
MEMORY: 2G
CONSOLE: "false"
ports:
- 25565:25565
- "25565:25565"
volumes:
- mc-paper:/data
restart: unless-stopped
volumes:
mc-paper:
mc-paper: {}

View File

@@ -0,0 +1,36 @@
version: '3'
services:
minecraft:
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
ports:
- "25565:25565"
volumes:
- "mc:/data"
environment:
EULA: "TRUE"
TYPE: FABRIC
MODS_FORGEAPI_PROJECTIDS: 433175
MODS_FORGEAPI_KEY: ${MODS_FORGEAPI_KEY}
MODS_FORGEAPI_DOWNLOAD_DEPENDENCIES: "TRUE"
REMOVE_OLD_FORGEAPI_MODS: "TRUE"
# YAML Heredoc, be sure to use '|-' this will remove the first newline and final new line.
# This is versus '|' that will leaving with two empty strings at top and bottom.
RCON_CMDS_STARTUP: |-
/gamerule doFireTick false
/team add New
/team add Old
/chunky radius 1000
/chunky start
RCON_CMDS_ON_CONNECT: |-
/team join New @a[team=]
/give @a[team=New] birch_boat
/team join Old @a[team=New]
RCON_CMDS_FIRST_CONNECT: |-
/chunky pause
RCON_CMDS_LAST_DISCONNECT: |-
/kill @e[type=minecraft:boat]
/chunky continue
restart: unless-stopped
volumes:
mc: {}

View File

@@ -1,27 +1,27 @@
version: '3.8'
services:
rlcraft:
mc:
image: itzg/minecraft-server:java8
container_name: rlcraft
volumes:
- rlcraft-modpack:/modpacks:ro
- rlcraft-data:/data
- data:/data
- ./modpacks:/modpacks:ro
environment:
EULA: "true"
TYPE: "FORGE"
VERSION: "1.12.2"
FORGEVERSION: "14.23.5.2855"
FORGE_VERSION: "14.23.5.2860"
OVERRIDE_SERVER_PROPERTIES: "true"
DIFFICULTY: "hard"
MAX_TICK_TIME: "-1"
VIEW_DISTANCE: "6"
ALLOW_FLIGHT: "true"
ENABLE_COMMAND_BLOCK: "true"
VIEW_DISTANCE: "10"
MEMORY: "4G"
GENERIC_PACK: "/modpacks/RLCraft_Server_Pack_1.12.2_Beta_v2.8.2.zip"
# Download from https://www.curseforge.com/minecraft/modpacks/rlcraft and place in modpacks subdir
GENERIC_PACK: "/modpacks/RLCraft+Server+Pack+1.12.2+-+Release+v2.9.1c.zip"
ports:
- 25565:25565
restart: unless-stopped
volumes:
rlcraft-data:
rlcraft-modpack:
data:

View File

@@ -3,8 +3,10 @@ version: "3.8"
services:
mc:
image: itzg/minecraft-server
tty: true
stdin_open: true
ports:
- 25565:25565
- "25565:25565"
environment:
EULA: "TRUE"
volumes:

View File

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

View File

@@ -14,8 +14,8 @@ services:
EULA: "TRUE"
#VERSION: "1.12.2" (Ensure this is compatbile with the version of SpongeForge you are using!)
TYPE: "FORGE"
FORGEVERSION: "RECOMMENDED"
#FORGEVERSION: "14.23.5.2807"
FORGE_VERSION: "RECOMMENDED"
#FORGE_VERSION: "14.23.5.2807"
CONSOLE: "false"
ENABLE_RCON: "true"
RCON_PASSWORD: "testing"

View File

@@ -35,20 +35,17 @@ spec:
name: main
readinessProbe:
exec:
command:
- mcstatus
- localhost
- ping
initialDelaySeconds: 5
command: [ "/usr/local/bin/mc-monitor", "status", "--host", "localhost" ]
# Give it i + p * f seconds to be ready, so 120 seconds
initialDelaySeconds: 20
periodSeconds: 5
failureThreshold: 20
# Monitor ongoing liveness
livenessProbe:
exec:
command:
- mcstatus
- localhost
- ping
initialDelaySeconds: 5
periodSeconds: 5
command: ["/usr/local/bin/mc-monitor", "status", "--host", "localhost"]
initialDelaySeconds: 120
periodSeconds: 60
volumeMounts:
- name: mc-data
mountPath: /data

View File

@@ -0,0 +1,13 @@
version: "3"
services:
mc:
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
environment:
EULA: "true"
TYPE: PAPER
VERSION: 1.19.3
MODRINTH_PROJECTS: "coreprotect"
MODRINTH_ALLOWED_VERSION_TYPE: "release"
volumes:
- ./data:/data

View File

@@ -0,0 +1,10 @@
This project demonstrates the use of two compose projects, `dbs` and `servers`, where the following capabilities are demonstrated:
- Managing databases, such as MariaDB, in its own compose project: `dbs`
- Using an `.env` file to avoid including user details within the compose file
- Accessing the database from a separate project, `servers`, via an external network declaration
- LuckPerms is configured to access the MariaDB instance
- Isolating the Minecraft server container by purposely **not** declaring port mappings
- Running Waterfall as a proxy
- Using configuration mount points to pre-configure Waterfall and the Minecraft server
- Using Spiget to download plugins, in this case LuckPerms

View File

@@ -0,0 +1,2 @@
LUCKPERMS_USER=luckperms
LUCKPERMS_PASSWORD=luckpermspw

View File

@@ -0,0 +1,21 @@
version: "3.8"
services:
mariadb:
image: mariadb:10
environment:
MARIADB_RANDOM_ROOT_PASSWORD: yes
MARIADB_DATABASE: luckperms
# These are loaded by compose from .env
MARIADB_USER: ${LUCKPERMS_USER}
MARIADB_PASSWORD: ${LUCKPERMS_PASSWORD}
volumes:
- mariadb:/var/lib/mysql
adminer:
image: adminer
ports:
- "8806:8080"
volumes:
mariadb: {}

View File

@@ -0,0 +1,41 @@
version: "3.8"
services:
proxy:
image: itzg/bungeecord
environment:
TYPE: WATERFALL
ports:
- "25565:25577"
volumes:
- waterfall:/server
- ./waterfall-config:/config
mc:
image: itzg/minecraft-server
environment:
EULA: "true"
TYPE: PAPER
# 28140: luckperms
SPIGET_RESOURCES: "28140"
# since we're behind a proxy
ONLINE_MODE: "false"
volumes:
- mc:/data
# mainly to drop in config files specific to plugins
- ./mc-plugins:/plugins
networks:
# so proxy can reach us
- default
# so we can use databases project
- dbs
volumes:
mc: {}
waterfall: {}
networks:
dbs:
# declared in ../dbs
external: true
name: dbs_default

View File

@@ -0,0 +1,710 @@
####################################################################################################
# +----------------------------------------------------------------------------------------------+ #
# | __ __ ___ __ __ | #
# | | | | / ` |__/ |__) |__ |__) |\/| /__` | #
# | |___ \__/ \__, | \ | |___ | \ | | .__/ | #
# | | #
# | https://luckperms.net | #
# | | #
# | WIKI: https://luckperms.net/wiki | #
# | DISCORD: https://discord.gg/luckperms | #
# | BUG REPORTS: https://github.com/lucko/LuckPerms/issues | #
# | | #
# | Each option in this file is documented and explained here: | #
# | ==> https://luckperms.net/wiki/Configuration | #
# | | #
# | New options are not added to this file automatically. Default values are used if an | #
# | option cannot be found. The latest config versions can be obtained at the link above. | #
# +----------------------------------------------------------------------------------------------+ #
####################################################################################################
# +----------------------------------------------------------------------------------------------+ #
# | | #
# | ESSENTIAL SETTINGS | #
# | | #
# | Important settings that control how LuckPerms functions. | #
# | | #
# +----------------------------------------------------------------------------------------------+ #
# The name of the server, used for server specific permissions.
#
# - When set to "global" this setting is effectively ignored.
# - In all other cases, the value here is added to all players in a "server" context.
# - See: https://luckperms.net/wiki/Context
server: global
# If the servers own UUID cache/lookup facility should be used when there is no record for a player
# already in LuckPerms.
#
# - When this is set to 'false', commands using a player's username will not work unless the player
# has joined since LuckPerms was first installed.
# - To get around this, you can use a player's uuid directly in the command, or enable this option.
# - When this is set to 'true', the server facility is used. This may use a number of methods,
# including checking the servers local cache, or making a request to the Mojang API.
use-server-uuid-cache: false
# +----------------------------------------------------------------------------------------------+ #
# | | #
# | STORAGE SETTINGS | #
# | | #
# | Controls which storage method LuckPerms will use to store data. | #
# | | #
# +----------------------------------------------------------------------------------------------+ #
# How the plugin should store data
#
# - The various options are explained in more detail on the wiki:
# https://luckperms.net/wiki/Storage-types
#
# - Possible options:
#
# | Remote databases - require connection information to be configured below
# |=> MySQL
# |=> MariaDB (preferred over MySQL)
# |=> PostgreSQL
# |=> MongoDB
#
# | Flatfile/local database - don't require any extra configuration
# |=> H2 (preferred over SQLite)
# |=> SQLite
#
# | Readable & editable text files - don't require any extra configuration
# |=> YAML (.yml files)
# |=> JSON (.json files)
# |=> HOCON (.conf files)
# |=> TOML (.toml files)
# |
# | By default, user, group and track data is separated into different files. Data can be combined
# | and all stored in the same file by switching to a combined storage variant.
# | Just add '-combined' to the end of the storage-method, e.g. 'yaml-combined'
#
# - A H2 database is the default option.
# - If you want to edit data manually in "traditional" storage files, we suggest using YAML.
storage-method: MariaDB
# The following block defines the settings for remote database storage methods.
#
# - You don't need to touch any of the settings here if you're using a local storage method!
# - The connection detail options are shared between all remote storage types.
data:
# Define the address and port for the database.
# - The standard DB engine port is used by default
# (MySQL: 3306, PostgreSQL: 5432, MongoDB: 27017)
# - Specify as "host:port" if differs
address: mariadb
# The name of the database to store LuckPerms data in.
# - This must be created already. Don't worry about this setting if you're using MongoDB.
database: luckperms
# Credentials for the database.
username: luckperms
password: 'luckpermspw'
# These settings apply to the MySQL connection pool.
# - The default values will be suitable for the majority of users.
# - Do not change these settings unless you know what you're doing!
pool-settings:
# Sets the maximum size of the MySQL connection pool.
# - Basically this value will determine the maximum number of actual
# connections to the database backend.
# - More information about determining the size of connection pools can be found here:
# https://github.com/brettwooldridge/HikariCP/wiki/About-Pool-Sizing
maximum-pool-size: 10
# Sets the minimum number of idle connections that the pool will try to maintain.
# - For maximum performance and responsiveness to spike demands, it is recommended to not set
# this value and instead allow the pool to act as a fixed size connection pool.
# (set this value to the same as 'maximum-pool-size')
minimum-idle: 10
# This setting controls the maximum lifetime of a connection in the pool in milliseconds.
# - The value should be at least 30 seconds less than any database or infrastructure imposed
# connection time limit.
maximum-lifetime: 1800000 # 30 minutes
# This setting controls how frequently the pool will 'ping' a connection in order to prevent it
# from being timed out by the database or network infrastructure, measured in milliseconds.
# - The value should be less than maximum-lifetime and greater than 30000 (30 seconds).
# - Setting the value to zero will disable the keepalive functionality.
keepalive-time: 0
# This setting controls the maximum number of milliseconds that the plugin will wait for a
# connection from the pool, before timing out.
connection-timeout: 5000 # 5 seconds
# This setting allows you to define extra properties for connections.
#
# By default, the following options are set to enable utf8 encoding. (you may need to remove
# these if you are using PostgreSQL)
# useUnicode: true
# characterEncoding: utf8
#
# You can also use this section to disable SSL connections, by uncommenting the 'useSSL' and
# 'verifyServerCertificate' options below.
properties:
useUnicode: true
characterEncoding: utf8
#useSSL: false
#verifyServerCertificate: false
# The prefix for all LuckPerms SQL tables.
#
# - This only applies for remote SQL storage types (MySQL, MariaDB, etc).
# - Change this if you want to use different tables for different servers.
table-prefix: 'luckperms_'
# The prefix to use for all LuckPerms MongoDB collections.
#
# - This only applies for the MongoDB storage type.
# - Change this if you want to use different collections for different servers. The default is no
# prefix.
mongodb-collection-prefix: ''
# The connection string URI to use to connect to the MongoDB instance.
#
# - When configured, this setting will override anything defined in the address, database,
# username or password fields above.
# - If you have a connection string that starts with 'mongodb://' or 'mongodb+srv://', enter it
# below.
# - For more information, please see https://docs.mongodb.com/manual/reference/connection-string/
mongodb-connection-uri: ''
# Define settings for a "split" storage setup.
#
# - This allows you to define a storage method for each type of data.
# - The connection options above still have to be correct for each type here.
split-storage:
# Don't touch this if you don't want to use split storage!
enabled: false
methods:
# These options don't need to be modified if split storage isn't enabled.
user: h2
group: h2
track: h2
uuid: h2
log: h2
# +----------------------------------------------------------------------------------------------+ #
# | | #
# | UPDATE PROPAGATION & MESSAGING SERVICE | #
# | | #
# | Controls the ways in which LuckPerms will sync data & notify other servers of changes. | #
# | These options are documented on greater detail on the wiki under "Instant Updates". | #
# | | #
# +----------------------------------------------------------------------------------------------+ #
# This option controls how frequently LuckPerms will perform a sync task.
#
# - A sync task will refresh all data from the storage, and ensure that the most up-to-date data is
# being used by the plugin.
# - This is disabled by default, as most users will not need it. However, if you're using a remote
# storage type without a messaging service setup, you may wish to set this to something like 3.
# - Set to -1 to disable the task completely.
sync-minutes: -1
# If the file watcher should be enabled.
#
# - When using a file-based storage type, LuckPerms can monitor the data files for changes, and
# automatically update when changes are detected.
# - If you don't want this feature to be active, set this option to false.
watch-files: true
# Define which messaging service should be used by the plugin.
#
# - If enabled and configured, LuckPerms will use the messaging service to inform other connected
# servers of changes.
# - Use the command "/lp networksync" to manually push changes.
# - Data is NOT stored using this service. It is only used as a messaging platform.
#
# - If you decide to enable this feature, you should set "sync-minutes" to -1, as there is no need
# for LuckPerms to poll the database for changes.
#
# - Possible options:
# => sql Uses the SQL database to form a queue system for communication. Will only work when
# 'storage-method' is set to MySQL or MariaDB. This is chosen by default if the
# option is set to 'auto' and SQL storage is in use. Set to 'notsql' to disable this.
# => pluginmsg Uses the plugin messaging channels to communicate with the proxy.
# LuckPerms must be installed on your proxy & all connected servers backend servers.
# Won't work if you have more than one proxy.
# => lilypad Uses LilyPad pub-sub to push changes. You need to have the LilyPad-Connect plugin
# installed.
# => redis Uses Redis pub-sub to push changes. Your server connection info must be configured
# below.
# => rabbitmq Uses RabbitMQ pub-sub to push changes. Your server connection info must be
# configured below.
# => custom Uses a messaging service provided using the LuckPerms API.
# => auto Attempts to automatically setup a messaging service using redis or sql.
messaging-service: auto
# If LuckPerms should automatically push updates after a change has been made with a command.
auto-push-updates: true
# If LuckPerms should push logging entries to connected servers via the messaging service.
push-log-entries: true
# If LuckPerms should broadcast received logging entries to players on this platform.
#
# - If you have LuckPerms installed on your backend servers as well as a BungeeCord proxy, you
# should set this option to false on either your backends or your proxies, to avoid players being
# messaged twice about log entries.
broadcast-received-log-entries: true
# Settings for Redis.
# Port 6379 is used by default; set address to "host:port" if differs
redis:
enabled: false
address: localhost
username: ''
password: ''
# Settings for RabbitMQ.
# Port 5672 is used by default; set address to "host:port" if differs
rabbitmq:
enabled: false
address: localhost
vhost: '/'
username: 'guest'
password: 'guest'
# +----------------------------------------------------------------------------------------------+ #
# | | #
# | CUSTOMIZATION SETTINGS | #
# | | #
# | Settings that allow admins to customize the way LuckPerms operates. | #
# | | #
# +----------------------------------------------------------------------------------------------+ #
# Controls how temporary permissions/parents/meta should be accumulated.
#
# - The default behaviour is "deny".
# - This behaviour can also be specified when the command is executed. See the command usage
# documentation for more info.
#
# - Possible options:
# => accumulate durations will be added to the existing expiry time
# => replace durations will be replaced if the new duration is later than the current
# expiration
# => deny the command will just fail if you try to add another node with the same expiry
temporary-add-behaviour: deny
# Controls how LuckPerms will determine a users "primary" group.
#
# - The meaning and influence of "primary groups" are explained in detail on the wiki.
# - The preferred approach is to let LuckPerms automatically determine a users primary group
# based on the relative weight of their parent groups.
#
# - Possible options:
# => stored use the value stored against the users record in the file/database
# => parents-by-weight just use the users most highly weighted parent
# => all-parents-by-weight same as above, but calculates based upon all parents inherited from
# both directly and indirectly
primary-group-calculation: parents-by-weight
# If the plugin should check for "extra" permissions with users run LP commands.
#
# - These extra permissions allow finer control over what users can do with each command, and who
# they have access to edit.
# - The nature of the checks are documented on the wiki under "Argument based command permissions".
# - Argument based permissions are *not* static, unlike the 'base' permissions, and will depend upon
# the arguments given within the command.
argument-based-command-permissions: false
# If the plugin should check whether senders are a member of a given group before they're able to
# edit the groups data or add/remove other users to/from it.
# Note: these limitations do not apply to the web editor!
require-sender-group-membership-to-modify: false
# If the plugin should send log notifications to users whenever permissions are modified.
#
# - Notifications are only sent to those with the appropriate permission to receive them
# - They can also be temporarily enabled/disabled on a per-user basis using
# '/lp log notify <on|off>'
log-notify: true
# Defines a list of log entries which should not be sent as notifications to users.
#
# - Each entry in the list is a RegEx expression which is matched against the log entry description.
log-notify-filtered-descriptions:
# - "parent add example"
# If LuckPerms should automatically install translation bundles and periodically update them.
auto-install-translations: true
# Defines the options for prefix and suffix stacking.
#
# - The feature allows you to display multiple prefixes or suffixes alongside a players username in
# chat.
# - It is explained and documented in more detail on the wiki under "Prefix & Suffix Stacking".
#
# - The options are divided into separate sections for prefixes and suffixes.
# - The 'duplicates' setting refers to how duplicate elements are handled. Can be 'retain-all',
# 'first-only' or 'last-only'.
# - The value of 'start-spacer' is included at the start of the resultant prefix/suffix.
# - The value of 'end-spacer' is included at the end of the resultant prefix/suffix.
# - The value of 'middle-spacer' is included between each element in the resultant prefix/suffix.
#
# - Possible format options:
# => highest Selects the value with the highest weight, from all values
# held by or inherited by the player.
#
# => lowest Same as above, except takes the one with the lowest weight.
#
# => highest_own Selects the value with the highest weight, but will not
# accept any inherited values.
#
# => lowest_own Same as above, except takes the value with the lowest weight.
#
# => highest_inherited Selects the value with the highest weight, but will only
# accept inherited values.
#
# => lowest_inherited Same as above, except takes the value with the lowest weight.
#
# => highest_on_track_<track> Selects the value with the highest weight, but only if the
# value was inherited from a group on the given track.
#
# => lowest_on_track_<track> Same as above, except takes the value with the lowest weight.
#
# => highest_not_on_track_<track> Selects the value with the highest weight, but only if the
# value was inherited from a group not on the given track.
#
# => lowest_not_on_track_<track> Same as above, except takes the value with the lowest weight.
#
# => highest_from_group_<group> Selects the value with the highest weight, but only if the
# value was inherited from the given group.
#
# => lowest_from_group_<group> Same as above, except takes the value with the lowest weight.
#
# => highest_not_from_group_<group> Selects the value with the highest weight, but only if the
# value was not inherited from the given group.
#
# => lowest_not_from_group_<group> Same as above, except takes the value with the lowest weight.
meta-formatting:
prefix:
format:
- "highest"
duplicates: first-only
start-spacer: ""
middle-spacer: " "
end-spacer: ""
suffix:
format:
- "highest"
duplicates: first-only
start-spacer: ""
middle-spacer: " "
end-spacer: ""
# +----------------------------------------------------------------------------------------------+ #
# | | #
# | PERMISSION CALCULATION AND INHERITANCE | #
# | | #
# | Modify the way permission checks, meta lookups and inheritance resolutions are handled. | #
# | | #
# +----------------------------------------------------------------------------------------------+ #
# The algorithm LuckPerms should use when traversing the "inheritance tree".
#
# - Possible options:
# => breadth-first See: https://en.wikipedia.org/wiki/Breadth-first_search
# => depth-first-pre-order See: https://en.wikipedia.org/wiki/Depth-first_search
# => depth-first-post-order See: https://en.wikipedia.org/wiki/Depth-first_search
inheritance-traversal-algorithm: depth-first-pre-order
# If a final sort according to "inheritance rules" should be performed after the traversal algorithm
# has resolved the inheritance tree.
#
# "Inheritance rules" refers to things such as group weightings, primary group status, and the
# natural contextual ordering of the group nodes.
#
# Setting this to 'true' will allow for the inheritance rules to take priority over the structure of
# the inheritance tree.
#
# Effectively when this setting is 'true': the tree is flattened, and rules applied afterwards,
# and when this setting is 'false':, the rules are just applied during each step of the traversal.
post-traversal-inheritance-sort: false
# Defines the mode used to determine whether a set of contexts are satisfied.
#
# - Possible options:
# => at-least-one-value-per-key Set A will be satisfied by another set B, if at least one of the
# key-value entries per key in A are also in B.
# => all-values-per-key Set A will be satisfied by another set B, if all key-value
# entries in A are also in B.
context-satisfy-mode: at-least-one-value-per-key
# LuckPerms has a number of built-in contexts. These can be disabled by adding the context key to
# the list below.
disabled-contexts:
# - "world"
# +----------------------------------------------------------------------------------------------+ #
# | Permission resolution settings | #
# +----------------------------------------------------------------------------------------------+ #
# If users on this server should have their global permissions applied.
# When set to false, only server specific permissions will apply for users on this server
include-global: true
# If users on this server should have their global world permissions applied.
# When set to false, only world specific permissions will apply for users on this server
include-global-world: true
# If users on this server should have global (non-server specific) groups applied
apply-global-groups: true
# If users on this server should have global (non-world specific) groups applied
apply-global-world-groups: true
# +----------------------------------------------------------------------------------------------+ #
# | Meta lookup settings | #
# +----------------------------------------------------------------------------------------------+ #
# Defines how meta values should be selected.
#
# - Possible options:
# => inheritance Selects the meta value that was inherited first
# => highest-number Selects the highest numerical meta value
# => lowest-number Selects the lowest numerical meta value
meta-value-selection-default: inheritance
# Defines how meta values should be selected per key.
meta-value-selection:
# max-homes: highest-number
# +----------------------------------------------------------------------------------------------+ #
# | Inheritance settings | #
# +----------------------------------------------------------------------------------------------+ #
# If the plugin should apply wildcard permissions.
#
# - If set to true, LuckPerms will detect wildcard permissions, and resolve & apply all registered
# permissions matching the wildcard.
apply-wildcards: true
# If LuckPerms should resolve and apply permissions according to the Sponge style implicit wildcard
# inheritance system.
#
# - That being: If a user has been granted "example", then the player should have also be
# automatically granted "example.function", "example.another", "example.deeper.nesting",
# and so on.
apply-sponge-implicit-wildcards: false
# If the plugin should apply negated Bukkit default permissions before it considers wildcard
# assignments.
#
# - Plugin authors can define permissions which explicitly should not be given automatically to OPs.
# This is usually used for so called "anti-permissions" - permissions which, when granted, apply
# something negative.
# - If this option is set to true, LuckPerms will consider any negated declarations made by
# plugins before it considers wildcards. (similar to the way the OP system works)
# - If this option is set to false, LuckPerms will consider any wildcard assignments first.
apply-default-negated-permissions-before-wildcards: false
# If the plugin should parse regex permissions.
#
# - If set to true, LuckPerms will detect regex permissions, marked with "r=" at the start of the
# node, and resolve & apply all registered permissions matching the regex.
apply-regex: true
# If the plugin should complete and apply shorthand permissions.
#
# - If set to true, LuckPerms will detect and expand shorthand node patterns.
apply-shorthand: true
# If the plugin should apply Bukkit child permissions.
#
# - Plugin authors can define custom permissions structures for their plugin, which will be resolved
# and used by LuckPerms if this setting is enabled.
apply-bukkit-child-permissions: true
# If the plugin should apply Bukkit default permissions.
#
# - Plugin authors can define permissions which should be given to all users by default, or setup
# permissions which should/shouldn't be given to opped players.
# - If this option is set to false, LuckPerms will ignore these defaults.
apply-bukkit-default-permissions: true
# If the plugin should apply attachment permissions.
#
# - Other plugins on the server are able to add their own "permission attachments" to players.
# - This allows them to grant players additional permissions which last until the end of the
# session, or until they're removed.
# - If this option is set to false, LuckPerms will not include these attachment permissions when
# considering if a player should have access to a certain permission.
apply-bukkit-attachment-permissions: true
# +----------------------------------------------------------------------------------------------+ #
# | Extra settings | #
# +----------------------------------------------------------------------------------------------+ #
# A list of context calculators which will be skipped when calculating contexts.
#
# - You can disable context calculators by either:
# => specifying the Java class name used by the calculator (e.g. com.example.ExampleCalculator)
# => specifying a sub-section of the Java package used by the calculator (e.g. com.example)
disabled-context-calculators: []
# Allows you to set "aliases" for the worlds sent forward for context calculation.
#
# - These aliases are provided in addition to the real world name. Applied recursively.
# - Remove the comment characters for the default aliases to apply.
world-rewrite:
# world_nether: world
# world_the_end: world
# Define special group weights for this server.
#
# - Group weights can also be applied directly to group data, using the setweight command.
# - This section allows weights to be set on a per-server basis.
group-weight:
# admin: 10
# +----------------------------------------------------------------------------------------------+ #
# | | #
# | FINE TUNING OPTIONS | #
# | | #
# | A number of more niche settings for tweaking and changing behaviour. The section also | #
# | contains toggles for some more specialised features. It is only necessary to make changes to | #
# | these options if you want to fine-tune LuckPerms behaviour. | #
# | | #
# +----------------------------------------------------------------------------------------------+ #
# +----------------------------------------------------------------------------------------------+ #
# | Server Operator (OP) settings | #
# +----------------------------------------------------------------------------------------------+ #
# Controls whether server operators should exist at all.
#
# - When set to 'false', all players will be de-opped, and the /op and /deop commands will be
# disabled. Note that vanilla features like the spawn-protection require an operator on the
# server to work.
enable-ops: true
# Enables or disables a special permission based system in LuckPerms for controlling OP status.
#
# - If set to true, any user with the permission "luckperms.autoop" will automatically be granted
# server operator status. This permission can be inherited, or set on specific servers/worlds,
# temporarily, etc.
# - Additionally, setting this to true will force the "enable-ops" option above to false. All users
# will be de-opped unless they have the permission node, and the op/deop commands will be
# disabled.
# - It is recommended that you use this option instead of assigning a single '*' permission.
auto-op: false
# Defines if "opped" players should be able to use all LuckPerms commands by default.
#
# - Set to false to only allow users who have the permissions access to the commands
commands-allow-op: true
# +----------------------------------------------------------------------------------------------+ #
# | Vault integration settings | #
# +----------------------------------------------------------------------------------------------+ #
# If Vault lookups for offline players on the main server thread should be enabled.
#
# LuckPerms has a "catch" for plugins attempting to perform unsafe offline player data lookups
# from the main server thread. This catch raises an exception (causes an error to occur) when unsafe
# lookups are made, instead of allowing the lookup to happen, which would likely cause the server
# to lag.
#
# However, if you're willing to accept the consequences, the catch can be disabled by setting this
# option to 'true.
vault-unsafe-lookups: false
# If LuckPerms should use the 'display name' of a group when returning groups in Vault API calls.
#
# - When this option is set to true, the display name of the group is returned.
# - When this option is set to false, the standard name/id of the group is returned.
vault-group-use-displaynames: true
# Controls which group LuckPerms should use for NPC players when handling Vault requests.
#
# - As NPCs aren't actually real players, LuckPerms does not load any user data for them. This
# becomes an issue when plugins want to check for their permissions using Vault.
# - As a solution, Vault checks for NPCs fallback to a group, which is defined below.
vault-npc-group: default
# Controls how LuckPerms should consider the OP status of NPC players when handing Vault requests.
#
# - If you want NPCs to have the same permissions as "normal" players, set this option to false.
# - If you want NPCs to have OP status, set this option to true.
vault-npc-op-status: false
# If the vault-server option below should be used.
#
# - When this option is set to false, the server value defined above under "server" is used.
use-vault-server: false
# The name of the server used within Vault operations.
#
# - If you don't want Vault operations to be server specific, set this to "global".
# - Will only take effect if use-vault-server is set to true above.
vault-server: global
# If global permissions should be considered when retrieving meta or player groups
vault-include-global: true
# If Vault operations should ignore any world arguments if supplied.
vault-ignore-world: false
# +----------------------------------------------------------------------------------------------+ #
# | Miscellaneous (and rarely used) settings | #
# +----------------------------------------------------------------------------------------------+ #
# If LuckPerms should produce extra logging output when it handles logins.
#
# - Useful if you're having issues with UUID forwarding or data not being loaded.
debug-logins: false
# If LuckPerms should allow usernames with non alphanumeric characters.
#
# - Note that due to the design of the storage implementation, usernames must still be 16 characters
# or less.
allow-invalid-usernames: false
# If LuckPerms should not require users to confirm bulkupdate operations.
#
# - When set to true, operations will be executed immediately.
# - This is not recommended, as bulkupdate has the potential to irreversibly delete large amounts of
# data, and is not designed to be executed automatically.
# - If automation is needed, users should prefer using the LuckPerms API.
skip-bulkupdate-confirmation: false
# If LuckPerms should prevent bulkupdate operations.
#
# - When set to true, bulkupdate operations (the /lp bulkupdate command) will not work.
# - When set to false, bulkupdate operations will be allowed via the console.
disable-bulkupdate: false
# If LuckPerms should allow a users primary group to be removed with the 'parent remove' command.
#
# - When this happens, the plugin will set their primary group back to default.
prevent-primary-group-removal: false
# If LuckPerms should update the list of commands sent to the client when permissions are changed.
update-client-command-list: true
# If LuckPerms should attempt to register "Brigadier" command list data for its commands.
register-command-list-data: true
# If LuckPerms should attempt to resolve Vanilla command target selectors for LP commands.
# See here for more info: https://minecraft.gamepedia.com/Commands#Target_selectors
resolve-command-selectors: false

View File

@@ -0,0 +1,52 @@
server_connect_timeout: 5000
enforce_secure_profile: false
remote_ping_cache: -1
forge_support: true
player_limit: -1
permissions:
default:
- bungeecord.command.server
- bungeecord.command.list
admin:
- bungeecord.command.alert
- bungeecord.command.end
- bungeecord.command.ip
- bungeecord.command.reload
- bungeecord.command.kick
timeout: 30000
log_commands: false
network_compression_threshold: 256
online_mode: true
disabled_commands:
- disabledcommandhere
servers:
mc:
motd: 'Lobby'
address: mc:25565
restricted: false
listeners:
- query_port: 25577
motd: '&1Another Bungee server'
tab_list: GLOBAL_PING
query_enabled: false
proxy_protocol: false
forced_hosts:
pvp.md-5.net: pvp
ping_passthrough: false
priorities:
- mc
bind_local_address: true
host: 0.0.0.0:25577
max_players: 1
tab_size: 60
force_default_server: false
ip_forward: false
remote_ping_timeout: 5000
prevent_proxy_connections: false
groups:
md_5:
- admin
connection_throttle: 4000
stats: 39440d41-8d83-40cb-a6a7-d95c3197c4d2
connection_throttle_limit: 3
log_pings: true

View File

@@ -0,0 +1,10 @@
plugin_channel_name_limit: 128
use_netty_dns_resolver: true
disable_modern_tab_limiter: true
log_initial_handler_connections: true
throttling:
tab_complete: 1000
game_version: ''
disable_tab_list_rewrite: true
registered_plugin_channels_limit: 128
disable_entity_metadata_rewrite: false

View File

@@ -0,0 +1,19 @@
version: "3.8"
services:
mc:
image: itzg/minecraft-server
ports:
- "25565:25565"
environment:
EULA: "true"
TYPE: AUTO_CURSEFORGE
CF_PAGE_URL: "https://www.curseforge.com/minecraft/modpacks/one-block-modded/files/4136487"
CF_SET_LEVEL_FROM: OVERRIDES
DEBUG: "false"
MEMORY: 4G
volumes:
- mc-data:/data
volumes:
mc-data: {}

View File

@@ -0,0 +1,18 @@
version: "3.8"
services:
mc:
image: itzg/minecraft-server:java8-multiarch
ports:
- "25565:25565"
environment:
EULA: "true"
TYPE: AUTO_CURSEFORGE
CF_SLUG: the-pixelmon-modpack
CF_FILENAME_MATCHER: "9.1.2"
MEMORY: 4G
volumes:
- mc-data:/data
volumes:
mc-data: {}

View File

@@ -0,0 +1,21 @@
version: '3.8'
services:
mc:
image: itzg/minecraft-server:java8-multiarch
volumes:
- data:/data
- ./modpacks:/modpacks:ro
environment:
EULA: "true"
TYPE: FORGE
VERSION: "1.15.2"
GENERIC_PACK: /modpacks/Valhelsia_2-2.3.4-SERVER.zip
MEMORY: "2G"
ports:
- "25565:25565"
healthcheck:
test: NONE
volumes:
data: {}

View File

@@ -0,0 +1,18 @@
version: "3.8"
services:
mc:
image: itzg/minecraft-server
ports:
- "25565:25565"
environment:
EULA: "true"
TYPE: AUTO_CURSEFORGE
CF_SLUG: vault-hunters-1-18-2
CF_FILENAME_MATCHER: "Update-6H"
MEMORY: 4G
volumes:
- mc-data:/data
volumes:
mc-data: {}

View File

@@ -1,15 +1,16 @@
#!/bin/bash
. /autopause/autopause-fcns.sh
. ${SCRIPTS:-/}start-utils
. /auto/autopause-fcns.sh
# shellcheck source=../../scripts/start-utils
. "${SCRIPTS:-/}start-utils"
if isTrue "${DEBUG_AUTOPAUSE}"; then
set -x
fi
autopause_error_loop() {
logAutopause "Available interfaces within the docker container:"
INTERFACES=$(echo /sys/class/net/*)
INTERFACES=${INTERFACES//\/sys\/class\/net\//}
logAutopause " $INTERFACES"
logAutopause " $(available_interfaces)"
logAutopause "Please set the environment variable AUTOPAUSE_KNOCK_INTERFACE to the interface that handles incoming connections."
logAutopause "If unsure which interface to choose, run the ifconfig command in the container."
logAutopause "Autopause failed to initialize. This log entry will be printed every 30 minutes."
@@ -34,12 +35,17 @@ if [[ -z "$AUTOPAUSE_KNOCK_INTERFACE" ]] ; then
logAutopause "AUTOPAUSE_KNOCK_INTERFACE variable must not be empty!"
autopause_error_loop
fi
if ! [[ -d "/sys/class/net/$AUTOPAUSE_KNOCK_INTERFACE" ]] ; then
if ! available_interfaces | grep -q "$AUTOPAUSE_KNOCK_INTERFACE" ; then
logAutopause "Selected interface \"$AUTOPAUSE_KNOCK_INTERFACE\" does not exist!"
autopause_error_loop
fi
sudo /usr/sbin/knockd -c /tmp/knockd-config.cfg -d -i "$AUTOPAUSE_KNOCK_INTERFACE"
knockdArgs=(-c /tmp/knockd-config.cfg -d -i "$AUTOPAUSE_KNOCK_INTERFACE")
if isTrue "${DEBUG_AUTOPAUSE}"; then
knockdArgs+=(-D)
fi
sudo /usr/sbin/knockd "${knockdArgs[@]}"
if [ $? -ne 0 ] ; then
logAutopause "Failed to start knockd daemon."
logAutopause "Probable cause: Unable to attach to interface \"$AUTOPAUSE_KNOCK_INTERFACE\"."
@@ -50,12 +56,13 @@ STATE=INIT
while :
do
isTrue "${DEBUG_AUTOPAUSE}" && log "DEBUG: autopause state = $STATE"
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"
logAutopause "MC Server listening for connections - pausing in $AUTOPAUSE_TIMEOUT_INIT seconds"
STATE=K
fi
;;
@@ -66,8 +73,8 @@ do
STATE=E
else
if [[ $(current_uptime) -ge $TIME_THRESH ]] ; then
logAutopause "No client connected since startup / knocked - stopping"
/autopause/pause.sh
logAutopause "No client connected since startup / knocked - pausing"
/auto/pause.sh
STATE=S
fi
fi
@@ -76,7 +83,7 @@ do
# Established
if ! java_clients_connected ; then
TIME_THRESH=$(($(current_uptime)+$AUTOPAUSE_TIMEOUT_EST))
logAutopause "All clients disconnected - stopping in $AUTOPAUSE_TIMEOUT_EST seconds"
logAutopause "All clients disconnected - pausing in $AUTOPAUSE_TIMEOUT_EST seconds"
STATE=I
fi
;;
@@ -87,8 +94,8 @@ do
STATE=E
else
if [[ $(current_uptime) -ge $TIME_THRESH ]] ; then
logAutopause "No client reconnected - stopping"
/autopause/pause.sh
logAutopause "No client reconnected - pausing"
/auto/pause.sh
STATE=S
fi
fi
@@ -96,7 +103,7 @@ do
XS)
# Stopped
if rcon_client_exists ; then
/autopause/resume.sh
/auto/resume.sh
fi
if java_running ; then
if java_clients_connected ; then
@@ -104,7 +111,11 @@ do
STATE=E
else
TIME_THRESH=$(($(current_uptime)+$AUTOPAUSE_TIMEOUT_KN))
logAutopause "Server was knocked - waiting for clients or timeout"
from=unknown
if [ -e /var/log/knocked-source ]; then
from=$(cat /var/log/knocked-source)
fi
logAutopause "Server was knocked from $from - waiting for clients or timeout"
STATE=K
fi
fi
@@ -115,8 +126,8 @@ do
esac
if [[ "$STATE" == "S" ]] ; then
# before rcon times out
sleep 2
sleep 5
else
sleep $AUTOPAUSE_PERIOD
sleep "$AUTOPAUSE_PERIOD"
fi
done

View File

@@ -20,12 +20,22 @@ mc_server_listening() {
mc-monitor status --host localhost --port "$SERVER_PORT" --timeout 10s >& /dev/null
}
java_clients_connected() {
java_clients_connections() {
local connections
if java_running ; then
connections=$(mc-monitor status --host localhost --port "$SERVER_PORT" --show-player-count)
if ! connections=$(mc-monitor status --host localhost --port "$SERVER_PORT" --show-player-count); then
connections=0
fi
else
connections=0
fi
(( connections > 0 ))
echo $connections
}
java_clients_connected() {
(( $(java_clients_connections) > 0 ))
}
available_interfaces() {
ifconfig -s | tail +2 | cut -f1 -d ' '
}

View File

@@ -1,9 +1,13 @@
#!/bin/bash
# needed for the clients connected function residing in autopause
. /autopause/autopause-fcns.sh
. /auto/autopause-fcns.sh
. ${SCRIPTS:-/}start-utils
# shellcheck source=../../scripts/start-utils
. "${SCRIPTS:-/}start-utils"
if isTrue "${DEBUG_AUTOSTOP}"; then
set -x
fi
# wait for java process to be started
while :
@@ -18,11 +22,12 @@ STATE=INIT
while :
do
isTrue "${DEBUG_AUTOSTOP}" && log "DEBUG: autostop state = $STATE"
case X$STATE in
XINIT)
# Server startup
if mc_server_listening ; then
TIME_THRESH=$(($(current_uptime)+$AUTOSTOP_TIMEOUT_INIT))
TIME_THRESH=$(($(current_uptime)+AUTOSTOP_TIMEOUT_INIT))
logAutostop "MC Server listening for connections - stopping in $AUTOSTOP_TIMEOUT_INIT seconds"
STATE=II
fi
@@ -35,7 +40,7 @@ do
else
if [[ $(current_uptime) -ge $TIME_THRESH ]] ; then
logAutostop "No client connected since startup - stopping server"
/autostop/stop.sh
/auto/stop.sh
exit 0
fi
fi
@@ -56,7 +61,7 @@ do
else
if [[ $(current_uptime) -ge $TIME_THRESH ]] ; then
logAutostop "No client reconnected - stopping"
/autostop/stop.sh
/auto/stop.sh
exit 0
fi
fi

View File

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

6
files/autopause/pause.sh → files/auto/pause.sh Executable file → Normal file
View File

@@ -1,6 +1,9 @@
#!/bin/bash
. /start-utils
if isTrue "${DEBUG_AUTOPAUSE}"; then
set -x
fi
if [[ $( ps -ax -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]] ; then
# save world
@@ -18,4 +21,7 @@ if [[ $( ps -ax -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]] ; t
# finally pause the process
logAutopauseAction "Pausing Java process"
pkill -STOP java
# create .paused file in data directory
touch /data/.paused
fi

15
files/auto/resume.sh Normal file
View File

@@ -0,0 +1,15 @@
#!/bin/bash
. /start-utils
if isTrue "${DEBUG_AUTOPAUSE}"; then
set -x
fi
if [[ $( ps -ax -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^T.*$ ]] ; then
logAutopauseAction "Knocked from $1, resuming Java process"
echo "$1" > /var/log/knocked-source
pkill -CONT java
# remove .paused file from data directory
rm -f /data/.paused
fi

13
files/auto/stop.sh Normal file
View File

@@ -0,0 +1,13 @@
#!/bin/bash
. /start-utils
if isTrue "${DEBUG_AUTOSTOP}"; then
set -x
fi
logAutostopAction "Stopping Java process"
if isTrue "${AUTOSTOP_PKILL_USE_SUDO:-false}"; then
sudo pkill -f --signal SIGTERM mc-server-runner
else
pkill -f --signal SIGTERM mc-server-runner
fi

View File

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

View File

@@ -1,6 +0,0 @@
#!/bin/bash
. /start-utils
logAutostopAction "Stopping Java process"
kill -SIGTERM 1

View File

@@ -0,0 +1,26 @@
{
"globalExcludes": [
"carry-on",
"defensive-measures",
"entity-texture-features-fabric",
"entityculling",
"extreme-sound-muffler",
"ignitioncoil",
"legendary-tooltips",
"nekos-enchanted-books",
"not-enough-animations",
"oculus",
"rubidium",
"rubidium-extra",
"skin-layers-3d",
"textrues-rubidium-options",
"torohealth-damage-indicators"
],
"modpacks": {
"all-of-fabric-6": {
"forceIncludes": [
"revelationary"
]
}
}
}

View File

@@ -10,13 +10,16 @@
<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>
<!-- Based on filePattern resolution, so daily -->
<TimeBasedTriggeringPolicy />
<SizeBasedTriggeringPolicy size="100 MB" />
<OnStartupTriggeringPolicy />
</Policies>
<DefaultRolloverStrategy>
<Delete basePath="logs">
<IfFileName glob="*.log.gz" />
<IfLastModified age="7d" />
<IfAccumulatedFileCount exceeds="20"/>
</Delete>
</DefaultRolloverStrategy>
</RollingRandomAccessFile>

View File

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

22
kustomize/README.md Normal file
View File

@@ -0,0 +1,22 @@
This directory provides a base to use with [kubectl kustomize](https://kubernetes.io/docs/tasks/manage-kubernetes-objects/kustomization/).
## Example overlay content
### kustomization.yml
```yaml
nameSuffix: "-forge"
commonLabels:
server: forge
bases:
- https://github.com/itzg/docker-minecraft-server.git/kustomize/base
configMapGenerator:
- name: mc
envs:
- mc.env
```
### mc.env
```
EULA=true
TYPE=FORGE
```

View File

@@ -0,0 +1,3 @@
resources:
- statefulset.yml
- service.yml

View File

@@ -0,0 +1,17 @@
apiVersion: v1
kind: Service
metadata:
labels:
service: mc
annotations: {}
# Such as
# mc-router.itzg.me/externalServerName: $(EXTERNAL_SERVICE_NAME)
name: mc
spec:
ports:
- name: minecraft
port: 25565
targetPort: 25565
type: NodePort
selector:
server: mc

View File

@@ -0,0 +1,51 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: mc
spec:
replicas: 1
serviceName: mc
selector:
matchLabels:
server: mc
template:
metadata:
labels:
server: mc
spec:
containers:
- name: mc
envFrom:
- configMapRef:
name: mc
optional: true
env: []
image: itzg/minecraft-server
stdin: true
tty: true
volumeMounts:
- mountPath: /data
name: data
resources:
requests:
cpu: 150m
livenessProbe:
exec:
command: ["mc-health"]
initialDelaySeconds: 120
periodSeconds: 60
readinessProbe:
exec:
command: ["mc-health"]
initialDelaySeconds: 20
periodSeconds: 10
failureThreshold: 12
volumeClaimTemplates:
- metadata:
name: data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 500Mi

View File

@@ -1,11 +1,16 @@
#!/bin/bash
. ${SCRIPTS:-/}start-utils
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
# The Dockerfile ENVs take precedence here, but defaulting for testing consistency
: "${UID:=1000}"
: "${GID:=1000}"
umask 0002
chmod g+w /data
if ! isTrue "${SKIP_SUDO:-false}" && [ $(id -u) = 0 ]; then
if ! isTrue "${SKIP_SUDO:-false}" && [ "$(id -u)" = 0 ]; then
runAsUser=minecraft
runAsGroup=minecraft
@@ -24,14 +29,14 @@ if ! isTrue "${SKIP_SUDO:-false}" && [ $(id -u) = 0 ]; then
if [[ $GID != 0 ]]; then
if [[ $GID != $(id -g minecraft) ]]; then
log "Changing gid of minecraft to $GID"
groupmod -o -g $GID minecraft
groupmod -o -g "$GID" minecraft
fi
else
runAsGroup=root
fi
fi
if [[ $(stat -c "%u" /data) != $UID ]]; then
if [[ $(stat -c "%u" /data) != "$UID" ]]; then
log "Changing ownership of /data to $UID ..."
chown -R ${runAsUser}:${runAsGroup} /data
fi
@@ -40,7 +45,12 @@ if ! isTrue "${SKIP_SUDO:-false}" && [ $(id -u) = 0 ]; then
echo 'hosts: files dns' > /etc/nsswitch.conf
fi
exec gosu ${runAsUser}:${runAsGroup} ${SCRIPTS:-/}start-configuration "$@"
distro=$(getDistro)
if [[ $distro == alpine ]]; then
exec su-exec ${runAsUser}:${runAsGroup} "${SCRIPTS:-/}start-configuration" "$@"
else
exec gosu ${runAsUser}:${runAsGroup} "${SCRIPTS:-/}start-configuration" "$@"
fi
else
exec ${SCRIPTS:-/}start-configuration "$@"
exec "${SCRIPTS:-/}start-configuration" "$@"
fi

View File

@@ -4,13 +4,27 @@
. "${SCRIPTS:-/}start-utils"
: "${SERVER_PORT:=25565}"
: "${ENABLE_AUTOPAUSE:=false}"
: "${AUTOPAUSE_TIMEOUT_EST:=3600}"
: "${AUTOPAUSE_TIMEOUT_KN:=120}"
: "${AUTOPAUSE_TIMEOUT_INIT:=600}"
: "${AUTOPAUSE_PERIOD:=10}"
: "${AUTOPAUSE_KNOCK_INTERFACE:=eth0}"
: "${DEBUG_AUTOPAUSE:=false}"
export SERVER_PORT
export ENABLE_AUTOPAUSE
export AUTOPAUSE_TIMEOUT_EST
export AUTOPAUSE_TIMEOUT_KN
export AUTOPAUSE_TIMEOUT_INIT
export AUTOPAUSE_PERIOD
export AUTOPAUSE_KNOCK_INTERFACE
export DEBUG_AUTOPAUSE
log "Autopause functionality enabled"
isDebugging && set -x
cp /autopause/knockd-config.cfg /tmp/knockd-config.cfg
cp /auto/knockd-config.cfg /tmp/knockd-config.cfg
# update server port to listen to
regseq="^\s*sequence\s*=\s*$SERVER_PORT\s*$"
@@ -70,4 +84,4 @@ elif [[ -z "$MAX_TICK_TIME" ]] ; then
export MAX_TICK_TIME
fi
/autopause/autopause-daemon.sh &
/auto/autopause-daemon.sh &

View File

@@ -4,7 +4,17 @@
. "${SCRIPTS:-/}start-utils"
: "${SERVER_PORT:=25565}"
: "${ENABLE_AUTOSTOP:=false}"
: "${AUTOSTOP_TIMEOUT_EST:=3600}"
: "${AUTOSTOP_TIMEOUT_INIT:=1800}"
: "${AUTOSTOP_PERIOD:=10}"
: "${DEBUG_AUTOSTOP:=false}"
export SERVER_PORT
export ENABLE_AUTOSTOP
export AUTOSTOP_TIMEOUT_EST
export AUTOSTOP_TIMEOUT_INIT
export AUTOSTOP_PERIOD
export DEBUG_AUTOSTOP
log "Autostop functionality enabled"
@@ -31,4 +41,4 @@ if ! [[ $AUTOSTOP_TIMEOUT_INIT =~ ^[0-9]+$ ]] ; then
log "Warning: AUTOSTOP_TIMEOUT_INIT is not numeric, set to 1800 (seconds)"
fi
/autostop/autostop-daemon.sh &
/auto/autostop-daemon.sh &

View File

@@ -3,11 +3,28 @@ set -euo pipefail
IFS=$'\n\t'
# shellcheck source=start-utils
. ${SCRIPTS:-/}start-utils
. "${SCRIPTS:-/}start-utils"
: "${EULA:=}"
: "${PROXY:=}"
: "${ENABLE_AUTOPAUSE:=false}"
: "${ENABLE_AUTOSTOP:=false}"
: "${RCON_CMDS_STARTUP:=}"
: "${RCON_CMDS_ON_CONNECT:=}"
: "${RCON_CMDS_ON_DISCONNECT:=}"
: "${RCON_CMDS_FIRST_CONNECT:=}"
: "${RCON_CMDS_LAST_DISCONNECT:=}"
: "${RCON_CMDS_PERIOD:=10}"
: "${RCON_PASSWORD_FILE:=}"
: "${ENABLE_RCON:=true}"
: "${RCON_PASSWORD:=minecraft}"
: "${RCON_PORT:=25575}"
export ENABLE_RCON RCON_PASSWORD RCON_PORT
: "${MEMORY=1G}"
: "${INIT_MEMORY=${MEMORY}}"
: "${MAX_MEMORY=${MEMORY}}"
export MEMORY INIT_MEMORY MAX_MEMORY
shopt -s nullglob
@@ -66,9 +83,28 @@ if [[ $RCON_PASSWORD_FILE ]]; then
log ""
fi
if ! which java > /dev/null; then
log "Fixing PATH to include java"
PATH="${PATH}:/opt/java/openjdk/bin"
function fixJavaPath() {
# Some Docker management UIs grab all the image declared variables and present them for configuration.
# When upgrading images across Java versions, that creates a mismatch in PATH's expected by base image.
if ! which java > /dev/null; then
log "ERROR: your Docker provider has an annoying flaw where it"
log " tries to set PATH even though the container establishes"
log " a very specific value."
sleep 2
# now find where java might be
for d in /opt/java/openjdk/bin /usr/bin; do
if [ -x "${d}/java" ]; then
PATH="${PATH}:${d}"
return 0
fi
done
return 1
fi
}
if ! fixJavaPath; then
log "ERROR: could not locate path that contains java"
exit 1
fi
export VERSIONS_JSON=https://launchermeta.mojang.com/mc/game/version_manifest.json
@@ -91,18 +127,32 @@ case "X$VERSION" in
;;
esac
export VANILLA_VERSION
log "Resolved version given ${VERSION} into ${VANILLA_VERSION}"
MAJOR_VANILLA_VERSION=$(get_major_version "$VANILLA_VERSION")
export MAJOR_VANILLA_VERSION
log "Resolved version given ${VERSION} into ${VANILLA_VERSION} and major version ${MAJOR_VANILLA_VERSION}"
cd /data || exit 1
export ORIGINAL_TYPE=${TYPE^^}
if isTrue "${ENABLE_AUTOPAUSE}"; then
${SCRIPTS:-/}start-autopause
"${SCRIPTS:-/}start-autopause"
fi
if isTrue "${ENABLE_AUTOSTOP}"; then
${SCRIPTS:-/}start-autostop
"${SCRIPTS:-/}start-autostop"
fi
if
[[ "$RCON_CMDS_STARTUP" ]] ||
[[ "$RCON_CMDS_ON_CONNECT" ]] ||
[[ "$RCON_CMDS_ON_DISCONNECT" ]] ||
[[ "$RCON_CMDS_FIRST_CONNECT" ]] ||
[[ "$RCON_CMDS_LAST_DISCONNECT" ]]
then
log "Starting RCON commands"
# shellcheck source=start-rconcmds
"${SCRIPTS:-/}start-rconcmds"
fi
if versionLessThan 1.7; then
@@ -116,74 +166,96 @@ fi
log "Resolving type given ${TYPE}"
case "${TYPE^^}" in
*BUKKIT|SPIGOT)
exec ${SCRIPTS:-/}start-deployBukkitSpigot "$@"
exec "${SCRIPTS:-/}start-deployBukkitSpigot" "$@"
;;
PAPER)
exec ${SCRIPTS:-/}start-deployPaper "$@"
exec "${SCRIPTS:-/}start-deployPaper" "$@"
;;
FORGE)
exec ${SCRIPTS:-/}start-deployForge "$@"
evaluateJavaCompatibilityForForge
exec "${SCRIPTS:-/}start-deployForge" "$@"
;;
FABRIC)
exec ${SCRIPTS:-/}start-deployFabric "$@"
exec "${SCRIPTS:-/}start-deployFabric" "$@"
;;
QUILT)
exec "${SCRIPTS:-/}start-deployQuilt" "$@"
;;
FTBA)
exec ${SCRIPTS:-/}start-deployFTBA "$@"
evaluateJavaCompatibilityForForge
exec "${SCRIPTS:-/}start-deployFTBA" "$@"
;;
FTB|CURSEFORGE)
exec ${SCRIPTS:-/}start-deployCF "$@"
evaluateJavaCompatibilityForForge
exec "${SCRIPTS:-/}start-deployCF" "$@"
;;
AUTO_CURSEFORGE)
exec "${SCRIPTS:-/}start-deployAutoCF" "$@"
;;
VANILLA)
exec "${SCRIPTS:-/}start-deployVanilla" "$@"
;;
SPONGEVANILLA)
exec ${SCRIPTS:-/}start-deploySpongeVanilla "$@"
exec "${SCRIPTS:-/}start-deploySpongeVanilla" "$@"
;;
CUSTOM)
exec ${SCRIPTS:-/}start-deployCustom "$@"
evaluateJavaCompatibilityForForge
exec "${SCRIPTS:-/}start-deployCustom" "$@"
;;
MAGMA)
exec ${SCRIPTS:-/}start-deployMagma "$@"
evaluateJavaCompatibilityForForge
exec "${SCRIPTS:-/}start-deployMagma" "$@"
;;
MOHIST)
exec ${SCRIPTS:-/}start-deployMohist "$@"
evaluateJavaCompatibilityForForge
exec "${SCRIPTS:-/}start-deployMohist" "$@"
;;
CATSERVER)
exec ${SCRIPTS:-/}start-deployCatserver "$@"
evaluateJavaCompatibilityForForge
exec "${SCRIPTS:-/}start-deployCatserver" "$@"
;;
LOLISERVER)
evaluateJavaCompatibilityForForge
exec "${SCRIPTS:-/}start-deployLoliserver" "$@"
;;
PURPUR)
exec ${SCRIPTS:-/}start-deployPurpur "$@"
;;
AIRPLANE)
exec ${SCRIPTS:-/}start-deployAirplane "$@"
exec "${SCRIPTS:-/}start-deployPurpur" "$@"
;;
PUFFERFISH)
exec ${SCRIPTS:-/}start-deployPufferfish "$@"
exec "${SCRIPTS:-/}start-deployPufferfish" "$@"
;;
CANYON)
exec ${SCRIPTS:-/}start-deployCanyon "$@"
exec "${SCRIPTS:-/}start-deployCanyon" "$@"
;;
LIMBO)
exec ${SCRIPTS:-/}start-deployLimbo "$@"
exec "${SCRIPTS:-/}start-deployLimbo" "$@"
;;
CRUCIBLE)
log "**********************************************************************"
log "WARNING: The image tag itzg/minecraft-server:java8 is recommended"
log " since some mods require Java 8"
log " Exception traces reporting ClassCastException: class jdk.internal.loader.ClassLoaders\$AppClassLoader"
log " can be fixed with java8"
log "**********************************************************************"
exec "${SCRIPTS:-/}start-deployCrucible" "$@"
;;
@@ -191,7 +263,7 @@ case "${TYPE^^}" in
log "Invalid type: '$TYPE'"
log "Must be: VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, FTBA (multiarch-only),"
log " CURSEFORGE, SPONGEVANILLA, PURPUR, CUSTOM,"
log " MAGMA, MOHIST, CATSERVER, AIRPLANE, PUFFERFISH, CANYON, LIMBO, CRUCIBLE"
log " MAGMA, MOHIST, CATSERVER, LOLISERVER, AIRPLANE, PUFFERFISH, CANYON, LIMBO, CRUCIBLE"
exit 1
;;

View File

@@ -1,47 +0,0 @@
#!/bin/bash
. ${SCRIPTS:-/}start-utils
set -euo pipefail
isDebugging && set -x
IFS=$'\n\t'
if [ "${VERSION}" != "LATEST" ] && [ "${VERSION}" != "PURPUR" ] ; then
log "ERROR: Airplane server type only supports VERSION=LATEST, VERSION=PURPUR."
exit 1
fi
: ${AIRPLANE_TYPE:=airplane}
if [ "${VERSION}" = "LATEST" ] ; then
AIRPLANE_TYPE="airplane"
fi
if [ "${VERSION}" = "PURPUR" ]; then
AIRPLANE_TYPE="airplanepurpur"
fi
log "Using ${AIRPLANE_TYPE} 1.17.1 (1.18 unsupported - use Paper/Pufferfish/Purpur for newer versions)"
export SERVER=${AIRPLANE_TYPE}-1.17.1.jar
log "Removing old Airplane versions ..."
shopt -s nullglob
for f in airplane*.jar; do
[[ $f != $SERVER ]] && rm $f
done
if [ ! -f "$SERVER" ] || isTrue "${FORCE_REDOWNLOAD:-false}"; then
downloadUrl="https://airplane.gg/dl/launcher-${AIRPLANE_TYPE}1.17.1.jar"
log "Downloading Airplane from $downloadUrl ..."
if ! get -o "$SERVER" "$downloadUrl"; then
log "ERROR: failed to download from $downloadUrl (status=$?)"
exit 3
fi
fi
# Normalize on Spigot for later operations
export FAMILY=SPIGOT
export SKIP_LOG4J_CONFIG=true
exec "${SCRIPTS:-/}start-spiget" "$@"

View File

@@ -0,0 +1,72 @@
#!/bin/bash
set -eu
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
: "${CF_PAGE_URL:=}"
: "${CF_SLUG:=}"
: "${CF_FILE_ID:=}"
: "${CF_FILENAME_MATCHER:=}"
: "${CF_PARALLEL_DOWNLOADS:=4}"
: "${CF_FORCE_SYNCHRONIZE:=false}"
: "${CF_EXCLUDE_INCLUDE_FILE:=https://raw.githubusercontent.com/itzg/docker-minecraft-server/master/files/cf-exclude-include.json}"
: "${CF_EXCLUDE_MODS:=}"
: "${CF_FORCE_INCLUDE_MODS:=}"
: "${CF_SET_LEVEL_FROM:=}" # --set-level-from
: "${CF_OVERRIDES_SKIP_EXISTING:=false}" # --overrides-skip-existing
resultsFile=/data/.install-curseforge.env
isDebugging && set -x
args=(
--results-file="$resultsFile"
)
if [[ $CF_PAGE_URL ]]; then
args+=(--modpack-page-url="$CF_PAGE_URL")
fi
if [[ $CF_FILE_ID ]]; then
args+=(--file-id="$CF_FILE_ID")
fi
if [[ $CF_SLUG ]]; then
args+=(--slug="$CF_SLUG")
fi
if [[ $CF_FILENAME_MATCHER ]]; then
args+=(--filename-matcher="$CF_FILENAME_MATCHER")
fi
if [[ ${CF_SET_LEVEL_FROM} ]]; then
args+=(--set-level-from="$CF_SET_LEVEL_FROM")
fi
args+=(
--parallel-downloads="$CF_PARALLEL_DOWNLOADS"
--force-synchronize="$CF_FORCE_SYNCHRONIZE"
--overrides-skip-existing="$CF_OVERRIDES_SKIP_EXISTING"
)
if [[ $CF_EXCLUDE_MODS || $CF_FORCE_INCLUDE_MODS ]]; then
if [[ $CF_EXCLUDE_MODS ]]; then
args+=( --exclude-mods="$CF_EXCLUDE_MODS" )
fi
if [[ $CF_FORCE_INCLUDE_MODS ]]; then
args+=( --force-include-mods="$CF_FORCE_INCLUDE_MODS" )
fi
else
if [[ $CF_EXCLUDE_INCLUDE_FILE ]]; then
args+=( --exclude-include-file="$CF_EXCLUDE_INCLUDE_FILE" )
fi
fi
if ! mc-image-helper install-curseforge "${args[@]}"; then
log "ERROR failed to auto-install CurseForge modpack"
exit 1
fi
# grab SERVER, FAMILY and export it
set -a
# shellcheck disable=SC1090
source "${resultsFile}"
set +a
exec "${SCRIPTS:-/}start-setupWorld" "$@"

View File

@@ -72,7 +72,7 @@ function downloadSpigot {
fi
setServerVar
if [ -f $SERVER ]; then
if [ -f "$SERVER" ] && ! isTrue "$FORCE_REDOWNLOAD"; then
# tell curl to only download when newer
curlArgs="-z $SERVER"
fi
@@ -80,7 +80,7 @@ function downloadSpigot {
curlArgs="$curlArgs -v"
fi
log "Downloading $match from $downloadUrl ..."
curl -fsSL -o $SERVER $curlArgs "$downloadUrl"
curl -fsSL -o "$SERVER" $curlArgs "$downloadUrl"
if [[ $? != 0 || $(grep -c "DOCTYPE html" $SERVER) != 0 ]]; then
cat <<EOF
@@ -92,12 +92,12 @@ ERROR: failed to download from $downloadUrl
EOF
if isDebugging && [[ $(grep -c "DOCTYPE html" $SERVER) != 0 ]]; then
cat $SERVER
if isDebugging && [[ $(grep -c "DOCTYPE html" "$SERVER") != 0 ]]; then
cat "$SERVER"
fi
# remove invalid download
rm $SERVER
rm "$SERVER"
exit 3
fi
@@ -118,7 +118,7 @@ function setServerVar {
if isTrue "$BUILD_SPIGOT_FROM_SOURCE" || isTrue "$BUILD_FROM_SOURCE"; then
setServerVar
if [ ! -f $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then
if [ ! -f "$SERVER" ] || isTrue "$FORCE_REDOWNLOAD"; then
buildSpigotFromSource
fi
else
@@ -127,6 +127,5 @@ fi
# Normalize on Spigot for operations below
export FAMILY=SPIGOT
export SKIP_LOG4J_CONFIG=true
exec ${SCRIPTS:-/}start-spiget "$@"

View File

@@ -27,13 +27,16 @@ isDebugging && set -x
: "${FTB_BASE_DIR:=${CF_BASE_DIR:-/data/FeedTheBeast}}"
export FTB_BASE_DIR
legacyJavaFixerUrl=https://ftb.forgecdn.net/FTB2/maven/net/minecraftforge/lex/legacyjavafixer/1.0/legacyjavafixer-1.0.jar
legacyJavaFixerUrl=https://files.minecraftforge.net/maven/net/minecraftforge/lex/legacyjavafixer/1.0/legacyjavafixer-1.0.jar
export TYPE=CURSEFORGE
FTB_SERVER_MOD=${FTB_SERVER_MOD:-$CF_SERVER_MOD}
log "Looking for Feed-The-Beast / CurseForge server modpack."
requireVar FTB_SERVER_MOD
if [[ ! $FTB_SERVER_MOD ]]; then
log "ERROR: CF_SERVER_MOD or FTB_SERVER_MOD is required to be set"
exit 1
fi
downloadModpack() {
srv_modpack=${FTB_SERVER_MOD}
@@ -133,31 +136,34 @@ if ! isTrue "${USE_MODPACK_START_SCRIPT:-true}"; then
exec "${SCRIPTS:-/}start-setupWorld" "$@"
fi
entryScriptExpr="
-name ServerStart.sh
-o -name serverstart.sh
-o -name ServerStartLinux.sh
-o -name LaunchServer.sh
-o -name server-start.sh
-o -name start-server.sh
-o -name startserver.sh
-o -name StartServer.sh
"
if [[ -d ${FTB_BASE_DIR} ]]; then
startScriptCount=$(find "${FTB_BASE_DIR}" $entryScriptExpr |wc -l)
if (( startScriptCount > 1 )); then
log "Conflicting FTB/CurseForge packages have been installed. Please cleanup ${FTB_BASE_DIR}"
exit 2
findStartScript() {
entryScriptExpr=(
-name ServerStart.sh
-o -name serverstart.sh
-o -name ServerStartLinux.sh
-o -name LaunchServer.sh
-o -name server-start.sh
-o -name SERVER-START.sh
-o -name start-server.sh
-o -name startserver.sh
-o -name StartServer.sh
-o -name run.sh
-o -name start.sh
-o -name launch.sh
)
if [ -d "${FTB_BASE_DIR}" ]; then
find "${FTB_BASE_DIR}" \( "${entryScriptExpr[@]}" \) -print -quit
fi
else
startScriptCount=0
fi
}
startScript=$(findStartScript)
# 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
if [[ ! $startScript ]]; then
downloadModpack
srv_modpack=${FTB_SERVER_MOD}
@@ -165,49 +171,61 @@ if [[ $startScriptCount = 0 ]]; then
mkdir -p "${FTB_BASE_DIR}"
unzip -o "${srv_modpack}" -d "${FTB_BASE_DIR}" | awk '{printf "."} END {print ""}'
installScript=$(find "${FTB_BASE_DIR}" -maxdepth 2 -type f -name install.sh)
installScriptExpr=(
-name install.sh
-o -name FTBInstall.sh
-o -name Install.sh
)
installScript=$(find "${FTB_BASE_DIR}" -maxdepth 2 -type f \( "${installScriptExpr[@]}" \) -print -quit)
if [[ "$installScript" ]]; then
(
cd "$(dirname "${installScript}")"
chmod +x ./install.sh
log "Running included install.sh"
./install.sh
chmod +x "${installScript}"
log "Running included $(basename "${installScript}"). This might take a minute or two..."
"${installScript}" > install.log
)
fi
startScript=$(findStartScript)
fi
if [[ $(find "${FTB_BASE_DIR}" $entryScriptExpr | wc -l) = 0 ]]; then
# start script provided by unzipped+installed modpack?
if [[ ! $startScript ]]; then
# no, then look for a forge jar to run
# Allow up to 2 levels since some modpacks have a top-level directory named
# for the modpack
forgeJar=$(find "${FTB_BASE_DIR}" -maxdepth 2 -type f \( -path "/libraries/*" -o -path "/mods/*" \) -prune -o -name "forge*.jar" -not -name "forge*installer.jar" -print)
if [[ "$forgeJar" ]]; then
FTB_BASE_DIR=$(dirname "${forgeJar}")
export FTB_BASE_DIR
log "No entry script found, so building one for ${forgeJar}"
cat > "${FTB_BASE_DIR}/ServerStart.sh" <<EOF
# Allow up to 2 levels since some modpacks have a top-level directory named for the modpack
forgeJar=$(find "${FTB_BASE_DIR}" -maxdepth 2 -type f \( -path "/libraries/*" -o -path "/mods/*" \) -prune -o -name "forge*.jar" -not -name "forge*installer.jar" -print)
if [[ "$forgeJar" ]]; then
FTB_BASE_DIR=$(dirname "${forgeJar}")
export FTB_BASE_DIR
log "No entry script found, so building one for ${forgeJar}"
cat > "${FTB_BASE_DIR}/ServerStart.sh" <<EOF
#!/bin/sh
. ./settings-local.sh
java \${JAVA_PARAMETERS} -Xmx\${MAX_RAM} -jar $(basename "${forgeJar}") nogui
EOF
chmod +x "${FTB_BASE_DIR}/ServerStart.sh"
else
log "Please make sure you are using the server version of the FTB modpack!"
exit 2
fi
startScript="${FTB_BASE_DIR}/ServerStart.sh"
chmod +x "$startScript"
else
log "ERROR: Modpack missing start script and unable to find Forge jar to generate one"
exit 2
fi
fi
scriptCount=$(find "${FTB_BASE_DIR}" $entryScriptExpr | wc -l)
if [[ $scriptCount = 0 ]]; then
log "Please make sure you are using the server version of the FTB modpack!"
exit 2
elif (( scriptCount > 1 )); then
log "Ambiguous startup scripts in FTB modpack! Found:"
find "${FTB_BASE_DIR}" $entryScriptExpr
exit 2
# Modpacks that use https://github.com/BloodyMods/ServerStarter will sometimes specify an
# extra subpath where all the server files get installed. Need to transplant EULA file there.
serverSetupConfig=$(find "${FTB_BASE_DIR}" -type f -name server-setup-config.yaml)
if [[ $serverSetupConfig && $serverSetupConfig != "~" ]]; then
if baseInstallPath=$(mc-image-helper yaml-path --file "$serverSetupConfig" ".install.baseInstallPath"); then
resolvedBaseInstallPath="$(dirname "$serverSetupConfig")/${baseInstallPath}"
mkdir -p "$resolvedBaseInstallPath"
cp -n /data/eula.txt "${resolvedBaseInstallPath}/eula.txt"
fi
fi
FTB_SERVER_START=$(find "${FTB_BASE_DIR}" $entryScriptExpr)
FTB_SERVER_START="$startScript"
export FTB_SERVER_START
FTB_DIR=$(dirname "${FTB_SERVER_START}")
@@ -226,15 +244,5 @@ if isTrue "${FTB_LEGACYJAVAFIXER}" && [ ! -e "${legacyJavaFixerPath}" ]; then
fi
fi
if [ -e "${FTB_DIR}/FTBInstall.sh" ]; then
pushd "${FTB_DIR}"
sh FTBInstall.sh
popd
elif [ -e "${FTB_DIR}/Install.sh" ]; then
pushd "${FTB_DIR}"
sh Install.sh
popd
fi
export FAMILY=FORGE
exec "${SCRIPTS:-/}start-setupWorld" "$@"

View File

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

View File

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

View File

@@ -55,7 +55,6 @@ if [ ! -d "$librariesDir" ]; then
fi
export SERVER
export SKIP_LOG4J_CONFIG=true
export FAMILY=HYBRID
exec "${SCRIPTS:-$(dirname "$0")}/start-setupWorld" "$@"

View File

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

View File

@@ -2,10 +2,16 @@
ftbInstallMarker=".ftb-installed"
. ${SCRIPTS:-/}start-utils
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
isDebugging && set -x
set -e
if [[ $(getDistro) = alpine ]]; then
log "ERROR: the FTBA installer is not supported on Alpine. Use the java8-multiarch image tag instead."
exit 1
fi
if ! [[ -v FTB_MODPACK_ID ]]; then
log "ERROR FTB_MODPACK_ID is required with TYPE=FTB"
exit 1
@@ -26,7 +32,7 @@ elif ! [[ ${FTB_MODPACK_VERSION_ID} =~ [0-9]+ ]]; then
exit 1
fi
if ! [ -f "${ftbInstallMarker}" ] || [ $(cat "${ftbInstallMarker}") != "${FTB_MODPACK_ID}=${FTB_MODPACK_VERSION_ID}" ]; then
if ! [ -f "${ftbInstallMarker}" ] || [ "$(cat "${ftbInstallMarker}")" != "${FTB_MODPACK_ID}=${FTB_MODPACK_VERSION_ID}" ]; then
ftbInstaller=/data/ftb-installer
if ! [[ -f "${ftbInstaller}" ]]; then
log "Downloading FTB installer"
@@ -40,10 +46,9 @@ if ! [ -f "${ftbInstallMarker}" ] || [ $(cat "${ftbInstallMarker}") != "${FTB_MO
chmod +x "${ftbInstaller}"
fi
rm -rf forge*jar mods config libraries defaultconfigs changelogs
log "Installing modpack ID ${FTB_MODPACK_ID}, version ID ${FTB_MODPACK_VERSION_ID}"
${ftbInstaller} ${FTB_MODPACK_ID} ${FTB_MODPACK_VERSION_ID} --noscript --auto
log "This could take a while..."
${ftbInstaller} "${FTB_MODPACK_ID}" "${FTB_MODPACK_VERSION_ID}" --noscript --auto > ftb-installer.log
rm -f forge*installer.jar
echo "${FTB_MODPACK_ID}=${FTB_MODPACK_VERSION_ID}" > ${ftbInstallMarker}
@@ -56,16 +61,16 @@ else
log "FTB modpack ID ${FTB_MODPACK_ID}, version ID ${FTB_MODPACK_VERSION_ID} is ready to go"
fi
isDebugging && cat version.json
forgeVersion=$(jq -r '.targets|unique[] | select(.name == "forge") | .version' version.json)
fabricVersion=$(jq -r '.targets|unique[] | select(.name == "fabric") | .version' version.json)
mcVersion=$(jq -r '.targets|unique[] | select(.name == "minecraft") | .version' version.json)
variants=(
forge-${mcVersion}-${forgeVersion}.jar
forge-${mcVersion}-${forgeVersion}-universal.jar
forge-${mcVersion}-${forgeVersion}-${mcVersion}-universal.jar
fabric-${mcVersion}-${fabricVersion}-server-launch.jar
"forge-${mcVersion}-${forgeVersion}.jar"
"forge-${mcVersion}-${forgeVersion}-universal.jar"
"forge-${mcVersion}-${forgeVersion}-${mcVersion}-universal.jar"
"fabric-${mcVersion}-${fabricVersion}-server-launch.jar"
run.sh
)
for f in "${variants[@]}"; do
if [ -f $f ]; then
@@ -75,9 +80,10 @@ for f in "${variants[@]}"; do
done
if ! [ -v SERVER ]; then
log "ERROR unable to locate the installed FTB server jar"
ls *.jar
log " Tried looking for ${variants[*]}"
exit 2
fi
export FAMILY=FORGE
exec ${SCRIPTS:-/}start-setupWorld $@
exec "${SCRIPTS:-/}start-setupWorld" "$@"

View File

@@ -4,78 +4,49 @@ set -eu
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
requireVar VANILLA_VERSION
export TYPE=FABRIC
: "${FABRIC_INSTALLER_VERSION:=${FABRICVERSION:-LATEST}}"
: "${FABRIC_INSTALLER:=}"
: "${FABRIC_INSTALLER_URL:=}"
: "${FABRIC_LAUNCHER_VERSION:=${FABRIC_INSTALLER_VERSION:-LATEST}}"
: "${FABRIC_LAUNCHER:=}"
: "${FABRIC_LAUNCHER_URL:=}"
: "${FABRIC_LOADER_VERSION:=LATEST}"
resultsFile=/data/.install-fabric.env
isDebugging && set -x
log "Checking Fabric version information."
if [[ $FABRIC_INSTALLER ]]; then
FABRIC_INSTALLER_VERSION=$(echo -n "$FABRIC_INSTALLER" | mc-image-helper hash)
elif [[ $FABRIC_INSTALLER_URL ]]; then
FABRIC_INSTALLER_VERSION=$(echo -n "$FABRIC_INSTALLER_URL" | mc-image-helper hash)
elif [[ ${FABRIC_INSTALLER_VERSION^^} = LATEST ]]; then
FABRIC_INSTALLER_VERSION=$(maven-metadata-release https://maven.fabricmc.net/net/fabricmc/fabric-installer/maven-metadata.xml)
# Custom fabric jar
if [[ $FABRIC_LAUNCHER ]]; then
if ! mc-image-helper install-fabric-loader \
--results-file=${resultsFile} \
--from-local-file="$FABRIC_LAUNCHER"; then
log "ERROR failed to install Fabric launcher from $FABRIC_LAUNCHER"
exit 1
fi
# Custom fabric jar url
elif [[ $FABRIC_LAUNCHER_URL ]]; then
if ! mc-image-helper install-fabric-loader \
--results-file=${resultsFile} \
--from-url="$FABRIC_LAUNCHER_URL"; then
log "ERROR failed to install Fabric launcher from $FABRIC_LAUNCHER_URL"
exit 1
fi
# Official fabric launcher
else
if ! mc-image-helper install-fabric-loader \
--results-file=${resultsFile} \
--minecraft-version="${VANILLA_VERSION}" \
--installer-version="${FABRIC_LAUNCHER_VERSION}" \
--loader-version="${FABRIC_LOADER_VERSION}"; then
log "ERROR failed to install Fabric launcher from $VANILLA_VERSION, $FABRIC_LAUNCHER_VERSION, $FABRIC_LOADER_VERSION"
exit 1
fi
fi
export SERVER=fabric-server-${VANILLA_VERSION}-${FABRIC_INSTALLER_VERSION}.jar
if [ ! \( -e ${SERVER} -a -e "server-${VANILLA_VERSION}.jar" \) ]; then
if [[ -z $FABRIC_INSTALLER && -z $FABRIC_INSTALLER_URL ]]; then
FABRIC_INSTALLER="fabric-installer-${FABRIC_INSTALLER_VERSION}.jar"
FABRIC_INSTALLER_URL="https://maven.fabricmc.net/net/fabricmc/fabric-installer/${FABRIC_INSTALLER_VERSION}/fabric-installer-${FABRIC_INSTALLER_VERSION}.jar"
elif [[ -z $FABRIC_INSTALLER ]]; then
FABRIC_INSTALLER="fabric-installer.jar"
elif [[ ! -e $FABRIC_INSTALLER ]]; then
log "ERROR: the given Fabric installer doesn't exist : $FABRIC_INSTALLER"
exit 2
fi
if [[ -z $FABRIC_LOADER_VERSION || ${FABRIC_LOADER_VERSION^^} = LATEST ]]; then
log "Checking Fabric Loader version information."
FABRIC_LOADER_VERSION=$(maven-metadata-release https://maven.fabricmc.net/net/fabricmc/fabric-loader/maven-metadata.xml)
fi
if [[ ! -e $FABRIC_INSTALLER ]]; then
log "Downloading $FABRIC_INSTALLER_URL ..."
if ! get -o "$FABRIC_INSTALLER" "$FABRIC_INSTALLER_URL"; then
log "Failed to download from given location $FABRIC_INSTALLER_URL"
exit 2
fi
fi
log "Installing Fabric ${VANILLA_VERSION} using $FABRIC_INSTALLER with loader version $FABRIC_LOADER_VERSION"
tries=3
set +e
while ((--tries >= 0)); do
java -jar $FABRIC_INSTALLER server \
-mcversion $VANILLA_VERSION \
-loader $FABRIC_LOADER_VERSION \
-downloadMinecraft \
-dir /data
if [[ $? == 0 ]]; then
break
fi
done
set -e
if (($tries < 0)); then
log "Fabric failed to install after several tries." >&2
exit 10
fi
mv server.jar "server-${VANILLA_VERSION}.jar"
mv fabric-server-launch.jar "${SERVER}"
fi
# Specify which server jar to run
echo "serverJar=server-${VANILLA_VERSION}.jar" > fabric-server-launcher.properties
# grab SERVER and export it
set -a
# shellcheck disable=SC1090
source "${resultsFile}"
set +a
export FAMILY=FABRIC
exec "${SCRIPTS:-/}start-setupWorld" "$@"

View File

@@ -1,151 +1,42 @@
#!/bin/bash
: "${FORGEVERSION:=RECOMMENDED}"
: "${FORGE_VERSION:=${FORGEVERSION:-RECOMMENDED}}"
: "${FORGE_FORCE_REINSTALL:=false}}"
# shellcheck source=start-utils
. "${SCRIPTS:-$(dirname "$0")}/start-utils"
isDebugging && set -x
get_installer() {
if [[ -z $FORGE_INSTALLER_URL ]]; then
log "Downloading $normForgeVersion"
forgeFileNames="
$shortForgeVersion/forge-$shortForgeVersion-installer.jar
$normForgeVersion/forge-$normForgeVersion-installer.jar
"
for fn in $forgeFileNames; do
downloadUrl=https://maven.minecraftforge.net/net/minecraftforge/forge/$fn
log "...trying $downloadUrl"
if get -o "$FORGE_INSTALLER" "$downloadUrl"; then
return
fi
done
log "Unable to locate usable URL for $normForgeVersion"
exit 2
else
log "Downloading $FORGE_INSTALLER_URL ..."
if ! get -o "$FORGE_INSTALLER" "$FORGE_INSTALLER_URL"; then
log "Failed to download from given location $FORGE_INSTALLER_URL"
exit 2
fi
fi
}
install() {
if [ ! -e "$FORGE_INSTALLER" ]; then
get_installer "$normForgeVersion" "$shortForgeVersion"
if [[ ${FORGE_INSTALLER} ]]; then
if ! mc-image-helper install-forge \
--output-directory=/data \
--results-file=/data/.run-forge.env \
--minecraft-version="${VANILLA_VERSION}" \
--forge-installer="${FORGE_INSTALLER}" \
--force-reinstall="${FORGE_FORCE_REINSTALL}"; then
log "ERROR failed to install Forge given installer ${FORGE_INSTALLER}"
exit 1
fi
log "Installing Forge $shortForgeVersion using $FORGE_INSTALLER"
mkdir -p mods
tries=3
while ((--tries >= 0)); do
if java -jar "$FORGE_INSTALLER" --installServer; then
break
fi
done
if ((tries < 0)); then
log "Forge failed to install after several tries." >&2
exit 10
fi
# NOTE $shortForgeVersion will be empty if installer location was given to us
log "Finding installed server jar..."
unset -v latest
# 1.17+ ?
if [ -f /data/run.sh ]; then
latest=/data/run.sh
# else pre 1.17
else
for file in *forge*.jar; do
if ! [[ $file =~ installer ]]; then
if [[ -z $latest ]] || [[ $file -nt $latest ]]; then
latest=$file
fi
fi
done
fi
if [[ -z $latest ]]; then
log "Unable to derive server jar for Forge"
exit 2
fi
export SERVER=$latest
log "Using server $SERVER"
debug "Writing install marker at $installMarker"
echo "$SERVER" > "$installMarker"
}
resolve_versions() {
if [[ -z $FORGE_INSTALLER && -z $FORGE_INSTALLER_URL ]]; then
norm=$VANILLA_VERSION
case $VANILLA_VERSION in
*.*.*)
norm=$VANILLA_VERSION ;;
*.*)
norm=${VANILLA_VERSION}.0 ;;
esac
#################################################################################
promosUrl=http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json
log "Checking Forge version information."
case $FORGEVERSION in
LATEST)
if ! FORGE_VERSION=$(get --json-path ".promos['$VANILLA_VERSION-latest']" "$promosUrl"); then
log "ERROR: Version $VANILLA_VERSION is not supported by Forge"
log " Refer to http://files.minecraftforge.net/ for supported versions"
exit 2
fi
;;
RECOMMENDED)
if ! FORGE_VERSION=$(get -s --json-path ".promos['$VANILLA_VERSION-recommended']" "$promosUrl"); then
if ! FORGE_VERSION=$(get --json-path ".promos['$VANILLA_VERSION-latest']" "$promosUrl"); then
log "ERROR: Version $VANILLA_VERSION is not supported by Forge"
log " Refer to http://files.minecraftforge.net/ for supported versions"
exit 2
fi
fi
;;
*)
FORGE_VERSION=$FORGEVERSION
;;
esac
normForgeVersion=$VANILLA_VERSION-$FORGE_VERSION-$norm
shortForgeVersion=$VANILLA_VERSION-$FORGE_VERSION
FORGE_INSTALLER="/tmp/forge-$shortForgeVersion-installer.jar"
elif [[ -z $FORGE_INSTALLER ]]; then
FORGE_INSTALLER="/tmp/forge-installer.jar"
elif [[ ! -e $FORGE_INSTALLER ]]; then
log "ERROR: the given Forge installer doesn't exist : $FORGE_INSTALLER"
exit 2
else
shortForgeVersion=$VANILLA_VERSION-${FORGE_INSTALLER_CUSTOM_VERSION:-custom}
fi
}
### main
resolve_versions
installMarker="/data/.forge-installed-$shortForgeVersion"
if [ ! -e "$installMarker" ] || isTrue "${FORCE_REINSTALL:-false}"; then
install
else
SERVER=$(cat "$installMarker")
export SERVER
if [ ! -e "$SERVER" ]; then
rm "$installMarker"
install
if ! mc-image-helper install-forge \
--output-directory=/data \
--results-file=/data/.run-forge.env \
--minecraft-version="${VANILLA_VERSION}" \
--forge-version="${FORGE_VERSION}" \
--force-reinstall="${FORGE_FORCE_REINSTALL}"; then
log "ERROR failed to install Forge"
exit 1
fi
fi
# grab SERVER and export it
set -a
source /data/.run-forge.env
set +a
export FAMILY=FORGE
exec "${SCRIPTS:-/}start-setupWorld" "$@"

View File

@@ -8,7 +8,7 @@ isDebugging && set -x
: ${LIMBO_BUILD:=LATEST}
: ${FORCE_REDOWNLOAD:=false}
: ${LIMBO_SCHEMA_FILENAME:=default.schem}
: ${LEVEL:=Default;${LIMBO_SCHEMA_FILENAME}}
: ${LEVEL:=default;${LIMBO_SCHEMA_FILENAME}}
# defaults to localhost, if this is not set
: ${SERVER_IP:=0.0.0.0}
@@ -58,7 +58,5 @@ if [[ ${LEVEL} != *\;* ]]; then
fi
export LEVEL
export SKIP_LOG4J_CONFIG=true
export FAMILY=LIMBO
exec ${SCRIPTS:-/}start-setupWorld $@

32
scripts/start-deployLoliserver Executable file
View File

@@ -0,0 +1,32 @@
#!/bin/bash
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
set -o pipefail
set -e
latestAsset=$(
curl -fsSL https://cdn.ci.loliidc.cn:30011/job/LoliServer-1.16.5/lastSuccessfulBuild/artifact/projects/LoliServer/build/libs | \
jq '.assets[] | select(.name | match(".*-server.jar"))'
)
if [[ -z "${latestAsset}" ]]; then
log "ERROR: latest release of Loliserver is missing server.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://cdn.ci.loliidc.cn:30011/job/LoliServer-1.16.5/lastSuccessfulBuild/artifact/projects/LoliServer/build/libs/${latestJarId}
fi
export FAMILY=HYBRID
exec "${SCRIPTS:-/}start-setupWorld" "$@"

View File

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

View File

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

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