- PostScript 57.3%
- Lua 40.4%
- Python 1.5%
- Shell 0.4%
- HTML 0.2%
| build-fixes | ||
| compat | ||
| docs | ||
| games/minetest | ||
| hooks | ||
| mm_compat | ||
| mm_info | ||
| mods | ||
| patches | ||
| .gitignore | ||
| config-file-example | ||
| game-versions.lock | ||
| lib-config.sh | ||
| LICENSE | ||
| minetest-game-download | ||
| mods-apply-patches | ||
| mods-apply-world.mt-regenerate-from-config-file | ||
| mods-audit.sh | ||
| mods-download | ||
| mods-list | ||
| mods-versions.lock | ||
| README.md | ||
| regenerate-minetest-conf | ||
| reset-all-world.mt-regenerate-from-config-file | ||
| reset-map-and-players | ||
| setup-mt | ||
minetest-mm
Language: this repository is maintained in English. All docs, comments, and commit messages must be in English so anyone can collaborate (issue #47).
Reproducible Luanti / Minetest server platform. One repo builds the engine, vendors the game and all mods, and deploys them with pinned versions — so every install and every upgrade is repeatable.
Tested with Luanti engine 5.17.0 + vendored minetest_game c42e4d0c.
Start here
New server? Copy config-file-example to config-file, edit it
(versions, passwords, ports), then:
./setup-mt # builds engine + deploys game
./mods-apply-world.mt-regenerate-from-config-file # deploys mods + world.mt, starts server
./mods-audit.sh --mods /home/minetest/.minetest/mods \
--worldmt /home/minetest/.minetest/worlds/world/world.mt
# must report 0 dead / 0 inactive
Then check debug.txt: 0x ERROR in the whole boot log
(including the segment before World at), server listening.
Existing server (data-safe, map + DB kept)?
git pull # in the repo clone on the server
# If pull aborts on local changes in regenerated files
# (mods-versions.lock, patched files under mods/ — both are regenerated,
# nothing precious), first run:
# git checkout -- mods-versions.lock mods/
# then pull again and VERIFY the hash: git rev-parse HEAD (must equal the
# pushed commit). Never pipe pull through tail — it masks the exit code
# and a failed pull silently deploys the stale tree.
# review config-file (mt_version; set BEFORE running setup-mt)
./setup-mt # rebuilds engine + deploys vendored game
./mods-apply-world.mt-regenerate-from-config-file # deploys mods/, regenerates world.mt, starts server
./mods-audit.sh --mods /home/minetest/.minetest/mods \
--worldmt /home/minetest/.minetest/worlds/world/world.mt
Then check debug.txt as above (0x ERROR in the whole boot segment).
Trying the newest upstreams? Do it on a test machine first, then commit the resulting lock files:
./mods-download --fresh # newest mods, rewrites mods-versions.lock
./minetest-game-download --fresh # newest game, rewrites game-versions.lock
# test, then commit + push both lock files
After the initial installation, switch first_install in config-file
to anything other than y.
Repository layout
| Path | What it is |
|---|---|
setup-mt |
Builds the Luanti engine and deploys the vendored game. Stops the server itself. |
mods-download |
Rebuilds disposable mods/ from locked upstream commits. |
minetest-game-download |
Rebuilds vendored games/minetest/ from the locked upstream commit. |
mods-apply-world.mt-regenerate-from-config-file |
Deploys mods/ from the repo, regenerates world.mt, starts the server. |
mods-apply-patches |
Applies patches/*.patch idempotently (also run by mods-download). |
mods-audit.sh |
Verifies deployed mods against world.mt (must report 0 dead / 0 inactive). |
regenerate-minetest-conf |
Rewrites the managed settings block of the live minetest.conf from config-file (data-safe, optional --restart). |
lib-config.sh |
Shared shell library (sourced, never executed): loads + validates config-file, idempotently rewrites minetest.conf / world.mt. Used by setup-mt, regenerate-minetest-conf, mods-apply-*, reset-*. |
reset-all-world.mt-regenerate-from-config-file |
Destructive: wipes DBs + world, redeploys everything from the repo. |
reset-map-and-players |
Destructive: wipes map + players + auth, keeps world.mt. |
mods/ |
Disposable mod tree (never hand-edit; rebuilt by mods-download). |
games/minetest/ |
Vendored minetest_game snapshot (never hand-edit; rebuilt by minetest-game-download). |
mods-list |
Enabled mods (load_mod_X = true, one per line, appended to world.mt verbatim); the single = false is intentional (interact). |
mods-versions.lock / game-versions.lock |
Pinned upstream commits (reproducibility). Never deleted. |
patches/ |
Reproducible fixes applied on top of upstreams. |
mm_compat/ |
Our own compat mod (additive aliases + craft fixes), copied into mods/. See mm_compat/README.md. |
mm_info/ |
Our own in-game server guide (welcome window, CZ/EN mod catalogue, rules). |
compat/ |
Upgrade gates: node registry + craft-conflict detection. See compat/README.md. |
hooks/ |
Git hooks (pre-push gate). Install with ./hooks/install.sh. |
docs/ |
ALIAS_COVERAGE.txt (alias rationale), DEPRECATED.md (stale-mod decisions), FUTURE_PLANS.md (constraints + open questions), MOD_STATE.csv (mod health overview), RECIPE_CHANGES.md (player-facing recipe contract). |
build-fixes/ |
Legacy patch for building engine 5.4.1 on new systems (unreferenced since the 5.17.0 upgrade; kept for history). |
config-file-example |
Template for the server's private config-file (never committed). Key vars: mt_version (engine tag), mt_game_version (game branch for --fresh), first_install, DB passwords, ports, mt_* gameplay flags. |
Script reference (all parameters)
Download scripts share one flag convention: --flag on the command line
or FLAG=1 in the environment (--fresh / FRESH=1, --vanilla /
VANILLA=1). Flags combine in any order (--fresh --vanilla = newest
upstreams, no local modifications).
./mods-download [--fresh] [--vanilla]— rebuild disposablemods/from upstream clones. Default usesmods-versions.lockpins (reproducible; first run with no lock behaves like--fresh).--freshignores the lock, clones newest upstreams, rewrites the lock.--vanillaskips OUR modifications (patches/,mm_compat/) to test plain upstreams. Env equivalents:FRESH=1,VANILLA=1../minetest-game-download [--fresh]— rebuild vendoredgames/minetest/from the upstream game. Default uses thegame-versions.lockpin.--fresh(orFRESH=1) clones newest upstream master and rewrites the lock — commit + push it../regenerate-minetest-conf [--restart]— idempotently (re)writes the managed settings block of the LIVEminetest.conffromconfig-file. Data-safe (map + DBs kept, engine defaults untouched); repairs legacy tails including empty values. Restarts the server only with--restart../setup-mt— no parameters. Builds the Luanti engine (mt_versionfromconfig-file), deploys the vendored game via plain copy. Onfirst_install=yit also writesminetest.conf+ theworld.mtskeleton (incl.creative_modefrom$mt_creative_mode); on upgrade runs it only rebuilds + redeploys. Run from the repo root../mods-apply-world.mt-regenerate-from-config-file— no parameters. Deploysmods/from the repo, regeneratesworld.mtfromconfig-file+mods-list, restarts the server. Data-safe (map + DB kept)../mods-apply-patches [MODS_DIR]— applypatches/*.patchonto a mods tree (default:./mods). Idempotent, safe to re-run../mods-audit.sh [--mods DIR] [--worldmt FILE] [-q|--quiet]— auditworld.mt(load_mod_*) vs mods on disk (modpack-aware, CRLF-tolerant). Defaults:--mods ./mods,--worldmt world.mt. Exit 0 = OK, 1 = problems found, 2 = bad arguments/files../reset-all-world.mt-regenerate-from-config-file [anything]— no engine build here (that issetup-mt's job): destructive, drops + recreates all DBs, wipes the world dir, redeploys game + mods from the repo. With any argument (e.g.yes) it skips the "start service?" prompt (for automation); bare run asks before starting the server../reset-map-and-players— no parameters. Destructive: drops map + players + auth DBs, cleans the world dir (keepsworld.mt). Asks before starting the server../hooks/install.sh— no parameters. Installshooks/pre-pushinto.git/hooks/and runs it once. Safe to re-run../compat/node-registry.sh [--mods DIR] [--game DIR] [-o OUTPUT]— statically extractregister_node/register_aliasnames (defaults:--mods ./mods, no game,-o compat/nodes.txt).mm_compat/is always excluded (it is coverage, not a source).python3 compat/craft-analyze.py [--allowlist FILE] [--compat FILE] [--witnesses FILE] [--player-doc FILE] [--mode gate|report] DUMP— analyze a runtime recipe dump (mm_craftdump_recipes.json).gate(default) exits 1 on any non-fixed HARD conflict;reportonly prints.--compatpoints atmm_compat/craft_recipes.luaso fixed pairs are excluded;--witnesseswrites the probe input forcraft-probe.lua;--player-docwrites the player-facing recipe summary.python3 compat/tests/test_mm_compat_selfcheck.py— static self-check of our own fixes (no server needed, ~0.1 s, runs in the pre-push hook): every fix cites its-- PAIR:, every loser-new shape differs from every winner grid (fail = the "fix" changes nothing), new shapes are pairwise free. Needscompat/craft-dump-5.17.0.jsonfor the served-vs-universe check — refresh it withcraft-dump.luaon testing after every fix round and commit it; without it that section reports SKIP (never silent).compat/helpers:craft-dump.lua(recipe dump on the running server),craft-probe.lua(engineget_craft_resultground truth for witnesses),runtime-dump.lua(node dump),craft-allowlist.txt, frozen baselines (nodes-static-*.txt,nodes-runtime-*.txt,craft-baseline-5.17.0.txt),tests/test_craft_analyze.py(12 analyzer regression cases).docs/:ALIAS_COVERAGE.txt(why each mm_compat alias exists),DEPRECATED.md,MOD_STATE.csv(mod health overview).
Principles
mods/is disposable. It is wiped and rebuilt purely frommods-download(clone list) + generated content + our modifications (patches/,mm_compat/). Never hand-edit anything insidemods/; fix the upstream URL,patches/<name>.patch, ormm_compat/instead.games/minetest/is vendored. A committed snapshot of upstream minetest_game, pinned bygame-versions.lock.setup-mtandreset-all-*deploy it via plain copy — no network at deploy time. Never hand-edit it.- Everything is pinned.
mods-versions.lock(mods) andgame-versions.lock(game) record the exact tested commits. Default runs use the locks (reproducible). No lock file is ever deleted. - Every server file regenerates from
config-file.minetest.conf(managed block viaregenerate-minetest-conf) andworld.mt(skeletonmods-list) are rewritten idempotently from validated variables — re-running any script yields the same result. Scripts abort (exit 2) instead of writing half-empty files when a required variable is unset or empty, and they resolve the repo root from their own path (so the calling directory does not matter).
- One flag convention, repo-wide:
--fresh(orFRESH=1) — ignore the lock, clone newest upstreams, rewrite the lock. Commit + push the new lock.--vanilla(orVANILLA=1,mods-downloadonly) — skip OUR modifications (patches/,mm_compat/) to test plain upstreams. Combine with--freshfor a fully vanilla tree.
Requirements
- Ubuntu 22.04 (works in LXD; PostgreSQL 14 is the default there).
config-fileis private and never committed (it holds passwords). Copy it from the template and edit it before the first run:
cp config-file-example config-file
# edit config-file with your preferences
Our modifications (patches/, mm_compat/)
mods-apply-patches [MODS_DIR]appliespatches/*.patchidempotently (run automatically bymods-downloadunless--vanilla).mm_compat/is a repo-owned mod copied intomods/bymods-download: additiveregister_aliasentries so old maps never show unknown blocks, plus deterministic fixes for conflicting craft recipes. Rule: every upstream rename gets a matching alias here (seecompat/gate).- To check whether upstreams already fixed what we patch, compare a vanilla
boot against a patched boot:
./mods-download --fresh --vanilla→ boot → comparedebug.txtlogs. (The homedecor kitchen fix for issue #34 is a regular patch now:patches/homedecor_kitchen-run_at_every_load.patch, applied viamods-apply-patcheslike all others.)
Upgrade safety gates (compat/)
Long-running maps must never show unknown blocks or lose craftable
items after an upgrade. Two gates guard this (details in compat/README.md):
- Node registry — static extraction of
register_node/register_aliasfrommods/+games/minetest/, diffed against frozen baselines.mm_compatis scanned as coverage (aliases), never as a source. - Craft gate — runtime recipe dump (
get_all_craft_recipes) analyzed for HARD conflicts (same inputs, different outputs); fixes live inmm_compat/craft_recipes.luaand are verified by an engine probe (get_craft_resultground truth).
Git hooks
./hooks/install.sh
The pre-push hook (~10 min, full-tree scans) blocks the push on: mm_compat/ /
mm_info out of sync with mods/ copies, staged secrets (config-file, world.mt copies, *.db /
*.sqlite, debug.txt / minetest.conf — this repo is public), failing
compat/tests/ (analyzer regressions + mm_compat self-check), node-baseline
regressions, unsatisfied mod dependencies, or a missing/invalid
game-versions.lock. Slow checks (full craft analysis ~4 min, runtime dumps)
do not run here — refresh them on testing and commit the results.
License
Our own work in this repository — scripts (setup-mt, mods-download,
mods-apply-*, reset-*, mods-audit.sh, hooks/, compat/ tooling),
patches/, mm_compat/, mm_info/, docs/ and this README — is released
under the WTFPL: do what the fuck you want to.
mods/ and games/minetest/ are not ours: every mod and the game keep
their own upstream licenses (see the license files shipped inside each
directory, e.g. mods/<name>/LICENSE*, plus license fields in
mod.conf). Those licenses always apply — the WTFPL above covers only our
own files and never overrides them. patches/*.patch are diffs against
specific upstream commits; applying or redistributing a patch means
redistributing the upstream code it touches, so the target mod's license
terms travel with it.