diff --git a/docs/README.md b/docs/README.md index 7a8d4ac6..eb355bf7 100644 --- a/docs/README.md +++ b/docs/README.md @@ -2,6 +2,7 @@ - [Using the `hectic` Attic Cache](./attic-cache.md) - [Minecraft incident log](./minecraft-incidents.md) +- [WorldOfSosal source versions and reset](./world-of-sosal-reset.md) - [Project Zomboid backups](./project-zomboid-backups.md) - [Gitea Kanban CLI](./gitea-kanban-cli.md) - [AFFiNE document typography](./affine-typography.md) diff --git a/docs/minecraft-prism.md b/docs/minecraft-prism.md old mode 100755 new mode 100644 index decb54ee..df888abc --- a/docs/minecraft-prism.md +++ b/docs/minecraft-prism.md @@ -1,11 +1,12 @@ # WorldOfSosal: Prism automatic updates -The published client entry points are: -- https://store.bfs.band/minecraft/ (BFS / Element host) -- https://store.hectic-lab.com/minecraft/world-of-sosal/ (hectic-lab) +The active client entry point is +https://store.hectic-lab.com/minecraft/world-of-sosal/. +BFS is unavailable as of 2026-11-12. Existing instances using its update URL +must switch their pre-launch URL to the active site's `current/pack.toml`, or +import the active site's Prism ZIP. -Each site provides its own Prism ZIP with that site's update URL and matching -server address. Both installs use the same Minecraft world and modpack release. +The active Prism ZIP includes the matching update URL and server address. Players import `WorldOfSosal-Prism.zip` into Prism once and approve its pre-launch command. Before each launch, packwiz-installer reconciles the client with the @@ -19,20 +20,29 @@ Official workflow: https://packwiz.infra.link/tutorials/installing/packwiz-insta ## Publishing a tested update -Keep the authoritative `.mrpack` in Storage Box at -`minecraft/pack/WorldOfSosal.mrpack`. For a server update, replace that archive, -set its new SHA-256 in `nixos/system/neuro/minecraft/world-of-sosal.nix`, +Keep authoritative `.mrpack` revisions as separate files in Storage Box. +The current source is `minecraft/pack/WorldOfSosal-v4-native-height.mrpack`, +SHA-256 `4a197bc039d6684fa1e652e1242b15d87bd8758de895ea8c4f8455ce6a712df1`. +V4 removes Dynamic Height and the Sable compatibility addon; other pack files +and Minecraft/NeoForge versions are unchanged. For a server update, upload a new +revision and set its path and SHA-256 in `nixos/system/neuro/minecraft/world-of-sosal.nix`, and rebuild/switch neuro before publishing the corresponding client export. The server importer and the client export must consume the same archive; publishing only the client can make it incompatible with the running server. ```sh # Test the client and deploy the matching server release first. -python3 script/publish-prism-mirrors.py WorldOfSosal.mrpack +python3 script/build-prism-pack.py WorldOfSosal-v4-native-height.mrpack \ + prism-export --server store.hectic-lab.com:25568 +python3 script/publish-prism-pack.py prism-export hectic-lab ``` -The mirror publisher creates temporary build directories and sets each server -address and update URL automatically. The builder downloads a SHA-256-pinned bootstrap from the +The publishing SSH alias must support SFTP. The main hectic-lab sshd uses port +22223; the experimental daemon on 22222 does not provide the SFTP subsystem. +The legacy `publish-prism-mirrors.py` also targets the unavailable BFS host and +is not the active publication command. + +The builder downloads a SHA-256-pinned bootstrap from the packwiz project's release, or accepts it via `--bootstrap /path/to/file.jar`. External mods retain their original URLs and SHA-512 checksums. Embedded mods and configuration are hosted with the release. Both required and optional client mods @@ -54,6 +64,28 @@ If Minecraft/NeoForge versions change, update and test both the server pin and client pack. packwiz-installer 0.5.14 understands NeoForge components in Prism's `mmc-pack.json`; a launcher restart/relaunch may be necessary after changing them. +## Verification on 2026-11-12 + +- Published `v4-native-height` on hectic-lab. Source archive SHA-256 is + `4a197bc039d6684fa1e652e1242b15d87bd8758de895ea8c4f8455ce6a712df1`; + the immutable web release is + `1abb0ff1a737f426c8e0cf3cd521875e32e06d9fe4582b8d78ea807ca87f2008`. +- Verified all 129 server mod files against the new archive before publication. + The running server already had the same mod set, so updating its source pin + and cache required no game restart or world changes. +- Public HTTPS checks passed for the manifest, index checksum, and Prism ZIP. + The ZIP pins Minecraft 1.21.1 and NeoForge 21.1.250. +- A real packwiz-installer upgrade from v3 to v4 in an isolated Prism directory + removed Dynamic Height and `sable_dynamicheight_compat`, preserved modified + `options.txt`, and corrected an intentionally mismatched NeoForge 21.1.249 + component to 21.1.250. All 121 downloaded client files and 470 overrides matched + the new archive, except the intentionally preserved options. +- The installer test served byte-identical published release snapshots over + loopback HTTP: neuro's HTTPS route stalled on the public index, while public + HTTPS checks from the workstation succeeded. A full Minecraft GUI login was + not observed in this update. +- BFS publication is excluded because that mirror is unavailable. + ## Verification on 2026-09-18 - Source archive SHA-256: diff --git a/docs/world-of-sosal-reset.md b/docs/world-of-sosal-reset.md new file mode 100644 index 00000000..b276f00f --- /dev/null +++ b/docs/world-of-sosal-reset.md @@ -0,0 +1,81 @@ +# WorldOfSosal source versions and reset + +The source map is independent of the running world. Keep every source revision +as a separate archive in Storage Box under `minecraft/map/versions/`. +Never replace an existing version. The original `minecraft/map/wow mine map.rar` +remains the parent source. + +Each new version has a UTC timestamp in its filename and a JSON sidecar recording +its SHA-256, parent archive and hash, spawn dimension and coordinates, and changes. +Upload to a temporary filename, verify the remote SHA-256, then rename to the +final version filename. Pin that path and hash in +`nixos/system/neuro/minecraft/wow-mine-map.nix`. + +The currently pinned source is `versions/world-of-sosal-original-bc80084d.rar`, +SHA-256 `bc80084de10a06b0fc2cb1651c61936b9e2fd2288f3f0fe44c964d83a393aa30`. +Its cache filename is `wow mine map.rar`. This original version restores its +original player data and spawn; it does not contain the new spawn datapack. + +The server now uses the native `crafting_azeroth_height` datapack +(`min_y=-512`, `height=2544`). The modpack importer's `postStart` removes +`dynamicheight-0.2.0+neoforge-1.21-1.21.1.jar` and +`sable_dynamicheight_compat-1.0.0.jar` after every import. +The original pack archive remains unchanged. + +With the previous mod configuration, saved Azeroth height changed from +MinY=-512, MaxY=2016 to MinY=-64, MaxY=320 and loaded chunks were rewritten. +The native-height trial checks the 81 chunks around `3742 89 8891`, saves them, +restarts Minecraft, and compares control blocks and chunk height metadata. +The 2026-11-12 trial passed on the main server: 12,798 sampled blocks matched the +source both before and after restart, all 81 chunks retained `yPos=-32` and +52-long heightmaps, and the cobblestone at `3742 88 8891` remained present. +No heightmap-size warnings appeared after restart. Temporary force-load tickets +are removed after the trial. This verifies server loading and persistence; +client login with the changed mod set is a separate check. + +The retained, currently inactive spawn revision is +`world-of-sosal-20261112T093842Z-spawn-3742-89-8891.tar.gz`, with SHA-256 +`da3f79e5593a5b7485ed371d65341cc1516c78a19a1fba71874ae8c1d90e624c`. +Its parent is retained as `versions/world-of-sosal-original-bc80084d.rar`, with +SHA-256 `bc80084de10a06b0fc2cb1651c61936b9e2fd2288f3f0fe44c964d83a393aa30`. +The spawn revision includes `worldofsosal_spawn`, which initializes each new +character once at `3742 89 8891` in Azeroth and sets a personal respawn point. +Its source is `nixos/system/neuro/minecraft/world-of-sosal-spawn/`. + +To discard all gameplay changes and return to the pinned source: + +```sh +ssh neuro systemctl start minecraft-world-reset-wowMineMap.service +``` + +This command deletes the entire working world, including all dimensions, +inventories, player positions, advancements, and statistics. It first verifies +the cached source archive's SHA-256, stops the game and world importer, deletes +`/srv/minecraft/wowMineMap/world`, then starts the server. The existing importer +extracts the pinned archive before Minecraft starts. + +Mods, server configuration, operator permissions, and source archives remain. +Ordinary server restarts preserve the working world; only the explicit reset +command discards it. + +Check completion with: + +```sh +ssh neuro systemctl status minecraft-world-reset-wowMineMap.service \ + minecraft-world-import-wowMineMap.service minecraft-server-wowMineMap.service \ + --no-pager +``` + +An inactive reset service with exit status 0 is expected after completion. +The cache must already contain the pinned archive. To switch source versions, +deploy the changed importer and cache the verified archive before resetting. + +The initial deployment on neuro installs the generated import and reset units +under `/etc/systemd/system.control/`, with GC roots +`/nix/var/nix/gcroots/worldofsosal-world-{import,reset}-unit`. This avoids an +unrelated NixOS upgrade. These persistent units override ordinary NixOS units: +replace both links and GC roots when deploying another source revision, or +remove the overrides after a full NixOS activation includes the same revision. +The modpack importer also has an override under `/etc/systemd/system.control/`, +pinned by `/nix/var/nix/gcroots/worldofsosal-modpack-import-unit`. Update or remove +that override under the same rules when changing the modpack import configuration. diff --git a/nixos/system/neuro/minecraft/public-tunnel.nix b/nixos/system/neuro/minecraft/public-tunnel.nix index 21687fc6..da35e5a8 100644 --- a/nixos/system/neuro/minecraft/public-tunnel.nix +++ b/nixos/system/neuro/minecraft/public-tunnel.nix @@ -9,7 +9,7 @@ let serviceConfig = { User = "mc-wow-tunnel"; Group = "mc-wow-tunnel"; - ExecStart = "${pkgs.openssh}/bin/ssh -NT -i ${config.sops.secrets."minecraft/wow-tunnel-key".path} -o IPQoS=none -o Ciphers=aes256-ctr -o MACs=hmac-sha2-256-etm@openssh.com -o KexAlgorithms=curve25519-sha256 -o BatchMode=yes -o IdentitiesOnly=yes -o StrictHostKeyChecking=yes -o UserKnownHostsFile=/etc/ssh/ssh_known_hosts -o ExitOnForwardFailure=yes -o ServerAliveInterval=15 -o ServerAliveCountMax=3 -o ConnectTimeout=10 -R 127.0.0.1:25577:127.0.0.1:25567 mc-wow-relay@${relay.address}"; + ExecStart = "${pkgs.openssh}/bin/ssh -NT -p ${toString (relay.port or 22)} -i ${config.sops.secrets."minecraft/wow-tunnel-key".path} -o IPQoS=none -o Ciphers=aes256-ctr -o MACs=hmac-sha2-256-etm@openssh.com -o KexAlgorithms=curve25519-sha256 -o BatchMode=yes -o IdentitiesOnly=yes -o StrictHostKeyChecking=yes -o UserKnownHostsFile=/etc/ssh/ssh_known_hosts -o ExitOnForwardFailure=yes -o ServerAliveInterval=15 -o ServerAliveCountMax=3 -o ConnectTimeout=10 -R 127.0.0.1:25577:127.0.0.1:25567 mc-wow-relay@${relay.address}"; Restart = "always"; RestartSec = 10; NoNewPrivileges = true; @@ -31,7 +31,7 @@ in { mode = "0400"; }; programs.ssh.knownHosts.minecraft-wow-relay = { - hostNames = [ "128.140.75.58" ]; + hostNames = [ "[128.140.75.58]:22223" ]; publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAFpr4DPSaJt0xeuGIfcZBJD3LsJHTdIRIs2Tt9HF+CT"; }; programs.ssh.knownHosts.minecraft-wow-relay-bfs = { @@ -41,6 +41,7 @@ in { systemd.services.minecraft-wow-tunnel = mkTunnel { name = "hectic-lab"; address = "128.140.75.58"; + port = 22223; }; systemd.services.minecraft-wow-tunnel-bfs = mkTunnel { name = "bfs.band"; diff --git a/nixos/system/neuro/minecraft/world-of-sosal-spawn/data/minecraft/tags/function/tick.json b/nixos/system/neuro/minecraft/world-of-sosal-spawn/data/minecraft/tags/function/tick.json new file mode 100644 index 00000000..deaf20b6 --- /dev/null +++ b/nixos/system/neuro/minecraft/world-of-sosal-spawn/data/minecraft/tags/function/tick.json @@ -0,0 +1,3 @@ +{ + "values": ["worldofsosal:spawn_tick"] +} diff --git a/nixos/system/neuro/minecraft/world-of-sosal-spawn/data/worldofsosal/function/first_spawn.mcfunction b/nixos/system/neuro/minecraft/world-of-sosal-spawn/data/worldofsosal/function/first_spawn.mcfunction new file mode 100644 index 00000000..219aefd8 --- /dev/null +++ b/nixos/system/neuro/minecraft/world-of-sosal-spawn/data/worldofsosal/function/first_spawn.mcfunction @@ -0,0 +1,3 @@ +spawnpoint @s 3742 89 8891 +tp @s 3742 89 8891 +tag @s add worldofsosal_initialized diff --git a/nixos/system/neuro/minecraft/world-of-sosal-spawn/data/worldofsosal/function/spawn_tick.mcfunction b/nixos/system/neuro/minecraft/world-of-sosal-spawn/data/worldofsosal/function/spawn_tick.mcfunction new file mode 100644 index 00000000..b851998f --- /dev/null +++ b/nixos/system/neuro/minecraft/world-of-sosal-spawn/data/worldofsosal/function/spawn_tick.mcfunction @@ -0,0 +1 @@ +execute as @a[tag=!worldofsosal_initialized] in crafting_azeroth:azeroth run function worldofsosal:first_spawn diff --git a/nixos/system/neuro/minecraft/world-of-sosal-spawn/pack.mcmeta b/nixos/system/neuro/minecraft/world-of-sosal-spawn/pack.mcmeta new file mode 100644 index 00000000..80ad934c --- /dev/null +++ b/nixos/system/neuro/minecraft/world-of-sosal-spawn/pack.mcmeta @@ -0,0 +1,6 @@ +{ + "pack": { + "pack_format": 48, + "description": "WorldOfSosal: initial spawn in Azeroth" + } +} diff --git a/nixos/system/neuro/minecraft/world-of-sosal.nix b/nixos/system/neuro/minecraft/world-of-sosal.nix index 2cead090..16482246 100644 --- a/nixos/system/neuro/minecraft/world-of-sosal.nix +++ b/nixos/system/neuro/minecraft/world-of-sosal.nix @@ -13,10 +13,10 @@ serverName = "wowMineMap"; remoteHost = "u664722.your-storagebox.de"; remoteUser = "u664722"; - remotePath = "minecraft/pack/WorldOfSosal-v3.mrpack"; + remotePath = "minecraft/pack/WorldOfSosal-v4-native-height.mrpack"; archiveName = "WorldOfSosal.mrpack"; cacheDir = "/var/lib/minecraft-modpacks/worldOfSosal"; - archiveSha256 = "f97cf251b14f40590e97e7b39e8a8ec43dacfce6da1b02357d15e0eee10d3ade"; + archiveSha256 = "4a197bc039d6684fa1e652e1242b15d87bd8758de895ea8c4f8455ce6a712df1"; expectedDependencies = { minecraft = "1.21.1"; neoforge = "21.1.250"; @@ -29,5 +29,11 @@ systemd.services.minecraft-modpack-import-worldOfSosal = { after = [ "minecraft-world-import-wowMineMap.service" ]; requires = [ "minecraft-world-import-wowMineMap.service" ]; + # Test the map's native dimension height without runtime height overrides. + postStart = '' + rm -f -- \ + "${config.services.minecraft-servers.dataDir}/wowMineMap/mods/dynamicheight-0.2.0+neoforge-1.21-1.21.1.jar" \ + "${config.services.minecraft-servers.dataDir}/wowMineMap/mods/sable_dynamicheight_compat-1.0.0.jar" + ''; }; } diff --git a/nixos/system/neuro/minecraft/wow-mine-map.nix b/nixos/system/neuro/minecraft/wow-mine-map.nix index 013c0a85..b2ef7e29 100644 --- a/nixos/system/neuro/minecraft/wow-mine-map.nix +++ b/nixos/system/neuro/minecraft/wow-mine-map.nix @@ -13,7 +13,7 @@ serverName = "wowMineMap"; remoteHost = "u664722.your-storagebox.de"; remoteUser = "u664722"; - remotePath = "minecraft/map/wow mine map.rar"; + remotePath = "minecraft/map/versions/world-of-sosal-original-bc80084d.rar"; archiveName = "wow mine map.rar"; cacheDir = "/var/lib/minecraft-maps"; archiveSha256 = "bc80084de10a06b0fc2cb1651c61936b9e2fd2288f3f0fe44c964d83a393aa30"; @@ -22,6 +22,26 @@ hostPublicKey = "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA5EB5p/5Hp3hGW1oHok+PIOH9Pbn7cnUiGmUEBrCVjnAw+HrKyN8bYVV0dIGllswYXwkG/+bgiBlE6IVIBAq+JwVWu1Sss3KarHY3OvFJUXZoZyRRg/Gc/+LRCE7lyKpwWQ70dbelGRyyJFH36eNv6ySXoUYtGkwlU5IVaHPApOxe4LHPZa/qhSRbPo2hwoh0orCtgejRebNtW5nlx00DNFgsvn8Svz2cIYLxsPVzKgUxs8Zxsxgn+Q/UvR7uq4AbAhyBMLxv7DjJ1pc7PJocuTno2Rw9uMZi1gkjbnmiOh6TTXIEWbnroyIhwc8555uto9melEUmWNQ+C+PwAK+MPw=="; }; + systemd.services.minecraft-world-reset-wowMineMap = { + description = "Reset WorldOfSosal to the pinned source map"; + path = [ pkgs.coreutils pkgs.systemd ]; + serviceConfig = { + Type = "oneshot"; + TimeoutStartSec = "45min"; + }; + script = let + source = config.services.minecraft-world-imports.wowMineMap; + in '' + set -eu + printf '%s %s\n' \ + '${source.archiveSha256}' \ + '${source.cacheDir}/${source.archiveName}' | sha256sum -c - + systemctl stop minecraft-server-wowMineMap.service minecraft-world-import-wowMineMap.service + rm -rf -- '${config.services.minecraft-servers.dataDir}/wowMineMap/${source.worldName}' + systemctl start minecraft-server-wowMineMap.service + ''; + }; + sops.secrets."minecraft/rcon-password" = { sopsFile = ../../../../sus/neuro-minecraft.yaml; owner = "minecraft";