Skip to content
Draft
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
36 changes: 20 additions & 16 deletions .env.dist
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# GLOBAL SERVER
##################################################
BASE_DIR=/data/compose/minecraft
BASE_DIR=/opt/docker/minecraft
BASE_TIMEZONE=Europe/Berlin

SERVER_TYPE=FABRIC
SERVER_MC_VERSION="1.20.1"
SERVER_NAME=1201-network
SERVER_MC_VERSION="26.1.2"
SERVER_NAME=26_1_2-network
SERVER_MOTD="§4[WARNING]§r Please connect to the correct server."
SERVER_VIEW_DISTANCE=14
# For the CF_API_KEY >> every '$' has to be escaped with another '$' character !!!
SERVER_CF_API_KEY=CHANGE-ME

# CurseForge API Key: Every '$' has to be escaped with another '$' character !!!
SERVER_CURSEFORGE_API_KEY=CHANGE-ME

# SERVICES
##################################################
Expand All @@ -23,15 +24,18 @@ DB_PASSWORD=CHANGE-ME
REDIS_PORT=6379
REDIS_PASSWORD=CHANGE-ME

SERVICE_VSCODE_PORT=8443
SERVICE_VSCODE_PASSWORD=CHANGE-ME
SERVICE_VSCODE_SUDO_PASSWORD=CHANGE-ME
SERVICE_VSCODE_PROXY_DOMAIN=mcdev.waldinet.de

# PROXY
##################################################
PROXY_TYPE=velocity
PROXY_TYPE=velocity # currently only velocity is supported
PROXY_PORT=1337
PROXY_PLUGINS="https://github.com/Lorenzo0111/RocketJoin/releases/download/2.4.1/RocketJoin-velocity-2.4.1.jar"
MODRINTH_DOWNLOAD_DEPENDENCIES="required"
PROXY_MODRINTH_PROJECTS="simple-voice-chat:5SU8XYFw"
PROXY_PLUGINS="https://github.com/Lorenzo0111/RocketJoin/releases/download/2.5/RocketJoin-velocity-2.5.jar"
# https://cdn-raw.modrinth.com/data/16vhQOQN/versions/OQpVrXXW/minimotd-velocity-2.0.13.jar
# https://ci.dmulloy2.net/job/ProtocolLib/668/artifact/build/libs/ProtocolLib.ja
# https://github.com/oddlama/vane/releases/download/v1.12.3/vane-velocity-1.12.3.jar
Expand All @@ -41,17 +45,17 @@ PROXY_PLUGINS="https://github.com/Lorenzo0111/RocketJoin/releases/download/2.4.1

# SERVER - SMP
##################################################
MC_SMP_NAME=smp
MC_SMP_NAME=waldicraft
MC_SMP_SEED=-7754207215465818387
MC_SMP_SERVER_PORT=1338
MC_SMP_MAX_MEMORY="4G"
MC_SMP_MAX_PLAYERS=10
MC_SMP_DIFFICULTY=normal
MC_SMP_RCON_PASSWORD=CHANGE-ME
MC_SMP_RCON_PORT=25575
MC_SMP_DATAPACKS="https://github.com/WaldiNet/Towers_Of_The_Wild_Reworked/releases/download/v4.2.1/Towers_Of_The_Wild_Reworked_v4.2.1_Fabric_Waystones.zip, https://cdn.modrinth.com/data/yID404Mu/versions/BBiCd6GO/scorched-v1.1.3b.zip, https://cdn.modrinth.com/data/HQsBdHGd/versions/ohkYIBHw/Ender%20Dragon%20Fight%20Remastered%20Data%20And%20Resource%20Pack-v4.3.zip"
MC_SMP_MODRINTH_PROJECTS="fabric-api:pYtlDijL, mysql-jdbc:94JxXm7O, luckperms:7PNj6nCm, amplified-nether:QXFvBT1u, appleskin:CxnVG86Y, architectury-api:Sbew3kXe, chunky:t8SbUchF, dynmap:vqx7tUUt, fabric-seasons:uMEzKato, fwaystones:wNz9DqWv, fabricproxy-lite:XJmDAnj5, lithium:ZSNsJrPI, nullscape:O0uQyKki, rei:kq4TOe4i, simple-voice-chat:I0UEW6B0, travelersbackpack:XFdxMe7g, trinkets:e563ycts"
MC_SMP_CURSEFORGE_FILES="worldedit:4586218"
MC_SMP_DATAPACKS=
MC_SMP_MODRINTH_PROJECTS="fabric-api:BLz7ETCw, waystones:crPXnQlJ, balm:ySr8K68c, shogi:2Xg13Gfy, luckperms:fTIdfb46, amplified-nether:rp2A0tDf, appleskin:HwaLJe3v, chunky:4Eotm6ov, fabricproxy-lite:CsEpiziv, mc-data-bridge:N02wJcbK, lithium:R7MxYvuW, nullscape:E4kh5rGD, midnightlib:jcj4Ev6D, repurposed-structures-fabric:Jvol4Hh2, terralith:FCzSjHeG, travelersbackpack:Q6rEigkb, forge-config-api-port:mwAOaKnn, simple-voice-chat:gVPjsMto, worldedit:gjsLvJfW"
MC_SMP_CURSEFORGE_FILES=
MC_SMP_SPIGET_RESOURCES=

# SERVER - EXPEDITION
Expand All @@ -64,9 +68,9 @@ MC_EXPEDITION_MAX_PLAYERS=10
MC_EXPEDITION_DIFFICULTY=normal
MC_EXPEDITION_RCON_PASSWORD=CHANGE-ME
MC_EXPEDITION_RCON_PORT=25580
MC_EXPEDITION_DATAPACKS="https://github.com/WaldiNet/Towers_Of_The_Wild_Reworked/releases/download/v4.2.1/Towers_Of_The_Wild_Reworked_v4.2.1_Fabric_Waystones.zip, https://cdn.modrinth.com/data/yID404Mu/versions/BBiCd6GO/scorched-v1.1.3b.zip, https://cdn.modrinth.com/data/HQsBdHGd/versions/ohkYIBHw/Ender%20Dragon%20Fight%20Remastered%20Data%20And%20Resource%20Pack-v4.3.zip"
MC_EXPEDITION_MODRINTH_PROJECTS="fabric-api:pYtlDijL, luckperms:7PNj6nCm, amplified-nether:QXFvBT1u, appleskin:CxnVG86Y, architectury-api:Sbew3kXe, chunky:t8SbUchF, dynmap:vqx7tUUt, fabric-seasons:uMEzKato, fwaystones:wNz9DqWv, fabricproxy-lite:XJmDAnj5, lithium:ZSNsJrPI, midnightlib:YXz8kIQl, nullscape:O0uQyKki, oxidizing-lightning-rods:zaW5MOC0, rei:kq4TOe4i, repurposed-structures-fabric:UUsn75P9, simple-voice-chat:I0UEW6B0, terralith:hYoo0DKV, travelersbackpack:XFdxMe7g, trinkets:e563ycts"
MC_EXPEDITION_CURSEFORGE_FILES="worldedit:4586218"
MC_EXPEDITION_DATAPACKS=
MC_EXPEDITION_MODRINTH_PROJECTS="fabric-api:BLz7ETCw, waystones:crPXnQlJ, balm:ySr8K68c, shogi:2Xg13Gfy, luckperms:fTIdfb46, amplified-nether:rp2A0tDf, appleskin:HwaLJe3v, chunky:4Eotm6ov, fabricproxy-lite:CsEpiziv, mc-data-bridge:N02wJcbK, lithium:R7MxYvuW, nullscape:E4kh5rGD, midnightlib:jcj4Ev6D, repurposed-structures-fabric:Jvol4Hh2, terralith:FCzSjHeG, travelersbackpack:Q6rEigkb, forge-config-api-port:mwAOaKnn, simple-voice-chat:gVPjsMto, worldedit:gjsLvJfW"
MC_EXPEDITION_CURSEFORGE_FILES=
MC_EXPEDITION_SPIGET_RESOURCES=

# SERVER - TESTING
Expand All @@ -79,8 +83,8 @@ MC_TESTING_MAX_PLAYERS=10
MC_TESTING_RCON_PORT=25581
MC_TESTING_RCON_PASSWORD=CHANGE-ME
MC_TESTING_DATAPACKS=
MC_TESTING_MODRINTH_PROJECTS="fabric-api:pYtlDijL, luckperms:7PNj6nCm, architectury-api:Sbew3kXe, chunky:t8SbUchF, dynmap:vqx7tUUt, fwaystones:wNz9DqWv, fabricproxy-lite:XJmDAnj5, lithium:ZSNsJrPI, rei:kq4TOe4i, simple-voice-chat:I0UEW6B0"
MC_TESTING_CURSEFORGE_FILES="worldedit:4586218"
MC_TESTING_MODRINTH_PROJECTS="fabric-api:BLz7ETCw, waystones:crPXnQlJ, balm:ySr8K68c, shogi:2Xg13Gfy, luckperms:fTIdfb46, chunky:4Eotm6ov, fabricproxy-lite:CsEpiziv, lithium:R7MxYvuW, simple-voice-chat:gVPjsMto, worldedit:gjsLvJfW"
MC_TESTING_CURSEFORGE_FILES=
MC_TESTING_SPIGET_RESOURCES=

# MODS
Expand Down
66 changes: 33 additions & 33 deletions .github/workflows/opencode.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
name: opencode
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
jobs:
opencode:
if: |
contains(github.event.comment.body, ' /oc') ||
startsWith(github.event.comment.body, '/oc') ||
contains(github.event.comment.body, ' /opencode') ||
startsWith(github.event.comment.body, '/opencode')
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
pull-requests: read
issues: read
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Run opencode
uses: anomalyco/opencode/github@latest
env:
OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }}
with:
model: opencode-go/deepseek-v4-pro
name: opencode

on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]

jobs:
opencode:
if: |
contains(github.event.comment.body, ' /oc') ||
startsWith(github.event.comment.body, '/oc') ||
contains(github.event.comment.body, ' /opencode') ||
startsWith(github.event.comment.body, '/opencode')
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
pull-requests: read
issues: read
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
persist-credentials: false

- name: Run opencode
uses: anomalyco/opencode/github@latest
env:
OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }}
with:
model: opencode-go/deepseek-v4-flash
101 changes: 101 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# AGENTS.md

## Project type

Docker Compose infrastructure for a Minecraft server network. No code, no build, no tests, no lint.

## Prerequisites

Only **Docker** is required. No language runtime.

## Setup and run

```bash
cp .env.dist .env # required first step — .env is gitignored
docker compose up -d
docker compose down
```

The `.env.dist` is the template. The `.env` file must exist at runtime and is never committed.

## .env quirks

- `SERVER_CURSEFORGE_API_KEY` must be set if any `_CURSEFORGE_FILES` variables are used.
- Mod lists use `_MODRINTH_PROJECTS` (slug:version-id format) and `_CURSEFORGE_FILES` (project-id:file-id format), per the itzg docs.

## Architecture

- **1 proxy** (Velocity via [`itzg/bungeecord`](https://github.com/itzg/docker-mc-proxy)) + **3 backend servers** (Fabric via [`itzg/minecraft-server`](https://github.com/itzg/docker-minecraft-server)).
- **3 backup containers** ([`itzg/mc-backup`](https://github.com/itzg/docker-mc-backup)) — one per server instance.
- **1 code-server** for in-browser editing (exposes the whole repo at `/config/workspace`).

### Server instances

| Instance | Container | Game mode | Memory |
|-------------|--------------------|--------------|--------|
| `waldicraft` | `server-smp` | survival | 4G |
| `expedition` | `server-expedition`| survival | 8G |
| `testing` | `server-testing` | creative/flat| 2G |

Each instance directory (`server/<name>/`) has three subdirs:
- `config/` — mounted read-only, committed to git
- `data/` — world data, mostly gitignored (only `ops.json`, `whitelist.json`, and `dynmap/` config are tracked)
- `mods/` — mod JARs, entirely gitignored (downloaded at container startup from Modrinth/CurseForge URLs in `.env`)

### Proxy/server forwarding

- Velocity uses `modern` forwarding mode with `forwarding.secret` (committed).
- Backend servers run `ONLINE_MODE=false` and use **FabricProxy-Lite** with hack settings for player info forwarding.
- Velocity `velocity.toml` maps server names to internal Docker hostnames:
```
waldicraft = "server-smp:25565"
expedition = "server-expedition:25565"
testing = "server-testing:25565"
```

## Adding or modifying mods

Mod JARs are **never committed**. They are downloaded at container startup. To change mods:

1. Edit the relevant `_MODRINTH_PROJECTS`, `_CURSEFORGE_FILES`, or `_DATAPACKS` variable in `.env.dist` (and update `.env`).
2. For mods not on Modrinth/CurseForge, place JARs manually in `server/<instance>/mods/`.
3. Mod config files go in `server/<instance>/config/` and **are** committed.

## Key files for configuration changes

- `.env.dist` — environment variables (ports, seeds, mods, memory, RCON passwords)
- `proxy/velocity/config/velocity.toml` — proxy routing and server list
- `server/<instance>/config/` — per-server mod configs
- `docker-compose.yaml` — service definitions

## Optional services

Four additional services exist in `docker-compose.yaml` but are **commented out**. To enable them, uncomment the service definition, verify paths/variables, and configure `.env` values. Only code-server is active by default.

### Nginx (`service-nginx`)

Serves the **LiveAtlas** web map UI plus dynmap tiles for all three servers. Required because all dynmap configs have `disable-webserver: true` and use `org.dynmap.JsonFileClientUpdateComponent` — the internal dynmap web server is off; data is written as JSON/tiles to the filesystem for an external web server to serve.

- Web root: `services/nginx/www/` — contains `index.html` (pre-configured LiveAtlas app) + `live-atlas/` (built JS/CSS assets)
- Mounts dynmap output from each server: `server/<name>/data/dynmap/web/standalone` and `…/tiles`
- LiveAtlas is pre-configured for all three servers in `index.html` using the filetree/JSON approach

### PHP-FPM (`service-php-fpm`)

Required by Nginx to handle PHP endpoints for LiveAtlas — chat sending, login, and register. The nginx config (`docker/nginx/conf.d/default.conf`) proxies `*.php` requests to `service-php-fpm:9000`. Must be enabled alongside Nginx.

### MySQL (`service-mysql`)

Alternative dynmap storage backend. The current dynmap configs use `type: filetree`; MySQL is the commented-out option (`type: mysql`) in each `configuration.txt`.

- Init script (`.docker/mysql/init/01-databases.sql`) creates a `dynmap` database and grants access to the `minecraft` user
- LiveAtlas `index.html` includes commented-out `MySQL_*.php` endpoint URLs for when MySQL is used
- Data volume `services/mysql/` is gitignored (see `services/.gitignore`)

### Redis (`service-redis`)

Available as a Redis 7.2 cache instance. No config in this repo references a specific Redis consumer — intended as infrastructure for a mod or plugin that needs it.

## CI

A single GitHub Actions workflow (`.github/workflows/opencode.yml`) triggers OpenCode AI on issue/PR comments containing `/oc` or `/opencode`.
Loading
Loading