diff --git a/.forgejo/workflows/gitleaks.yml b/.forgejo/workflows/gitleaks.yml index 0eeab63..de62852 100644 --- a/.forgejo/workflows/gitleaks.yml +++ b/.forgejo/workflows/gitleaks.yml @@ -1,16 +1,10 @@ -# .forgejo/workflows/gitleaks.yml -# # gitleaks secret-scan workflow. -# Scans the repository for accidentally committed secrets on push and PRs. # +# Scans the repository for accidentally committed secrets (API keys, tokens, +# private keys) on every push and pull request. # -# Requires a Forgejo/Gitea Actions runner; it is a no-op without one and is -# safe to remove if you do not use Forgejo/Gitea Actions. -# -# -# -# -# +# This is a Forgejo/Gitea Actions workflow; it is a no-op if no Actions runner +# is configured, and is safe to delete if you do not use Forgejo/Gitea Actions. name: gitleaks diff --git a/README.md b/README.md index 8cad8e2..04108cf 100644 --- a/README.md +++ b/README.md @@ -1,66 +1,134 @@ -# [All the Mods 10-5.4](https://www.curseforge.com/minecraft/modpacks/all-the-mods-10) on Curseforge - +# docker-allthemods10 -- [Description](#description) -- [Requirements](#requirements) -- [Options](#options) - * [Adding Minecraft Operators](#adding-minecraft-operators) -- [Troubleshooting](#troubleshooting) - * [Accept the EULA](#accept-the-eula) - * [Permissions of Files](#permissions-of-files) - * [Resetting](#resetting) -- [Source](#source-original-atm9-repo) +A Docker image that runs an **[All the Mods 10](https://www.curseforge.com/minecraft/modpacks/all-the-mods-10)** (ATM10) dedicated Minecraft server on [NeoForge](https://neoforged.net/). - +No Minecraft or modpack files are shipped in the image. On first start the +container downloads the pinned ATM10 server files from CurseForge and runs the +NeoForge installer; subsequent starts boot the already-installed server. The +first run can take a while as the installer completes — watch the logs. -## Description - -This container is built to run on an [Unraid](https://unraid.net) server, outside of that your mileage will vary. - -The docker on the first run will download the same version as tagged `All the Mods 10-5.2` and install it. This can take a while as the Forge installer can take a bit to complete. You can watch the logs and it will eventually finish. - -After the first run, it will simply start the server. - -Note: There are no modded Minecraft files shipped in the container, they are all downloaded at runtime. +- **Modpack:** All the Mods 10, server version `5.5` +- **Loader:** NeoForge `21.1.219` (Minecraft 1.21.1) +- **Base image:** `eclipse-temurin:21-jdk` ## Requirements -* /data mounted to a persistent disk -* Port 25565/tcp mapped -* environment variable EULA set to "true" +- Docker (or any OCI runtime / Kubernetes — see [`k8s_example.md`](k8s_example.md)) +- A persistent volume mounted at `/data` +- TCP port `25565` published +- `EULA=true` — you must accept the [Minecraft EULA](https://aka.ms/MinecraftEULA) to run a server -As the end user, you are responsible for accepting the EULA from Mojang to run their server, by default in the container it is set to false. +## Quick start -## Options +```sh +# Build the image +docker build -t allthemods10 . -These environment variables can be set to override their defaults. +# Run it +docker run -d \ + --name atm10 \ + -p 25565:25565 \ + -v atm10-data:/data \ + -e EULA=true \ + -e MOTD="All the Mods 10 Server" \ + -e MAX_PLAYERS=10 \ + allthemods10 +``` -* JVM_OPTS "-Xms2048m -Xmx4096m" -* MOTD "All the Mods 10-4.10 Server Powered by Docker" -* ALLOW_FLIGHT "true" or "false" -* MAX_PLAYERS "5" -* ONLINE_MODE "true" or "false" -* ENABLE_WHITELIST "true" or "false" -* WHITELIST_USERS "TestUserName1, TestUserName2" -* OP_USERS "TestUserName1, TestUserName2" +The server installs into the `/data` volume on first boot. Give it a few +minutes and watch `docker logs -f atm10` until the world is ready. -## Troubleshooting +## Configuration -### Accept the EULA -Did you pass in the environment variable EULA set to `true`? +All configuration is via environment variables. Only `EULA` is required. -### Permissions of Files -This container is designed for [Unraid](https://unraid.net) so the user in the container runs on uid 99 and gid 100. This may cause permission errors on the /data mount on other systems. +| Variable | Default | Description | +|--------------------|---------------------------------|-------------| +| `EULA` | `false` | Set to `true` to accept the Minecraft EULA. The server will not start otherwise. | +| `JVM_OPTS` | `-Xms2048m -Xmx4096m` (example) | JVM flags. Each space-separated token is appended to `user_jvm_args.txt`. | +| `MOTD` | `A Minecraft Server` | Server message of the day. | +| `MAX_PLAYERS` | `20` | Maximum concurrent players. | +| `ALLOW_FLIGHT` | `false` | `true`/`false` — allow flight. | +| `ONLINE_MODE` | `true` | `true`/`false` — authenticate players against Mojang. | +| `ENABLE_WHITELIST` | `false` | `true`/`false` — enforce the whitelist. | +| `WHITELIST_USERS` | _(empty)_ | Comma-separated Minecraft usernames to add to the whitelist. | +| `OP_USERS` | _(empty)_ | Comma-separated Minecraft usernames to grant operator (level 4). | +| `RCON_PASSWORD` | _(empty)_ | If set, enables RCON on the server and uses this password. | +| `RCON_PORT` | `25575` | RCON listen port (only used when `RCON_PASSWORD` is set). | -### Resetting -If the installation is incomplete for some reason. Deleting the downloaded server file in /data will restart the install/upgrade process. +`WHITELIST_USERS` and `OP_USERS` are resolved to UUIDs at startup via +[playerdb.co](https://playerdb.co/) and merged into `whitelist.json` / +`ops.json` idempotently, so the same name is never added twice. -## Source (Original ATM9 repo) -Github: https://github.com/Goobaroo/docker-allthemods9 +### Permissions -Docker: https://hub.docker.com/repository/docker/goobaroo/allthemods9 +The server process runs as **uid `99` / gid `100`**, which matches the default +`nobody:users` ownership on [Unraid](https://unraid.net). On other hosts you may +need to `chown 99:100` the `/data` volume (the Kubernetes example does this with +an init container). -## Source (W3LFARe repo) -Github: https://github.com/W3LFARe/docker-allthemods10 +### Resetting / upgrading -Docker: https://registry.hub.docker.com/r/w3lfare/allthemods10 +If an install is incomplete or you want to force a re-download, delete the +`Server-Files-.zip` file in `/data`; the next start will re-run the +install/upgrade. + +## Optional: RCON order fulfillment daemon + +`fulfillment.py` is an optional companion daemon that delivers in-game items via +RCON in response to confirmed orders from an external shop API (for example, a +donation/store integration). It is **disabled by default** and only starts when +all three of these are set: + +- `SHOP_API_URL` — base URL of the shop API +- `SHOP_API_KEY` — API key +- `RCON_PASSWORD` — so the daemon can talk to the server over RCON + +When enabled it polls the shop API for pending orders, delivers the configured +item kits to online players via RCON, and marks orders fulfilled. The item kits +(`ITEM_COMMANDS`) and poll/startup timing are defined at the top of +`fulfillment.py`; edit them to match your own shop and items. Additional +variables: `RCON_HOST` (default `127.0.0.1`), `FULFILLMENT_POLL_INTERVAL` +(default `30`s), `FULFILLMENT_STARTUP_DELAY` (default `90`s). + +If you do not run a shop, you can ignore this file entirely — leave the three +variables unset and the server runs normally. + +## Kubernetes + +A community-contributed StatefulSet/Service manifest is in +[`k8s_example.md`](k8s_example.md). It is provided as a starting point and is +not an officially supported deployment method. + +## Continuous integration + +- `.github/workflows/docker-hub.yml` — builds and pushes the image to Docker Hub + on pushes to `main`/`develop` (expects `DOCKERHUB_USERNAME` / `DOCKERHUB_TOKEN` + secrets). +- `.github/workflows/update-mod.yml` — a daily job that checks CurseForge for a + newer server build and opens an update commit (expects a `CURSEFORGE_API_KEY`). +- `.forgejo/workflows/gitleaks.yml` — runs gitleaks secret scanning (Forgejo/Gitea + Actions; safe to delete if unused). + +## Contributing + +Issues and pull requests are welcome. Please keep the image lean — modpack +content is downloaded at runtime, not vendored — and avoid committing secrets +(a gitleaks workflow guards against this). + +## License & attribution + +This repository contains only the **Docker packaging** (entrypoint scripts and +CI workflows) for the All the Mods 10 server. It ships no Minecraft or modpack +files. + +It is a fork of [`W3LFARe/docker-allthemods10`](https://github.com/W3LFARe/docker-allthemods10), +which in turn derives from [`Goobaroo/docker-allthemods9`](https://github.com/Goobaroo/docker-allthemods9). +The packaging is provided **as-is**, under the same terms as those upstream +projects. + +Minecraft, NeoForge, the All the Mods 10 modpack, and the individual mods it +bundles are each subject to their own licenses and terms — including the +[Mojang/Minecraft EULA](https://aka.ms/MinecraftEULA) and the All the Mods +team's distribution terms. You are responsible for complying with them when you +run this server.