0f3671f42d
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 23s
CI / integration (pull_request) Successful in 18s
CI / ui (pull_request) Successful in 45s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m5s
Replace the dictionary hot-reload with an online update flow in the GM console (/_gm/dictionary): the operator uploads scrabble-dawg-vX.Y.Z.tar.gz, previews the per-variant words added/removed against the active dictionary, and confirms to install + activate it. Versions are immutable; in-progress games keep their pinned version while new games use the new one. - engine: DiffWords (enumerate both DAWGs, decode only the differences), OpenFinder, Registry.Finder, DictFiles; OpenWithVersions skips the .staging area. - dictadmin: hardened release-archive validation + extraction (path-traversal, symlink, oversize, entry-count rejection) and staging -> install (atomic rename). - game: active dictionary version persisted in the dictionary_state singleton (single source of truth, restored on boot), concurrency-safe accessor. - storage: BACKEND_DICT_DIR is a named volume seeded from the image (nonroot-owned), so uploaded versions persist across redeploys; the build's DICT_VERSION labels the seed and equals the resident tag (BACKEND_DICT_VERSION). - docs: ARCHITECTURE §5, FUNCTIONAL (+ru), backend README, TESTING, PRERELEASE. Tests: engine + dictadmin unit; integration upload->preview->install->activate-> restart->pin->immutability->CSRF.
47 lines
2.0 KiB
Go Template
47 lines
2.0 KiB
Go Template
{{define "content" -}}
|
|
<h1>Dictionary</h1>
|
|
{{with .Data}}
|
|
<section class="panel"><h2>Active version</h2>
|
|
<p>New games pin <span class="pill">{{.ActiveVersion}}</span>. Games already in progress keep the version they started on.</p>
|
|
</section>
|
|
<section class="panel"><h2>Resident versions</h2>
|
|
<table class="list">
|
|
<thead><tr><th>Variant</th><th>Resident</th></tr></thead>
|
|
<tbody>
|
|
{{range .Variants}}
|
|
<tr><td>{{.Variant}}</td><td>{{range .Versions}}<span class="pill">{{.}}</span> {{end}}</td></tr>
|
|
{{end}}
|
|
</tbody>
|
|
</table>
|
|
</section>
|
|
<section class="panel"><h2>Update dictionaries</h2>
|
|
<p class="note">Upload the release archive <code>scrabble-dawg-vX.Y.Z.tar.gz</code> downloaded from the scrabble-dictionary repository. The next step previews the added and removed words per variant; nothing is installed until you confirm.</p>
|
|
<form class="form" method="post" action="/_gm/dictionary/upload" enctype="multipart/form-data">
|
|
<label>Release archive <input type="file" name="archive" accept=".gz,.tgz,application/gzip" required></label>
|
|
<div><button type="submit">Upload & preview</button></div>
|
|
</form>
|
|
</section>
|
|
<section class="panel"><h2>Pending dictionary changes</h2>
|
|
<table class="list">
|
|
<thead><tr><th>Variant</th><th>Action</th><th>Word</th><th>Resolved</th></tr></thead>
|
|
<tbody>
|
|
{{range .Changes}}
|
|
<tr><td>{{.Variant}}</td><td>{{.Action}}</td><td><code>{{.Word}}</code></td><td>{{.ResolvedAt}}</td></tr>
|
|
{{else}}<tr><td colspan="4"><span class="note">no pending changes</span></td></tr>{{end}}
|
|
</tbody>
|
|
</table>
|
|
<form class="form" method="post" action="/_gm/dictionary/changes/apply">
|
|
<label>Mark applied for variant
|
|
<select name="variant">
|
|
<option value="scrabble_en">scrabble_en</option>
|
|
<option value="scrabble_ru">scrabble_ru</option>
|
|
<option value="erudit_ru">erudit_ru</option>
|
|
</select>
|
|
</label>
|
|
<label>In version <input type="text" name="version" value="{{.ActiveVersion}}" required></label>
|
|
<div><button type="submit">Mark applied</button></div>
|
|
</form>
|
|
</section>
|
|
{{end}}
|
|
{{- end}}
|