Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 71 additions & 2 deletions .schema/gametemplate.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,40 @@
"modpacks": {
"description": "Modpacks, when set, surfaces a Modpacks browser for this provider and\ndeclares how installing one is applied. A modpack is selected as a\nwhole (not added to the mods dir like a single mod), so install\neither pins it via a game-image env (RefEnv) or resolves and installs\nits dependency mods. Omit for providers without modpacks. Steam\nWorkshop collections are always env-mode: set RefEnv to the game\nimage's collection-id variable (e.g. \"WORKSHOP_COLLECTION\") since\nsteamcmd resolves a collection's members itself inside the container.",
"properties": {
"adoptVersionFile": {
"description": "AdoptVersionFile says where the image records the installed pack\nversion, so legacy unpinned packs can be adopted with their version.",
"properties": {
"field": {
"description": "Field is the top-level JSON field holding the version (e.g. \"versionId\").",
"maxLength": 64,
"minLength": 1,
"type": "string"
},
"path": {
"description": "Path is the JSON file, relative to the data mount\n(e.g. \".modrinth-modpack-manifest.json\").",
"maxLength": 128,
"minLength": 1,
"type": "string",
"x-kubernetes-validations": [
{
"message": "path must be relative to the data mount and must not contain '..'",
"rule": "!self.startsWith('/') && !self.contains('..')"
}
]
}
},
"required": [
"field",
"path"
],
"type": "object"
},
"apiKeyEnv": {
"description": "APIKeyEnv is the game-image env that receives the shared CurseForge\nAPI key (e.g. \"CF_API_KEY\") through a secretKeyRef to a server-owned\nSecret, while the admin has key sharing on. Only valid when the\nprovider is curseforge.",
"maxLength": 64,
"pattern": "^[A-Za-z_][A-Za-z0-9_]*$",
"type": "string"
},
"env": {
"description": "Env are additional fixed env applied alongside RefEnv when a modpack\nis active, e.g. {TYPE: MODRINTH} to switch the itzg image into\nModrinth-modpack mode. Bounded to keep the CRD small.",
"items": {
Expand Down Expand Up @@ -605,16 +639,46 @@
"maxItems": 16,
"type": "array"
},
"missingFilesPath": {
"description": "MissingFilesPath is the file, relative to the data mount, where the\nimage lists files that need a manual download\n(e.g. \"MODS_NEED_DOWNLOAD.txt\").",
"maxLength": 128,
"type": "string",
"x-kubernetes-validations": [
{
"message": "missingFilesPath must be relative to the data mount and must not contain '..'",
"rule": "!self.startsWith('/') && !self.contains('..')"
}
]
},
"needsKeyImageTags": {
"description": "NeedsKeyImageTags lists image tags (the part after \":\" and before \"@\")\nthat have no built-in CurseForge key. Servers on these images get this\nprovider only while key sharing is on.",
"items": {
"maxLength": 64,
"type": "string"
},
"maxItems": 8,
"type": "array"
},
"refEnv": {
"description": "RefEnv, when set, is the game-image env the operator points at the\nchosen modpack reference (slug/URL) \u2014 e.g. \"MODRINTH_MODPACK\" for the\nitzg image. Installing then patches GameServer.spec.env and restarts;\none modpack is active per server. When empty, installing instead\nresolves and installs the modpack's dependency mods (e.g. a\nThunderstore/BepInEx pack).",
"maxLength": 64,
"type": "string"
},
"versionEnv": {
"description": "VersionEnv is the game-image env the operator sets to the pinned pack\nversion id (e.g. \"MODRINTH_VERSION\", \"CF_FILE_ID\",\n\"FTB_MODPACK_VERSION_ID\"). Required for env-mode packs that support\npinning; when empty the registry is not offered for pinned install.",
"maxLength": 64,
"pattern": "^[A-Za-z_][A-Za-z0-9_]*$",
"type": "string"
}
},
"type": "object"
},
"modpacksOnly": {
"description": "ModpacksOnly hides this provider from the Mods tab: it is offered only\nin the Modpacks tab (e.g. \"ftb\", whose registry has packs but no\nsingle-mod listing). Requires Modpacks to be set to be useful.",
"type": "boolean"
},
"provider": {
"description": "Provider names the built-in registry engine: \"modrinth\" (Minecraft\nmods/plugins, keyless), \"thunderstore\" (BepInEx games, keyless,\nper-community), \"curseforge\" (mods/modpacks for the game identified\nby CurseForgeGameID, needs an API key), \"hangar\" (PaperMC plugins,\nkeyless), \"factorio\" (the official Factorio mod portal; browse is\nkeyless, downloads need the player's own factorio.com credentials so\ninstalls hand off to the from-URL form), \"steam\" (Steam Workshop\nbrowse, needs a Steam Web API key; see SteamAppID \u2014 Workshop content\nhas no download URL, so it's a preview-only browser wired to\nmodpacks.refEnv for collection-based games like Garry's Mod/CS2),\n\"nexus\" (Nexus Mods, needs an API key, browse-only for the same\nreason as steam \u2014 see Community for its per-game domain slug),\n\"spigot\" (SpigotMC plugins via the Spiget API, keyless), \"github\"\n(one repository's Releases stand in for versions, keyless but\nrate-limited \u2014 see GitHub), or \"umod\" (Rust/Hurtworld/7 Days to\nDie's Oxide/uMod plugin ecosystem, keyless).",
"description": "Provider names the built-in registry engine: \"modrinth\" (Minecraft\nmods/plugins, keyless), \"thunderstore\" (BepInEx games, keyless,\nper-community), \"curseforge\" (mods/modpacks for the game identified\nby CurseForgeGameID, needs an API key), \"hangar\" (PaperMC plugins,\nkeyless), \"factorio\" (the official Factorio mod portal; browse is\nkeyless, downloads need the player's own factorio.com credentials so\ninstalls hand off to the from-URL form), \"steam\" (Steam Workshop\nbrowse, needs a Steam Web API key; see SteamAppID \u2014 Workshop content\nhas no download URL, so it's a preview-only browser wired to\nmodpacks.refEnv for collection-based games like Garry's Mod/CS2),\n\"nexus\" (Nexus Mods, needs an API key, browse-only for the same\nreason as steam \u2014 see Community for its per-game domain slug),\n\"spigot\" (SpigotMC plugins via the Spiget API, keyless), \"github\"\n(one repository's Releases stand in for versions, keyless but\nrate-limited \u2014 see GitHub), or \"umod\" (Rust/Hurtworld/7 Days to\nDie's Oxide/uMod plugin ecosystem, keyless), or \"ftb\" (Feed The Beast\nmodpacks, keyless, modpack-only: it has no single-mod browse).",
"enum": [
"modrinth",
"thunderstore",
Expand All @@ -625,7 +689,8 @@
"spigot",
"github",
"umod",
"nexus"
"nexus",
"ftb"
],
"type": "string"
},
Expand All @@ -652,6 +717,10 @@
{
"message": "curseforgeGameID is required when provider is curseforge",
"rule": "self.provider != 'curseforge' || (has(self.curseforgeGameID) && self.curseforgeGameID > 0)"
},
{
"message": "modpacks.apiKeyEnv is only valid when provider is curseforge",
"rule": "!has(self.modpacks) || !has(self.modpacks.apiKeyEnv) || self.provider == 'curseforge'"
}
]
},
Expand Down
44 changes: 44 additions & 0 deletions minecraft-java/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,50 @@ one-click install a mod or plugin by name without hunting for a URL. The
chosen file downloads through the same allowlist (Modrinth's CDN is listed).
**From URL** install remains available for anything not on Modrinth.

## Modpacks (2.13.0)

The **Modpacks** tab installs a whole modpack onto a server. Modrinth,
CurseForge and FTB packs are listed; the pack is pinned to a version and
installed on boot by the game image, so one modpack applies per server.
Changing the pinned version is a server update, and Gameplane adopts packs
that were installed before version pinning existed. FTB packs are modpacks
only and do not appear in the Mods tab.

Each provider pins its pack by version: CurseForge by file ID
(`CF_FILE_ID`), Modrinth by version ID (`MODRINTH_VERSION`) and FTB by
version ID (`FTB_MODPACK_VERSION_ID`).

### What admins need for CurseForge

- **API key.** Store the CurseForge API key through the panel's mod registry
API. Without one, the CurseForge provider is hidden.
- **Minecraft 1.16.5 and older (`java8` images).** The `java8-multiarch` and
`java8` images have no built-in CurseForge key. CurseForge packs for these
versions are offered only while key sharing is on. Sharing is opt-in (off by
default) and is set through the API: add the
`gameplane.local/share-with-game-servers: "true"` annotation to the managed
Secret `gameplane-modreg-curseforge`. Until a dashboard switch exists, this
is the only way to turn it on. With sharing on,
each server gets its own server-owned copy of the key, passed to the game
container as `CF_API_KEY`. The copy follows key rotation and is removed when
the admin key is removed or sharing is turned off. The key never appears in
GameServer env as plain text, in logs, or in API responses.
- **Images for 1.18.2 and newer** (`java17`, `java21`, `java25`) ship a
built-in key, so sharing is not needed for them.

### Blocked downloads

Some CurseForge mod authors do not allow third-party downloads. Gameplane
lists those files in the Modpacks tab. Upload them to the server's
`downloads/` folder (`/data/downloads`, the `CF_DOWNLOADS_REPO` path on the
data volume), then restart the server to finish the install.

### FTB

FTB packs need no key. They use the `ftb` provider, which is modpacks only.

Modpacks need minimum Gameplane 0.5.0.

## JVM startup settings (2.12.0)

Install the Gameplane CRDs and operator with support for `applyOnRestart`
Expand Down
2 changes: 1 addition & 1 deletion minecraft-java/locales/.review.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
"mods.quilt.displayName": "b9af36268901",
"mods.spigot.displayName": "d1b98c6328d1",
"module.displayName": "98d613a03d7b",
"module.summary": "77dc338111c2",
"module.summary": "1d86b30c6f92",
"template.description": "04177b3c0f71",
"template.displayName": "98d613a03d7b",
"versions.1~116~15-forge.displayName": "3cedd3d01ab6",
Expand Down
2 changes: 1 addition & 1 deletion minecraft-java/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@
"description": "Display name of the module (module.yaml displayName)"
},
"module.summary": {
"defaultMessage": "Vanilla / Paper / Spigot / Bukkit / Purpur / Forge / NeoForge / Fabric / Quilt servers (itzg/minecraft-server) with a version+loader picker spanning 1.16.5–latest, per-loader mod volumes, and in-app Modrinth browse.",
"defaultMessage": "Vanilla / Paper / Spigot / Bukkit / Purpur / Forge / NeoForge / Fabric / Quilt servers (itzg/minecraft-server) with a version+loader picker spanning 1.16.5–latest, per-loader mod volumes, in-app Modrinth browse, and Modrinth, CurseForge and FTB modpacks.",
"description": "One-line summary of the module (module.yaml summary)"
},
"template.description": {
Expand Down
2 changes: 1 addition & 1 deletion minecraft-java/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@
"description": "Display name of the module (module.yaml displayName)"
},
"module.summary": {
"defaultMessage": "Serveurs Vanilla / Paper / Spigot / Bukkit / Purpur / Forge / NeoForge / Fabric / Quilt (itzg/minecraft-server) avec un sélecteur version + loader allant de 1.16.5 à la dernière version, des volumes de mods distincts par loader et la recherche Modrinth intégrée à l’application.",
"defaultMessage": "Serveurs Vanilla / Paper / Spigot / Bukkit / Purpur / Forge / NeoForge / Fabric / Quilt (itzg/minecraft-server) avec un sélecteur version + loader allant de 1.16.5 à la dernière version, des volumes de mods distincts par loader et la recherche Modrinth intégrée à l’application, ainsi que les modpacks Modrinth, CurseForge et FTB.",
"description": "One-line summary of the module (module.yaml summary)"
},
"template.description": {
Expand Down
6 changes: 3 additions & 3 deletions minecraft-java/module.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
apiVersion: gameplane.local/module/v1
name: minecraft-java
displayName: Minecraft (Java Edition)
version: 2.12.0
version: 2.13.0
game: minecraft-java
categories: [Sandbox, Survival, Building, Modded, Creative]
summary: Vanilla / Paper / Spigot / Bukkit / Purpur / Forge / NeoForge / Fabric / Quilt servers (itzg/minecraft-server) with a version+loader picker spanning 1.16.5–latest, per-loader mod volumes, and in-app Modrinth browse.
summary: Vanilla / Paper / Spigot / Bukkit / Purpur / Forge / NeoForge / Fabric / Quilt servers (itzg/minecraft-server) with a version+loader picker spanning 1.16.5–latest, per-loader mod volumes, in-app Modrinth browse, and Modrinth, CurseForge and FTB modpacks.
homepage: https://www.minecraft.net/
license: MIT
gameplaneMinVersion: 0.4.1
gameplaneMinVersion: 0.5.0
81 changes: 81 additions & 0 deletions minecraft-java/specs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Gameplane Module Specification: Minecraft (Java Edition)

## 1. Purpose & Scope

- **Game**: Minecraft: Java Edition
- **Module Slug**: `minecraft-java`
- **Version**: 2.13.0 (minimum Gameplane 0.5.0)
- **Role**: GameTemplate for Minecraft Java servers, backed by the community `itzg/minecraft-server` image.

---

## 2. Container Image & Architecture

- **Images**: `itzg/minecraft-server` tagged by Java runtime. `java8-multiarch` for Minecraft 1.16.5 and older, `java17` for 1.18.2 to 1.20.x, `java21` for 1.21.x, `java25` for newer versions. The tag selects the runtime only; `TYPE` and `VERSION` select the server software.
- **Image override**: `GameServer.spec.image` replaces the tag for one server.

---

## 3. Network Ports & Protocols

| Port Name | Container Port | Protocol | Advertised | Usage / Purpose |
|---|---|---|---|---|
| `game` | 25565 | TCP | yes | Game traffic |
| `rcon` | 25575 | TCP | no | Agent console, moderation, backup quiesce, metrics (pod network only) |

---

## 4. Mod Registries (`spec.capabilities.mods.registry.providers`)

The Mods tab and the Modpacks tab read the same provider list.

| Provider | Mods tab | Modpacks tab | Key | Pin env (version) |
|---|---|---|---|---|
| `modrinth` (default) | yes | yes | none | `MODRINTH_VERSION` |
| `curseforge` | yes | yes | `CF_API_KEY` (see section 5) | `CF_FILE_ID` |
| `hangar` | yes | no | none | n/a |
| `ftb` | no (`modpacksOnly: true`) | yes | none | `FTB_MODPACK_VERSION_ID` |

### CurseForge provider

- `curseforgeGameID: 432` (Minecraft).
- Modpacks: `TYPE=AUTO_CURSEFORGE`, `CF_SLUG` (pack), `CF_FILE_ID` (pinned file), `CF_DOWNLOADS_REPO=/data/downloads`.
- `missingFilesPath: MODS_NEED_DOWNLOAD.txt`: files whose authors block third-party downloads are listed here and in the Modpacks tab. The admin places them in `/data/downloads` and restarts.
- `needsKeyImageTags: [java8-multiarch, java8]`: these images have no built-in key.

### FTB provider

- `TYPE=FTBA`, `FTB_MODPACK_ID`, pinned by `FTB_MODPACK_VERSION_ID`.
- Keyless. Modpacks only.

### Modrinth provider

- `TYPE=MODRINTH`, `MODRINTH_MODPACK` (slug), pinned by `MODRINTH_VERSION`.
- `adoptVersionFile: { path: .modrinth-modpack-manifest.json, field: versionId }` lets Gameplane adopt packs installed before version pinning.

---

## 5. CurseForge API Key Handling

- The CurseForge API key is stored through the panel's mod registry API. Without it, the CurseForge provider is hidden.
- Images with a built-in key (`java17` and newer) need nothing more.
- Images without one (`java8`, `java8-multiarch`) get CurseForge packs only while key sharing is on. Sharing is opt-in (off by default) and is set through the API by adding the `gameplane.local/share-with-game-servers: "true"` annotation to the managed Secret `gameplane-modreg-curseforge`. There is no dashboard switch yet.
- While sharing is on, the operator gives each affected server a server-owned Secret holding the admin key. The game container reads it as `CF_API_KEY` via `valueFrom.secretKeyRef`. The Secret follows key rotation and is removed when the admin key is removed or sharing is turned off.
- The key is never written into GameServer env as plain text, into logs, or into API responses.

---

## 6. Storage & Persistence Layout

- **Data PVC**: 10 GiB default, mounted at `/data` (override with `GameServer.spec.storage`).
- **Downloads**: `/data/downloads` (CurseForge blocked-file drop folder).
- **Mod volumes**: one PVC per (version, loader) pair, provisioned on demand and retained across version switches.
- **World data**: `/data/world`, `world_nether`, `world_the_end`.

---

## 7. Startup & Probes

- Readiness: `mc-health`, initial delay 30s.
- Liveness: `mc-health`, initial delay 120s.
- First boot downloads the server jar, and any modpack, before the game starts. That output appears in the Logs tab's container output source.
Loading
Loading