From 5dc9d586fa848f16ca0a162e4e9db7e44ea40adf Mon Sep 17 00:00:00 2001 From: Ryan Barlow <7389646+ryanbarlow97@users.noreply.github.com> Date: Sat, 17 Oct 2026 16:00:43 +0000 Subject: [PATCH] chore: align TFMCWeb repository and deployment names --- README.md | 8 +++---- backend/src/characters/wardrobe.py | 2 +- backend/src/coreprotect/README.md | 2 +- backend/src/luckperms/README.md | 2 +- backend/src/patchnotes/folders.py | 2 +- backend/src/patreon/README.md | 2 +- backend/src/rail/README.md | 2 +- backend/src/servers/inventory.py | 4 ++-- backend/src/servers/test_inventory.py | 12 ++++++++++ backend/tests/test_compose_projects.py | 29 +++++++++++++++++++++++++ discord/minecraftban/config.example.yml | 2 +- discord/precedent/config.example.yml | 2 +- docker-compose.staging.yml | 2 +- docker-compose.yml | 2 ++ frontend/app/wiki/data/dowsing.ts | 2 +- frontend/app/wiki/data/gem-infusion.ts | 2 +- frontend/app/wiki/data/magic.ts | 2 +- frontend/app/wiki/data/materials.ts | 2 +- frontend/app/wiki/data/thievery.ts | 2 +- frontend/app/wiki/data/vehicles.ts | 2 +- scripts/patchnotes-update.py | 4 ++-- scripts/ps-compose.sh | 6 +++-- scripts/ps-preview.sh | 12 +++++----- scripts/server-control-update.py | 4 ++-- scripts/staging-down.sh | 2 +- 25 files changed, 79 insertions(+), 34 deletions(-) create mode 100644 backend/tests/test_compose_projects.py diff --git a/README.md b/README.md index 090667ed..976fce49 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# ProvinceSystem +# TFMCWeb > TF-Minecraft's web home for maps, characters, and custom creations. -ProvinceSystem powers the TFMC website and its connected world services. It brings together the interactive map, character creation, skin submissions, custom drinks, and player guides. +TFMCWeb powers the TFMC website and its connected world services. It brings together the interactive map, character creation, skin submissions, custom drinks, and player guides. It connects the Minecraft world with a browser experience: players can explore the political landscape, manage character details, and work on creations that return to the game through the companion plugins. @@ -23,11 +23,11 @@ It connects the Minecraft world with a browser experience: players can explore t ## Documentation -[Project documentation](https://github.com/TF-Minecraft/Docs/blob/main/projects/ProvinceSystem/README.md) +[Project documentation](https://github.com/TF-Minecraft/Docs/blob/main/projects/TFMCWeb/README.md) Technical documentation is maintained in [TF-Minecraft/Docs](https://github.com/TF-Minecraft/Docs). -[Previews and deployment](https://github.com/TF-Minecraft/Docs/blob/main/projects/ProvinceSystem/DEPLOY.md) +[Previews and deployment](https://github.com/TF-Minecraft/Docs/blob/main/projects/TFMCWeb/DEPLOY.md) ## Tests diff --git a/backend/src/characters/wardrobe.py b/backend/src/characters/wardrobe.py index bb9210ab..2d88ce3d 100644 --- a/backend/src/characters/wardrobe.py +++ b/backend/src/characters/wardrobe.py @@ -208,7 +208,7 @@ def resolve_skin_model(png_bytes: bytes, override: str | None) -> str: def _backend_root() -> Path: - # .../ProvinceSystem/backend/src/characters/wardrobe.py → backend/ + # .../TFMCWeb/backend/src/characters/wardrobe.py → backend/ return Path(__file__).resolve().parents[2] diff --git a/backend/src/coreprotect/README.md b/backend/src/coreprotect/README.md index 943f1258..ba775ce4 100644 --- a/backend/src/coreprotect/README.md +++ b/backend/src/coreprotect/README.md @@ -2,6 +2,6 @@ Read-only CoreProtect activity, session, and movement data for the staff panel. -[Configuration and technical reference](https://github.com/TF-Minecraft/Docs/blob/main/projects/ProvinceSystem/docs/integrations/coreprotect.md) +[Configuration and technical reference](https://github.com/TF-Minecraft/Docs/blob/main/projects/TFMCWeb/docs/integrations/coreprotect.md) Technical documentation is maintained in [TF-Minecraft/Docs](https://github.com/TF-Minecraft/Docs). diff --git a/backend/src/luckperms/README.md b/backend/src/luckperms/README.md index c029f84d..93db33be 100644 --- a/backend/src/luckperms/README.md +++ b/backend/src/luckperms/README.md @@ -2,6 +2,6 @@ Permission snapshots and queued staff changes through the TFMCWeb bridge. -[Configuration and technical reference](https://github.com/TF-Minecraft/Docs/blob/main/projects/ProvinceSystem/docs/integrations/luckperms.md) +[Configuration and technical reference](https://github.com/TF-Minecraft/Docs/blob/main/projects/TFMCWeb/docs/integrations/luckperms.md) Technical documentation is maintained in [TF-Minecraft/Docs](https://github.com/TF-Minecraft/Docs). diff --git a/backend/src/patchnotes/folders.py b/backend/src/patchnotes/folders.py index dd14582b..424b0a54 100644 --- a/backend/src/patchnotes/folders.py +++ b/backend/src/patchnotes/folders.py @@ -98,7 +98,7 @@ "Research": "Research", "SimpleFactions": "SimpleFactions", "TFMCCore": "TFMCCore", - "TFMCWeb": "TFMCWeb", + "TFMCWeb": "TFMCWebBridge", "TLibs": "TLibs", "Thievery": "Thievery", "TrialRooms": "TrialRooms", diff --git a/backend/src/patreon/README.md b/backend/src/patreon/README.md index 9bbe9a99..b92a5143 100644 --- a/backend/src/patreon/README.md +++ b/backend/src/patreon/README.md @@ -2,6 +2,6 @@ Supporter linking, entitlement decisions, and delivery to Discord and Minecraft. -[Configuration and technical reference](https://github.com/TF-Minecraft/Docs/blob/main/projects/ProvinceSystem/docs/integrations/patreon-backend.md) +[Configuration and technical reference](https://github.com/TF-Minecraft/Docs/blob/main/projects/TFMCWeb/docs/integrations/patreon-backend.md) Technical documentation is maintained in [TF-Minecraft/Docs](https://github.com/TF-Minecraft/Docs). diff --git a/backend/src/rail/README.md b/backend/src/rail/README.md index 1ab86055..635d73e5 100644 --- a/backend/src/rail/README.md +++ b/backend/src/rail/README.md @@ -2,6 +2,6 @@ Read-only VehicleFramework track data for the staff map. -[Configuration and technical reference](https://github.com/TF-Minecraft/Docs/blob/main/projects/ProvinceSystem/docs/integrations/rail.md) +[Configuration and technical reference](https://github.com/TF-Minecraft/Docs/blob/main/projects/TFMCWeb/docs/integrations/rail.md) Technical documentation is maintained in [TF-Minecraft/Docs](https://github.com/TF-Minecraft/Docs). diff --git a/backend/src/servers/inventory.py b/backend/src/servers/inventory.py index 94db3ce1..2c0b5842 100644 --- a/backend/src/servers/inventory.py +++ b/backend/src/servers/inventory.py @@ -580,7 +580,7 @@ def _plugin_state(jars: list[Jar], latest: Release, by_hash: dict[str, Release], def plugin_identifier(name: str | None) -> str: lowered = (name or "").lower() - return {"activity": "activitytf", "geiger_counter": "geigercounters"}.get(lowered, lowered) + return {"activity": "activitytf", "geiger_counter": "geigercounters", "tfmcweb": "tfmcwebbridge"}.get(lowered, lowered) def _match(jar: Jar, by_hash: dict[str, Release], prefixes: list[tuple[str, str]]) -> str | None: @@ -590,7 +590,7 @@ def _match(jar: Jar, by_hash: dict[str, Release], prefixes: list[tuple[str, str] matched = next((repo for prefix, repo in prefixes if lowered.startswith(prefix + "-")), None) if matched: return matched - # Stable Bukkit identifiers differ from repository names for these two plugins. + # Stable Bukkit identifiers differ from repository names for these plugins. name = plugin_identifier(jar.name) return next((repo for _, repo in prefixes if repo.lower() == name), None) diff --git a/backend/src/servers/test_inventory.py b/backend/src/servers/test_inventory.py index 9aa69ad7..eee8ef3e 100644 --- a/backend/src/servers/test_inventory.py +++ b/backend/src/servers/test_inventory.py @@ -12,6 +12,18 @@ from src.servers import inventory +def test_bridge_repository_matches_unchanged_runtime_name(): + latest = inventory.Release("TFMCWebBridge", "1.0", "2026-10-17", "", "tfmcweb-1.0.jar", "published") + jar = inventory.Jar("custom-test.jar", "unpublished", "TFMCWeb", "DEV", False) + plugins, others = inventory.compare( + {"TFMCWebBridge": [latest]}, + {"dev": {"jars": [jar], "startup": None, "releases_only": False}}, + ) + assert others == [] + assert plugins[0]["servers"]["dev"]["state"] == "test_build" + assert plugins[0]["servers"]["dev"]["files"] == ["custom-test.jar"] + + def make_jar(folder, file, name, version, extra=b""): folder.mkdir(parents=True, exist_ok=True) path = folder / file diff --git a/backend/tests/test_compose_projects.py b/backend/tests/test_compose_projects.py new file mode 100644 index 00000000..c9741009 --- /dev/null +++ b/backend/tests/test_compose_projects.py @@ -0,0 +1,29 @@ +"""Host project selection stays stable when deploying an older checkout.""" +import json +import os +from pathlib import Path +import subprocess + +import pytest + + +@pytest.mark.parametrize("target,project,checkout", [ + ("main", "tfmcweb-production", "ProvinceSystem"), + ("dev", "tfmcweb-staging", "tfmc-staging"), +]) +def test_host_wrapper_pins_project_independently_of_checkout(tmp_path, target, project, checkout): + source = Path(__file__).resolve().parents[2] / "scripts" / "ps-compose.sh" + script = tmp_path / "ps-compose" + script.write_text(source.read_text().replace("/home/tfmc", str(tmp_path))) + (tmp_path / checkout).mkdir() + site = "www" if target == "main" else target + overlay = tmp_path / f".site-images-{site}.json" + overlay.write_text("{}") + docker = tmp_path / "docker" + docker.write_text('#!/usr/bin/env python3\nimport json,sys\nprint(json.dumps(sys.argv[1:]))\n') + docker.chmod(0o755) + result = subprocess.run(["bash", str(script), target, "ps"], check=True, capture_output=True, + text=True, env={**os.environ, "PATH": f"{tmp_path}:{os.environ['PATH']}"}) + args = json.loads(result.stdout) + assert args[:5] == ["compose", "--project-name", project, "--project-directory", str(tmp_path / checkout)] + assert args[-3:] == ["-f", str(overlay), "ps"] diff --git a/discord/minecraftban/config.example.yml b/discord/minecraftban/config.example.yml index 36899717..97bb9ac0 100644 --- a/discord/minecraftban/config.example.yml +++ b/discord/minecraftban/config.example.yml @@ -4,7 +4,7 @@ # Same machine as AMP + ProvinceSystem stack (recommended): # api_base_url: "http://127.0.0.1:8000" # staff_key: "dev-staff-key" -# See TF-Minecraft/Docs: projects/ProvinceSystem/docs/integrations/discord-bot.md. +# See TF-Minecraft/Docs: projects/TFMCWeb/docs/integrations/discord-bot.md. api_base_url: "http://127.0.0.1:8000" staff_key: "dev-staff-key" diff --git a/discord/precedent/config.example.yml b/discord/precedent/config.example.yml index a5bcaded..fcbeb780 100644 --- a/discord/precedent/config.example.yml +++ b/discord/precedent/config.example.yml @@ -4,7 +4,7 @@ # Same machine as AMP + staging stack (recommended): # api_base_url: "http://127.0.0.1:18001" # staff_key: "dev-staff-key" -# See TF-Minecraft/Docs: projects/ProvinceSystem/docs/integrations/discord-bot.md +# See TF-Minecraft/Docs: projects/TFMCWeb/docs/integrations/discord-bot.md api_base_url: "http://127.0.0.1:18001" staff_key: "dev-staff-key" diff --git a/docker-compose.staging.yml b/docker-compose.staging.yml index 66b96b84..605beb9a 100644 --- a/docker-compose.staging.yml +++ b/docker-compose.staging.yml @@ -1,4 +1,4 @@ -name: tfmc-staging +name: tfmcweb-staging services: backend: diff --git a/docker-compose.yml b/docker-compose.yml index 876d0911..6dc346dd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,3 +1,5 @@ +name: tfmcweb-production + services: backend: # Reaps the renderer's Chromium processes. diff --git a/frontend/app/wiki/data/dowsing.ts b/frontend/app/wiki/data/dowsing.ts index a40d6e91..f2b0845e 100644 --- a/frontend/app/wiki/data/dowsing.ts +++ b/frontend/app/wiki/data/dowsing.ts @@ -2,7 +2,7 @@ import { M, T, V } from "./helpers"; import type { Recipe, WikiSection } from "./types"; // Source: plugins/Dowsing (config.yml, blocks.yml, types.yml, slots.yml, production_methods.yml), -// ItemsAdder ia_tfmc/contents/nodes.yml, and https://github.com/TF-Minecraft/Docs/blob/main/projects/ProvinceSystem/docs/wiki-research/a2-gems-dowsing-archaeo.md. +// ItemsAdder ia_tfmc/contents/nodes.yml, and https://github.com/TF-Minecraft/Docs/blob/main/projects/TFMCWeb/docs/wiki-research/a2-gems-dowsing-archaeo.md. const planks = { name: "Oak Planks", qty: 1, texture: V("oak_planks.png") }; diff --git a/frontend/app/wiki/data/gem-infusion.ts b/frontend/app/wiki/data/gem-infusion.ts index 21dabeb8..227169f0 100644 --- a/frontend/app/wiki/data/gem-infusion.ts +++ b/frontend/app/wiki/data/gem-infusion.ts @@ -1,5 +1,5 @@ import type { WikiCommandSet, WikiSection } from "./types"; -// Source: https://github.com/TF-Minecraft/Docs/blob/main/projects/ProvinceSystem/docs/wiki-research/a2-gems-dowsing-archaeo.md, section 1. +// Source: https://github.com/TF-Minecraft/Docs/blob/main/projects/TFMCWeb/docs/wiki-research/a2-gems-dowsing-archaeo.md, section 1. export const gemRarities = { columns: ["Rarity", "Display", "Weight", "Broadcast"], rows: [ diff --git a/frontend/app/wiki/data/magic.ts b/frontend/app/wiki/data/magic.ts index 6833b95f..4c87efa8 100644 --- a/frontend/app/wiki/data/magic.ts +++ b/frontend/app/wiki/data/magic.ts @@ -4,7 +4,7 @@ import type { Recipe, WikiCommandSet, WikiSection } from "./types"; // ---------- Magic (elements, shrines, spell runes, attunement) ---------- // -// Sources: https://github.com/TF-Minecraft/Docs/blob/main/projects/ProvinceSystem/docs/wiki-research/a-magic-knowledge.md section 1 (live Magic/*.yml, +// Sources: https://github.com/TF-Minecraft/Docs/blob/main/projects/TFMCWeb/docs/wiki-research/a-magic-knowledge.md section 1 (live Magic/*.yml, // MMOItems rune/charge definitions, the jar's plugin.yml). No source repository // exists for the Magic plugin, so everything here is config-derived. diff --git a/frontend/app/wiki/data/materials.ts b/frontend/app/wiki/data/materials.ts index 1795083d..04166942 100644 --- a/frontend/app/wiki/data/materials.ts +++ b/frontend/app/wiki/data/materials.ts @@ -163,7 +163,7 @@ export const serverCraftedMaterials: CatalogMaterial[] = [ // Historical export name retained for the station recipe generator's catalogue scan. // Gathered/loot materials may also have unpacking recipes. Acquisition evidence: -// https://github.com/TF-Minecraft/Docs/blob/main/projects/ProvinceSystem/docs/wiki-research/material-acquisition.md (cloned server config + local drop implementation). +// https://github.com/TF-Minecraft/Docs/blob/main/projects/TFMCWeb/docs/wiki-research/material-acquisition.md (cloned server config + local drop implementation). export const dropOnlyMaterials: DropOnlyMaterial[] = [ { name: "Enchanted Dust", diff --git a/frontend/app/wiki/data/thievery.ts b/frontend/app/wiki/data/thievery.ts index 626ed202..621a6fda 100644 --- a/frontend/app/wiki/data/thievery.ts +++ b/frontend/app/wiki/data/thievery.ts @@ -2,7 +2,7 @@ import type { CommandRow, WikiCommandSet, WikiSection } from "./types"; // ---------- Thievery ---------- // -// Sourced from https://github.com/TF-Minecraft/Docs/blob/main/projects/ProvinceSystem/docs/wiki-research/e-adventure.md, "Thievery" section. +// Sourced from https://github.com/TF-Minecraft/Docs/blob/main/projects/TFMCWeb/docs/wiki-research/e-adventure.md, "Thievery" section. // Jar: thievery-1.0.0.jar. No `permissions:` block exists in plugin.yml, so // every command below is open to a normal player except where noted. diff --git a/frontend/app/wiki/data/vehicles.ts b/frontend/app/wiki/data/vehicles.ts index 662fcd2f..a650e73b 100644 --- a/frontend/app/wiki/data/vehicles.ts +++ b/frontend/app/wiki/data/vehicles.ts @@ -3,7 +3,7 @@ import { constructionStations } from "./vehicle-construction"; import { T, V } from "./helpers"; import modelCatalogue from "../../../public/wiki/models/vehicles/catalogue.json"; -// Source: https://github.com/TF-Minecraft/Docs/blob/main/projects/ProvinceSystem/docs/wiki-research/g-gadgets.md sections 0, 3 and 4. +// Source: https://github.com/TF-Minecraft/Docs/blob/main/projects/TFMCWeb/docs/wiki-research/g-gadgets.md sections 0, 3 and 4. // Speeds are raw configuration rankings, not measured travel speeds. export interface VehicleSkin { id: string; diff --git a/scripts/patchnotes-update.py b/scripts/patchnotes-update.py index 5b726106..91633450 100644 --- a/scripts/patchnotes-update.py +++ b/scripts/patchnotes-update.py @@ -1,5 +1,5 @@ #!/usr/bin/python3 -I -"""Install the patch note jobs' Python package from a commit on ProvinceSystem main. +"""Install the patch note jobs' Python package from a commit on TFMCWeb main. The rewrite worker runs as root because the Codex login belongs to root, so the worker and the watch jobs run a root-owned copy of backend/src/patchnotes, never @@ -26,7 +26,7 @@ import urllib.request from pathlib import Path -REPO = "TF-Minecraft/ProvinceSystem" +REPO = "TF-Minecraft/TFMCWeb" PACKAGE = "backend/src/patchnotes" ROOT = Path("/usr/local/lib/tfmc-patchnotes") CURRENT = ROOT / "current" diff --git a/scripts/ps-compose.sh b/scripts/ps-compose.sh index b50d6bf2..fe5c44c8 100755 --- a/scripts/ps-compose.sh +++ b/scripts/ps-compose.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Limited docker compose for the ProvinceSystem main and dev sites. Installed as root's +# Limited docker compose for the TFMCWeb main and dev sites. Installed as root's # /usr/local/sbin/ps-compose and run as tfmc (docker group) through sudo, so people # without docker access can manage the two sites but not mount the host. set -euo pipefail @@ -18,10 +18,12 @@ shift case "$target" in main) dir=/home/tfmc/ProvinceSystem + project=tfmcweb-production files=(-f "$dir/docker-compose.yml" -f "$dir/docker-compose.override.yml") ;; dev) dir=/home/tfmc/tfmc-staging + project=tfmcweb-staging files=(-f "$dir/docker-compose.staging.yml" -f "$dir/docker-compose.override.yml") ;; *) @@ -55,4 +57,4 @@ image_overlay="/home/tfmc/.site-images-$image_site.json" [[ ! -f $image_overlay ]] || files+=(-f "$image_overlay") cd "$dir" -exec docker compose --project-directory "$dir" "${files[@]}" "$cmd" "$@" +exec docker compose --project-name "$project" --project-directory "$dir" "${files[@]}" "$cmd" "$@" diff --git a/scripts/ps-preview.sh b/scripts/ps-preview.sh index 5c795d13..fdc175fa 100755 --- a/scripts/ps-preview.sh +++ b/scripts/ps-preview.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Per-branch ProvinceSystem website previews at https://.tfminecraft.net. +# Per-branch TFMCWeb website previews at https://.tfminecraft.net. # Installed as root's /usr/local/sbin/ps-preview and run as tfmc (docker group), by the # preview key on psdeploy (through ps-preview-ssh), by admins with sudo -u tfmc, and by # ps-preview-reap.timer. Preview backends run as tfmc too, so tfmc owns every file. @@ -69,9 +69,9 @@ remove_dir() { staging_backend() { local id id=$(docker ps -a -q \ - --filter label=com.docker.compose.project=tfmc-staging \ + --filter label=com.docker.compose.project=tfmcweb-staging \ --filter label=com.docker.compose.service=backend | head -n1) - [[ -n "$id" ]] || die "cannot find the tfmc-staging backend container" + [[ -n "$id" ]] || die "cannot find the tfmcweb-staging backend container" echo "$id" } @@ -108,7 +108,7 @@ native_ready() { } preview_db_container() { - docker ps -q --filter label=com.docker.compose.project=tfmc-staging \ + docker ps -q --filter label=com.docker.compose.project=tfmcweb-staging \ --filter label=com.docker.compose.service=db | head -n1 } @@ -276,7 +276,7 @@ cmd_up() { low_prio docker pull -q "$IMAGE_PREFIX-backend:$slug" >/dev/null low_prio docker pull -q "$IMAGE_PREFIX-frontend:$slug" >/dev/null docker image prune -f \ - --filter "label=org.opencontainers.image.source=https://github.com/TF-Minecraft/ProvinceSystem" >/dev/null + --filter "label=org.opencontainers.image.source=https://github.com/TF-Minecraft/TFMCWeb" >/dev/null [[ $(docker image inspect -f '{{index .Config.Labels "net.tfminecraft.storage"}}' "$IMAGE_PREFIX-backend:$slug") == postgres ]] || die "branch image must include the native Postgres migration" local service container @@ -359,7 +359,7 @@ cmd_reap() { done < <(docker ps -a --filter label=com.docker.compose.project \ --format '{{.Label "com.docker.compose.project"}}' | grep '^pv-' | sort -u) docker image prune -f \ - --filter "label=org.opencontainers.image.source=https://github.com/TF-Minecraft/ProvinceSystem" >/dev/null + --filter "label=org.opencontainers.image.source=https://github.com/TF-Minecraft/TFMCWeb" >/dev/null } cmd_list() { diff --git a/scripts/server-control-update.py b/scripts/server-control-update.py index 4f1fab6c..2af556d3 100755 --- a/scripts/server-control-update.py +++ b/scripts/server-control-update.py @@ -1,5 +1,5 @@ #!/usr/bin/python3 -I -"""Install the control helper's Python modules from a commit on ProvinceSystem main. +"""Install the control helper's Python modules from a commit on TFMCWeb main. The host administrator installs this file once as root, and sudoers lets the deployment account run it. It only replaces the modules that run as the @@ -24,7 +24,7 @@ import urllib.request from pathlib import Path -REPO = "TF-Minecraft/ProvinceSystem" +REPO = "TF-Minecraft/TFMCWeb" SERVICE = "tfmc-server-control.service" CODE = Path("/usr/local/lib/tfmc-server-control") SERVERS = CODE / "backend/src/servers" diff --git a/scripts/staging-down.sh b/scripts/staging-down.sh index 6559a987..066e30b0 100755 --- a/scripts/staging-down.sh +++ b/scripts/staging-down.sh @@ -2,4 +2,4 @@ set -euo pipefail cd "$(dirname "$0")/.." docker compose -f docker-compose.staging.yml down -echo "Staging stack stopped (tfmc-staging)." +echo "Staging stack stopped (tfmcweb-staging)."