Compare commits

..
Author SHA1 Message Date
Дмитрий 2f9be0a196 Fix collecting the next published Manager changelog from its Git tag 2026-10-22 00:02:38 +05:00
ДмитрийandClaude Sonnet 5.5 f6eccf849f Content Scaling module settings: creature health multipliers
Five float fields (open world, dungeons, raids, ordinary mobs, bosses; 0.1 to 10) in six languages, with save-time validation in coa-core. They appear once the
server's Content Scaling module carries the matching CoAContentScaling.Difficulty.Health.* settings.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-21 15:09:43 +05:00
Corfirean 19791edb94 Preserve fragment validation alongside release-note synchronization (#127) 2026-10-20 06:38:25 +05:00
Corfirean 4537b2a826 Restore all published Manager changelogs and keep release notes synchronized (#126) 2026-10-20 06:37:28 +05:00
Corfirean 4a88f696a0 Link agents to the shared release and artifact handoff runbook (#123) 2026-10-19 19:32:50 +05:00
Corfirean e3fbb2e4b6 Update older versions directly using database migration history (#112) 2026-10-16 16:56:32 +05:00
Corfirean a7b56d6aed Simplify updates to one recovery-backed migration pass (#111)
* Share migration planning and execution across update phases

* Apply updates in one recovery-backed pass without nested server rehearsals

* Preserve applied core SQL and share account migration history across realms
2026-10-16 13:39:43 +05:00
Corfirean cda7875a9a Merge pull request #110 from Corfirean/release/0.6.19
Release Manager 0.6.19
2026-10-16 07:27:31 +05:00
Дмитрий f53c7cb221 Release Manager 0.6.19 2026-10-16 07:27:12 +05:00
Corfirean ca6bcf0052 Merge pull request #109 from Corfirean/fix/lightweight-update-check-20261016
Avoid archive downloads during checks and preflight combined rehearsal space
2026-10-16 06:02:05 +05:00
Дмитрий d6a6384f9c Keep update previews local and preflight the complete rehearsal footprint 2026-10-16 05:54:25 +05:00
Corfirean 21ddc1e7d8 Merge pull request #108 from Corfirean/fix/update-bridge-20261016
Restore updates from older server versions through tested intermediate releases
2026-10-16 05:27:19 +05:00
37 changed files with 2020 additions and 558 deletions

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
name: changelog-fragments
# Checks the changelog.d/ fragment files with the shared rules (https://github.com/Corfirean/coa-server-build/blob/main/changelog/GUIDE.md).
on:
push:
paths: ['changelog.d/**']
pull_request:
paths: ['changelog.d/**']
permissions:
contents: read
jobs:
check:
uses: Corfirean/coa-server-build/.github/workflows/changelog-check.yml@main
+41 -8
View File
@@ -1,14 +1,47 @@
name: changelog
# Checks the changelog.d/ fragment files with the shared rules (https://github.com/Corfirean/coa-server-build/blob/main/changelog/GUIDE.md).
on:
push:
paths: ['changelog.d/**']
branches: [master]
paths: [tools/sync_history.py, changelog/history.json, .github/workflows/changelog.yml]
pull_request:
paths: ['changelog.d/**']
paths: [tools/sync_history.py, tools/test_sync_history.py, changelog/history.json, .github/workflows/changelog.yml]
release:
types: [published, released]
workflow_run:
workflows: [release]
types: [completed]
workflow_dispatch:
permissions:
contents: read
contents: write
concurrency:
group: component-changelog
cancel-in-progress: false
jobs:
check:
uses: Corfirean/coa-server-build/.github/workflows/changelog-check.yml@main
test:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v7
- run: python3 -m unittest discover -s tools -p test_sync_history.py
sync:
needs: test
if: github.event_name != 'pull_request' && (github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success')
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v7
with:
ref: ${{ github.event.repository.default_branch }}
fetch-depth: 0
- name: Synchronize this component from published immutable sources
run: python3 tools/sync_history.py --sync-release-notes
- name: Commit updated history
run: |
git config user.name 'github-actions[bot]'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
git add CHANGELOG.md changelog/history.json
if git diff --cached --quiet; then exit 0; fi
git commit -m 'Update published Manager changelog'
git push origin HEAD:"${{ github.event.repository.default_branch }}"
+20 -2
View File
@@ -3,8 +3,7 @@
<!-- changelog:start (managed by coa-server-build/changelog/changelog.py sync-instructions) -->
## Changelog (shared by all CoA repositories)
Every CoA project (server fork, bots, Content Scaling, Manager, renderer) feeds **one** changelog that is posted to the
community. When you finish a change that a **player** or a **server owner** would notice (a new feature, a changed
Every CoA project (server fork, bots, Content Scaling, Manager, renderer) uses the same fragment format. **Manager and server release histories are separate**; each repository publishes only its own shipped component changes. When you finish a change that a **player** or a **server owner** would notice (a new feature, a changed
behaviour, a fix for something people ran into, a removed feature, a known issue), add **one small file to
`changelog.d/` in the same commit**. Do not add one for internal work (refactors, tests, CI, documentation).
@@ -29,3 +28,22 @@ Optional: one short paragraph in plain English for the reader (at most 300 chara
`python changelog.py new --area bots --type fixed --audience players --title "..."`.
- Full guide with examples: https://github.com/Corfirean/coa-server-build/blob/main/changelog/GUIDE.md
<!-- changelog:end -->
## Shared build and release workflow
Before preparing or publishing a Manager/server release, read the maintained
[release runbook](https://github.com/Corfirean/coa-server-build/blob/main/docs/server-release.md)
and [build agent instructions](https://github.com/Corfirean/coa-server-build/blob/main/AGENTS.md).
Use the local build checkout when available; otherwise retrieve the current files from GitHub.
Recover the exact prepared run, source commit, version, hashes and artifact expiry before rebuilding.
Prepare-only is not publication permission. A normal owner command to release the identified candidate
includes its required stable promotion; do not stop at a server Pre-release or ask twice for the same action.
Reuse signed prepared Manager installers after verifying their source metadata, SHA-256, updater JSON
and signature against the matching source's updater public key. Do not rerun compilation just to upload
already verified assets, or overwrite a published version with different bytes.
Server promotion uses the persistent Windows PC and the shared workflow's verified caches. Preserve
production databases; run applicable local acceptance in disposable fixtures. Record the actual passed,
failed and unrun checks. Verify both GitHub Latest and the public signed stable pointer before reporting
that users can update. Leave the durable handoff described in the runbook for the next agent.
+290 -15
View File
@@ -1,25 +1,300 @@
# CoA Server Manager changelog
Manager releases only. Updating the Manager does not update the server.
[Server changelog](https://github.com/Corfirean/coa-server-build/blob/main/CHANGELOG.md)
Dates follow GitHub publication (UTC); legacy records retain their archived dates. Newest releases first.
## 0.6.22 — 2026-10-19
- Updated Custom Races client patches to 1.8.
- Included the updated race appearance and cursor addons.
- Existing client files are preserved when installing or removing race patches.
[Release](https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.22) · [Source changes](https://github.com/Corfirean/coa-server-manager/compare/v0.6.21...v0.6.22)
## 0.6.21 — 2026-10-16
- Server updates apply migrations once after saving a recovery point.
- Older server versions update directly without installing intermediate packages.
- Update validation recognizes an already stopped server.
- Recorded core SQL stays applied after old history tables are cleaned up.
- Switching realms no longer repeats shared account database updates.
- Update offers distinguish version support from database validation.
[Release](https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.21) · [Source changes](https://github.com/Corfirean/coa-server-manager/compare/v0.6.19...v0.6.21)
## 0.6.19 — 2026-10-16
- Update checks no longer download a server archive to compare its launcher.
[Release](https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.19) · [Source changes](https://github.com/Corfirean/coa-server-manager/compare/v0.6.18...v0.6.19)
## 0.6.18 — 2026-10-16
- Older servers find a tested intermediate update instead of being blocked.
[Release](https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.18) · [Source changes](https://github.com/Corfirean/coa-server-manager/compare/v0.6.17...v0.6.18)
## 0.6.17 — 2026-10-15
- Already running MySQL is recognized before startup readiness checks.
- New servers install the current stable build directly.
- Install the matching client patches for Grummle.
- Failed repairs restore the previous server after final verification errors.
- Failed server updates show an error on the Overview screen.
- Private update checks show preparation stages and stop failure details.
- Repair recovery copies preserve all bundled database objects and accounts.
- Server checks report interrupted SQUID database imports.
- Shutdown remains available when startup templates or database records are damaged.
- Successful server repairs no longer block later server actions.
[Release](https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.17) · [Source changes](https://github.com/Corfirean/coa-server-manager/compare/v0.6.16...v0.6.17)
## 0.6.16 — 2026-10-13
- Linux Docker servers follow Settings, sharing and backups (experimental).
- Local hosts can connect while sharing a server online.
- Custom race client installation follows the current upstream release.
- Docker friend mode requests a restart when remote client support changes.
- Module cards show installed server revisions and the client race patch version.
- Server updates accept long Windows paths inside the private test server.
- Diagnostics record blocked startup requests and maintenance owner information.
- Client race patches can be repaired and removed while preserving original files.
- Checking an already installed server update no longer reports incompatibility.
- Failed server startup shows service errors even when the launcher reported ready.
- Starting the server waits for update checks and identifies ongoing maintenance.
[Release](https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.16) · [Source changes](https://github.com/Corfirean/coa-server-manager/compare/v0.6.15...v0.6.16)
## 0.6.15 — 2026-10-11
- Large server updates no longer repeatedly rewrite the recovery journal.
[Release](https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.15) · [Source changes](https://github.com/Corfirean/coa-server-manager/compare/v0.6.14...v0.6.15)
## 0.6.14 — 2026-10-11
- Fixed server update checks failing with long Windows paths.
[Release](https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.14) · [Source changes](https://github.com/Corfirean/coa-server-manager/compare/v0.6.13...v0.6.14)
## 0.6.13 — 2026-10-11
- Failed server startup after an update automatically restores the previous version.
- Windows update recovery preserves database procedures triggers and views.
- Custom races bot setting synchronizes Playerbots excluded race lists.
- Blocked updates identify database objects that prevent automatic recovery.
- Updates can follow signed channels that select a complete server release.
- Server updates check startup privately before allowing players to connect.
- Updates repair missing database defaults from the verified release schema.
- Server updates no longer replay module installation scripts on existing databases.
- Windows server updates are tested on a private copy before changing your installation.
- Server updates can require a tested combination of platform and installed version.
- Failed database checks keep a complete report after rollback.
- Players can install custom race patches when connecting to a friend.
[Release](https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.13) · [Source changes](https://github.com/Corfirean/coa-server-manager/compare/v0.6.12...v0.6.13)
## 0.6.12 — 2026-10-10
- Background world servers no longer stop because the local console is closed.
[Release](https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.12) · [Source changes](https://github.com/Corfirean/coa-server-manager/compare/v0.6.11...v0.6.12)
## 0.6.11 — 2026-10-10
- Server and Bots settings open without a blank window.
[Release](https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.11) · [Source changes](https://github.com/Corfirean/coa-server-manager/compare/v0.6.10...v0.6.11)
## 0.6.10 — 2026-10-10
- Custom race client patches update to the latest races and appearances.
[Release](https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.10) · [Source changes](https://github.com/Corfirean/coa-server-manager/compare/v0.6.9...v0.6.10)
## 0.6.9 — 2026-10-10
- Custom races can be enabled and their client patches installed from Modules.
[Release](https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.9) · [Source changes](https://github.com/Corfirean/coa-server-manager/compare/v0.6.8...v0.6.9)
## 0.6.8 — 2026-10-10
- Linux: install from the install screen, play with Wine or Proton (experimental).
- A failing database update is no longer reported as "database not running.
- Unsaved settings are protected and crashed servers can restart automatically.
[Release](https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.8) · [Source changes](https://github.com/Corfirean/coa-server-manager/compare/v0.6.7...v0.6.8)
## 0.6.7 — 2026-10-08
- Choose where backups are stored, for example on another drive.
- Bot settings with a fixed list of values show a drop-down.
- The bot dashboard loads completely and can be opened in the browser.
- Accounts of the SQUID bots are hidden from the Accounts list.
- A Dashboard tab shows what the SQUID bots are doing.
- A stopped server stays stopped after an update, unless you ask it to start.
- Checking for updates no longer fails with "Something went wrong" after a crash.
- Server updates no longer stop with "has a different checksum" on the Wildcard repair.
- A world server started from the coa-bots folder is recognised.
[Release](https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.7) · [Source changes](https://github.com/Corfirean/coa-server-manager/compare/v0.6.6...v0.6.7)
## 0.6.6 — 2026-10-07
- Install a server from a package on Linux, running in Docker (experimental).
- The Auction House Bot card no longer asks for a character GUID.
- Choose and remember the local network address friends use to connect.
- The NPC Enchanter card explains how to place and remove the NPC.
- Diagnostic files with database checks stay readable after secrets are removed.
- One button collects all diagnostics, including crashes and Windows crash records.
- Problem reports go to the right project.
[Release](https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.6) · [Source changes](https://github.com/Corfirean/coa-server-manager/compare/v0.6.5...v0.6.6)
## 0.6.5 — 2026-10-06
- Imported SquidBots servers warn before replacing their original binary.
- SquidBots settings follow the options shipped by the module.
- SquidBots shows its bundled release and includes it in problem reports.
- Server updates accept verified published migration variants without rerunning them.
- Server updates replace older launchers adapted by the Manager for Wildcard.
- Older server packages cannot replace a newer installation.
- Checking again no longer offers an already installed launcher update.
- Large SQUID database imports have more time to finish on first startup.
- Update history conflicts are detected before server files change.
- Pending database updates remain visible when the server version matches.
[Release](https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.5) · [Source changes](https://github.com/Corfirean/coa-server-manager/compare/v0.6.4...v0.6.5)
## 0.6.4 — 2026-10-05
- Start your installed server or client without downloading an available update.
- Finish a server update that was blocked by a startup failure.
[Release](https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.4) · [Source changes](https://github.com/Corfirean/coa-server-manager/compare/v0.6.3...v0.6.4)
## 0.6.3 — 2026-10-04
- Configure partial dungeon parties and open-world life steal in module settings.
- Download and update the game client without installing a server.
[Release](https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.3) · [Source changes](https://github.com/Corfirean/coa-server-manager/compare/v0.6.2...v0.6.3)
## 0.6.2 — 2026-10-04
- Choose which item types the auction bot sells.
- Module settings now offer translated controls and an enemy damage slider.
- Failed server updates restore databases and files together.
- Configure SQUID Playerbots and prevent conflicting bot systems.
- Server packages must include a complete database schema check.
[Release](https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.2) · [Source changes](https://github.com/Corfirean/coa-server-manager/compare/v0.6.1...v0.6.2)
## 0.6.1 — 2026-10-04
- PLAY launches only the client with the selected realmlist; starting the local server remains a separate action.
- Server multipliers accept decimals typed with a dot or comma. Talent and rested experience descriptions now explain their actual behavior.
- Added database and file checks, and Repair with backups and signed package verification. Unresolved schema damage is reported instead of guessed repairs.
- Fixed character database rebuilds retaining migration history that could skip required SQL. Applied migration hash changes are now rejected.
- Added optional simultaneous CoA and Wildcard worlds on Windows, with separate processes, ports and status indicators.
- Server multipliers now accept decimals typed with a dot or comma.
- Play launches only the game client without starting your local server.
- Check database structure and repair server files with a safety backup.
- Start CoA and Wildcard together from Settings.
[Release](https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.1) · [Source changes](https://github.com/Corfirean/coa-server-manager/compare/v0.6.0...v0.6.1)
## 0.6.0 — 2026-10-03
- Added Simplified Chinese for the interface and all server and bot settings.
- The closed game client now follows the selected CoA or Wildcard realm. Play checks the saved realm before launching; existing settings are preserved and backed up.
- Fixed GitHub reports opening Windows Explorer instead of the default browser. Long reports use the clipboard fallback.
- Fixed configuration snapshots created in the same millisecond overwriting each other during restore.
- Added experimental Linux startup: persistent state uses the XDG data folder, Tailscale detection supports Linux, and a Wayland rendering workaround respects existing user settings.
- Added experimental start, stop and status controls for manually prepared Docker servers, with private database networking and a remote console bound to localhost.
- Linux extraction restores executable permissions for ELF binaries and scripts, and paths retain case-sensitive filesystem semantics.
- The game client follows the realm selected in the Manager.
- Configuration snapshots no longer overwrite each other.
- Experimental Linux startup and Docker server controls.
- Problem reports open in the default browser.
- Simplified Chinese is available in the Manager.
### Availability
[Release](https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.0) · [Source changes](https://github.com/Corfirean/coa-server-manager/compare/v0.5.0...v0.6.0)
This release ships the Windows installer and signed updater assets. Linux support is a development preview, not a one-click installation flow. Docker installation/database setup, SQL operations and backups, updates, Wildcard realm profiles, and Wine/Proton client launching remain unfinished. Servers must be prepared manually and use Linux binaries built with the packaged configuration layout.
## 0.5.0 — 2026-10-03
Server shutdown and starting-zone scaling issues require separate server releases and are not fixed by updating the Manager alone.
- Imported servers get the module config files they lack.
- Modules marked Soon stay greyed out.
- The Bots page is hidden when the module is not on the server.
- Updating the game client shows a progress bar on its button.
- Switch between CoA and Wildcard while keeping separate characters and module settings.
[Release](https://github.com/Corfirean/coa-server-manager/releases/tag/v0.5.0) · [Source changes](https://github.com/Corfirean/coa-server-manager/compare/v0.4.0...v0.5.0)
## 0.4.0 — 2026-10-02
- Added module cards with switches and settings.
- Added searchable server settings and appearance and collection controls.
- Added account deletion with confirmation.
- Fixed update checks offering an already installed version.
[Release](https://github.com/Corfirean/coa-server-manager/releases/tag/v0.4.0) · [Source changes](https://github.com/Corfirean/coa-server-manager/compare/v0.3.1...v0.4.0)
## 0.3.1 — 2026-10-01
- Added named realmlists and a switcher beside Play.
- Added account management and a prefilled GitHub problem-report form.
- Server updates continue when leaving the settings page.
[Release](https://github.com/Corfirean/coa-server-manager/releases/tag/v0.3.1) · [Source changes](https://github.com/Corfirean/coa-server-manager/compare/v0.3.0...v0.3.1)
## 0.3.0 — 2026-10-01
- Download and update the game client through the Manager while preserving custom files.
- Server updates are checked automatically and offered on Overview.
[Release](https://github.com/Corfirean/coa-server-manager/releases/tag/v0.3.0) · [Source changes](https://github.com/Corfirean/coa-server-manager/compare/v0.2.0...v0.3.0)
## 0.2.0 — 2026-10-01
- Added companion creation progress and controls to stop creation, take bots offline or remove them.
- Choose how many bots log in when the server starts.
- Added a control to log out a chosen number of bots and reduce server load.
[Release](https://github.com/Corfirean/coa-server-manager/releases/tag/v0.2.0) · [Source changes](https://github.com/Corfirean/coa-server-manager/compare/v0.1.6...v0.2.0)
## 0.1.6 — 2026-09-30
- Overview shows world speed.
- Improved companion setup, including requests made while the server is stopped.
- Expanded translated settings and connection guides.
[Release](https://github.com/Corfirean/coa-server-manager/releases/tag/v0.1.6) · [Source changes](https://github.com/Corfirean/coa-server-manager/compare/v0.1.4...v0.1.6)
## 0.1.4 — 2026-09-30
- Sharing settings are reapplied before server startup.
- Added a restart shortcut after enabling play with friends.
[Release](https://github.com/Corfirean/coa-server-manager/releases/tag/v0.1.4) · [Source changes](https://github.com/Corfirean/coa-server-manager/compare/v0.1.3...v0.1.4)
## 0.1.3 — 2026-09-30
- The interface scales with the window.
- Each friend connection mode shows the realmlist line to use.
[Release](https://github.com/Corfirean/coa-server-manager/releases/tag/v0.1.3) · [Source changes](https://github.com/Corfirean/coa-server-manager/compare/v0.1.2...v0.1.3)
## 0.1.2 — 2026-09-30
- Manager updates download in the background and install when the app closes.
- Missing module configuration files are created from the supplied defaults.
[Release](https://github.com/Corfirean/coa-server-manager/releases/tag/v0.1.2) · [Source changes](https://github.com/Corfirean/coa-server-manager/compare/v0.1.1...v0.1.2)
## 0.1.1 — 2026-09-30
- Added translations throughout setup, server updates, backups, diagnostics and settings.
- Added clearer errors when server packages are unavailable or a server cannot be reached.
[Release](https://github.com/Corfirean/coa-server-manager/releases/tag/v0.1.1) · [Source changes](https://github.com/Corfirean/coa-server-manager/compare/v0.1.0...v0.1.1)
## 0.1.0 — 2026-09-30
- Initial Windows release: install or import a server and manage startup from one app.
- Configure server and bot settings, manage accounts, create backups and restore saved data.
- Launch the game client, set up sharing with friends and collect diagnostics.
[Release](https://github.com/Corfirean/coa-server-manager/releases/tag/v0.1.0)
Generated
+3 -3
View File
@@ -491,7 +491,7 @@ dependencies = [
[[package]]
name = "coa-core"
version = "0.6.18"
version = "0.6.21"
dependencies = [
"base64 0.22.1",
"chrono",
@@ -520,7 +520,7 @@ dependencies = [
[[package]]
name = "coa-release"
version = "0.6.18"
version = "0.6.21"
dependencies = [
"chrono",
"coa-core",
@@ -529,7 +529,7 @@ dependencies = [
[[package]]
name = "coa-server-manager"
version = "0.6.18"
version = "0.6.21"
dependencies = [
"coa-core",
"serde",
+1 -1
View File
@@ -3,7 +3,7 @@ resolver = "2"
members = ["crates/coa-core", "crates/coa-release", "src-tauri"]
[workspace.package]
version = "0.6.18"
version = "0.6.21"
edition = "2021"
license = "AGPL-3.0-only"
+5
View File
@@ -57,6 +57,11 @@ Download the installer from the [Releases](https://github.com/Corfirean/coa-serv
and run it. You need about 10 GB of free disk space for the server. The game client (about 43 GB) is separate: point the
Manager at the one you have, or let it download one for you.
## Changelog
[Manager release history](CHANGELOG.md) · [Server release history](https://github.com/Corfirean/coa-server-build/blob/main/CHANGELOG.md).
Manager and server updates have separate version histories.
## Status
Phases 0–10 of the plan in [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) are done: foundation, import, start/stop,
@@ -0,0 +1,7 @@
---
area: manager
type: changed
audience: admins
title: Server updates apply migrations once after saving a recovery point
---
Updates no longer build and start a second full server copy. The Manager checks both realms, saves recovery, applies pending SQL once and verifies startup. Failed SQL or startup restores the recovery point. Full-copy upgrade testing remains a release task.
@@ -0,0 +1,7 @@
---
area: manager
type: changed
audience: admins
title: Older server versions update directly without installing intermediate packages
---
The Manager checks database history and applies missing SQL from the latest signed package. A version missing from the release test list no longer blocks the update. Unknown versions, interrupted migrations and downgrades remain blocked.
@@ -0,0 +1,7 @@
---
area: manager
type: fixed
audience: admins
title: Update validation recognizes an already stopped server
---
Validation uses the same complete-server stop check as recovery instead of issuing redundant unconditional shutdown commands.
@@ -0,0 +1,7 @@
---
area: manager
type: fixed
audience: admins
title: Update checks no longer download a server archive to compare its launcher
---
Manager recognizes its supported launcher edits against the signed file hash locally. Overlapping checks wait briefly for one another, and the private update copy checks combined program and database space before copying.
@@ -0,0 +1,7 @@
---
area: manager
type: fixed
audience: admins
title: Recorded core SQL stays applied after old history tables are cleaned up
---
Existing core migration records are preserved in Manager history. Unknown legacy checksums remain explicitly unknown, and interrupted or changed migrations are still rejected.
@@ -0,0 +1,7 @@
---
area: manager
type: fixed
audience: admins
title: Switching realms no longer repeats shared account database updates
---
Solo and Wildcard use one migration history for their shared account database. Previously applied records from either realm are recognized without running their SQL again.
@@ -0,0 +1,7 @@
---
area: manager
type: fixed
audience: admins
title: Update offers distinguish version support from database validation
---
An available version sequence no longer claims that every database state has been tested. Database compatibility is checked during the update.
@@ -0,0 +1,7 @@
---
area: manager
type: added
audience: admins
title: Module settings for Content Scaling include creature health
---
The Content Scaling page now has five health multipliers: for the open world, dungeons and raids, and for ordinary mobs and bosses. They multiply the health the scaling already gives creatures (1 keeps the normal balance, lower is easier, 0.1 to 10) and need a server build that includes the matching Content Scaling settings.
+1 -2
View File
@@ -1,7 +1,6 @@
# changelog.d
One small Markdown file per change that a player or a server owner would notice. They are collected from every CoA
repository when a release is made. The rules and the file format are in `AGENTS.md` (section "Changelog") and, in full,
One small Markdown file per change that a player or a server owner would notice. Server and Manager releases collect only their own shipped changes from immutable sources; their public histories are separate. The rules and the file format are in `AGENTS.md` (section "Changelog") and, in full,
in https://github.com/Corfirean/coa-server-build/blob/main/changelog/GUIDE.md
This README is ignored by the collector.
@@ -0,0 +1,200 @@
[
{
"tag": "v0.6.22",
"date": "2026-10-19T07:49:11Z",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.22",
"body": "## Manager\r\n- Updated Custom Races client patches to 1.8, including Drakkin, Drakonid and updated racial abilities\r\n- Added updated race appearances and cursor addons\r\n- Existing client files are preserved when installing or removing race patches\r\n\r\nPrepared from commit 65df6604846d5492e40a6b08a797199478666e24. Installer and updater signature were verified before publication.\r\n"
},
{
"tag": "v0.6.21",
"date": "2026-10-16T12:11:35Z",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.21",
"body": "## Manager\n- Older server versions update directly to the latest signed package without installing intermediate releases.\n- The published source-version list records release test coverage; a missing entry no longer blocks an older installation by itself.\n- Apply only missing database migrations, preserving recorded AzerothCore history and sharing account migration history between Solo and Wildcard.\n- Save one complete recovery point, apply SQL once and check the database schema, startup, account and character identities. Restore files and databases on failure.\n- Keep unknown imported versions, interrupted migrations, changed SQL checksums, downgrades and incompatible packages blocked.\n- Remove the nested per-update server rehearsal and recursive intermediate-package lookup.\n\nInstalling this Manager does not update your server automatically. Unknown third-party repacks still require a verified starting state; this release does not guess which unrecorded SQL was applied manually.\r\n\nValidation: 11 package-based scenarios passed against Server 0.261015.58, including the earliest base and a repeated current-version check. A separate direct 800006 -> 58 upgrade on an isolated copy preserved all 133 account and 3123 character identities. No client login or gameplay acceptance was performed.\n\r\n"
},
{
"tag": "v0.6.19",
"date": "2026-10-16T02:37:16Z",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.19",
"body": "## Manager\n- Update checks no longer download a full server package just to verify the launcher\n- Concurrent update checks wait briefly for the current check instead of immediately reporting another operation\n- Update rehearsals check the combined space required for program files and databases before creating the private copy\n\nIncludes the signed intermediate upgrade path from v0.6.18 for older server installations.\n\nThis release updates the Manager only. Existing server files and databases are not changed by installing it.\r\n"
},
{
"tag": "v0.6.18",
"date": "2026-10-16T00:33:21Z",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.18",
"body": "## CoA Server Manager 0.6.18\n\n- Fixed update checks blocking older server versions when a tested intermediate release is available\n- Manager now offers the required intermediate update automatically and explains how to continue to the latest stable version\n- Intermediate packages must match the signatures and manifest hashes recorded in the target release's compatibility matrix\n- Unsupported source errors now identify the installed version, target version and directly supported versions\n\nFor servers on **0.261011.800006**, Manager offers **0.261013.54** first. After it completes, check for updates again to install **0.261015.58**. Clear any manually entered Advanced package source to use automatic selection.\n\nThe server package and stable channel have not changed. Existing data follows the normal backup and verified update process.\n"
},
{
"tag": "v0.6.17",
"date": "2026-10-15T16:51:52Z",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.17",
"body": "## CoA Server Manager 0.6.17 / Server 0.261015.58\n\n### Manager\n\n- New servers now install the current stable build directly, without installing 2.0 first\n- Fixed completed repairs leaving the server stuck in a maintenance state\n- Servers can now stop even when startup templates or MySQL process records are damaged\n- Repair now preserves database accounts, views, procedures and triggers, with improved rollback after failures\n- Interrupted SQUID database imports are now reported by Check and Repair\n- Update errors remain visible on Overview, with technical details and a copy button\n- Improved update preparation progress and diagnostics for shutdown failures and port conflicts\n- Updated Custom Races client patches to 1.7 while preserving existing race assets\n\n### Server\n\n- Integrated 34 CoA upstream commits\n- Updated Custom Races to 1.7, adding playable Grummle and their racial abilities\n- Updated SQUID Playerbots to 2.3.1\n- Added complete installation packages for the current server release\n- Improved shutdown recovery and startup configuration errors\n\n### Content scaling\n\n- Creature health settings are now respected while Content Scaling is enabled\n"
},
{
"tag": "v0.6.16",
"date": "2026-10-13T12:39:15Z",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.16",
"body": "**Manager** (for server owners)\n- Added: Linux Docker servers follow Settings, sharing and backups (experimental). Experimental. Settings the Docker backend fixes are hidden, friends sharing and logs work, the game data folder can be changed, and the realm no longer shows offline after a start.\n- Added: Updates can follow signed channels that select a complete server release. The Manager checks the channel signature and downloads every package part from the same release. Existing installations continue using the previous download source until the new channel is published.\n- Added: Windows server updates are tested on a private copy before changing your installation. The Manager tests migrations and server startup using your databases and configurations. A failed rehearsal leaves the installed server unchanged and preserves a diagnostic report.\n- Added: Server updates can require a tested combination of platform and installed version. Signed release metadata identifies core and module revisions, supported starting versions and database contracts. Incompatible packages are rejected before shutdown; changed schema contracts and incompatible databases block installation before migration.\n- Added: Module cards show installed server revisions and the client race patch version. Module revisions come from the currently installed release metadata. The race card shows the client patch version separately; missing version metadata is reported honestly instead of showing a download version as installed.\n- Changed: Failed server startup after an update automatically restores the previous version. The Manager restores server files and databases, then checks the recovered server. If recovery cannot be confirmed, it preserves the recovery point and blocks further startup until the problem is resolved.\n\n----- next message -----\n\n**Manager** (for server owners) (cont.)\n- Fixed: Windows update recovery preserves database procedures triggers and views. A verified copy of stopped MySQL restores all databases and accounts together. Interrupted restoration can be retried, and the replaced database directory is retained.\n- Fixed: Custom races bot setting synchronizes Playerbots excluded race lists. The \"Bots can be custom races\" setting now configures AiPlayerbot.ExcludedBotRaces in playerbots.conf. Off excludes all added races (recommended), while on allows stable added races (experimental).\n- Fixed: Blocked updates identify database objects that prevent automatic recovery. Diagnostics include the complete list of unsupported database objects across the recovery point, helping resolve update failures without removing user data.\n- Fixed: Server updates check startup privately before allowing players to connect. Startup checks use temporary local ports. Original settings are restored before opening the server, and interrupted checks retain a recovery journal.\n- Fixed: Local hosts can connect while sharing a server online. The Manager no longer replaces the realm's local address with its public address when Friends mode is enabled.\n- Fixed: Updates repair missing database defaults from the verified release schema. Only missing literal defaults are restored when column properties match. Existing rows, custom defaults, types and nullability are preserved; unresolved incompatibilities still block the update.\n- Fixed: Server updates no longer replay module installation scripts on existing databases. Update packages contain incremental SQL only. Module table initialization and seed scripts remain available when preparing a clean installation, preventing existing content from being reset during updates.\n\n----- next message -----\n\n**Manager** (for server owners) (cont.)\n- Fixed: Failed database checks keep a complete report after rollback. Schema errors show readable default values and save every detected difference for troubleshooting, including after the server is restored.\n- Fixed: Large server updates no longer repeatedly rewrite the recovery journal. Updates containing rebuilt navigation data now prepare all recovery copies before replacing files. Interrupted updates remain recoverable without rewriting the full journal for every file.\n- Fixed: Normalize rehearsal server roots to prevent Windows path prefix errors. Server update rehearsals now canonicalize the installation root before collecting files, resolving a \"prefix not found\" error during rehearsal preparation on Windows.\n- Fixed: SQUID imports character tables first and reports slow database imports. SQUID prepares character tables before its large travel data. Startup shows each base import and identifies a failed import without starting the world server or replaying an incomplete migration.\n- Fixed: Docker friend mode requests a restart when remote client support changes. Enabling remote CoA clients now requests a world restart even when the game ports were already open. Repeating the same unchanged setting does not request another Line truncated
},
{
"tag": "v0.6.15",
"date": "2026-10-11T23:10:59Z",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.15",
"body": "## Fixes\n\n- Large server updates, including rebuilt maps, vmaps and mmaps, no longer rewrite the complete recovery journal for every file.\n- All recovery copies are prepared before replacing any server file. Interrupted updates still restore the previous files and remove newly created files only when their content matches the update.\n\nValidated by Windows and Linux CI, the full Manager test suite, and a regression covering power loss during file replacement and incomplete recovery-copy preparation.\n\nUpdate the Manager before installing the navigation refresh. Portable Characters and Portable Session Bridge are not included."
},
{
"tag": "v0.6.14",
"date": "2026-10-11T21:14:34Z",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.14",
"body": "See the assets to download the installer. Existing installations update themselves."
},
{
"tag": "v0.6.13",
"date": "2026-10-11T14:03:44Z",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.13",
"body": "See the assets to download the installer. Existing installations update themselves."
},
{
"tag": "v0.6.12",
"date": "2026-10-10T03:10:14Z",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.12",
"body": "See the assets to download the installer. Existing installations update themselves."
},
{
"tag": "v0.6.11",
"date": "2026-10-10T03:05:20Z",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.11",
"body": "See the assets to download the installer. Existing installations update themselves."
},
{
"tag": "v0.6.10",
"date": "2026-10-10T02:07:18Z",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.10",
"body": "See the assets to download the installer. Existing installations update themselves."
},
{
"tag": "v0.6.9",
"date": "2026-10-10T01:50:51Z",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.9",
"body": "See the assets to download the installer. Existing installations update themselves."
},
{
"tag": "v0.6.8",
"date": "2026-10-10T01:05:56Z",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.8",
"body": "See the assets to download the installer. Existing installations update themselves."
},
{
"tag": "v0.6.7",
"date": "2026-10-08T04:59:31Z",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.7",
"body": "See the assets to download the installer. Existing installations update themselves."
},
{
"tag": "v0.6.6",
"date": "2026-10-07T05:47:46Z",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.6",
"body": "See the assets to download the installer. Existing installations update themselves."
},
{
"tag": "v0.6.5",
"date": "2026-10-06T06:17:21Z",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.5",
"body": "# CoA Server Manager 0.6.5 / Server 0.261006.1\n\nUpdate CoA Server Manager to 0.6.5 first, then update the server. This server package requires Manager 0.6.5.\n\n## Server updates and recovery\n\n- Recognize known, signed historical migration checksums without rewriting migration history or replaying applied SQL.\n- Check migration history and SQL files before replacing server files. Interrupted or failed migrations still require recovery.\n- Preserve damaged update records and protect recovery points belonging to unfinished updates. Check saved copies before restoring them.\n- Refresh saved update status after update and recovery attempts, including failures.\n- Recognize launcher adjustments made by the Manager, including older Wildcard launchers. Custom edits still require a choice.\n- Stop offering an already installed launcher update after checking again.\n- Reject older server packages. Use the update's recovery point to undo an update.\n- Restore missing Wildcard card and specialization-cache tables through a new corrective migration, preserving existing tables and data.\n- Fix launcher integration imports when using the server's isolated Python runtime.\n\n## SQUID Playerbots\n\n- Include SQUID Playerbots v1.8.1 together with the matching core, launcher and Manager integration.\n- Provide translated bot settings, release information and controls for the active bot system. Prevent conflicting bot systems from starting together.\n- Include the SQUID database in recovery points when installed.\n- Keep servers with SQUID disabled independent of its database startup hooks.\n- Detect unfinished initial database imports instead of treating partially imported tables as complete.\n- Allow more time for large SQL imports and initial bot creation. The Manager startup deadline is up to 45 minutes when SQUID is enabled; ordinary startup deadlines are unchanged.\n- Preserve historical SQL files and migration history. Only new migrations are applied.\n- Require an explicit keep-or-replace decision when updating imported server binaries protected by their original launcher or updater.\n\n## Local candidate validation\n\nThe signed final package passed an update and startup of both CoA and Wildcard on a marked disposable installation. Selected account, character and inventory fields were preserved, historical migrations were skipped, and a repeated update check was clean. Fresh SQUID database import and repeated startup were checked using the same native binaries and SQL as the final package.\n"
},
{
"tag": "v0.6.4",
"date": "2026-10-05T09:22:40Z",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.4",
"body": "Fixes server updates that failed to start with the repack's bundled Python runtime.\n\nIf an update is waiting for recovery, open Settings → Server updates and choose **Retry server startup**. Successful validation finishes the already applied update without replaying database migrations. Rollback remains available if validation fails.\n\n**Start without updating** and **Play without updating** let you use the installed server or client when a newer version is available. Interrupted server updates still require recovery.\n\n[Shared changelog](https://github.com/Corfirean/coa-server-build/blob/main/CHANGELOG.md)\n"
},
{
"tag": "v0.6.3",
"date": "2026-10-04T22:41:10Z",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.3",
"body": "See the assets to download the installer. Existing installations update themselves."
},
{
"tag": "v0.6.2",
"date": "2026-10-04T21:54:32Z",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.2",
"body": "## Manager 0.6.2\n\n- Server Update and Repair now back up databases before changes and recover databases, files and version metadata together after a failed update.\n- Database checks detect missing Wildcard tables even when migration history says the SQL ran. New server packages include the expected full database schema.\n- Interrupted or failed SQL is not blindly replayed; unresolved recovery is reported before another update or server start.\n- Checks cover race/class starting data and existing character visibility.\n- Adds the bot and module settings included in the reviewed dependency, including SQUID settings and translated controls.\n- Includes the latest Docker database-access changes.\n\nInstall/update Manager first, then update the server package. Run Settings → Check files and database if an existing installation reports database problems. Already lost database rows require a backup; restoring table structure cannot recreate them.\n\nValidation: 233 core tests passed locally after merging current master; workspace check and frontend build passed. Release package verification used disposable MySQL and a signed server package.\r\n\n\nShared release changelog: https://github.com/Corfirean/coa-server-build/blob/main/CHANGELOG.md\n\r\n"
},
{
"tag": "v0.6.1",
"date": "2026-10-04T10:58:56Z",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.1",
"body": "## Changes\n\n- PLAY launches only the game client with the selected realmlist. Use START SERVER separately for your local server.\n- Decimal server multipliers can be typed with either a dot or a comma.\n- Talent settings explain that the standard AzerothCore multiplier does not affect CoA talent points; rested experience settings describe accumulation correctly.\n- Added file/database checks and Repair with backups, verified official packages and reports of unresolved schema damage.\n- Fixed stale character migration history after rebuilding a character database and reject changed hashes of already applied migrations.\n- Added optional simultaneous CoA and Wildcard worlds on Windows, with separate processes, ports, logs and status indicators.\n\n## Notes\n\nRepair requires a stopped server and matching currently published packages. It preserves player data and settings; unsupported schema repairs are reported for corrective migrations.\n\nSimultaneous worlds require a compatible Wildcard server build. Existing Linux/Docker support remains experimental; simultaneous worlds are Windows-only.\n\nDownload the Windows installer below, or let an existing Manager installation update automatically. Server packages are updated separately.\r\n"
},
{
"tag": "v0.6.0",
"date": "2026-10-03T18:06:31Z",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.0",
"body": "# CoA Server Manager changelog\r\n\r\n## 0.6.0 — 2026-10-03\r\n\r\n- Added Simplified Chinese for the interface and all server and bot settings.\r\n- The closed game client now follows the selected CoA or Wildcard realm. Play checks the saved realm before launching; existing settings are preserved and backed up.\r\n- Fixed GitHub reports opening Windows Explorer instead of the default browser. Long reports use the clipboard fallback.\r\n- Fixed configuration snapshots created in the same millisecond overwriting each other during restore.\r\n- Added experimental Linux startup: persistent state uses the XDG data folder, Tailscale detection supports Linux, and a Wayland rendering workaround respects existing user settings.\r\n- Added experimental start, stop and status controls for manually prepared Docker servers, with private database networking and a remote console bound to localhost.\r\n- Linux extraction restores executable permissions for ELF binaries and scripts, and paths retain case-sensitive filesystem semantics.\r\n\r\n### Availability\r\n\r\nThis release ships the Windows installer and signed updater assets. Linux support is a development preview, not a one-click installation flow. Docker installation/database setup, SQL operations and backups, updates, Wildcard realm profiles, and Wine/Proton client launching remain unfinished. Servers must be prepared manually and use Linux binaries built with the packaged configuration layout.\r\n\r\nServer shutdown and starting-zone scaling issues require separate server releases and are not fixed by updating the Manager alone.\r\n"
},
{
"tag": "v0.5.0",
"date": "2026-10-03T06:26:08Z",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.5.0",
"body": "## CoA and Wildcard realm profiles\n\nChoose CoA or Wildcard on Overview. The first Wildcard switch creates a separate world and empty character database; accounts are shared. Only one world runs at a time. Switching a running server saves characters and restarts it, and returning to CoA restores its module settings.\n\n- Requires a server build and database migrations with Wildcard support. Existing destination databases or realm ID 2 are preserved and block automatic creation.\n- CoA companion bots are unavailable on Wildcard. Content Scaling and other optional modules remain experimental there.\n- Backups cover both realms; restores identify their realm. Server migrations update both realms and shared auth once.\n- Configuration switches support recovery after interruption.\n\nValidation: 178 Rust tests, frontend build and translation checks, native isolated-fixture creation/start/switch, full backup, restore and migration checks. Final real-clock Wildcard gameplay verification: four scenarios passed with zero failures and zero isolated reruns (first login, level rolls, skill-card rolls, stats). Module gameplay compatibility beyond those scenarios remains unverified.\n\nDownload the Windows installer below. Existing Manager installations receive the signed update automatically. [Details and demo](https://github.com/Corfirean/coa-server-manager/blob/v0.5.0/docs/WILDCARD.md).\r\n\r\n"
},
{
"tag": "v0.4.0",
"date": "2026-10-02T16:51:50Z",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.4.0",
"body": "See the assets to download the installer. Existing installations update themselves."
},
{
"tag": "v0.3.1",
"date": "2026-10-01T11:44:28Z",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.3.1",
"body": "See the assets to download the installer. Existing installations update themselves."
},
{
"tag": "v0.3.0",
"date": "2026-10-01T03:13:59Z",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.3.0",
"body": "See the assets to download the installer. Existing installations update themselves."
},
{
"tag": "v0.2.0",
"date": "2026-10-01T00:58:01Z",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.2.0",
"body": "See the assets to download the installer. Existing installations update themselves."
},
{
"tag": "v0.1.6",
"date": "2026-09-30T18:16:06Z",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.1.6",
"body": "See the assets to download the installer. Existing installations update themselves."
},
{
"tag": "v0.1.4",
"date": "2026-09-30T15:04:30Z",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.1.4",
"body": "See the assets to download the installer. Existing installations update themselves."
},
{
"tag": "v0.1.3",
"date": "2026-09-30T14:55:17Z",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.1.3",
"body": "See the assets to download the installer. Existing installations update themselves."
},
{
"tag": "v0.1.2",
"date": "2026-09-30T11:06:53Z",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.1.2",
"body": "See the assets to download the installer. Existing installations update themselves."
},
{
"tag": "v0.1.1",
"date": "2026-09-30T07:40:42Z",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.1.1",
"body": "See the assets to download the installer. Existing installations update themselves."
},
{
"tag": "v0.1.0",
"date": "2026-09-30T07:03:22Z",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.1.0",
"body": "See the assets to download the installer. Existing installations update themselves."
}
]
+576
View File
@@ -0,0 +1,576 @@
{
"schema": 1,
"component": "manager",
"repository": "Corfirean/coa-server-manager",
"consumedFragments": [
"Corfirean/coa-server-manager:20261002-collections-tab-with-transmog-vanity-riding-and.md",
"Corfirean/coa-server-manager:20261002-companion-bots-are-recognised-from-their-default.md",
"Corfirean/coa-server-manager:20261002-delete-an-account-from-the-players-page.md",
"Corfirean/coa-server-manager:20261002-importing-a-server-suggests-the-right-folder-whe.md",
"Corfirean/coa-server-manager:20261002-modules-page-with-cards-status-badges-and-per-mo.md",
"Corfirean/coa-server-manager:20261002-report-a-problem-collects-more-and-ignores-repea.md",
"Corfirean/coa-server-manager:20261002-server-settings-in-one-panel-with-search-tabs-an.md",
"Corfirean/coa-server-manager:20261002-the-update-check-says-you-are-up-to-date-instead.md",
"Corfirean/coa-server-manager:20261003-client-realm-sync.md",
"Corfirean/coa-server-manager:20261003-config-snapshot-restore.md",
"Corfirean/coa-server-manager:20261003-imported-servers-get-the-module-config-files-the.md",
"Corfirean/coa-server-manager:20261003-linux-preview.md",
"Corfirean/coa-server-manager:20261003-modules-marked-soon-stay-greyed-out.md",
"Corfirean/coa-server-manager:20261003-report-browser.md",
"Corfirean/coa-server-manager:20261003-simplified-chinese.md",
"Corfirean/coa-server-manager:20261003-the-bots-page-is-hidden-when-the-module-is-not-o.md",
"Corfirean/coa-server-manager:20261003-updating-the-game-client-shows-a-progress-bar-on.md",
"Corfirean/coa-server-manager:20261003-wildcard-realm-profiles.md",
"Corfirean/coa-server-manager:20261004-auction-item-types.md",
"Corfirean/coa-server-manager:20261004-fractional-settings.md",
"Corfirean/coa-server-manager:20261004-independent-client-launch.md",
"Corfirean/coa-server-manager:20261004-module-settings.md",
"Corfirean/coa-server-manager:20261004-recover-server-updates.md",
"Corfirean/coa-server-manager:20261004-repair-and-database-validation.md",
"Corfirean/coa-server-manager:20261004-scaling-lfg-leech-settings.md",
"Corfirean/coa-server-manager:20261004-simultaneous-realms.md",
"Corfirean/coa-server-manager:20261004-squid-playerbots.md",
"Corfirean/coa-server-manager:20261005-connect-without-server.md",
"Corfirean/coa-server-manager:20261005-imported-squid-warning.md",
"Corfirean/coa-server-manager:20261005-launch-without-updating.md",
"Corfirean/coa-server-manager:20261005-linux-docker-server-installer.md",
"Corfirean/coa-server-manager:20261005-linux-docker-server-settings.md",
"Corfirean/coa-server-manager:20261005-linux-install-screen-and-client.md",
"Corfirean/coa-server-manager:20261005-retry-update-startup.md",
"Corfirean/coa-server-manager:20261005-squid-release-metadata.md",
"Corfirean/coa-server-manager:20261005-squid-version-reports.md",
"Corfirean/coa-server-manager:20261005-update-history-hotfix.md",
"Corfirean/coa-server-manager:20261005-update-legacy-realm-launcher.md",
"Corfirean/coa-server-manager:20261005-validate-release-database.md",
"Corfirean/coa-server-manager:20261006-ah-bot-needs-no-character-guid.md",
"Corfirean/coa-server-manager:20261006-lan-address-selector.md",
"Corfirean/coa-server-manager:20261006-npc-enchanter-placement-hint.md",
"Corfirean/coa-server-manager:20261006-prevent-server-downgrades.md",
"Corfirean/coa-server-manager:20261006-recognize-managed-launcher.md",
"Corfirean/coa-server-manager:20261006-squid-first-start-timeout.md",
"Corfirean/coa-server-manager:20261006-update-preflight-and-recovery-guards.md",
"Corfirean/coa-server-manager:20261006-update-sql-and-status-guards.md",
"Corfirean/coa-server-manager:20261007-diagnostics-valid-json.md",
"Corfirean/coa-server-manager:20261007-one-click-diagnostics.md",
"Corfirean/coa-server-manager:20261007-report-routing.md",
"Corfirean/coa-server-manager:20261008-backup-folder-and-bot-choices.md",
"Corfirean/coa-server-manager:20261008-bot-settings-drop-down.md",
"Corfirean/coa-server-manager:20261008-dashboard-delivery.md",
"Corfirean/coa-server-manager:20261008-database-error-not-misread.md",
"Corfirean/coa-server-manager:20261008-hide-squid-bot-accounts.md",
"Corfirean/coa-server-manager:20261008-squid-dashboard-tab.md",
"Corfirean/coa-server-manager:20261008-start-after-update-options.md",
"Corfirean/coa-server-manager:20261008-update-check-survives-damaged-state.md",
"Corfirean/coa-server-manager:20261008-wildcard-repair-checksum.md",
"Corfirean/coa-server-manager:20261008-world-server-from-coa-bots-folder.md",
"Corfirean/coa-server-manager:20261010-automatic-update-recovery.md",
"Corfirean/coa-server-manager:20261010-complete-mysql-update-recovery.md",
"Corfirean/coa-server-manager:20261010-custom-races-bot-exclusions.md",
"Corfirean/coa-server-manager:20261010-custom-races-update.md",
"Corfirean/coa-server-manager:20261010-custom-races.md",
"Corfirean/coa-server-manager:20261010-database-recovery-diagnostics.md",
"Corfirean/coa-server-manager:20261010-headless-world-startup.md",
"Corfirean/coa-server-manager:20261010-immutable-update-channels.md",
"Corfirean/coa-server-manager:20261010-isolated-update-validation.md",
"Corfirean/coa-server-manager:20261010-local-host-while-sharing.md",
"Corfirean/coa-server-manager:20261010-missing-database-defaults.md",
"Corfirean/coa-server-manager:20261010-module-base-update-replay.md",
"Corfirean/coa-server-manager:20261010-private-database-update-rehearsal.md",
"Corfirean/coa-server-manager:20261010-release-compatibility.md",
"Corfirean/coa-server-manager:20261010-schema-validation-report.md",
"Corfirean/coa-server-manager:20261010-settings-blank-window.md",
"Corfirean/coa-server-manager:20261010-unsaved-changes-and-crash-recovery.md",
"Corfirean/coa-server-manager:20261011-player-race-patches.md",
"Corfirean/coa-server-manager:20261012-bulk-navigation-update.md",
"Corfirean/coa-server-manager:20261012-rehearsal-path-normalization.md",
"Corfirean/coa-server-manager:20261013-custom-races-client-update.md",
"Corfirean/coa-server-manager:20261013-docker-remote-client-restart.md",
"Corfirean/coa-server-manager:20261013-installed-module-versions.md",
"Corfirean/coa-server-manager:20261013-long-rehearsal-paths.md",
"Corfirean/coa-server-manager:20261013-maintenance-diagnostic-export.md",
"Corfirean/coa-server-manager:20261013-preserve-client-patches.md",
"Corfirean/coa-server-manager:20261013-recheck-installed-release.md",
"Corfirean/coa-server-manager:20261013-startup-error-details.md",
"Corfirean/coa-server-manager:20261013-stock-bot-races.md",
"Corfirean/coa-server-manager:20261013-update-check-start-contention.md",
"Corfirean/coa-server-manager:20261013-upstream-bot-race-preset.md",
"Corfirean/coa-server-manager:20261014-already-running-mysql-is-recognized-before-start.md",
"Corfirean/coa-server-manager:20261014-current-clean-install.md",
"Corfirean/coa-server-manager:20261014-custom-races-grummle-client.md",
"Corfirean/coa-server-manager:20261014-failed-repairs-restore-the-previous-server-after.md",
"Corfirean/coa-server-manager:20261014-overview-update-errors.md",
"Corfirean/coa-server-manager:20261014-private-update-checks-show-preparation-stages-an.md",
"Corfirean/coa-server-manager:20261014-repair-recovery-copies-preserve-all-bundled-data.md",
"Corfirean/coa-server-manager:20261014-server-checks-report-interrupted-squid-database.md",
"Corfirean/coa-server-manager:20261014-shutdown-remains-available-when-startup-template.md",
"Corfirean/coa-server-manager:20261014-successful-server-repairs-no-longer-block-later.md",
"Corfirean/coa-server-manager:20261016-consistent-update-migrations.md",
"Corfirean/coa-server-manager:20261016-direct-database-upgrades.md",
"Corfirean/coa-server-manager:20261016-idempotent-validation-stop.md",
"Corfirean/coa-server-manager:20261016-intermediate-updates.md",
"Corfirean/coa-server-manager:20261016-lightweight-update-checks.md",
"Corfirean/coa-server-manager:20261016-preserve-core-migration-history.md",
"Corfirean/coa-server-manager:20261016-shared-auth-migration-history.md",
"Corfirean/coa-server-manager:20261016-update-compatibility-wording.md",
"Corfirean/coa-server-manager:20261018-custom-races-client.md"
],
"releases": [
{
"tag": "v0.1.0",
"version": "0.1.0",
"date": "2026-09-30",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.1.0",
"commit": "0a9be3d80030f8549a2925e176ab0ee829603c44",
"notes": [
"Initial Windows release: install or import a server and manage startup from one app",
"Configure server and bot settings, manage accounts, create backups and restore saved data",
"Launch the game client, set up sharing with friends and collect diagnostics"
]
},
{
"tag": "v0.1.1",
"version": "0.1.1",
"date": "2026-09-30",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.1.1",
"commit": "f620f87432e5affb84bdc14ca0bb0f5a8bb5c534",
"notes": [
"Added translations throughout setup, server updates, backups, diagnostics and settings",
"Added clearer errors when server packages are unavailable or a server cannot be reached"
],
"compare": "https://github.com/Corfirean/coa-server-manager/compare/v0.1.0...v0.1.1"
},
{
"tag": "v0.1.2",
"version": "0.1.2",
"date": "2026-09-30",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.1.2",
"commit": "0e1016e93c457c8aeea3ba31416be66a201a19ef",
"notes": [
"Manager updates download in the background and install when the app closes",
"Missing module configuration files are created from the supplied defaults"
],
"compare": "https://github.com/Corfirean/coa-server-manager/compare/v0.1.1...v0.1.2"
},
{
"tag": "v0.1.3",
"version": "0.1.3",
"date": "2026-09-30",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.1.3",
"commit": "4eda03ab6355a6cf280865bca91ce8d2fc6167e7",
"notes": [
"The interface scales with the window",
"Each friend connection mode shows the realmlist line to use"
],
"compare": "https://github.com/Corfirean/coa-server-manager/compare/v0.1.2...v0.1.3"
},
{
"tag": "v0.1.4",
"version": "0.1.4",
"date": "2026-09-30",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.1.4",
"commit": "db16d95558910d4cdc97edbce97ec78aaf535a83",
"notes": [
"Sharing settings are reapplied before server startup",
"Added a restart shortcut after enabling play with friends"
],
"compare": "https://github.com/Corfirean/coa-server-manager/compare/v0.1.3...v0.1.4"
},
{
"tag": "v0.1.6",
"version": "0.1.6",
"date": "2026-09-30",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.1.6",
"commit": "f7d29b09efd54ab3a0f830d4d6891013038398e4",
"notes": [
"Overview shows world speed",
"Improved companion setup, including requests made while the server is stopped",
"Expanded translated settings and connection guides"
],
"compare": "https://github.com/Corfirean/coa-server-manager/compare/v0.1.4...v0.1.6"
},
{
"tag": "v0.2.0",
"version": "0.2.0",
"date": "2026-10-01",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.2.0",
"commit": "0940e9cf28759a9489d53dbd28882d6b46cb0076",
"notes": [
"Added companion creation progress and controls to stop creation, take bots offline or remove them",
"Choose how many bots log in when the server starts",
"Added a control to log out a chosen number of bots and reduce server load"
],
"compare": "https://github.com/Corfirean/coa-server-manager/compare/v0.1.6...v0.2.0"
},
{
"tag": "v0.3.0",
"version": "0.3.0",
"date": "2026-10-01",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.3.0",
"commit": "c8f6d61b98ceb0920ba605467eb73b1364d24404",
"notes": [
"Download and update the game client through the Manager while preserving custom files",
"Server updates are checked automatically and offered on Overview"
],
"compare": "https://github.com/Corfirean/coa-server-manager/compare/v0.2.0...v0.3.0"
},
{
"tag": "v0.3.1",
"version": "0.3.1",
"date": "2026-10-01",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.3.1",
"commit": "d01e401f3ce5c5f9a7daeb721815e2cf5fe1d694",
"notes": [
"Added named realmlists and a switcher beside Play",
"Added account management and a prefilled GitHub problem-report form",
"Server updates continue when leaving the settings page"
],
"compare": "https://github.com/Corfirean/coa-server-manager/compare/v0.3.0...v0.3.1"
},
{
"tag": "v0.4.0",
"version": "0.4.0",
"date": "2026-10-02",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.4.0",
"commit": "53aa117ec2e2f4c0572a74829c41e99d5a4eedb6",
"notes": [
"Added module cards with switches and settings",
"Added searchable server settings and appearance and collection controls",
"Added account deletion with confirmation",
"Fixed update checks offering an already installed version"
],
"compare": "https://github.com/Corfirean/coa-server-manager/compare/v0.3.1...v0.4.0"
},
{
"tag": "v0.5.0",
"version": "0.5.0",
"date": "2026-10-03",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.5.0",
"commit": "1bcef5f8c2e85b28eb466e720002d2fbf2b67161",
"notes": [
"Imported servers get the module config files they lack",
"Modules marked Soon stay greyed out",
"The Bots page is hidden when the module is not on the server",
"Updating the game client shows a progress bar on its button",
"Switch between CoA and Wildcard while keeping separate characters and module settings"
],
"compare": "https://github.com/Corfirean/coa-server-manager/compare/v0.4.0...v0.5.0"
},
{
"tag": "v0.6.0",
"version": "0.6.0",
"date": "2026-10-03",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.0",
"commit": "162bfd1e04ca4faa205b5c38432f56b07066c6be",
"notes": [
"The game client follows the realm selected in the Manager",
"Configuration snapshots no longer overwrite each other",
"Experimental Linux startup and Docker server controls",
"Problem reports open in the default browser",
"Simplified Chinese is available in the Manager"
],
"compare": "https://github.com/Corfirean/coa-server-manager/compare/v0.5.0...v0.6.0"
},
{
"tag": "v0.6.1",
"version": "0.6.1",
"date": "2026-10-04",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.1",
"commit": "2e3fb24e1af5c3ee9a787c345cbcce973739fe69",
"notes": [
"Server multipliers now accept decimals typed with a dot or comma",
"Play launches only the game client without starting your local server",
"Check database structure and repair server files with a safety backup",
"Start CoA and Wildcard together from Settings"
],
"compare": "https://github.com/Corfirean/coa-server-manager/compare/v0.6.0...v0.6.1"
},
{
"tag": "v0.6.2",
"version": "0.6.2",
"date": "2026-10-04",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.2",
"commit": "b90b377fc308210abdf7fc63ea2f2ac1eac29f4a",
"notes": [
"Choose which item types the auction bot sells",
"Module settings now offer translated controls and an enemy damage slider",
"Failed server updates restore databases and files together",
"Configure SQUID Playerbots and prevent conflicting bot systems",
"Server packages must include a complete database schema check"
],
"compare": "https://github.com/Corfirean/coa-server-manager/compare/v0.6.1...v0.6.2"
},
{
"tag": "v0.6.3",
"version": "0.6.3",
"date": "2026-10-04",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.3",
"commit": "07ec22798f2b81f33e470837ece7fec693ac24bb",
"notes": [
"Configure partial dungeon parties and open-world life steal in module settings",
"Download and update the game client without installing a server"
],
"compare": "https://github.com/Corfirean/coa-server-manager/compare/v0.6.2...v0.6.3"
},
{
"tag": "v0.6.4",
"version": "0.6.4",
"date": "2026-10-05",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.4",
"commit": "6c771fae20ac59870f5990a6495f8cd035caab65",
"notes": [
"Start your installed server or client without downloading an available update",
"Finish a server update that was blocked by a startup failure"
],
"compare": "https://github.com/Corfirean/coa-server-manager/compare/v0.6.3...v0.6.4"
},
{
"tag": "v0.6.5",
"version": "0.6.5",
"date": "2026-10-06",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.5",
"commit": "277ebba847912e113657bcef4ed53e4e4e708161",
"notes": [
"Imported SquidBots servers warn before replacing their original binary",
"SquidBots settings follow the options shipped by the module",
"SquidBots shows its bundled release and includes it in problem reports",
"Server updates accept verified published migration variants without rerunning them",
"Server updates replace older launchers adapted by the Manager for Wildcard",
"Older server packages cannot replace a newer installation",
"Checking again no longer offers an already installed launcher update",
"Large SQUID database imports have more time to finish on first startup",
"Update history conflicts are detected before server files change",
"Pending database updates remain visible when the server version matches"
],
"compare": "https://github.com/Corfirean/coa-server-manager/compare/v0.6.4...v0.6.5"
},
{
"tag": "v0.6.6",
"version": "0.6.6",
"date": "2026-10-07",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.6",
"commit": "fac6ce469a77c134437484a78e91e7811df8a389",
"notes": [
"Install a server from a package on Linux, running in Docker (experimental)",
"The Auction House Bot card no longer asks for a character GUID",
"Choose and remember the local network address friends use to connect",
"The NPC Enchanter card explains how to place and remove the NPC",
"Diagnostic files with database checks stay readable after secrets are removed",
"One button collects all diagnostics, including crashes and Windows crash records",
"Problem reports go to the right project"
],
"compare": "https://github.com/Corfirean/coa-server-manager/compare/v0.6.5...v0.6.6"
},
{
"tag": "v0.6.7",
"version": "0.6.7",
"date": "2026-10-08",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.7",
"commit": "7540527d3035660f1c45ea66497e0412cc65249c",
"notes": [
"Choose where backups are stored, for example on another drive",
"Bot settings with a fixed list of values show a drop-down",
"The bot dashboard loads completely and can be opened in the browser",
"Accounts of the SQUID bots are hidden from the Accounts list",
"A Dashboard tab shows what the SQUID bots are doing",
"A stopped server stays stopped after an update, unless you ask it to start",
"Checking for updates no longer fails with \"Something went wrong\" after a crash",
"Server updates no longer stop with \"has a different checksum\" on the Wildcard repair",
"A world server started from the coa-bots folder is recognised"
],
"compare": "https://github.com/Corfirean/coa-server-manager/compare/v0.6.6...v0.6.7"
},
{
"tag": "v0.6.8",
"version": "0.6.8",
"date": "2026-10-10",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.8",
"commit": "ee59708fbfcdb5f4e30c62f2e4aa952f82604cac",
"notes": [
"Linux: install from the install screen, play with Wine or Proton (experimental)",
"A failing database update is no longer reported as \"database not running",
"Unsaved settings are protected and crashed servers can restart automatically"
],
"compare": "https://github.com/Corfirean/coa-server-manager/compare/v0.6.7...v0.6.8"
},
{
"tag": "v0.6.9",
"version": "0.6.9",
"date": "2026-10-10",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.9",
"commit": "374a3f9c2322f30900f7f8a0549a643c8a511567",
"notes": [
"Custom races can be enabled and their client patches installed from Modules"
],
"compare": "https://github.com/Corfirean/coa-server-manager/compare/v0.6.8...v0.6.9"
},
{
"tag": "v0.6.10",
"version": "0.6.10",
"date": "2026-10-10",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.10",
"commit": "b0951dbee7516334d8ae3baa1c7bf7635f6cb202",
"notes": [
"Custom race client patches update to the latest races and appearances"
],
"compare": "https://github.com/Corfirean/coa-server-manager/compare/v0.6.9...v0.6.10"
},
{
"tag": "v0.6.11",
"version": "0.6.11",
"date": "2026-10-10",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.11",
"commit": "376f1dbb469ece197aa1caf68b3e5fdd73e3b277",
"notes": [
"Server and Bots settings open without a blank window"
],
"compare": "https://github.com/Corfirean/coa-server-manager/compare/v0.6.10...v0.6.11"
},
{
"tag": "v0.6.12",
"version": "0.6.12",
"date": "2026-10-10",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.12",
"commit": "94d4ade1c73c6a64018dc182fe3a3ba87607d7a2",
"notes": [
"Background world servers no longer stop because the local console is closed"
],
"compare": "https://github.com/Corfirean/coa-server-manager/compare/v0.6.11...v0.6.12"
},
{
"tag": "v0.6.13",
"version": "0.6.13",
"date": "2026-10-11",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.13",
"commit": "ed7bf7262bc43de109f17a2812bc41c34d99c51d",
"notes": [
"Failed server startup after an update automatically restores the previous version",
"Windows update recovery preserves database procedures triggers and views",
"Custom races bot setting synchronizes Playerbots excluded race lists",
"Blocked updates identify database objects that prevent automatic recovery",
"Updates can follow signed channels that select a complete server release",
"Server updates check startup privately before allowing players to connect",
"Updates repair missing database defaults from the verified release schema",
"Server updates no longer replay module installation scripts on existing databases",
"Windows server updates are tested on a private copy before changing your installation",
"Server updates can require a tested combination of platform and installed version",
"Failed database checks keep a complete report after rollback",
"Players can install custom race patches when connecting to a friend"
],
"compare": "https://github.com/Corfirean/coa-server-manager/compare/v0.6.12...v0.6.13"
},
{
"tag": "v0.6.14",
"version": "0.6.14",
"date": "2026-10-11",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.14",
"commit": "58c976a388215bea8bbf232503810c6519a33562",
"notes": [
"Fixed server update checks failing with long Windows paths"
],
"compare": "https://github.com/Corfirean/coa-server-manager/compare/v0.6.13...v0.6.14"
},
{
"tag": "v0.6.15",
"version": "0.6.15",
"date": "2026-10-11",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.15",
"commit": "d86a1676fed98f9e4556617a603959e42bc401c8",
"notes": [
"Large server updates no longer repeatedly rewrite the recovery journal"
],
"compare": "https://github.com/Corfirean/coa-server-manager/compare/v0.6.14...v0.6.15"
},
{
"tag": "v0.6.16",
"version": "0.6.16",
"date": "2026-10-13",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.16",
"commit": "b45e2502ece1a5578555d7d5dfe36a95b374a58e",
"notes": [
"Linux Docker servers follow Settings, sharing and backups (experimental)",
"Local hosts can connect while sharing a server online",
"Custom race client installation follows the current upstream release",
"Docker friend mode requests a restart when remote client support changes",
"Module cards show installed server revisions and the client race patch version",
"Server updates accept long Windows paths inside the private test server",
"Diagnostics record blocked startup requests and maintenance owner information",
"Client race patches can be repaired and removed while preserving original files",
"Checking an already installed server update no longer reports incompatibility",
"Failed server startup shows service errors even when the launcher reported ready",
"Starting the server waits for update checks and identifies ongoing maintenance"
],
"compare": "https://github.com/Corfirean/coa-server-manager/compare/v0.6.15...v0.6.16"
},
{
"tag": "v0.6.17",
"version": "0.6.17",
"date": "2026-10-15",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.17",
"commit": "dc323df681ca77fb15ce4284da0feadfe83e0c7e",
"notes": [
"Already running MySQL is recognized before startup readiness checks",
"New servers install the current stable build directly",
"Install the matching client patches for Grummle",
"Failed repairs restore the previous server after final verification errors",
"Failed server updates show an error on the Overview screen",
"Private update checks show preparation stages and stop failure details",
"Repair recovery copies preserve all bundled database objects and accounts",
"Server checks report interrupted SQUID database imports",
"Shutdown remains available when startup templates or database records are damaged",
"Successful server repairs no longer block later server actions"
],
"compare": "https://github.com/Corfirean/coa-server-manager/compare/v0.6.16...v0.6.17"
},
{
"tag": "v0.6.18",
"version": "0.6.18",
"date": "2026-10-16",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.18",
"commit": "16396407ad63c1b596dc4fd7e2672ef87cf23f56",
"notes": [
"Older servers find a tested intermediate update instead of being blocked"
],
"compare": "https://github.com/Corfirean/coa-server-manager/compare/v0.6.17...v0.6.18"
},
{
"tag": "v0.6.19",
"version": "0.6.19",
"date": "2026-10-16",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.19",
"commit": "cda7875a9a2061d4b576912cc6943220ff6fddba",
"notes": [
"Update checks no longer download a server archive to compare its launcher"
],
"compare": "https://github.com/Corfirean/coa-server-manager/compare/v0.6.18...v0.6.19"
},
{
"tag": "v0.6.21",
"version": "0.6.21",
"date": "2026-10-16",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.21",
"commit": "e3fbb2e4b6dbe40fa00264abcd12b4cfd9702305",
"notes": [
"Server updates apply migrations once after saving a recovery point",
"Older server versions update directly without installing intermediate packages",
"Update validation recognizes an already stopped server",
"Recorded core SQL stays applied after old history tables are cleaned up",
"Switching realms no longer repeats shared account database updates",
"Update offers distinguish version support from database validation"
],
"compare": "https://github.com/Corfirean/coa-server-manager/compare/v0.6.19...v0.6.21"
},
{
"tag": "v0.6.22",
"version": "0.6.22",
"date": "2026-10-19",
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.6.22",
"commit": "65df6604846d5492e40a6b08a797199478666e24",
"notes": [
"Updated Custom Races client patches to 1.8",
"Included the updated race appearance and cursor addons",
"Existing client files are preserved when installing or removing race patches"
],
"compare": "https://github.com/Corfirean/coa-server-manager/compare/v0.6.21...v0.6.22"
}
]
}
@@ -0,0 +1,57 @@
//! Read-only audit, or explicit SQL checks on a disposable database fixture.
use coa_core::{db::{Account, Db}, migrations::{self, Store}, manifest::Manifest, realms::Mode};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let args: Vec<_> = std::env::args().collect();
if args.len() < 3 { return Err("usage: migration_plan <root> <signed-manifest> [--apply|--sql-only <migration-directory>]".into()); }
let root = std::path::Path::new(&args[1]);
let bytes = std::fs::read(&args[2])?;
let signature = std::fs::read_to_string(format!("{}.sig",args[2]))?;
coa_core::signing::verify(&bytes, &signature, coa_core::signing::EMBEDDED_PUBLIC_KEY)?;
let manifest = Manifest::parse(&bytes)?;
for (index,mode) in [Mode::Coa, Mode::Wildcard].into_iter().enumerate() {
let db = Db::from_repack(root, Account::Admin)?.for_realm(mode);
let rows = db.load_readonly()?;
let relevant: Vec<_> = rows.iter().filter(|r| r.id == "rev_20260903_01_live_class_baseline").map(|r| format!("{} {:?} {}",r.db,r.status,r.baseline)).collect();
println!("{} baseline history: {:?}",mode.name(),relevant);
let list: Vec<_> = manifest.migrations.iter().filter(|m|index==0 || m.db!="auth").cloned().collect();
let plan = migrations::status(&db,&list)?;
println!("{} pending: {:?}",mode.name(),plan.iter().filter(|m|m.status!=migrations::Status::Applied).map(|m|(&m.db,&m.id,m.status)).collect::<Vec<_>>());
}
if args.get(3).is_some_and(|s| s == "--apply" || s == "--sql-only") {
assert!(root.file_name().unwrap().to_string_lossy().starts_with("update-database-diagnosis-") && root.join(".coa-update-fixture").is_file(), "Only disposable fixture roots may be changed");
if args[3] == "--sql-only" {
let db = Db::from_repack(root, Account::Admin)?.for_realm(Mode::Coa);
let identity = || -> coa_core::Result<String> {
let mut rows = String::new();
for (schema,table,columns) in [("acore_auth","account","id,HEX(username)"),("acore_characters","characters","guid,account,HEX(name)"),("acore_characters_wildcard","characters","guid,account,HEX(name)")] {
rows.push_str(schema);
rows.push_str(&db.query(&format!("SELECT {columns} FROM {schema}.{table} ORDER BY 1;"))?);
}
Ok(coa_core::fsx::sha256_bytes(rows.as_bytes()))
};
let before = identity()?;
migrations::verify_files(&manifest.migrations,std::path::Path::new(&args[4]))?;
for (index,mode) in [Mode::Coa,Mode::Wildcard].into_iter().enumerate() {
let realm_db = db.clone().for_realm(mode);
let list: Vec<_> = manifest.migrations.iter().filter(|m|index==0 || m.db!="auth").cloned().collect();
let result = migrations::apply_pending(&realm_db,&list,std::path::Path::new(&args[4]),&||Ok("disposable fixture".into()))?;
println!("{} SQL result: {}",mode.name(),serde_json::to_string(&result)?);
if result.failed.is_some() {return Err("SQL failed; fixture preserved".into());}
}
assert_eq!(before,identity()?,"Account or character identity changed");
println!("Account and character identities preserved: {}",before);
let capture = root.join("captured-schema");
coa_core::schema_check::capture(&db,&capture)?;
println!("Captured schema SHA256: {}",coa_core::fsx::sha256_file(&capture.join(coa_core::schema_check::CONTRACT))?);
return Ok(());
}
if args.len() != 5 { return Err("Migration directory required".into()); }
use coa_core::update::{Env, RepackEnv};
let meta = coa_core::registry::metadata_dir_for(root)?;
let env = RepackEnv { root, meta_dir: &meta };
let result = env.migrate(&manifest, std::path::Path::new(&args[4]));
let _ = coa_core::driver::run(root, coa_core::driver::Verb::StopAll);
println!("Application result: {}",serde_json::to_string(&result?)?);
}
Ok(())
}
@@ -0,0 +1,28 @@
//! Exercise the production updater only on a disposable copy of an installed server.
use coa_core::{registry::MetaDir, update::{self, Env, RepackEnv}};
fn main() -> Result<(),Box<dyn std::error::Error>> {
let args:Vec<_>=std::env::args().collect();
if args.len()!=3 && args.len()!=4 {return Err("usage: upgrade_fixture <disposable-root> <signed-package-directory>".into());}
let root=std::path::Path::new(&args[1]);
assert!(root.file_name().unwrap().to_string_lossy().starts_with("coa-schema-fixture-real") && root.join(".coa-update-fixture").is_file(),"Disposable fixture required");
let meta=coa_core::registry::metadata_dir_for(root)?;
let (_,installed)=MetaDir::open(&meta)?;
assert_eq!(coa_core::fsx::canonicalize_lenient(std::path::Path::new(&installed.server_path))?,coa_core::fsx::canonicalize_lenient(root)?,"Fixture metadata must point to the copy");
assert!(installed.client_path.is_none(),"Detach the real client from fixture metadata");
let env=RepackEnv{root,meta_dir:&meta};
if args.get(3).is_some_and(|flag|flag=="--validate-only") {
let result=env.validate();
let _=coa_core::driver::run(root,coa_core::driver::Verb::StopAll);
result?;
println!("Startup and identity validation passed");
return Ok(());
}
let outcome=update::apply(&update::Params{root,meta_dir:&meta,source:coa_core::pkgsource::Source::Dir(args[2].clone().into()),trusted_key:coa_core::signing::EMBEDDED_PUBLIC_KEY,cancel:Default::default(),resolutions:Default::default(),env:&env,fail_after_ops:None},&|phase,percent|println!("{percent}% {phase}"));
let stopped=coa_core::driver::run(root,coa_core::driver::Verb::StopAll);
println!("Shutdown after test: {:?}",stopped.map(|r|r.ok));
let outcome=outcome?;
println!("Final transaction: {:?}",outcome.txn.state);
env.ensure_stopped()?;
assert_eq!(outcome.txn.state,update::State::Committed);
Ok(())
}
+1
View File
@@ -93,6 +93,7 @@ pub struct Compatibility {
pub core_commit: String,
pub module_commits: std::collections::BTreeMap<String, String>,
pub client_patch_version: String,
/// Sources exercised during release qualification, not an exclusive updater allowlist.
pub source_versions: Vec<String>,
#[serde(default, skip_serializing_if = "std::collections::BTreeMap::is_empty")]
pub source_databases: std::collections::BTreeMap<String, SourceDatabase>,
+148 -52
View File
@@ -11,6 +11,7 @@ use crate::fsx;
use crate::manifest::Migration;
const LEDGER_SCHEMA: &str = "acore_world";
const AUTH_LEDGER_SCHEMA: &str = "acore_auth";
const LEDGER_TABLE: &str = "coa_manager_migrations";
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize)]
@@ -37,6 +38,10 @@ pub trait Store {
fn load(&self) -> Result<Vec<LedgerRow>>;
fn load_readonly(&self) -> Result<Vec<LedgerRow>> { self.load() }
fn put(&self, row: &LedgerRow) -> Result<()>;
fn put_batch(&self, rows: &[LedgerRow]) -> Result<()> {
for row in rows { self.put(row)?; }
Ok(())
}
fn run_file(&self, schema: &str, file: &Path) -> Result<()>;
}
@@ -48,59 +53,101 @@ fn ident_ok(s: &str) -> bool {
!s.is_empty() && s.len() <= 150 && s.chars().all(|c| c.is_ascii_alphanumeric() || matches!(c, '_' | '.' | '-'))
}
pub(crate) fn shared_auth(kind: &str) -> bool {
matches!(db::schema_of(kind), Ok("acore_auth"))
}
fn create_ledger(db: &Db, schema: &str) -> Result<()> {
db.query(&format!("CREATE TABLE IF NOT EXISTS `{schema}`.`{LEDGER_TABLE}` (`db` VARCHAR(32) NOT NULL, `id` VARCHAR(190) NOT NULL, `sha256` CHAR(64) NOT NULL, `status` VARCHAR(16) NOT NULL, `applied_at` DATETIME NOT NULL, `error` TEXT NULL, `baseline` TINYINT NOT NULL DEFAULT 0, PRIMARY KEY (`db`,`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;"))?;
Ok(())
}
impl Store for Db {
fn load(&self) -> Result<Vec<LedgerRow>> {
self.query(&format!(
"CREATE TABLE IF NOT EXISTS `{LEDGER_SCHEMA}`.`{LEDGER_TABLE}` (`db` VARCHAR(32) NOT NULL, `id` VARCHAR(190) NOT NULL, `sha256` CHAR(64) NOT NULL, `status` VARCHAR(16) NOT NULL, `applied_at` DATETIME NOT NULL, `error` TEXT NULL, `baseline` TINYINT NOT NULL DEFAULT 0, PRIMARY KEY (`db`,`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;"
))?;
self.load_readonly()
create_ledger(self, LEDGER_SCHEMA)?;
create_ledger(self, AUTH_LEDGER_SCHEMA)?;
let rows = self.load_readonly()?;
// Preserve already-recorded core history even if a module later replaces its updates table.
// A zero checksum remains unknown; importing it does not invent a checksum for old SQL.
let selected: std::collections::BTreeMap<_, _> = rows.iter().map(|row| ((row.db.clone(), row.id.to_ascii_lowercase()), row)).collect();
let core: Vec<_> = selected.values().filter(|r| r.status == Status::Applied && r.baseline && r.sha256 == "0".repeat(64)
&& matches!(r.db.as_str(), "world" | "characters") && ident_ok(&r.id)).map(|r| (*r).clone()).collect();
self.put_batch(&core)?;
Ok(rows)
}
fn load_readonly(&self) -> Result<Vec<LedgerRow>> {
let out = if self.tables(LEDGER_SCHEMA)?.iter().any(|name| name == LEDGER_TABLE) {
self.query(&format!("SELECT `db`,`id`,`sha256`,`status`,`baseline`,COALESCE(HEX(`error`),'') FROM `{LEDGER_SCHEMA}`.`{LEDGER_TABLE}` ORDER BY `db`,`id`;"))?
} else { String::new() };
let mut rows = Vec::new();
// Files the core's own updater (or whoever prepared this database) already recorded count as applied.
for (kind, schema) in db::SCHEMAS {
if self.tables(schema)?.iter().any(|name| name == "updates") {
let names = self.query(&format!("SELECT name FROM `{schema}`.`updates`;"))?;
for name in names.lines().filter(|n| n.ends_with(".sql")) {
rows.push(LedgerRow { db: kind.into(), id: name.trim_end_matches(".sql").into(), sha256: "0".repeat(64), status: Status::Applied, error: None, baseline: true });
}
// Resolve physical schemas once, then read all history in two client calls.
// Using a neutral connection prevents a Wildcard query from rerouting the other realm.
let connection = self.clone().for_realm(crate::realms::Mode::Coa);
let world = self.realm_schema("acore_world");
let characters = self.realm_schema("acore_characters");
let other = if self.realm() == crate::realms::Mode::Coa { "acore_world_wildcard" } else { "acore_world" };
let schemas: std::collections::BTreeSet<_> = [world, characters, other, AUTH_LEDGER_SCHEMA].into_iter().collect();
let catalog = connection.query(&format!("SELECT table_schema,table_name FROM information_schema.tables WHERE table_schema IN ('{}') AND table_name IN ('updates','{LEDGER_TABLE}') AND table_type='BASE TABLE';", schemas.into_iter().collect::<Vec<_>>().join("','")))?;
let available: std::collections::BTreeSet<_> = catalog.lines().filter_map(|line| line.split_once('\t')).collect();
let text = |expression: &str| format!("CONVERT({expression} USING utf8mb4) COLLATE utf8mb4_bin");
let mut queries = Vec::new();
for (kind, schema) in [("characters", characters), ("auth", AUTH_LEDGER_SCHEMA), ("world", world)] {
if available.contains(&(schema, "updates")) {
queries.push(format!("SELECT 'core','{kind}',{},REPEAT('0',64),'applied',1,'' FROM `{schema}`.`updates` WHERE BINARY RIGHT(name,4)='.sql'",text("LEFT(name,CHAR_LENGTH(name)-4)")));
}
}
for line in out.lines().filter(|l| !l.is_empty()) {
let f: Vec<&str> = line.split('\t').collect();
if f.len() < 5 {
return Err(Error::Invalid("The database migration history is malformed; no SQL was replayed.".into()));
for (origin, schema, filter) in [("local",world,""), ("other",other," WHERE `db` IN ('auth','coa-auth','wildcard-auth')"), ("shared",AUTH_LEDGER_SCHEMA,"")] {
if available.contains(&(schema, LEDGER_TABLE)) {
queries.push(format!("SELECT '{origin}',{},{},{},{},`baseline`,{} FROM `{schema}`.`{LEDGER_TABLE}`{filter}",text("`db`"),text("`id`"),text("`sha256`"),text("`status`"),text("COALESCE(HEX(`error`),'')")));
}
if !matches!(f[3], "applied" | "failed" | "running") || !ident_ok(f[1]) || f[2].len() != 64 || !f[2].chars().all(|c| c.is_ascii_hexdigit()) {
}
if queries.is_empty() { return Ok(vec![]); }
let out = connection.query(&queries.join(" UNION ALL "))?;
let (mut rows, mut local, mut auth, mut shared) = (Vec::new(), Vec::new(), Vec::new(), Vec::new());
for line in out.lines().filter(|l| !l.is_empty()) {
let f: Vec<_> = line.split('\t').collect();
if f.len() < 6 { return Err(Error::Invalid("The database migration history is malformed; no SQL was replayed.".into())); }
// Unrelated legacy filenames cannot match a valid manifest migration ID.
if f[0] == "core" && !ident_ok(f[2]) { continue; }
if !matches!(f[4], "applied" | "failed" | "running") || !ident_ok(f[2]) || f[3].len() != 64 || !f[3].chars().all(|c| c.is_ascii_hexdigit()) {
return Err(Error::Invalid("The database migration history is invalid; no SQL was replayed.".into()));
}
let err = f.get(5).filter(|h| !h.is_empty()).and_then(|h| hex::decode(h).ok()).map(|b| String::from_utf8_lossy(&b).into_owned());
rows.push(LedgerRow {
db: f[0].into(),
id: f[1].into(),
sha256: f[2].into(),
status: match f[3] { "applied" => Status::Applied, "running" => Status::Running, _ => Status::Failed },
baseline: f[4] == "1",
error: err,
});
let error = f.get(6).filter(|h| !h.is_empty()).and_then(|h| hex::decode(h).ok()).map(|b| String::from_utf8_lossy(&b).into_owned());
let row = LedgerRow { db:f[1].into(), id:f[2].into(), sha256:f[3].into(), status:match f[4] { "applied"=>Status::Applied,"running"=>Status::Running,_=>Status::Failed }, baseline:f[5]=="1", error };
match f[0] {
"core" => rows.push(row),
"local" if !shared_auth(&row.db) => local.push(row),
"local" | "other" => auth.push(row),
"shared" => shared.push(row),
_ => return Err(Error::Invalid("Unknown migration history source.".into())),
}
}
rows.extend(local);
// An interrupted legacy auth execution must not be hidden by another realm's applied row.
auth.sort_by_key(|r| (match r.status { Status::Applied=>0,Status::Running=>1,Status::Failed=>2,Status::Pending=>3 },r.sha256!="0".repeat(64)));
for mut row in auth { row.db="auth".into(); rows.push(row); }
// New auth records live with the shared account database and are authoritative.
for mut row in shared {
if !shared_auth(&row.db) { return Err(Error::Invalid("The shared authentication migration history is invalid.".into())); }
rows.retain(|r| !(shared_auth(&r.db) && r.id.eq_ignore_ascii_case(&row.id)));
row.db="auth".into(); rows.push(row);
}
Ok(rows)
}
fn put(&self, r: &LedgerRow) -> Result<()> {
if !ident_ok(&r.id) || !ident_ok(&r.db) || r.sha256.len() != 64 || !r.sha256.chars().all(|c| c.is_ascii_hexdigit()) {
return Err(Error::Invalid("migration record has an invalid identifier".into()));
fn put(&self, row: &LedgerRow) -> Result<()> { self.put_batch(std::slice::from_ref(row)) }
fn put_batch(&self, rows: &[LedgerRow]) -> Result<()> {
let mut groups = std::collections::BTreeMap::<&str, Vec<String>>::new();
for r in rows {
if !ident_ok(&r.id) || !ident_ok(&r.db) || r.sha256.len() != 64 || !r.sha256.chars().all(|c| c.is_ascii_hexdigit()) {
return Err(Error::Invalid("migration record has an invalid identifier".into()));
}
let status = match r.status { Status::Applied => "applied", Status::Running => "running", _ => "failed" };
let error = r.error.as_deref().map(|e| format!("UNHEX('{}')", hex_of(e))).unwrap_or_else(|| "NULL".into());
let (schema, kind) = if shared_auth(&r.db) { (AUTH_LEDGER_SCHEMA, "auth") } else { (LEDGER_SCHEMA, r.db.as_str()) };
groups.entry(schema).or_default().push(format!("('{}','{}','{}','{status}',NOW(),{error},{})",kind,r.id,r.sha256,r.baseline as u8));
}
for (schema, values) in groups {
self.query(&format!("REPLACE INTO `{schema}`.`{LEDGER_TABLE}` (`db`,`id`,`sha256`,`status`,`applied_at`,`error`,`baseline`) VALUES {};",values.join(",")))?;
}
let status = match r.status { Status::Applied => "applied", Status::Running => "running", _ => "failed" };
let err = r.error.as_deref().map(|e| format!("UNHEX('{}')", hex_of(e))).unwrap_or_else(|| "NULL".into());
self.query(&format!(
"REPLACE INTO `{LEDGER_SCHEMA}`.`{LEDGER_TABLE}` (`db`,`id`,`sha256`,`status`,`applied_at`,`error`,`baseline`) VALUES ('{}','{}','{}','{status}',NOW(),{err},{});",
r.db, r.id, r.sha256, r.baseline as u8
))?;
Ok(())
}
@@ -137,21 +184,34 @@ pub fn status(store: &dyn Store, list: &[Migration]) -> Result<Vec<Item>> {
.map(|m| {
// Manager records are appended after the core's updates table and are authoritative.
let row = recorded(&rows, m);
let changed = row.is_some_and(|r| hash_changed(r, m));
let history = effective_history(&rows, m);
let changed = history.iter().any(|r| hash_changed(r,m));
let interrupted = history.iter().find(|r| matches!(r.status, Status::Running | Status::Failed));
Item {
id: m.id.clone(),
db: m.db.clone(),
status: if changed || row.is_some_and(|r| r.status == Status::Running) { Status::Failed } else { row.map(|r| r.status).unwrap_or(Status::Pending) },
status: if changed || interrupted.is_some() { Status::Failed } else { row.map(|r| r.status).unwrap_or(Status::Pending) },
destructive: m.destructive,
baseline: row.map(|r| r.baseline).unwrap_or(false),
error: if changed { Some("An already applied SQL file changed. Publish a new migration instead of replaying it.".into()) } else { row.and_then(|r| r.error.clone()) },
error: if changed { Some("An already applied SQL file changed. Publish a new migration instead of replaying it.".into()) } else { interrupted.and_then(|r| r.error.clone()).or_else(|| row.and_then(|r| r.error.clone())) },
}
})
.collect())
}
fn recorded<'a>(rows: &'a [LedgerRow], m: &Migration) -> Option<&'a LedgerRow> {
rows.iter().rev().find(|r| r.db == m.db && r.id == m.id)
rows.iter().rev().find(|r| (r.db == m.db || shared_auth(&r.db) && shared_auth(&m.db)) && r.id.eq_ignore_ascii_case(&m.id))
}
fn effective_history<'a>(rows: &'a [LedgerRow], m: &Migration) -> Vec<&'a LedgerRow> {
if shared_auth(&m.db) { rows.iter().filter(|r| shared_auth(&r.db) && r.id.eq_ignore_ascii_case(&m.id)).collect() }
else { recorded(rows, m).into_iter().collect() }
}
fn preserve_auth_history(store: &dyn Store, rows: &[LedgerRow], list: &[Migration]) -> Result<()> {
let applied: Vec<_> = list.iter().filter(|m| shared_auth(&m.db)).filter_map(|m| recorded(rows,m))
.filter(|r| r.status == Status::Applied).cloned().collect();
store.put_batch(&applied)
}
/// Migrations that were published with different bytes but have the same effect, so a server that applied either
@@ -166,7 +226,7 @@ const SAME_EFFECT: &[(&str, &[&str])] = &[(
)];
fn same_effect(id: &str, a: &str, b: &str) -> bool {
SAME_EFFECT.iter().any(|(known, hashes)| *known == id
SAME_EFFECT.iter().any(|(known, hashes)| known.eq_ignore_ascii_case(id)
&& hashes.iter().any(|h| h.eq_ignore_ascii_case(a)) && hashes.iter().any(|h| h.eq_ignore_ascii_case(b)))
}
@@ -183,8 +243,7 @@ pub fn preflight(store: &dyn Store, list: &[Migration]) -> Result<()> {
pub fn pending_count(store: &dyn Store, list: &[Migration]) -> Result<usize> {
let rows = store.load_readonly()?;
check_history(&rows, list)?;
Ok(list.iter().filter(|m| recorded(&rows, m).is_none_or(|r| r.status != Status::Applied)).count())
Ok(pending_migrations(&rows, list)?.len())
}
fn verified_file(m: &Migration, dir: &Path) -> Result<(&'static str, std::path::PathBuf, bool)> {
@@ -199,22 +258,39 @@ fn verified_file(m: &Migration, dir: &Path) -> Result<(&'static str, std::path::
/// Check every migration artifact, including applied history, before replacing server files.
pub fn verify_files(list: &[Migration], dir: &Path) -> Result<()> {
validate_list(list)?;
for m in list { verified_file(m, dir)?; }
Ok(())
}
fn validate_list(list: &[Migration]) -> Result<()> {
let mut seen = std::collections::BTreeSet::new();
for m in list {
if !seen.insert((&m.db, &m.id)) { return Err(Error::InvalidManifest(format!("duplicate migration {} ({})", m.id, m.db))); }
verified_file(m, dir)?;
if !ident_ok(&m.id) { return Err(Error::InvalidManifest(format!("migration id {:?} is not allowed", m.id))); }
let schema = db::schema_of(&m.db)?;
if !seen.insert((schema, m.id.to_ascii_lowercase())) {
return Err(Error::InvalidManifest(format!("duplicate migration {} ({})", m.id, m.db)));
}
}
Ok(())
}
fn pending_migrations<'a>(rows: &[LedgerRow], list: &'a [Migration]) -> Result<Vec<&'a Migration>> {
check_history(rows, list)?;
Ok(list.iter().filter(|m| recorded(rows, m).is_none_or(|r| r.status != Status::Applied)).collect())
}
fn check_history(rows: &[LedgerRow], list: &[Migration]) -> Result<()> {
validate_list(list)?;
for m in list {
if recorded(rows, m).is_some_and(|r| matches!(r.status, Status::Running | Status::Failed)) {
for row in effective_history(rows,m) {
if matches!(row.status, Status::Running | Status::Failed) {
return Err(Error::Invalid(format!("Database update {} ({}) failed or was interrupted and may be partially applied. Restore its recovery point before retrying.", m.id, m.db)));
}
if recorded(rows, m).is_some_and(|r| hash_changed(r, m)) {
if hash_changed(row,m) {
return Err(Error::Invalid(format!("Applied database update {} ({}) has a different checksum. A new migration is required; it was not replayed.", m.id, m.db)));
}
}
}
Ok(())
}
@@ -223,9 +299,11 @@ fn check_history(rows: &[LedgerRow], list: &[Migration]) -> Result<()> {
/// was brought up to date by hand).
pub fn baseline(store: &dyn Store, list: &[Migration]) -> Result<usize> {
let rows = store.load()?;
check_history(&rows,list)?;
preserve_auth_history(store,&rows,list)?;
let mut n = 0;
for m in list {
if rows.iter().any(|r| r.db == m.db && r.id == m.id && r.status == Status::Applied) {
if recorded(&rows,m).is_some_and(|r| r.status == Status::Applied) {
continue;
}
store.put(&LedgerRow { db: m.db.clone(), id: m.id.clone(), sha256: m.sha256.clone(), status: Status::Applied, error: None, baseline: true })?;
@@ -246,8 +324,7 @@ pub struct ApplyReport {
pub fn apply_pending(store: &dyn Store, list: &[Migration], dir: &Path, snapshot: &dyn Fn() -> Result<String>) -> Result<ApplyReport> {
let rows = store.load()?;
// The list order is the release's order of application (released updates, then pending, then modules).
check_history(&rows, list)?;
let todo: Vec<&Migration> = list.iter().filter(|m| recorded(&rows, m).is_none_or(|r| r.status != Status::Applied)).collect();
let todo = pending_migrations(&rows, list)?;
tracing::info!(total = list.len(), pending = todo.len(), skipped = list.len() - todo.len(), "database migration plan");
// Resolve and verify every file before running anything.
@@ -261,11 +338,13 @@ pub fn apply_pending(store: &dyn Store, list: &[Migration], dir: &Path, snapshot
let mut report = ApplyReport { applied: Vec::new(), failed: None, snapshot: None };
if files.is_empty() {
preserve_auth_history(store,&rows,list)?;
return Ok(report);
}
if any_destructive {
report.snapshot = Some(snapshot().map_err(|e| Error::Invalid(format!("No database update was applied because the safety backup failed: {e}")))?);
}
preserve_auth_history(store,&rows,list)?;
for (m, schema, path) in files {
tracing::info!(migration = %m.id, database = %m.db, "database migration starting");
store.put(&LedgerRow { db: m.db.clone(), id: m.id.clone(), sha256: m.sha256.clone(), status: Status::Running, error: Some("Interrupted SQL must be recovered before replay.".into()), baseline: false })?;
@@ -368,6 +447,23 @@ mod tests {
assert!(store.ran.borrow().is_empty());
}
#[test]
fn every_entry_point_rejects_duplicate_sql_before_execution() {
let (dir, original) = setup(&[("world", "once", "SELECT 1;\n")]);
for alias in ["world", "coa-world"] {
let mut list = original.clone();
let mut duplicate = original[0].clone();
duplicate.db = alias.into();
list.push(duplicate);
let store = Mem::default();
assert!(preflight(&store, &list).is_err());
assert!(pending_count(&store, &list).is_err());
assert!(apply_pending(&store, &list, dir.path(), &no_snapshot).is_err());
assert!(store.ran.borrow().is_empty());
assert!(store.rows.borrow().is_empty());
}
}
#[test]
fn staged_files_reject_missing_corrupt_duplicate_and_invalid_migrations() {
let (dir, list) = setup(&[("characters", "repair", "SELECT 1;\n")]);
+36
View File
@@ -371,6 +371,12 @@ fn save_settings_in(cat: &[Entry], root: &Path, meta: &Path, id: &str, changes:
return Err(Error::Invalid("Enemy damage must be a number from 0.25 to 2.0.".into()));
}
}
if id == "content-scaling" && key.starts_with("CoAContentScaling.Difficulty.Health.") && key.ends_with("Multiplier") {
let multiplier = value.parse::<f32>().map_err(|_| Error::Invalid("Health multipliers must be a number from 0.1 to 10.".into()))?;
if !multiplier.is_finite() || !(0.1..=10.0).contains(&multiplier) {
return Err(Error::Invalid("Health multipliers must be a number from 0.1 to 10.".into()));
}
}
if id == "content-scaling" && key == "CoAContentScaling.World.Leech.Percent" {
let percent = value.parse::<f32>().map_err(|_| Error::Invalid("Life steal must be a number from 0 to 100 percent.".into()))?;
if !percent.is_finite() || !(0.0..=100.0).contains(&percent) {
@@ -697,6 +703,36 @@ mod tests {
assert_eq!(settings_in(&cat, &root, "content-scaling").unwrap().iter().find(|s| s.key == key).unwrap().value, "2");
}
#[test]
fn creature_health_multipliers_are_validated_per_key() {
let d = tempfile::tempdir().unwrap();
let (root, meta) = server(d.path());
let cat = catalog();
let conf = dir(&root).join("mod-coa-content-scaling.conf.dist");
let keys = [
"CoAContentScaling.Difficulty.Health.WorldMultiplier",
"CoAContentScaling.Difficulty.Health.DungeonMultiplier",
"CoAContentScaling.Difficulty.Health.RaidMultiplier",
"CoAContentScaling.Difficulty.Health.TrashMultiplier",
"CoAContentScaling.Difficulty.Health.BossMultiplier",
];
let mut text = String::from("CoAContentScaling.Enable = 1\n");
for key in keys {
text.push_str(&format!("{key} = 1.0\n"));
}
fs::write(&conf, text).unwrap();
for key in keys {
let changes = |v: &str| BTreeMap::from([(key.to_string(), v.to_string())]);
for bad in ["NaN", "inf", "0", "0.09", "10.01", "-1", "abc", ""] {
assert!(save_settings_in(&cat, &root, &meta, "content-scaling", &changes(bad)).is_err(), "{key} {bad}");
}
for good in ["0.1", "0.4", "1", "2.5", "10"] {
assert_eq!(save_settings_in(&cat, &root, &meta, "content-scaling", &changes(good)).unwrap(), [key]);
assert_eq!(settings_in(&cat, &root, "content-scaling").unwrap().iter().find(|s| s.key == key).unwrap().value, good);
}
}
}
#[test]
fn an_older_file_name_is_used_when_the_current_one_is_missing_and_a_part_that_cannot_be_switched_stays_on() {
let d = tempfile::tempdir().unwrap();
+46 -140
View File
@@ -129,10 +129,6 @@ pub(crate) fn inventory(root: &Path) -> Result<BTreeMap<String, String>> {
}
pub(crate) fn copy_verified(source: &Path, target: &Path, files: &BTreeMap<String, String>) -> Result<()> {
copy_verified_with_progress(source, target, files, &|_| {})
}
fn copy_verified_with_progress(source: &Path, target: &Path, files: &BTreeMap<String, String>, report: &dyn Fn(&str)) -> Result<()> {
if target.exists() { return Err(Error::Invalid("Database snapshot destination already exists.".into())); }
let bytes = files.keys().try_fold(0u64, |total, name| -> Result<u64> {
let path = fsx::ensure_within(source, &fsx::safe_join(source, name)?)?;
@@ -142,15 +138,13 @@ fn copy_verified_with_progress(source: &Path, target: &Path, files: &BTreeMap<St
fs::create_dir_all(parent)?;
fsx::require_space(parent, bytes)?;
fs::create_dir(target)?;
for (index, (relative, expected)) in files.iter().enumerate() {
if index % 250 == 0 { report(&format!("Copying private server files: {} of {}", index, files.len())); }
for (relative, expected) in files {
let source_file = fsx::ensure_within(source, &fsx::safe_join(source, relative)?)?;
let target_file = fsx::ensure_within(target, &fsx::safe_join(target, relative)?)?;
fs::create_dir_all(target_file.parent().unwrap())?;
fs::copy(&source_file, &target_file)?;
if fsx::sha256_file(&target_file)? != *expected { return Err(Error::Invalid(format!("Database snapshot file {relative} failed verification."))); }
}
report("Verifying the complete private file copy");
if inventory(target)? != *files { return Err(Error::Invalid("Database snapshot inventory differs.".into())); }
Ok(())
}
@@ -250,99 +244,6 @@ pub(crate) fn verify(point: &Path, snapshot: &Snapshot) -> Result<()> {
Ok(())
}
pub(crate) fn rehearsal_copy_with_progress(root: &Path, meta: &Path, point: &Path, snapshot: &Snapshot, report: &dyn Fn(&str)) -> Result<PathBuf> {
report("Verifying the database recovery copy before rehearsal");
verify(point, snapshot)?;
let canonical = fsx::canonicalize_lenient(root)?;
let root = canonical.as_path();
let destination = meta.join("rehearsals").join(uuid::Uuid::new_v4().simple().to_string()).join("server");
let mut files = BTreeMap::new();
let mut directories = vec![root.to_path_buf()];
while let Some(directory) = directories.pop() {
for entry in fs::read_dir(directory)? {
let entry = entry?;
let raw = entry.path();
let relative = raw.strip_prefix(root).map_err(|e| Error::Invalid(e.to_string()))?.to_string_lossy().replace('\\', "/");
let lower = relative.to_ascii_lowercase();
let first = lower.split('/').next().unwrap();
if entry.file_type()?.is_dir() && !relative.contains('/')
&& !["core", "data", "scripts", "settings", "runtime", "mysql", ".realms", "bugreport", "extras", "licenses"].contains(&first) { continue; }
if lower == "mysql/data" || lower.starts_with("mysql/data-")
|| lower.split('/').any(|part| part == ".state")
|| lower == "bugreport/reports" || lower == "core/logs" || lower == "mysql/logs" { continue; }
let metadata = fs::symlink_metadata(&raw)?;
reject_link(&metadata)?;
let path = fsx::ensure_within(root, &raw)?;
if metadata.is_dir() { directories.push(path); }
else if metadata.is_file() {
files.insert(relative, fsx::sha256_file(&path)?);
if files.len() % 250 == 0 { report(&format!("Preparing the private copy: {} files checked", files.len())); }
}
else { return Err(Error::Invalid("Unsupported rehearsal file.".into())); }
}
}
copy_verified_with_progress(root, &destination, &files, report)?;
report("Restoring MySQL into the private server copy");
copy_snapshot(point, snapshot, &destination.join("mysql/data"))?;
let (_, mut installed) = crate::registry::MetaDir::open(meta)?;
installed.id = uuid::Uuid::new_v4().to_string();
installed.server_path = destination.to_string_lossy().into_owned();
installed.client_path = None;
crate::registry::MetaDir::create(&destination, &installed)?;
Ok(destination)
}
pub(crate) fn isolate_connections(root: &Path) -> Result<()> {
for relative in ["Settings/worldserver.conf.template", "Settings/authserver.conf.template", "Core/configs/worldserver.conf", "Core/configs/authserver.conf"] {
let path = fsx::ensure_within(root, &root.join(relative))?;
if !path.is_file() {
if relative.ends_with(".template") { return Err(Error::Invalid("The private update copy lacks connection templates.".into())); }
continue;
}
let mut config = crate::config::parser::ConfFile::parse_bytes(&fs::read(&path)?)?;
for key in ["LoginDatabaseInfo", "WorldDatabaseInfo", "CharacterDatabaseInfo"] {
if relative.contains("worldserver") || key == "LoginDatabaseInfo" {
config.set(key, &format!("\"@{key}@\""), &[]);
}
}
config.set("BindIP", "\"127.0.0.1\"", &[]);
if relative.contains("worldserver") {
config.set("Ra.IP", "\"127.0.0.1\"", &[]);
config.set("DataDir", "\"@DATA@\"", &[]);
}
fsx::atomic_write(&path, config.to_text().as_bytes())?;
}
Ok(())
}
pub(crate) fn unchanged(root: &Path, snapshot: &Snapshot) -> Result<()> {
let data = fsx::ensure_within(root, &root.join("mysql/data"))?;
if inventory(&data)? != snapshot.files || directories(&data)? != snapshot.directories {
return Err(Error::Invalid("The installed database changed during the private rehearsal. Retry after stopping other database access.".into()));
}
Ok(())
}
pub(crate) fn validate_connections(templates: &Path, installation: &Path) -> Result<()> {
let port = crate::layout::read_ports(installation).mysql.to_string();
let (_, password) = crate::db::credentials(installation)?;
let realm = crate::realms::state(installation)?.active;
for relative in ["Settings/worldserver.conf.template", "Settings/authserver.conf.template"] {
let path = fsx::ensure_within(templates, &templates.join(relative))?;
let config = crate::config::parser::ConfFile::parse_bytes(&fs::read(path)?)?;
for (key, kind) in [("LoginDatabaseInfo", "auth"), ("WorldDatabaseInfo", "world"), ("CharacterDatabaseInfo", "characters")] {
if relative.contains("authserver") && kind != "auth" { continue; }
let value = config.get(key).ok_or_else(|| Error::Invalid(format!("The update cannot isolate the missing {key} connection.")))?.trim().trim_matches('"');
if value == format!("@{key}@") { continue; }
let fields: Vec<_> = value.split(';').collect();
if fields.len() != 5 || !matches!(fields[0], "127.0.0.1" | "localhost") || fields[1] != port || fields[2] != "acore" || fields[3] != password || fields[4] != realm.schema(kind)? {
return Err(Error::Invalid(format!("The {key} connection does not use this repack's bundled database. A private update cannot safely qualify an external database.")));
}
}
}
Ok(())
}
// Keep the replaced data directory. If interrupted between renames, a retry can install a new verified copy.
pub(crate) fn swap(root: &Path, meta: &Path, point: &Path, snapshot: &Snapshot, fail_after_move: bool) -> Result<PathBuf> {
verify(point, snapshot)?;
@@ -570,6 +471,46 @@ mod tests {
};
let mut server = start();
db.query("CREATE DATABASE acore_characters; CREATE DATABASE acore_world; CREATE DATABASE acore_auth; CREATE TABLE acore_characters.probe(id INT PRIMARY KEY, note VARCHAR(40)); CREATE TABLE acore_world.probe(id INT NOT NULL DEFAULT 0); INSERT INTO acore_world.probe VALUES(43); CREATE TABLE acore_auth.probe(id INT); INSERT INTO acore_auth.probe VALUES(44); CREATE USER 'fixture_user'@'localhost' IDENTIFIED BY 'fixture'; CREATE TRIGGER acore_characters.probe_insert BEFORE INSERT ON acore_characters.probe FOR EACH ROW SET NEW.note='triggered'; INSERT INTO acore_characters.probe VALUES(42,'original'); CREATE VIEW acore_characters.probe_view AS SELECT c.id,w.id AS world_id FROM acore_characters.probe c CROSS JOIN acore_world.probe w; CREATE PROCEDURE acore_characters.probe_proc() SELECT id FROM acore_characters.probe; CREATE FUNCTION acore_characters.probe_func() RETURNS INT DETERMINISTIC RETURN 73;").unwrap();
// Shared auth must not run again when the active realm changes.
use crate::migrations::Store;
db.query("CREATE DATABASE acore_world_wildcard;").unwrap();
let migration_dir = root.join("migration-fixture");
fs::create_dir_all(migration_dir.join("auth")).unwrap();
fs::create_dir_all(migration_dir.join("world")).unwrap();
let auth_sql = b"INSERT INTO acore_auth.probe VALUES(45);";
fs::write(migration_dir.join("auth/shared_once.sql"), auth_sql).unwrap();
let auth_list = vec![crate::manifest::Migration { id:"shared_once".into(), db:"auth".into(), sha256:fsx::sha256_bytes(auth_sql), destructive:false, compatible_sha256:vec![] }];
assert_eq!(crate::migrations::apply_pending(&db, &auth_list, &migration_dir, &|| Ok("fixture".into())).unwrap().applied.len(), 1);
let wildcard = db.clone().for_realm(crate::realms::Mode::Wildcard);
assert_eq!(crate::migrations::pending_count(&wildcard, &auth_list).unwrap(), 0, "auth is shared by both realms");
assert!(crate::migrations::apply_pending(&wildcard, &auth_list, &migration_dir, &|| Ok("fixture".into())).unwrap().applied.is_empty());
assert_eq!(db.query("SELECT COUNT(*) FROM acore_auth.probe WHERE id=45;").unwrap(), "1");
let mut failed = crate::migrations::LedgerRow { db:"auth".into(), id:"shared_once".into(), sha256:auth_list[0].sha256.clone(), status:crate::migrations::Status::Failed, error:Some("interrupted fixture".into()), baseline:false };
db.put(&failed).unwrap();
assert!(crate::migrations::pending_count(&wildcard, &auth_list).is_err());
failed.status = crate::migrations::Status::Applied; failed.error = None; db.put(&failed).unwrap();
// Legacy per-world auth records are adopted without replaying their SQL.
let legacy_sql = b"INSERT INTO acore_auth.probe VALUES(46);";
fs::write(migration_dir.join("auth/legacy_auth.sql"), legacy_sql).unwrap();
db.query(&format!("INSERT INTO acore_auth.probe VALUES(46); REPLACE INTO acore_world.coa_manager_migrations VALUES('auth','legacy_auth','{}','applied',NOW(),NULL,0);", fsx::sha256_bytes(legacy_sql))).unwrap();
let legacy_auth = vec![crate::manifest::Migration { id:"legacy_auth".into(), db:"auth".into(), sha256:fsx::sha256_bytes(legacy_sql), destructive:false, compatible_sha256:vec![] }];
assert_eq!(crate::migrations::pending_count(&wildcard, &legacy_auth).unwrap(), 0);
assert!(crate::migrations::apply_pending(&wildcard, &legacy_auth, &migration_dir, &|| Ok("fixture".into())).unwrap().applied.is_empty());
assert_eq!(db.query("SELECT COUNT(*) FROM acore_auth.probe WHERE id=46;").unwrap(), "1");
// A core history cleanup cannot make previously recorded SQL pending again.
db.query("CREATE TABLE acore_world.updates(name VARCHAR(150) PRIMARY KEY) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; INSERT INTO acore_world.updates VALUES('LEGACY_WORLD.sql'); INSERT INTO acore_world.probe VALUES(99);").unwrap();
db.load().unwrap();
db.query("DROP TABLE acore_world.updates;").unwrap();
let legacy_world_sql = b"INSERT INTO acore_world.probe VALUES(99);";
fs::write(migration_dir.join("world/legacy_world.sql"), legacy_world_sql).unwrap();
let legacy_world = vec![crate::manifest::Migration { id:"legacy_world".into(), db:"world".into(), sha256:fsx::sha256_bytes(legacy_world_sql), destructive:false, compatible_sha256:vec![] }];
assert_eq!(crate::migrations::pending_count(&db, &legacy_world).unwrap(), 0);
assert!(crate::migrations::apply_pending(&db, &legacy_world, &migration_dir, &|| Ok("fixture".into())).unwrap().applied.is_empty());
assert_eq!(db.query("SELECT COUNT(*) FROM acore_world.probe WHERE id=99;").unwrap(), "1");
db.query("DELETE FROM acore_world.probe WHERE id=99;").unwrap();
assert_eq!(db.recovery_objects("acore_characters").unwrap().len(), 4);
db.query("CREATE TABLE acore_characters.coa_squid_pending(path VARCHAR(255), sha256 CHAR(64)); INSERT INTO acore_characters.coa_squid_pending VALUES('playerbots/base/ai_playerbot_texts.sql', REPEAT('a',64));").unwrap();
let squid_problems = crate::squid::database_problems(&root, crate::realms::Mode::Coa, &|sql| {
@@ -660,45 +601,10 @@ mod tests {
fsx::atomic_write(&archive_path, b"damaged").unwrap();
assert!(verify(&point, &snapshot).is_err());
}
#[test]
fn private_rehearsals_reject_external_database_connections() {
let (_temp, root, _meta, _point, _snapshot) = fixture();
fsx::atomic_write_json(&root.join("Settings/repack.json"), &serde_json::json!({"mysqlPort":3307})).unwrap();
fsx::atomic_write_json(&root.join("Settings/database.json"), &serde_json::json!({"rootPassword":"test-root","appPassword":"test-app"})).unwrap();
fsx::atomic_write(&root.join("Settings/worldserver.conf.template"), b"LoginDatabaseInfo = \"@LoginDatabaseInfo@\"\nWorldDatabaseInfo = \"@WorldDatabaseInfo@\"\nCharacterDatabaseInfo = \"@CharacterDatabaseInfo@\"\n").unwrap();
fsx::atomic_write(&root.join("Settings/authserver.conf.template"), b"LoginDatabaseInfo = \"127.0.0.1;3307;acore;test-app;acore_auth\"\n").unwrap();
validate_connections(&root, &root).unwrap();
fsx::atomic_write(&root.join("Settings/authserver.conf.template"), b"LoginDatabaseInfo = \"192.0.2.1;3307;acore;test-app;acore_auth\"\n").unwrap();
let error = validate_connections(&root, &root).unwrap_err().to_string();
assert!(error.contains("external database"));
assert!(!error.contains("test-app"));
}
#[test]
fn a_changed_live_database_invalidates_the_rehearsal() {
let (_temp, root, _meta, _point, snapshot) = fixture();
assert!(unchanged(&root, &snapshot).is_err());
fsx::atomic_write(&root.join("mysql/data/characters.ibd"), b"saved").unwrap();
fs::create_dir_all(root.join("mysql/data/empty_schema")).unwrap();
unchanged(&root, &snapshot).unwrap();
fsx::atomic_write(&root.join("mysql/data/extra.ibd"), b"new data").unwrap();
assert!(unchanged(&root, &snapshot).is_err());
}
#[test]
fn rehearsal_copy_succeeds_with_nested_directories_and_unnormalized_root() {
let (_temp, root, meta, point, snapshot) = fixture();
let meta_obj = crate::registry::InstallMeta::new(crate::registry::InstallKind::New, &root);
fsx::atomic_write_json(&meta.join("install.json"), &meta_obj).unwrap();
fsx::atomic_write(&root.join("Core/worldserver.exe"), b"exe").unwrap();
fsx::atomic_write(&root.join("Core/configs/worldserver.conf"), b"conf").unwrap();
fsx::atomic_write(&root.join("Settings/repack.json"), b"{}").unwrap();
let phases = std::cell::RefCell::new(Vec::new());
let dest = rehearsal_copy_with_progress(&root, &meta, &point, &snapshot, &|phase| phases.borrow_mut().push(phase.to_string())).unwrap();
assert_eq!(fs::read(dest.join("Core/configs/worldserver.conf")).unwrap(), b"conf");
assert_eq!(fs::read(dest.join("mysql/data/characters.ibd")).unwrap(), b"saved");
let phases = phases.into_inner();
assert!(phases[0].contains("Verifying the database"));
assert!(phases.iter().any(|phase| phase.contains("Copying private server files")));
assert!(phases.last().unwrap().contains("Restoring MySQL"));
}
}
+2 -1
View File
@@ -348,7 +348,8 @@ AC>";
let (port, _h) = fake_ra("Account not found.");
let mut ra = Ra::connect_to(port, "u", "p").unwrap();
assert!(ra.set_account_password("x", "newpass9").is_err(), "the name is validated before anything is sent");
assert!(ra.set_account_password("Nobody", "newpass9").unwrap_err().to_string().contains("not found"));
let error = ra.set_account_password("Nobody", "newpass9").unwrap_err().to_string();
assert!(error.contains("not found"), "Unexpected console error: {error}");
}
#[test]
+1 -3
View File
@@ -14,8 +14,6 @@ impl crate::update::Env for QualificationEnv<'_> {
fn preflight(&self, manifest: &crate::manifest::Manifest) -> Result<()> { self.0.preflight(manifest) }
fn snapshot(&self) -> Result<String> { self.0.snapshot() }
fn verify_snapshot(&self, id: &str) -> Result<()> { self.0.verify_snapshot(id) }
fn rehearse(&self, manifest: &crate::manifest::Manifest, tree: &Path, items: &[crate::update::PlanItem], point: &str) -> Result<()> { self.0.rehearse(manifest, tree, items, point) }
fn rehearse_with_progress(&self, manifest: &crate::manifest::Manifest, tree: &Path, items: &[crate::update::PlanItem], point: &str, report: &dyn Fn(&str, u8)) -> Result<()> { self.0.rehearse_with_progress(manifest, tree, items, point, report) }
fn restore_snapshot(&self, id: &str) -> Result<()> { self.0.restore_snapshot(id) }
fn migrate(&self, manifest: &crate::manifest::Manifest, staged: &Path) -> Result<crate::migrations::ApplyReport> { self.0.migrate(manifest, staged) }
fn validate(&self) -> Result<()> { self.0.validate() }
@@ -87,7 +85,7 @@ pub fn qualify_upgrade(base: &Path, source: &Path, candidate: &Path, fixture: &P
"schema": 1, "result": "passed", "fromVersion": source_manifest.version,
"toVersion": candidate_manifest.version, "fromManifestSha256": fsx::sha256_bytes(&source_bytes),
"fromSchemaSha256": source_manifest.files.iter().find(|file| file.path == schema_check::CONTRACT).map(|file| &file.sha256),
"checks": ["manager-transaction", "private-user-database-rehearsal", "database-schema", "private-auth-world-startup", "existing-identities", "user-file-preservation"],
"checks": ["manager-transaction", "recovery-backed-database-update", "database-schema", "private-auth-world-startup", "existing-identities", "user-file-preservation"],
}))
}
+84 -188
View File
@@ -92,9 +92,6 @@ pub trait Env {
fn ensure_stopped(&self) -> Result<()>;
fn preflight(&self, _manifest: &Manifest) -> Result<()> { Ok(()) }
fn verify_snapshot(&self, _id: &str) -> Result<()> { Ok(()) }
fn rehearse(&self, _manifest: &Manifest, _tree: &Path, _items: &[PlanItem], _point: &str) -> Result<()> { Ok(()) }
fn rehearse_with_progress(&self, manifest: &Manifest, tree: &Path, items: &[PlanItem], point: &str, _report: &dyn Fn(&str, u8)) -> Result<()> { self.rehearse(manifest, tree, items, point) }
/// Create a recovery point for the databases and configuration; returns its id.
fn snapshot(&self) -> Result<String>;
fn restore_snapshot(&self, id: &str) -> Result<()>;
fn migrate(&self, manifest: &Manifest, staged_migrations: &Path) -> Result<ApplyReport>;
@@ -339,7 +336,7 @@ pub fn preview_with(root: &Path, meta: &InstallMeta, source: &Source, trusted_ke
let meta_dir = crate::registry::metadata_dir_for(root)?;
let observed_version = MetaDir::open(&meta_dir)?.1.core.version;
let (m, _) = fetch_manifest(source, trusted_key)?;
let _lock = operation_lock_for(&meta_dir, "checking updates", false)?;
let _lock = operation_lock_for(&meta_dir, "checking updates", true)?;
ensure_recovered(&meta_dir)?;
let (_, current_meta) = MetaDir::open(&meta_dir)?;
let meta = if current_meta.core.version != observed_version { &current_meta } else { meta };
@@ -347,7 +344,7 @@ pub fn preview_with(root: &Path, meta: &InstallMeta, source: &Source, trusted_ke
reject_downgrade(meta, &m)?;
let mut items = plan(root, meta, &m, resolutions, None)?;
if items.iter().any(|item| item.path == "Scripts/manage.py" && item.action != Action::Skip)
&& launcher_already_integrated(root, &meta_dir, meta, &m, source)? {
&& launcher_already_integrated(root, meta, &m)? {
if let Some(item) = items.iter_mut().find(|item| item.path == "Scripts/manage.py") {
item.action = Action::Skip;
item.reason = Some("already up to date with Manager integration".into());
@@ -377,27 +374,11 @@ pub fn preview_with(root: &Path, meta: &InstallMeta, source: &Source, trusted_ke
})
}
fn launcher_already_integrated(root: &Path, meta_dir: &Path, meta: &InstallMeta, manifest: &Manifest, source: &Source) -> Result<bool> {
fn launcher_already_integrated(root: &Path, meta: &InstallMeta, manifest: &Manifest) -> Result<bool> {
let Some(file) = manifest.files.iter().find(|file| file.path == "Scripts/manage.py") else { return Ok(false); };
let actual = sha_if_exists(&root.join(&file.path));
if actual.as_ref() != meta.original_hashes.get(&file.path) || actual.is_none() { return Ok(false); }
let cache = meta_dir.join("manifests").join(format!("launcher-{}.py", file.sha256));
let signed = match fs::read(&cache) {
Ok(bytes) if fsx::sha256_bytes(&bytes) == file.sha256 => bytes,
_ => {
let temp = tempfile::tempdir()?;
let parts = fetch_parts(source, manifest, &temp.path().join("download"), &Cancel::default(), &|_, _| {})?;
package::extract(&parts, manifest, &temp.path().join("tree"), &|_, _| {})?;
let bytes = fs::read(temp.path().join("tree").join(&file.path))?;
if fsx::sha256_bytes(&bytes) != file.sha256 { return Err(Error::Invalid("The signed launcher failed verification.".into())); }
// This derived cache is optional; failure to save it does not change the server.
let _ = fsx::atomic_write(&cache, &bytes);
bytes
}
};
Ok(std::str::from_utf8(&signed).ok().is_some_and(|signed| {
fs::read(root.join(&file.path)).ok().is_some_and(|actual| crate::driver::launcher_matches(signed, &actual))
}))
let Ok(actual) = fs::read(root.join(&file.path)) else { return Ok(false); };
if meta.original_hashes.get(&file.path) != Some(&fsx::sha256_bytes(&actual)) { return Ok(false); }
Ok(crate::driver::launcher_matches_recorded(&file.sha256, &actual))
}
fn reject_downgrade(meta: &InstallMeta, manifest: &Manifest) -> Result<()> {
@@ -406,8 +387,10 @@ fn reject_downgrade(meta: &InstallMeta, manifest: &Manifest) -> Result<()> {
if c.platform != platform {
return Err(Error::Invalid(format!("This package targets {} rather than {platform}.", c.platform)));
}
if meta.core.version.as_ref().is_none_or(|version| version != &manifest.version && !c.source_versions.contains(version)) {
return Err(Error::Invalid(format!("Installed server {} is outside the compatibility matrix for {}. Tested source versions: {}.", meta.core.version.as_deref().unwrap_or("unknown"), manifest.version, c.source_versions.join(", "))));
// The source list records release qualification, not an exclusive upgrade route.
// Database history and target validation decide whether the update can complete.
if meta.core.version.as_deref().and_then(crate::manifest::parse_version).is_none() {
return Err(Error::Invalid("The installed server version is unknown. An imported repack needs a verified starting state before updating.".into()));
}
}
if let Some(installed) = meta.core.version.as_deref() {
@@ -528,14 +511,6 @@ pub fn apply(p: &Params, report: &dyn Fn(&str, u8)) -> Result<Outcome> {
let point_meta = crate::backup::point_json(meta_dir, txn.recovery_point.as_deref().unwrap())?;
if point_meta.is_file() { txn.recovery_hashes.insert("@point".into(), fsx::sha256_file(&point_meta)?); }
save(meta_dir, &txn)?;
step(report, "Testing the update on a private copy of your server", 54);
if let Err(error) = p.env.rehearse_with_progress(&m, &tree, &items, txn.recovery_point.as_deref().unwrap(), report) {
txn.state = State::Failed;
txn.message = Some(format!("The private update rehearsal failed: {error}. The installed server was not updated."));
save(meta_dir, &txn)?;
return Err(Error::Invalid(txn.message.unwrap()));
}
txn.ops = items
.iter()
.filter(|i| i.action != Action::Skip)
@@ -923,7 +898,7 @@ impl RepackEnv<'_> {
if realms.wildcard_created { modes.push(if realms.active == crate::realms::Mode::Coa { crate::realms::Mode::Wildcard } else { crate::realms::Mode::Coa }); }
let mut count = 0;
for (index, mode) in modes.into_iter().enumerate() {
let list: Vec<_> = manifest.migrations.iter().filter(|m| index == 0 || m.db != "auth").cloned().collect();
let list: Vec<_> = manifest.migrations.iter().filter(|m| index == 0 || !crate::migrations::shared_auth(&m.db)).cloned().collect();
count += crate::migrations::pending_count(&db.clone().for_realm(mode), &list)?;
}
Ok(count)
@@ -989,85 +964,6 @@ impl Env for RepackEnv<'_> {
}
fn automatic_rollback(&self) -> bool { true }
fn rehearse(&self, manifest: &Manifest, tree: &Path, items: &[PlanItem], id: &str) -> Result<()> {
self.rehearse_with_progress(manifest, tree, items, id, &|_, _| {})
}
fn rehearse_with_progress(&self, manifest: &Manifest, tree: &Path, items: &[PlanItem], id: &str, report: &dyn Fn(&str, u8)) -> Result<()> {
if items.iter().any(|item| item.action != Action::Skip && item.path.to_ascii_lowercase().starts_with("mysql/")) {
return Err(Error::Invalid("A server update cannot replace MySQL while using a cold recovery copy; a separate database engine upgrade is required.".into()));
}
let point = crate::backup::get(self.meta_dir, id)?;
let Some(snapshot) = &point.mysql_snapshot else {
// Docker uses its separate experimental release channel until its clone runner is qualified.
if crate::docker::is_docker(self.root) { return Ok(()); }
return Err(Error::Invalid("This installation has no complete MySQL recovery copy for an update rehearsal.".into()));
};
crate::mysql_snapshot::validate_connections(self.root, self.root)?;
crate::mysql_snapshot::stop(self.root)?;
let point_dir = crate::backup::point_json(self.meta_dir, id)?.parent().unwrap().to_path_buf();
let fixture = crate::mysql_snapshot::rehearsal_copy_with_progress(self.root, self.meta_dir, &point_dir, snapshot, &|phase| step(report, phase, 54))?;
let metadata = crate::registry::metadata_dir_for(&fixture)?;
let env = RepackEnv { root: &fixture, meta_dir: &metadata };
let result = crate::install::with_scratch_ports(&fixture, || {
let mut txn = Txn { id: "rehearsal".into(), state: State::Applying, from_version: None,
to_version: manifest.version.clone(), recovery_point: None, databases_started: false,
ops: items.iter().filter(|item| item.action != Action::Skip).map(|item| Op {
path: item.path.clone(), action: item.action, reason: item.reason.clone(),
new_sha256: manifest.files.iter().find(|file| file.path == item.path).unwrap().sha256.clone(),
had_previous: fsx::safe_join(&fixture, &item.path).is_ok_and(|path| path.is_file()), started:false, done:false,
}).collect(), message:None, recovery_hashes:BTreeMap::new() };
let before = txn_dir(&metadata, &txn.id)?.join("before");
fs::create_dir_all(&before)?;
step(report, "Applying update files to the private server copy", 55);
apply_ops(&fixture, tree, &before, &manifest.files, &mut txn, &metadata, None)?;
crate::mysql_snapshot::validate_connections(&fixture, self.root)?;
crate::mysql_snapshot::isolate_connections(&fixture)?;
step(report, "Testing database updates on the private server copy", 56);
let identities = crate::backup::with_database(&fixture, |db| {
let identities = database_identities(db)?;
let realms = crate::realms::state(&fixture)?;
let mut modes = vec![realms.active];
if realms.wildcard_created { modes.push(if realms.active == crate::realms::Mode::Coa { crate::realms::Mode::Wildcard } else { crate::realms::Mode::Coa }); }
for (index, mode) in modes.into_iter().enumerate() {
let db = db.clone().for_realm(mode);
crate::schema_check::repair_missing_defaults(&db, &fixture, manifest.files.iter().find(|file| file.path == crate::schema_check::CONTRACT).map(|file| file.sha256.as_str()))?;
let list: Vec<_> = manifest.migrations.iter().filter(|migration| index == 0 || migration.db != "auth").cloned().collect();
let report = crate::migrations::apply_pending(&db, &list, &tree.join("_migrations"), &|| Ok("private rehearsal".into()))?;
if let Some((migration, error)) = report.failed { return Err(Error::Invalid(format!("Rehearsal migration {migration} failed: {error}"))); }
crate::schema_check::repair_missing_defaults(&db, &fixture, manifest.files.iter().find(|file| file.path == crate::schema_check::CONTRACT).map(|file| file.sha256.as_str()))?;
}
verify_database_identities(db, &identities)?;
Ok(identities)
})?;
step(report, "Testing startup of the private server copy", 57);
env.validate()?;
crate::backup::with_database(&fixture, |db| verify_database_identities(db, &identities))?;
env.ensure_stopped()
});
step(report, "Stopping the private server copy and verifying the installed database", 57);
let stopped = crate::mysql_snapshot::stop(&fixture);
let live_state = if result.is_ok() { crate::mysql_snapshot::stop(self.root).and_then(|()| crate::mysql_snapshot::unchanged(self.root, snapshot)) } else { Ok(()) };
let logs: BTreeMap<_, _> = ["Core/Logs/auth-console.log", "Core/Logs/world-console.log", "Core/Logs/supervisor.log", "mysql/logs/mysql-error.log"].into_iter()
.map(|path| (path, crate::diag::redact(&crate::health::tail(&fixture.join(path), 32768)))).collect();
let mut schema_reports = Vec::<serde_json::Value>::new();
if let Ok(entries) = fs::read_dir(metadata.join("diagnostics")) {
for entry in entries.flatten().filter(|entry| entry.file_name().to_string_lossy().starts_with("schema-validation-")) {
let path = fsx::ensure_within(&metadata, &entry.path())?;
if fs::metadata(&path)?.len() <= 4 * 1024 * 1024 { schema_reports.push(fsx::read_json(&path)?); }
}
}
let report = serde_json::json!({"schema":1,"checkedAt":chrono::Utc::now().to_rfc3339(),"toVersion":manifest.version,"recoveryPoint":id,
"result":if result.is_ok() && stopped.is_ok() && live_state.is_ok() {"passed"} else {"failed"}, "error":result.as_ref().err().map(ToString::to_string), "stopError":stopped.as_ref().err().map(ToString::to_string), "liveStateError":live_state.as_ref().err().map(ToString::to_string), "logs":logs,"schemaReports":schema_reports,"fixture":fixture});
let report_path = self.meta_dir.join("diagnostics").join(format!("database-rehearsal-{}.json", uuid::Uuid::new_v4()));
fsx::atomic_write_json(&report_path, &report)?;
stopped?;
let parent = fixture.parent().unwrap();
let owned = fsx::ensure_within(&self.meta_dir.join("rehearsals"), parent)?;
fs::remove_dir_all(owned)?;
live_state?;
result
}
fn preflight(&self, manifest: &Manifest) -> Result<()> {
crate::mysql_snapshot::stop_previous_rehearsals(self.meta_dir)?;
if let Some(compatibility) = &manifest.compatibility {
@@ -1087,7 +983,7 @@ impl Env for RepackEnv<'_> {
if crate::docker::is_docker(self.root) {
return Err(Error::Invalid(format!("The installed {} database does not match its upgrade source: {}.{}: {}", mode.name(), problem.database, problem.table, problem.detail)));
}
tracing::warn!(realm = mode.name(), table = %problem.table, "Installed schema differs; the private candidate rehearsal must qualify this database");
tracing::warn!(realm = mode.name(), table = %problem.table, "Installed schema differs; pending migrations and target validation will run with a full recovery point");
}
}
Ok(())
@@ -1142,43 +1038,10 @@ impl Env for RepackEnv<'_> {
}
fn migrate(&self, manifest: &Manifest, staged: &Path) -> Result<ApplyReport> {
let root = self.root;
crate::backup::with_database(root, |db| {
let realms = crate::realms::state(root)?;
if let Some(contract) = manifest.files.iter().find(|file| file.path == crate::schema_check::CONTRACT) {
self.migration_snapshot()?;
crate::schema_check::repair_missing_defaults(db, root, Some(&contract.sha256))?;
}
let mut result = crate::migrations::apply_pending(db, &manifest.migrations, staged, &|| {
self.migration_snapshot()
})?;
if realms.wildcard_created && result.failed.is_none() {
let other = if realms.active == crate::realms::Mode::Coa { crate::realms::Mode::Wildcard } else { crate::realms::Mode::Coa };
let other_db = db.clone().for_realm(other);
crate::schema_check::repair_missing_defaults(&other_db, root, manifest.files.iter().find(|file| file.path == crate::schema_check::CONTRACT).map(|file| file.sha256.as_str()))?;
let shared_snapshot = result.snapshot.clone();
let migrations: Vec<_> = manifest.migrations.iter().filter(|m| m.db != "auth").cloned().collect();
let extra = crate::migrations::apply_pending(&other_db, &migrations, staged, &|| {
if let Some(id) = &shared_snapshot { return Ok(id.clone()); }
self.migration_snapshot()
})?;
result.applied.extend(extra.applied);
result.failed = extra.failed;
if result.snapshot.is_none() { result.snapshot = extra.snapshot; }
if result.failed.is_none() {
crate::schema_check::repair_missing_defaults(&other_db, root, manifest.files.iter().find(|file| file.path == crate::schema_check::CONTRACT).map(|file| file.sha256.as_str()))?;
if let Some(p) = crate::schema_check::check_with_report(&other_db, root)?.first() {
return Err(Error::Invalid(format!("Database validation failed on {}: {}.{}: {}", other.name(), p.table, p.column, p.detail)));
}
}
}
if result.failed.is_none() {
crate::schema_check::repair_missing_defaults(db, root, manifest.files.iter().find(|file| file.path == crate::schema_check::CONTRACT).map(|file| file.sha256.as_str()))?;
let problems = crate::schema_check::check_with_report(db, root)?;
if let Some(p) = problems.first() {
return Err(Error::Invalid(format!("Database validation failed: {}.{}.{}: {} ({} problems).", p.database, p.table, p.column, p.detail, problems.len())));
}
}
crate::backup::with_database(self.root, |db| {
let identities = database_identities(db)?;
let result = migrate_databases(db, self.root, manifest, staged, &|| self.migration_snapshot())?;
if result.failed.is_none() { verify_database_identities(db, &identities)?; }
Ok(result)
})
}
@@ -1194,23 +1057,24 @@ impl Env for RepackEnv<'_> {
impl RepackEnv<'_> {
fn validate_server(&self, check_schema: bool) -> Result<()> {
let stopped = crate::driver::run(self.root, crate::driver::Verb::StopAll)?;
if !stopped.ok { return Err(Error::Invalid("Could not stop the server before isolated validation.".into())); }
crate::mysql_snapshot::stop(self.root)?;
self.ensure_stopped()?;
self.recover_validation()?;
let result = (|| -> Result<()> {
crate::update_isolation::begin(self.root, self.meta_dir)?;
use crate::process::{observe, ServiceState};
if check_schema { crate::backup::with_database(self.root, |db| {
let mut modes = vec![crate::realms::Mode::Coa];
if crate::realms::state(self.root)?.wildcard_created { modes.push(crate::realms::Mode::Wildcard); }
for mode in modes {
if let Some(p) = crate::schema_check::check_with_report(&db.clone().for_realm(mode), self.root)?.first() {
return Err(Error::Invalid(format!("Database validation failed on {}: {}.{}: {}", mode.name(), p.database, p.table, p.detail)));
let identities = crate::backup::with_database(self.root, |db| {
if check_schema {
let mut modes = vec![crate::realms::Mode::Coa];
if crate::realms::state(self.root)?.wildcard_created { modes.push(crate::realms::Mode::Wildcard); }
for mode in modes {
if let Some(p) = crate::schema_check::check_with_report(&db.clone().for_realm(mode), self.root)?.first() {
return Err(Error::Invalid(format!("Database validation failed on {}: {}.{}: {}", mode.name(), p.database, p.table, p.detail)));
}
}
}
Ok(())
})?; }
database_identities(db)
})?;
// The check start is the first start of the new build: give the module configs the settings the update added
// (as a normal start does), or the server logs a "missing property" line for every one of them.
match crate::registry::MetaDir::open(self.meta_dir) {
@@ -1248,6 +1112,7 @@ impl RepackEnv<'_> {
}
};
if healthy {
crate::backup::with_database(self.root, |db| verify_database_identities(db, &identities))?;
return Ok(());
}
let cause = crate::driver::startup_failure(self.root, &started);
@@ -1255,10 +1120,7 @@ impl RepackEnv<'_> {
let _ = crate::driver::run(self.root, crate::driver::Verb::StopAll);
Err(Error::Invalid(cause))
})();
let stopped = crate::driver::run(self.root, crate::driver::Verb::StopAll)?;
if !stopped.ok {
return Err(Error::Invalid("Isolated validation could not stop the server; recovery configurations were preserved.".into()));
}
crate::mysql_snapshot::stop(self.root)?;
self.ensure_stopped()?;
self.recover_validation()?;
result
@@ -1266,6 +1128,40 @@ impl RepackEnv<'_> {
}
/// One migration pass for both realms, with shared history checks and one recovery point.
fn migrate_databases(db: &crate::db::Db, root: &Path, manifest: &Manifest, staged: &Path, snapshot: &dyn Fn() -> Result<String>) -> Result<ApplyReport> {
let realms = crate::realms::state(root)?;
let mut modes = vec![realms.active];
if realms.wildcard_created {
modes.push(if realms.active == crate::realms::Mode::Coa { crate::realms::Mode::Wildcard } else { crate::realms::Mode::Coa });
}
// Reject a broken history in either realm before changing the first one.
for (index, mode) in modes.iter().enumerate() {
let list: Vec<_> = manifest.migrations.iter().filter(|m| index == 0 || !crate::migrations::shared_auth(&m.db)).cloned().collect();
crate::migrations::preflight(&db.clone().for_realm(*mode), &list)?;
}
let contract = manifest.files.iter().find(|file| file.path == crate::schema_check::CONTRACT).map(|file| file.sha256.as_str());
let mut result = ApplyReport { applied: vec![], failed: None, snapshot: None };
if contract.is_some() { result.snapshot = Some(snapshot()?); }
for (index, mode) in modes.into_iter().enumerate() {
let db = db.clone().for_realm(mode);
let list: Vec<_> = manifest.migrations.iter().filter(|m| index == 0 || !crate::migrations::shared_auth(&m.db)).cloned().collect();
crate::schema_check::repair_missing_defaults(&db, root, contract)?;
let extra = crate::migrations::apply_pending(&db, &list, staged, &|| {
if let Some(id) = &result.snapshot { Ok(id.clone()) } else { snapshot() }
})?;
result.applied.extend(extra.applied);
result.failed = extra.failed;
if result.snapshot.is_none() { result.snapshot = extra.snapshot; }
if result.failed.is_some() { return Ok(result); }
crate::schema_check::repair_missing_defaults(&db, root, contract)?;
if let Some(p) = crate::schema_check::check_with_report(&db, root)?.first() {
return Err(Error::Invalid(format!("Database validation failed on {}: {}.{}: {}", mode.name(), p.table, p.column, p.detail)));
}
}
Ok(result)
}
fn database_identities(db: &crate::db::Db) -> Result<BTreeMap<String, std::collections::BTreeSet<String>>> {
let db = db.clone().for_realm(crate::realms::Mode::Coa);
let mut identities = BTreeMap::new();
@@ -1285,7 +1181,7 @@ fn verify_database_identities(db: &crate::db::Db, before: &BTreeMap<String, std:
let after = database_identities(db)?;
for (schema, expected) in before {
if after.get(schema).is_none_or(|actual| !expected.is_subset(actual)) {
return Err(Error::Invalid(format!("The private update changed or removed existing character or account identities in {schema}.")));
return Err(Error::Invalid(format!("The update changed or removed existing character or account identities in {schema}.")));
}
}
Ok(())
@@ -1313,19 +1209,15 @@ mod tests {
migrate_fail: Cell<bool>,
preflight_fail: Cell<bool>,
restore_fail: Cell<bool>,
rehearsal_fail: Cell<bool>,
}
impl Fake {
fn ok() -> Fake {
Fake { activation_expected: RefCell::new(None), activation_failed: Cell::new(false), activated: Cell::new(false), automatic_rollback: Cell::new(false), recovery_healthy: Cell::new(true), stopped: Cell::new(true), healthy: Cell::new(true), snapshot_ok: Cell::new(true), calls: Default::default(), migrate_fail: Cell::new(false), preflight_fail: Cell::new(false), restore_fail: Cell::new(false), rehearsal_fail: Cell::new(false) }
Fake { activation_expected: RefCell::new(None), activation_failed: Cell::new(false), activated: Cell::new(false), automatic_rollback: Cell::new(false), recovery_healthy: Cell::new(true), stopped: Cell::new(true), healthy: Cell::new(true), snapshot_ok: Cell::new(true), calls: Default::default(), migrate_fail: Cell::new(false), preflight_fail: Cell::new(false), restore_fail: Cell::new(false) }
}
}
impl Env for Fake {
fn rehearse(&self, _: &Manifest, _: &Path, _: &[PlanItem], _: &str) -> Result<()> {
if self.rehearsal_fail.get() { Err(Error::Invalid("SQL failed in the private copy".into())) } else { Ok(()) }
}
fn activate(&self) -> Result<()> {
if let Some((meta, version)) = self.activation_expected.borrow().as_ref() {
ensure_recovered(meta)?;
@@ -1584,6 +1476,8 @@ mod tests {
let (_, mut meta) = MetaDir::open(&w.meta).unwrap();
meta.original_hashes.insert("Scripts/manage.py".into(), fsx::sha256_bytes(integrated.as_bytes()));
fsx::atomic_write_json(&w.meta.join("install.json"), &meta).unwrap();
let original = fetch_manifest(&Source::Dir(w.pkg.clone()), &w.key).unwrap().0;
for part in &original.archive.as_ref().unwrap().parts { fs::remove_file(w.pkg.join(&part.name)).unwrap(); }
let p = preview(&w.root, &meta, &Source::Dir(w.pkg.clone()), &w.key, &BTreeMap::new()).unwrap();
assert_eq!(p.items.iter().find(|item| item.path == "Scripts/manage.py").unwrap().action, Action::Skip);
let manifest = fetch_manifest(&Source::Dir(w.pkg.clone()), &w.key).unwrap().0;
@@ -1591,7 +1485,7 @@ mod tests {
assert_eq!(applied_plan.iter().find(|item| item.path == "Scripts/manage.py").unwrap().action, Action::Skip);
let mut changed = fetch_manifest(&Source::Dir(w.pkg.clone()), &w.key).unwrap().0;
changed.files.iter_mut().find(|file| file.path == "Scripts/manage.py").unwrap().sha256 = fsx::sha256_bytes(b"new launcher");
assert!(launcher_already_integrated(&w.root, &w.meta, &meta, &changed, &Source::Dir(w.pkg.clone())).is_err());
assert!(!launcher_already_integrated(&w.root, &meta, &changed).unwrap());
write(&w.root, "Scripts/manage.py", format!("{integrated}\n# user edit\n").as_bytes());
// Same version: the owner's edit is not an update (Repair lists and restores it).
let p = preview(&w.root, &meta, &Source::Dir(w.pkg.clone()), &w.key, &BTreeMap::new()).unwrap();
@@ -1738,7 +1632,7 @@ mod tests {
}
#[test]
fn incompatible_source_or_platform_is_rejected_without_touching_installation() {
fn unlisted_source_is_allowed_but_unknown_versions_and_other_platforms_are_rejected() {
let w = world(&[], false);
let (_, meta) = MetaDir::open(&w.meta).unwrap();
let mut manifest = Manifest::parse(&fs::read(w.pkg.join("manifest.json")).unwrap()).unwrap();
@@ -1751,7 +1645,12 @@ mod tests {
manifest.validate().unwrap();
validate_candidate(&meta, &manifest).unwrap();
manifest.compatibility.as_mut().unwrap().source_versions = vec!["0.9.0".into()];
assert!(validate_candidate(&meta, &manifest).unwrap_err().to_string().contains("compatibility matrix"));
validate_candidate(&meta, &manifest).unwrap();
let mut unknown = meta.clone();
unknown.core.version = None;
assert!(validate_candidate(&unknown, &manifest).unwrap_err().to_string().contains("unknown"));
unknown.core.version = Some("unverified-repack".into());
assert!(validate_candidate(&unknown, &manifest).is_err());
let mut already_updated = meta.clone();
already_updated.core.version = Some(manifest.version.clone());
validate_candidate(&already_updated, &manifest).unwrap();
@@ -2072,20 +1971,17 @@ mod tests {
}
#[test]
fn failed_rehearsal_preserves_installed_files_version_and_recovery_point() {
fn update_saves_recovery_then_migrates_and_validates_once() {
let w = world(&[], true);
let env = Fake::ok();
env.rehearsal_fail.set(true);
let original = fsx::sha256_file(&w.meta.join("install.json")).unwrap();
let error = run(&w, &env, BTreeMap::new(), None).unwrap_err();
assert!(error.to_string().contains("installed server was not updated"));
assert_eq!(read(&w, "Core/worldserver.exe"), b"world-v1");
assert_eq!(fsx::sha256_file(&w.meta.join("install.json")).unwrap(), original);
assert_eq!(&*env.calls.borrow(), &["stop", "snapshot"]);
assert!(pending_checked(&w.meta).unwrap().is_none());
let journal = journals(&w.meta).unwrap().remove(0);
assert_eq!(journal.recovery_point.as_deref(), Some("rp-1"));
assert!(!journal.databases_started && journal.ops.is_empty());
let result = run(&w, &env, BTreeMap::new(), None).unwrap();
assert_eq!(result.txn.state, State::Committed);
let calls = env.calls.borrow();
assert_eq!(calls.iter().filter(|call| **call == "snapshot").count(), 1);
assert_eq!(calls.iter().filter(|call| **call == "migrate").count(), 1);
assert_eq!(calls.iter().filter(|call| **call == "validate").count(), 1);
assert!(calls.iter().position(|call| *call == "snapshot") < calls.iter().position(|call| *call == "migrate"));
assert!(!w.meta.join("rehearsals").exists());
}
#[test]
+50 -137
View File
@@ -1,12 +1,9 @@
use std::collections::BTreeSet;
use crate::{fsx, manifest::Manifest, pkgsource::{self, Source}, registry::InstallMeta, update, Error, Result};
const RELEASES: &str = "https://github.com/Corfirean/coa-server-build/releases/download/server-";
use crate::{manifest::Manifest, pkgsource::{self, Source}, registry::InstallMeta, update, Result};
#[derive(Debug)]
pub struct Selection {
pub source: Source,
// Retained for the frontend response shape; direct updates never offer a bridge.
pub latest_version: Option<String>,
}
@@ -16,48 +13,8 @@ pub fn select(meta: &InstallMeta, source: Source, key: &str) -> Result<Selection
fn select_with(meta: &InstallMeta, source: Source, fetch: &mut impl FnMut(&Source) -> Result<(Manifest, Vec<u8>)>) -> Result<Selection> {
let (manifest, _) = fetch(&source)?;
if update::validate_candidate(meta, &manifest).is_ok() {
return Ok(Selection { source, latest_version: None });
}
let original = update::validate_candidate(meta, &manifest).unwrap_err();
if !matches!(&source, Source::Url(url) if url.trim_end_matches('/') == format!("{RELEASES}{}", manifest.version)) {
return Err(original);
}
let Some(installed) = meta.core.version.as_deref().and_then(crate::manifest::parse_version) else { return Err(original); };
if manifest.kind != crate::manifest::Kind::Update
|| manifest.compatibility.as_ref().is_none_or(|c| c.platform != if cfg!(windows) { "windows-x86_64" } else { "linux-x86_64" })
|| !manifest.compatible_with_manager(crate::MANAGER_VERSION)
|| crate::manifest::parse_version(&manifest.version).is_none_or(|version| version <= installed) {
return Err(original);
}
let mut visited = BTreeSet::new();
let Some(source) = find(meta, &manifest, fetch, &mut visited, 0)? else { return Err(original); };
Ok(Selection { source, latest_version: Some(manifest.version) })
}
fn find(meta: &InstallMeta, manifest: &Manifest, fetch: &mut impl FnMut(&Source) -> Result<(Manifest, Vec<u8>)>, visited: &mut BTreeSet<String>, depth: usize) -> Result<Option<Source>> {
if depth >= 8 || visited.len() >= 32 { return Ok(None); }
let Some(compatibility) = &manifest.compatibility else { return Ok(None); };
let Some(installed) = meta.core.version.as_deref().and_then(crate::manifest::parse_version) else { return Ok(None); };
let target = crate::manifest::parse_version(&manifest.version).unwrap();
let mut versions: Vec<_> = compatibility.source_versions.iter().filter_map(|version| {
crate::manifest::parse_version(version).filter(|number| *number > installed && *number < target).map(|number| (number, version))
}).collect();
versions.sort_by(|left, right| right.0.cmp(&left.0));
for (_, version) in versions {
let Some(database) = compatibility.source_databases.get(version) else { continue; };
if !visited.insert(version.clone()) || visited.len() > 32 { continue; }
let source = Source::Url(format!("{RELEASES}{version}"));
let (bridge, bytes) = fetch(&source)?;
if bridge.version != *version || fsx::sha256_bytes(&bytes) != database.manifest_sha256 {
return Err(Error::InvalidManifest("The intermediate update differs from the signed compatibility matrix.".into()));
}
if update::validate_candidate(meta, &bridge).is_ok() { return Ok(Some(source)); }
if bridge.kind != crate::manifest::Kind::Update || !bridge.compatible_with_manager(crate::MANAGER_VERSION)
|| bridge.compatibility.as_ref().is_none_or(|c| c.platform != compatibility.platform) { continue; }
if let Some(source) = find(meta, &bridge, fetch, visited, depth + 1)? { return Ok(Some(source)); }
}
Ok(None)
update::validate_candidate(meta, &manifest)?;
Ok(Selection { source, latest_version: None })
}
#[cfg(test)]
@@ -67,12 +24,12 @@ mod tests {
use ed25519_dalek::{Signer, SigningKey};
use std::{fs, path::Path};
fn package(version: &str, from: &str, digest: &str) -> serde_json::Value {
serde_json::json!({"schema":1,"kind":"update","version":version,"core":{"commit":"a".repeat(40)},
fn package() -> serde_json::Value {
serde_json::json!({"schema":1,"kind":"update","version":"0.261015.58","core":{"commit":"a".repeat(40)},
"builtAt":"test","minManagerVersion":"0.6.16","files":[],"migrations":[],"archive":null,
"compatibility":{"schema":1,"platform":if cfg!(windows) {"windows-x86_64"} else {"linux-x86_64"},
"coreCommit":"a".repeat(40),"moduleCommits":{"squid":"b".repeat(40)},"clientPatchVersion":"1.7",
"sourceVersions":[from],"sourceDatabases":{from:{"manifestSha256":digest,"schemaSha256":null}}}})
"sourceVersions":["0.261013.54"],"sourceDatabases":{"0.261013.54":{"manifestSha256":"c".repeat(64),"schemaSha256":null}}}})
}
fn meta(version: &str) -> InstallMeta {
@@ -81,100 +38,56 @@ mod tests {
meta
}
fn signed_fixture(values: &[serde_json::Value], tamper: Option<&str>) -> (tempfile::TempDir, String) {
fn fixture(value: &serde_json::Value, tamper: bool) -> (tempfile::TempDir, String) {
let folder = tempfile::tempdir().unwrap();
let signing = SigningKey::from_bytes(&[37; 32]);
for value in values {
let version = value["version"].as_str().unwrap();
let dir = folder.path().join(version);
fs::create_dir(&dir).unwrap();
let bytes = serde_json::to_vec(value).unwrap();
fs::write(dir.join("manifest.json.sig"), STANDARD.encode(signing.sign(&bytes).to_bytes())).unwrap();
fs::write(dir.join("manifest.json"), &bytes).unwrap();
if tamper == Some(version) { fs::write(dir.join("manifest.json"), b"tampered").unwrap(); }
}
let bytes = serde_json::to_vec(value).unwrap();
fs::write(folder.path().join("manifest.json.sig"), STANDARD.encode(signing.sign(&bytes).to_bytes())).unwrap();
fs::write(folder.path().join("manifest.json"), if tamper { b"tampered".as_slice() } else { &bytes }).unwrap();
(folder, STANDARD.encode(signing.verifying_key().to_bytes()))
}
fn select_fixture(values: &[serde_json::Value], installed: &str, tamper: Option<&str>) -> Result<Selection> {
let (folder, key) = signed_fixture(values, tamper);
let latest = values.last().unwrap()["version"].as_str().unwrap();
select_with(&meta(installed), Source::Url(format!("{RELEASES}{latest}")), &mut |source| {
let Source::Url(url) = source else { unreachable!() };
let version = url.strip_prefix(RELEASES).unwrap();
pkgsource::fetch_manifest(&Source::Dir(folder.path().join(version)), &key)
})
}
fn pair() -> Vec<serde_json::Value> {
let bridge = package("1.1.0", "1.0.0", &"c".repeat(64));
let digest = fsx::sha256_bytes(&serde_json::to_vec(&bridge).unwrap());
vec![bridge, package("1.2.0", "1.1.0", &digest)]
}
#[test]
fn finds_a_signed_intermediate_without_relaxing_candidate_validation() {
let selection = select_fixture(&pair(), "1.0.0", None).unwrap();
assert!(matches!(selection.source, Source::Url(url) if url.ends_with("1.1.0")));
assert_eq!(selection.latest_version.as_deref(), Some("1.2.0"));
let latest = Manifest::parse(&serde_json::to_vec(pair().last().unwrap()).unwrap()).unwrap();
assert!(update::validate_candidate(&meta("1.0.0"), &latest).is_err());
}
#[test]
fn direct_updates_and_current_versions_do_not_request_an_intermediate() {
for installed in ["1.1.0", "1.2.0"] {
let selection = select_fixture(&pair(), installed, None).unwrap();
assert!(selection.latest_version.is_none());
}
}
#[test]
fn rejects_tampered_or_replaced_intermediate_manifests() {
assert!(select_fixture(&pair(), "1.0.0", Some("1.1.0")).is_err());
let mut values = pair();
values[0]["builtAt"] = "replaced".into();
assert!(select_fixture(&values, "1.0.0", None).unwrap_err().to_string().contains("differs"));
}
#[test]
fn follows_multiple_tested_edges_and_rejects_missing_paths() {
let mut values = pair();
let digest = fsx::sha256_bytes(&serde_json::to_vec(values.last().unwrap()).unwrap());
values.push(package("1.3.0", "1.2.0", &digest));
let selection = select_fixture(&values, "1.0.0", None).unwrap();
assert!(matches!(selection.source, Source::Url(url) if url.ends_with("1.1.0")));
assert!(select_fixture(&values, "0.9.0", None).is_err());
assert!(select_fixture(&values, "2.0.0", None).is_err());
}
#[test]
fn never_routes_custom_sources_or_unknown_installations() {
let values = pair();
let (folder, key) = signed_fixture(&values, None);
let mut calls = 0;
let result = select_with(&meta("1.0.0"), Source::Dir(folder.path().join("1.2.0")), &mut |source| {
calls += 1;
pkgsource::fetch_manifest(source, &key)
});
assert!(result.is_err());
assert_eq!(calls, 1);
assert!(select_fixture(&values, "unknown", None).is_err());
}
#[test]
fn rejects_incompatible_platforms_and_manager_versions() {
for index in [0, 1] {
for (field, value) in [("minManagerVersion", "99.0.0"), ("platform", "other-platform")] {
let mut values = pair();
if field == "platform" { values[index]["compatibility"][field] = value.into(); }
else { values[index][field] = value.into(); }
if index == 0 {
let digest = fsx::sha256_bytes(&serde_json::to_vec(&values[0]).unwrap());
values[1]["compatibility"]["sourceDatabases"]["1.1.0"]["manifestSha256"] = digest.into();
}
assert!(select_fixture(&values, "1.0.0", None).is_err());
fn every_known_older_version_selects_the_latest_signed_package_once() {
for installed in ["0.2.0", "0.261004.20", "0.261005.0", "0.261007.24", "0.261011.800006", "0.261013.54", "0.261015.58"] {
let (folder, key) = fixture(&package(), false);
for kind in [crate::registry::InstallKind::New, crate::registry::InstallKind::Imported] {
let mut installation = meta(installed);
installation.kind = kind;
let mut calls = 0;
let selected = select_with(&installation, Source::Dir(folder.path().into()), &mut |source| {
calls += 1;
pkgsource::fetch_manifest(source, &key)
}).unwrap();
assert!(matches!(selected.source, Source::Dir(path) if path == folder.path()));
assert!(selected.latest_version.is_none());
assert_eq!(calls, 1, "no intermediate package fetches for {installed}");
}
}
}
#[test]
fn unknown_versions_and_downgrades_remain_blocked() {
let (folder, key) = fixture(&package(), false);
for installed in ["unknown", "a65be06ec62f4", "0.261016.59"] {
assert!(select(&meta(installed), Source::Dir(folder.path().into()), &key).is_err());
}
}
#[test]
fn signed_target_is_required_even_for_unlisted_old_versions() {
let (folder, key) = fixture(&package(), true);
assert!(select(&meta("0.261004.20"), Source::Dir(folder.path().into()), &key).is_err());
}
#[test]
fn platform_and_manager_requirements_are_still_enforced() {
for (field, value) in [("minManagerVersion", "99.0.0"), ("platform", "other-platform")] {
let mut target = package();
if field == "platform" { target["compatibility"][field] = value.into(); }
else { target[field] = value.into(); }
let (folder, key) = fixture(&target, false);
assert!(select(&meta("0.261004.20"), Source::Dir(folder.path().into()), &key).is_err());
}
}
}
+19
View File
@@ -0,0 +1,19 @@
# Update workflow
The Manager selects the latest signed package directly for any known older server version. The source-version list records release qualification; it is not an exclusive allowlist and does not prove that a particular installed database can apply the package. Unknown imported versions, downgrades, incompatible platforms and newer Manager requirements remain blocked.
The updater verifies the signed manifest and archive, checks file changes and database history, stops the server, and saves one complete recovery point. It then replaces files, applies pending SQL once, verifies the target schema and starts the updated server once for validation. Shared authentication migrations run once; both realm histories are checked before changing either. Account and character identities are compared before and after migration and startup.
Account migration history is stored in the shared account database. Read-only checks recognize legacy auth records from both realms. Write operations adopt existing records and preserve already-applied core history; unknown legacy checksums stay unknown. History is read in two batched client calls, with explicit physical schemas and consistent text collations. Use the current Manager for subsequent database operations.
Applied migrations are skipped; changed checksums and interrupted/failed records stop the update. Duplicate SQL identifiers for the same schema are rejected before execution. SQL or startup failure restores files and databases together. If recovery fails, startup remains blocked and the recovery artifacts remain available.
The per-update nested server rehearsal and intermediate-package routing have been removed. Full-copy upgrade/startup testing belongs to release qualification, on independent disposable installations. Cleanup of interrupted rehearsals from older Manager versions remains for compatibility. Signed packages, recovery verification, configuration merge and startup validation stay enabled. No migration guard is bypassed and no unexecuted SQL is marked applied. Retired source archives do not prevent a direct update, but the database history must still be consistent and target checks must pass.
## Verify with an actual installation copy
`cargo run -p coa-core --example upgrade_fixture -- <copy-root> <signed-package-directory>` exercises the production updater, including recovery copies and startup. It refuses mutation unless the directory name starts with `coa-schema-fixture-real` and contains `.coa-update-fixture`. Prepare a disposable copy from a verified recovery point, with separate ports, metadata and no client path. Never point it at a working installation.
`migration_plan <copy-root> <signed-manifest>` reads database history without creating a migration ledger. On a separate marked `update-database-diagnosis-*` copy, `--apply <migration-directory>` exercises the production database phase. `--sql-only <migration-directory>` verifies and applies the signed SQL list for both realms and compares account/character identities. SQL-only success is not full package/startup qualification and does not verify the target schema contract.
Record package signatures, exact source recovery point, actual result, repeat-run behavior and unavailable stages. Do not label a route universally tested based on a version list or SQL-only success.
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "coa-server-manager",
"version": "0.6.18",
"version": "0.6.21",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "coa-server-manager",
"version": "0.6.18",
"version": "0.6.21",
"dependencies": {
"@tauri-apps/api": "^2.12.0",
"@tauri-apps/plugin-dialog": "^2.8.0",
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "coa-server-manager",
"private": true,
"version": "0.6.18",
"version": "0.6.21",
"license": "AGPL-3.0-only",
"type": "module",
"scripts": {
+1 -1
View File
@@ -1,7 +1,7 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "CoA Server Manager",
"version": "0.6.18",
"version": "0.6.21",
"identifier": "com.coa.servermanager",
"build": {
"beforeDevCommand": "npm run dev",
+1 -1
View File
@@ -430,7 +430,7 @@ const en = {
"upd.folderHint": "Update package folder (leave empty to use the official source)",
"upd.available": "Version {to} is available",
"upd.availableFrom": "Version {to} is available (you have {from})",
"upd.intermediate": "Update to {to} first, then check again to continue to {latest}. Each step uses a tested upgrade path.",
"upd.intermediate": "Update to {to} first, then check again to continue to {latest}. The package supports this version sequence; your database is checked when you update.",
"upd.summary": "Download {size} · {files} file(s) change",
"upd.summaryDb": "Download {size} · {files} file(s) change · {db} database update(s)",
"upd.conflict": "This file was modified outside CoA Server Manager.",
+1 -1
View File
@@ -412,7 +412,7 @@ const ru: Partial<Record<keyof typeof en, string>> = {
"upd.folderHint": "Папка с пакетом обновления (оставьте пустым, чтобы использовать официальный источник)",
"upd.available": "Доступна версия {to}",
"upd.availableFrom": "Доступна версия {to} (у вас {from})",
"upd.intermediate": "Сначала обновитесь до {to}, затем проверьте обновления ещё раз для перехода на {latest}. Каждый этап использует проверенный путь обновления.",
"upd.intermediate": "Сначала обновитесь до {to}, затем проверьте обновления ещё раз для перехода на {latest}. Пакет поддерживает эту последовательность версий; состояние вашей базы проверяется при обновлении.",
"upd.summary": "Загрузка {size} · изменится файлов: {files}",
"upd.summaryDb": "Загрузка {size} · изменится файлов: {files} · обновлений базы данных: {db}",
"upd.conflict": "Этот файл был изменён вне CoA Server Manager.",
+5
View File
@@ -50,6 +50,11 @@ add(scaling + "LFG.AllowPartialGroups", "bool", ["Enter with the current party",
add(scaling + "World.Leech.Enable", "bool", ["Open-world life steal", "Отхил от урона в открытом мире", "Lebensraub in der offenen Welt", "Vol de vie en monde ouvert", "Robo de vida en mundo abierto", "开放世界吸血"], ["Heal from your damage to open-world creatures. Excludes players, their pets and instances. Requires the module; group scaling and solo assistance are optional.", "Восстанавливает здоровье от вашего урона существам открытого мира. Исключает игроков, их питомцев и инстансы. Требует включения модуля; скейлинг группы и соло-помощь необязательны.", "Heilt durch eigenen Schaden an Weltkreaturen. Ohne Spieler, deren Begleiter und Instanzen. Erfordert das Modul; Gruppenanpassung und Solohilfe sind optional.", "Soigne grâce aux dégâts aux créatures du monde ouvert. Exclut joueurs, familiers et instances. Nécessite le module ; adaptation au groupe et aide solo facultatives.", "Cura con tu daño a criaturas del mundo abierto. Excluye jugadores, mascotas e instancias. Requiere el módulo; ajuste al grupo y ayuda individual opcionales.", "对开放世界生物造成伤害时恢复生命。不适用于玩家、玩家宠物和副本。需要启用模块,队伍缩放和单人辅助可选。"]);
add(scaling + "World.Leech.Percent", "float", ["Life steal (%)", "Отхил от нанесённого урона (%)", "Lebensraub (%)", "Vol de vie (%)", "Robo de vida (%)", "吸血比例(%)"], ["Percentage of damage returned as health: 0–100. 10 means 10%. Requires open-world life steal. Overkill gives no extra healing.", "Процент урона, возвращаемый здоровьем: 0–100. Значение 10 означает 10%. Требует включения отхила в открытом мире. Избыточный урон при добивании не увеличивает отхил.", "Schadensanteil als Heilung: 0–100. 10 bedeutet 10%. Erfordert Welt-Lebensraub. Überzähliger Schaden heilt nicht zusätzlich.", "Pourcentage des dégâts rendu en vie : 0–100. 10 signifie 10%. Nécessite le vol de vie. Les dégâts excédentaires ne soignent pas davantage.", "Porcentaje del daño recuperado como salud: 0–100. 10 significa 10%. Requiere robo de vida. El daño excedente no aporta curación adicional.", "将伤害的0至100%转化为生命。10表示10%。需要启用吸血。过量伤害不会额外治疗。"], { min: 0, max: 100 });
add(scaling + "Difficulty.DamageMultiplier", "range", ["Enemy damage", "Урон противников", "Gegnerschaden", "Dégâts ennemis", "Daño enemigo", "敌人伤害"], ["Dungeon and raid damage after group scaling and solo assistance. 100% keeps the normal balance; lower is easier. Applies to everyone on this server. Does not change health, loot or instant-kill mechanics.", "Урон в подземельях и рейдах после скейлинга группы и соло-помощи. 100% — обычный баланс, ниже — легче. Действует для всех игроков сервера. Не меняет здоровье, добычу и механики мгновенной смерти.", "Schaden in Dungeons und Schlachtzügen nach Gruppenanpassung und Solohilfe. 100% ist normal, weniger ist leichter. Gilt für alle Spieler. Ändert weder Gesundheit noch Beute oder Soforttötungen.", "Dégâts en donjon et raid après adaptation au groupe et aide solo. 100% conserve l’équilibrage normal ; moins est plus facile. Pour tous les joueurs. Ne change ni la vie, ni le butin, ni les morts instantanées.", "Daño en mazmorras y bandas tras el ajuste del grupo y la ayuda individual. 100% mantiene el equilibrio normal; menos es más fácil. Para todos los jugadores. No cambia salud, botín ni muerte instantánea.", "队伍缩放和单人辅助后的地下城与团队副本伤害。100%为正常,降低后更容易。对全服玩家生效,不改变生命值、掉落或即死机制。"], { min: 0.25, max: 2 });
add(scaling + "Difficulty.Health.WorldMultiplier", "float", ["Mob health in the open world (×)", "Здоровье мобов в открытом мире (×)", "Mob-Gesundheit in der offenen Welt (×)", "Vie des monstres en monde ouvert (×)", "Vida de los monstruos en el mundo abierto (×)", "野外怪物生命值(×)"], ["Multiplies the health of scaled creatures in the open world, on top of the scaling and the world health setting of the server. 1 keeps the normal balance; lower is easier. Creatures already in the world change when they respawn.", "Умножает здоровье подстроенных существ в открытом мире поверх скейлинга и настройки здоровья мира. 1 — обычный баланс, меньше — легче. Существа, уже стоящие в мире, меняются после возрождения.", "Multipliziert die Gesundheit skalierter Kreaturen in der offenen Welt zusätzlich zur Skalierung und zur Welt-Gesundheitseinstellung. 1 ist normal, weniger ist leichter. Bereits vorhandene Kreaturen ändern sich nach dem Respawn.", "Multiplie la vie des créatures adaptées en monde ouvert, en plus de l’adaptation et du réglage de vie du monde. 1 conserve l’équilibrage normal ; moins est plus facile. Les créatures déjà présentes changent après réapparition.", "Multiplica la vida de las criaturas ajustadas en el mundo abierto, además del ajuste y la vida configurada del mundo. 1 mantiene el equilibrio normal; menos es más fácil. Las criaturas ya presentes cambian al reaparecer.", "在缩放和服务器世界生命值设置之上,倍乘野外已缩放生物的生命值。1为正常,降低后更容易。已存在的生物在重生后生效。"], { min: 0.1, max: 10 });
add(scaling + "Difficulty.Health.DungeonMultiplier", "float", ["Mob health in dungeons (×)", "Здоровье мобов в подземельях (×)", "Mob-Gesundheit in Dungeons (×)", "Vie des monstres en donjon (×)", "Vida de los monstruos en mazmorras (×)", "地下城怪物生命值(×)"], ["Multiplies the health of scaled creatures in dungeons, on top of the scaling and the dungeon health setting of the server. 1 keeps the normal balance; lower is easier. Applies to new dungeon runs.", "Умножает здоровье подстроенных существ в подземельях поверх скейлинга и настройки здоровья подземелий. 1 — обычный баланс, меньше — легче. Действует на новые заходы.", "Multipliziert die Gesundheit skalierter Kreaturen in Dungeons zusätzlich zur Skalierung und zur Dungeon-Gesundheitseinstellung. 1 ist normal, weniger ist leichter. Gilt für neue Dungeon-Läufe.", "Multiplie la vie des créatures adaptées en donjon, en plus de l’adaptation et du réglage de vie des donjons. 1 conserve l’équilibrage normal ; moins est plus facile. S’applique aux nouvelles instances.", "Multiplica la vida de las criaturas ajustadas en mazmorras, además del ajuste y la vida configurada de mazmorras. 1 mantiene el equilibrio normal; menos es más fácil. Se aplica a nuevas instancias.", "在缩放和服务器地下城生命值设置之上,倍乘地下城内已缩放生物的生命值。1为正常,降低后更容易。对新的副本生效。"], { min: 0.1, max: 10 });
add(scaling + "Difficulty.Health.RaidMultiplier", "float", ["Mob health in raids (×)", "Здоровье мобов в рейдах (×)", "Mob-Gesundheit in Schlachtzügen (×)", "Vie des monstres en raid (×)", "Vida de los monstruos en bandas (×)", "团队副本怪物生命值(×)"], ["Multiplies the health of scaled creatures in raids, on top of the scaling and the raid health setting of the server. 1 keeps the normal balance; lower is easier. A boss with a calibrated health value keeps it.", "Умножает здоровье подстроенных существ в рейдах поверх скейлинга и настройки здоровья рейдов. 1 — обычный баланс, меньше — легче. Босс с откалиброванным здоровьем сохраняет его.", "Multipliziert die Gesundheit skalierter Kreaturen in Schlachtzügen zusätzlich zur Skalierung und zur Schlachtzug-Gesundheitseinstellung. 1 ist normal, weniger ist leichter. Ein Boss mit kalibriertem Wert behält ihn.", "Multiplie la vie des créatures adaptées en raid, en plus de l’adaptation et du réglage de vie des raids. 1 conserve l’équilibrage normal ; moins est plus facile. Un boss à vie calibrée la conserve.", "Multiplica la vida de las criaturas ajustadas en bandas, además del ajuste y la vida configurada de bandas. 1 mantiene el equilibrio normal; menos es más fácil. Un jefe con vida calibrada la conserva.", "在缩放和服务器团队副本生命值设置之上,倍乘团队副本内已缩放生物的生命值。1为正常,降低后更容易。有校准生命值的首领保持原值。"], { min: 0.1, max: 10 });
add(scaling + "Difficulty.Health.TrashMultiplier", "float", ["Ordinary mob health (×)", "Здоровье обычных мобов (×)", "Gesundheit gewöhnlicher Mobs (×)", "Vie des monstres ordinaires (×)", "Vida de monstruos normales (×)", "普通怪物生命值(×)"], ["Multiplies the health of ordinary creatures everywhere, together with the place setting. 1 keeps the normal balance; lower is easier.", "Умножает здоровье обычных существ везде, вместе с настройкой места. 1 — обычный баланс, меньше — легче.", "Multipliziert die Gesundheit gewöhnlicher Kreaturen überall, zusammen mit der Ortseinstellung. 1 ist normal, weniger ist leichter.", "Multiplie la vie des créatures ordinaires partout, avec le réglage du lieu. 1 conserve l’équilibrage normal ; moins est plus facile.", "Multiplica la vida de las criaturas normales en todas partes, junto con el ajuste del lugar. 1 mantiene el equilibrio normal; menos es más fácil.", "与所在区域设置一起,倍乘各处普通生物的生命值。1为正常,降低后更容易。"], { min: 0.1, max: 10 });
add(scaling + "Difficulty.Health.BossMultiplier", "float", ["Boss health (×)", "Здоровье боссов (×)", "Boss-Gesundheit (×)", "Vie des boss (×)", "Vida de los jefes (×)", "首领生命值(×)"], ["Multiplies the health of bosses everywhere, together with the place setting: a dungeon boss gets the dungeon and the boss multiplier. 1 keeps the normal balance; lower is easier.", "Умножает здоровье боссов везде, вместе с настройкой места: босс подземелья получает множитель подземелья и боссов. 1 — обычный баланс, меньше — легче.", "Multipliziert die Gesundheit von Bossen überall, zusammen mit der Ortseinstellung: ein Dungeon-Boss erhält den Dungeon- und den Boss-Multiplikator. 1 ist normal, weniger ist leichter.", "Multiplie la vie des boss partout, avec le réglage du lieu : un boss de donjon reçoit le multiplicateur du donjon et celui des boss. 1 conserve l’équilibrage normal ; moins est plus facile.", "Multiplica la vida de los jefes en todas partes, junto con el ajuste del lugar: un jefe de mazmorra recibe el multiplicador de mazmorra y el de jefes. 1 mantiene el equilibrio normal; menos es más fácil.", "与所在区域设置一起,倍乘各处首领的生命值:地下城首领同时受地下城和首领倍率影响。1为正常,降低后更容易。"], { min: 0.1, max: 10 });
add(scaling + "SoloAssist.Mode", "enum", ["Solo assistance", "Помощь в соло", "Solohilfe", "Aide solo", "Ayuda individual", "单人辅助"], ["Additional damage reduction when the scaling target is one player.", "Дополнительное снижение урона, когда расчёт сложности рассчитан на одного игрока.", "Zusätzliche Schadensreduktion bei einem Skalierungsziel von einem Spieler.", "Réduction supplémentaire quand la difficulté est calculée pour un joueur.", "Reducción adicional cuando la dificultad se calcula para un jugador.", "难度目标为一名玩家时额外减伤。"], { options: [
{ value: "None", label: ["None", "Без помощи", "Keine", "Aucune", "Ninguna", "无"] },
{ value: "Light", label: ["Light (−15%)", "Лёгкая (−15%)", "Leicht (−15%)", "Légère (−15%)", "Ligera (−15%)", "轻度(−15%)"] },
+222
View File
@@ -0,0 +1,222 @@
"""Maintain a component's own published history, using immutable release sources.
The same dependency-free script is vendored as tools/sync_history.py in Manager.
Historical corrections live in the reviewed history JSON, not in moving branches.
"""
import argparse
import base64
from concurrent.futures import ThreadPoolExecutor
import json
from pathlib import Path
import re
import subprocess
import tempfile
SERVER_AREAS = {'server', 'bots', 'scaling', 'modules', 'addon', 'client'}
MANAGER_AREAS = {'manager', 'client'}
def gh(*args):
return subprocess.check_output(['gh', *args], encoding='utf-8')
def api(path):
return json.loads(gh('api', path))
def version_key(version):
if not re.fullmatch(r'\d+(?:\.\d+)+', version):
raise ValueError('Invalid published version: ' + version)
return tuple(map(int, version.split('.')))
def eligible(release, component):
pattern = r'v(\d+(?:\.\d+)+)' if component == 'manager' else r'server-(\d+(?:\.\d+)+)'
return not release['draft'] and not release['prerelease'] and re.fullmatch(pattern, release['tag_name'])
def published(repo, component):
pages = json.loads(gh('api', '--paginate', '--slurp', f'repos/{repo}/releases?per_page=100'))
return sorted([r for page in pages for r in page if eligible(r, component)],
key=lambda r: version_key(r['tag_name'].removeprefix('server-').removeprefix('v')))
def fragment_note(text, areas):
sections = text.strip().split('---', 2)
if len(sections) != 3 or sections[0]:
raise ValueError('Invalid release fragment')
fields = dict(line.split(':', 1) for line in sections[1].splitlines() if ':' in line)
fields = {k.strip(): v.strip().strip('"\'') for k, v in fields.items()}
if fields.get('area') not in areas:
return None
if not fields.get('title'):
raise ValueError('Release fragment has no title')
if re.search(r'\b(compilation|compiler|cache|manual builds|repository owners|packaging time)\b', fields['title'], re.I):
return None
# Keep public notes player-facing. Technical refs remain in the source fragment.
title = fields['title'].rstrip('.')
return title
def remote_fragments(repo, sha, seen, areas):
if not re.fullmatch(r'[0-9a-f]{40}', sha):
raise ValueError('Changelog collection requires an immutable source SHA')
listing = api(f'repos/{repo}/contents/changelog.d?ref={sha}')
files = [f for f in listing if re.fullmatch(r'\d{8}-[a-z0-9-]+\.md', f['name'])]
new = [f for f in files if repo + ':' + f['name'] not in seen]
def read(item):
blob = api(f'repos/{repo}/git/blobs/{item["sha"]}')
return fragment_note(base64.b64decode(blob['content']).decode('utf-8'), areas)
with ThreadPoolExecutor(max_workers=6) as pool:
notes = [note for note in pool.map(read, new) if note]
return notes, [repo + ':' + f['name'] for f in files]
def collect_manager(root, tag, seen):
sha = subprocess.check_output(['git', '-C', str(root), 'rev-parse', tag + '^{commit}'], encoding='utf8').strip()
paths = subprocess.check_output(['git', '-C', str(root), 'ls-tree', '-r', '--name-only', sha, 'changelog.d'], encoding='utf8').splitlines()
paths = [p for p in paths if re.fullmatch(r'changelog.d/\d{8}-[a-z0-9-]+\.md', p)]
repo = 'Corfirean/coa-server-manager'
notes = []
for path in paths:
if repo + ':' + Path(path).name not in seen:
text = subprocess.check_output(['git', '-C', str(root), 'show', f'{sha}:{path}'], encoding='utf8')
note = fragment_note(text, MANAGER_AREAS)
if note:
notes.append(note)
return notes, [repo + ':' + Path(p).name for p in paths], {'commit': sha}
def collect_server(repo, tag, seen, previous):
with tempfile.TemporaryDirectory() as folder:
subprocess.run(['gh', 'release', 'download', tag, '--repo', repo, '--pattern', 'release-lock.json', '--dir', folder], check=True)
lock = json.loads((Path(folder) / 'release-lock.json').read_text(encoding='utf-8-sig'))
notes, ids = [], []
for role in ('core', 'bots', 'scaling', 'build'):
item = lock['components'].get(role)
if not item:
raise ValueError('Release lock has no ' + role + ' source')
if item['repository'] == 'Corfirean/coa-server-manager':
raise ValueError('A Manager source cannot supply server release notes')
entries, found = remote_fragments(item['repository'], item['sha'], seen, SERVER_AREAS)
notes.extend(entries)
ids.extend(found)
old = previous.get('components', {})
# Imported updates are explicitly updates, never attributed as our authored fixes.
for role, label in [('races', 'Custom Races'), ('squid', 'SQUID Playerbots')]:
item = lock['components'].get(role)
if item and item['sha'] != old.get(role, {}).get('sha'):
ref = item.get('ref', '')
version = re.sub(r'^(coa-custom-|v)', '', ref)
if version and not re.fullmatch(r'[0-9a-f]{40}|main|master', version):
notes.append(f'Updated {label} to {version}')
if lock['components'].get('upstream', {}).get('sha') != old.get('upstream', {}).get('sha'):
notes.append('Updated the reviewed CoA upstream snapshot')
return list(dict.fromkeys(notes)), ids, {'snapshot': lock['snapshot'], 'components': lock['components']}
def notes_md(record):
lines = [f'## {record["version"]} — {record["date"]}', '']
lines.extend('- ' + note.rstrip('.') + '.' for note in record['notes'])
label = 'Archived release record' if record.get('legacy') else 'Release'
lines += ['', f'[{label}]({record["url"]})']
if record.get('compare'):
lines[-1] += f' · [Source changes]({record["compare"]})'
return '\n'.join(lines) + '\n'
def render(history):
component = history['component']
title = 'CoA Server Manager' if component == 'manager' else 'CoA Server'
other = ('[Server changelog](https://github.com/Corfirean/coa-server-build/blob/main/CHANGELOG.md)' if component == 'manager'
else '[Manager changelog](https://github.com/Corfirean/coa-server-manager/blob/master/CHANGELOG.md)')
lines = [f'# {title} changelog', '',
('Manager releases only. Updating the Manager does not update the server.' if component == 'manager'
else 'Server packages, companions and server modules only. Manager releases have their own changelog.'),
'', other, '', 'Dates follow GitHub publication (UTC); legacy records retain their archived dates. Newest releases first.', '']
for record in sorted(history['releases'], key=lambda r: (r['date'], version_key(r['version'])), reverse=True):
lines.append(notes_md(record))
return '\n'.join(lines).rstrip() + '\n'
def validate_history(history):
expected = {'server': 'Corfirean/coa-server-build', 'manager': 'Corfirean/coa-server-manager'}
component = history.get('component')
if history.get('schema') != 1 or history.get('repository') != expected.get(component):
raise ValueError('History must belong to exactly one known component repository')
versions, tags = set(), set()
for record in history['releases']:
version_key(record['version'])
if record['version'] in versions or record['tag'] in tags:
raise ValueError('Duplicate release in component history')
versions.add(record['version']); tags.add(record['tag'])
prefix = 'v' if component == 'manager' else 'server-'
if not record.get('legacy') and record['tag'] != prefix + record['version']:
raise ValueError('Release tag belongs to a different component/version')
if not record.get('notes') or not all(isinstance(n, str) and n.strip() for n in record['notes']):
raise ValueError('Release notes must contain confirmed changes')
if component == 'server' and any(i.startswith('Corfirean/coa-server-manager:') for i in history.get('consumedFragments', [])):
raise ValueError('Server history cannot consume Manager fragments')
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--root', type=Path, default=Path.cwd())
parser.add_argument('--history', default='changelog/history.json')
parser.add_argument('--sync-release-notes', action='store_true')
parser.add_argument('--render-only', action='store_true')
args = parser.parse_args()
path = args.root / args.history
history = json.loads(path.read_text(encoding='utf8'))
validate_history(history)
component, repo = history['component'], history['repository']
if component not in ('server', 'manager'):
raise ValueError('History must belong to one component')
existing = {r['tag'] for r in history['releases']}
seen = set(history.get('consumedFragments', []))
releases = [] if args.render_only else published(repo, component)
previous = sorted(history['releases'], key=lambda r: (r['date'], version_key(r['version'])))[-1] if existing else {}
for release in releases:
tag = release['tag_name']
if tag in existing:
continue
version = tag.removeprefix('server-').removeprefix('v')
if previous and version_key(version) <= version_key(previous['version']):
raise ValueError('Historical backfill requires a reviewed history correction: ' + tag)
if component == 'manager':
notes, ids, source = collect_manager(args.root, tag, seen)
else:
notes, ids, source = collect_server(repo, tag, seen, previous)
if not notes:
notes = ['Detailed player-facing notes were not recorded; see the source changes for this release']
record = {'tag': tag, 'version': tag.removeprefix('server-').removeprefix('v'),
'date': release['published_at'][:10], 'url': release['html_url'], 'notes': notes, **source}
if previous.get('tag'):
record['compare'] = f'https://github.com/{repo}/compare/{previous["tag"]}...{tag}'
history['releases'].append(record)
seen.update(ids)
previous = record
history['consumedFragments'] = sorted(seen)
validate_history(history)
# Keep a separately reviewed history as the source of truth for historical corrections.
path.write_text(json.dumps(history, indent=2, ensure_ascii=False) + '\n', encoding='utf8', newline='\n')
(args.root / 'CHANGELOG.md').write_text(render(history), encoding='utf8', newline='\n')
if args.sync_release_notes:
actual = {r['tag_name']: r for r in (releases or published(repo, component))}
for record in history['releases']:
release = actual.get(record['tag'])
if not release:
continue # Never create a missing historical release or touch a prerelease.
body = notes_md(record)
if (release.get('body') or '').strip() != body.strip():
with tempfile.TemporaryDirectory() as folder:
note_file = Path(folder) / 'notes.md'
note_file.write_text(body, encoding='utf8', newline='\n')
subprocess.run(['gh', 'release', 'edit', record['tag'], '--repo', repo, '--notes-file', str(note_file)], check=True)
print(f'{component}: {len(history["releases"])} releases; component changelog synchronized')
if __name__ == '__main__':
main()
+108
View File
@@ -0,0 +1,108 @@
import copy
import json
from pathlib import Path
import subprocess
import sys
import tempfile
import unittest
from unittest.mock import patch
import sync_history as sync
class ComponentHistoryTests(unittest.TestCase):
def history(self):
return {'schema': 1, 'component': 'manager', 'repository': 'Corfirean/coa-server-manager',
'consumedFragments': [], 'releases': [{'version': '0.6.22', 'tag': 'v0.6.22',
'date': '2026-10-19', 'url': 'https://example.test/release', 'notes': ['Existing client files are preserved']}]}
def test_manager_history_cannot_be_used_as_server_history(self):
history = self.history()
history['component'] = 'server'
with self.assertRaises(ValueError): sync.validate_history(history)
def test_duplicate_release_and_wrong_tag_are_rejected(self):
history = self.history()
history['releases'].append(copy.deepcopy(history['releases'][0]))
with self.assertRaises(ValueError): sync.validate_history(history)
history['releases'].pop()
history['releases'][0]['tag'] = 'server-0.6.22'
with self.assertRaises(ValueError): sync.validate_history(history)
def test_unpublished_and_prerelease_tags_never_enter_history(self):
release = {'tag_name': 'v0.7.0', 'draft': True, 'prerelease': False}
self.assertFalse(sync.eligible(release, 'manager'))
release.update(draft=False, prerelease=True)
self.assertFalse(sync.eligible(release, 'manager'))
release.update(prerelease=False)
self.assertTrue(sync.eligible(release, 'manager'))
self.assertFalse(sync.eligible(release, 'server'))
self.assertFalse(sync.eligible(dict(release, tag_name='stable'), 'server'))
def test_fragment_classification_preserves_source_boundaries(self):
text = '---\narea: manager\ntitle: Updates recover safely\n---\nYour files are preserved.'
self.assertIsNone(sync.fragment_note(text, sync.SERVER_AREAS))
self.assertIn('Updates recover safely', sync.fragment_note(text, sync.MANAGER_AREAS))
def test_remote_collection_uses_frozen_sha_and_reads_only_new_fragments(self):
with patch.object(sync, 'api', return_value=[{'name': '20261019-a.md', 'sha': 'b' * 40}]) as api:
notes, ids = sync.remote_fragments('owner/repo', 'a' * 40, {'owner/repo:20261019-a.md'}, sync.SERVER_AREAS)
self.assertEqual(notes, [])
self.assertEqual(len(ids), 1)
api.assert_called_once_with('repos/owner/repo/contents/changelog.d?ref=' + 'a' * 40)
with self.assertRaises(ValueError): sync.remote_fragments('owner/repo', 'main', set(), sync.SERVER_AREAS)
def test_manager_collection_reads_the_real_frozen_tag(self):
with tempfile.TemporaryDirectory() as folder:
root = Path(folder)
fragments = root / 'changelog.d'
fragments.mkdir()
own = fragments / '20261021-own.md'
own.write_text('---\narea: manager\ntitle: Characters show their saved versions\n---\n', encoding='utf8')
(fragments / '20261021-server.md').write_text('---\narea: server\ntitle: Server only\n---\n', encoding='utf8')
subprocess.run(['git', 'init', '-q', str(root)], check=True)
subprocess.run(['git', '-C', str(root), 'add', '.'], check=True)
subprocess.run(['git', '-C', str(root), '-c', 'user.name=Fixture', '-c', 'user.email=fixture@example.invalid', '-c', 'commit.gpgsign=false', 'commit', '-qm', 'Frozen notes'], check=True)
subprocess.run(['git', '-C', str(root), 'tag', 'v0.7.0'], check=True)
own.write_text('Uncommitted content must not become release notes', encoding='utf8')
notes, ids, source = sync.collect_manager(root, 'v0.7.0', set())
self.assertEqual(notes, ['Characters show their saved versions'])
self.assertEqual(len(ids), 2)
self.assertEqual(len(source['commit']), 40)
seen = {'Corfirean/coa-server-manager:20261021-own.md'}
self.assertEqual(sync.collect_manager(root, 'v0.7.0', seen)[0], [])
def test_render_is_component_scoped_and_stable(self):
text = sync.render(self.history())
self.assertIn('# CoA Server Manager changelog', text)
self.assertEqual(text.count('## 0.6.22'), 1)
self.assertNotIn('## 0.7.0', text)
self.assertEqual(text, sync.render(self.history()))
def test_render_only_does_not_contact_github_or_change_published_history(self):
with tempfile.TemporaryDirectory() as folder:
root = Path(folder); (root / 'changelog').mkdir()
path = root / 'changelog/history.json'
path.write_text(json.dumps(self.history()), encoding='utf8')
with patch.object(sys, 'argv', ['sync', '--root', str(root), '--render-only']), patch.object(sync, 'gh', side_effect=AssertionError('No network')):
sync.main()
first = (root / 'CHANGELOG.md').read_bytes()
sync.main()
self.assertEqual(first, (root / 'CHANGELOG.md').read_bytes())
self.assertEqual(len(json.loads(path.read_text())['releases']), 1)
def test_repeated_sync_adds_a_published_version_only_once(self):
with tempfile.TemporaryDirectory() as folder:
root = Path(folder); (root / 'changelog').mkdir()
path = root / 'changelog/history.json'
path.write_text(json.dumps(self.history()), encoding='utf8')
release = {'tag_name': 'v0.6.23', 'published_at': '2026-10-20T12:00:00Z', 'html_url': 'https://example.test/new'}
with patch.object(sys, 'argv', ['sync', '--root', str(root)]), patch.object(sync, 'published', return_value=[release]), patch.object(sync, 'collect_manager', return_value=(['Update checks recover safely'], ['own:fragment.md'], {'commit': 'a' * 40})) as collect:
sync.main(); sync.main()
self.assertEqual(collect.call_count, 1)
history = json.loads(path.read_text())
self.assertEqual(len(history['releases']), 2)
self.assertEqual(history['releases'][0]['notes'], self.history()['releases'][0]['notes'])
self.assertEqual(history['consumedFragments'], ['own:fragment.md'])
if __name__ == '__main__': unittest.main()