Repository navigation
feat: add the systeminfo, stats, log, backup and suggest commands - #43
Merged
Merged
Conversation
Wrap the admin APIs that report on and maintain a running Fess: - systeminfo / stats: show the server information and statistics (text tables, full data with json/yaml). - log list|download, backup list|download: list the files and stream one to --dest; an existing destination is kept unless --force is given, and a failed transfer leaves no partial file. log download checks the id against the list first because Fess answers an unknown id with an empty download. backup download requests the id with a trailing slash because Fess does not run the action for a path whose last segment has an extension. - suggest info|delete-all|delete-document|delete-query: show the word counts and delete words; the deletes ask for confirmation unless --yes is given. All five APIs exist in 14.19.2, 15.6.1, 15.7.0, 15.8.0 and 15.9.0. Adds unit tests (including a download test against a local HTTP server), integration tests and the skills reference pages.
This was referenced Oct 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds five commands for the admin APIs that report on and maintain a running Fess:
systeminfo--output text|json|yaml)GET /api/admin/systeminfostatsGET /api/admin/statsloglist,download <id> --dest PATH [--force]GET /log/files,GET /log/file/{id}backuplist,download <id> --dest PATH [--force]GET /backup/files,GET /backup/file/{id}suggestinfo,delete-all,delete-document,delete-query(--yesskips the confirmation)GET /suggest,DELETE /suggest/{all,document,query}json/yamlgive the full response. Every command exits non-zero on an API failure, in all output modes.--dest. An existing destination is kept unless--forceis given, and a failed transfer leaves no partial file (it is written to<dest>.partand renamed).log downloadchecks the id againstlog listfirst: Fess answers an id that names no log file with an empty200, which cannot be told from an empty log file.backup downloadrequests the id with a trailing slash (see the server oddities below).SKILL.mdindex, resource count 25 -> 30, and the stale "not exposed" list inworkflows.mdtrimmed.Versions
All five APIs exist in 14.19.2, 15.6.1, 15.7.0, 15.8.0 and 15.9.0 (checked in each tag's source; the action classes are unchanged apart from additions in 15.9: mapping files and
chat_log.ndjsonin backup). None of them needs the CodeLibs engine plugins, so the 15.9404ofFessApiAdminAction.hookBeforedoes not apply (only the dictionary APIs overriderequiresEnginePlugins).Verified
Live, 15.9.0 (Fess + OpenSearch 3.9.0): every subcommand and output mode by hand, with real data (5 crawled pages, search log entries, suggest words generated by the Suggest Indexer job):
logdownload of.log,.log.gz, and an empty file; all 11 backup ids; unknown ids; a bad token (exit 3); an unreachable server (exit 1); suggestdelete-query/delete-document/delete-allwith counts before and after (delete-documentkeeps the query words and vice versa); confirmation abort.Live, 14.19.2 (OpenSearch 2.19.1) and 15.8.0 (OpenSearch 3.8.0): the 17 new integration tests pass, plus a by-hand pass of all subcommands. On these two versions the suggest index was empty, so the delete assertions ran against an empty index.
Unit: 219 pass (
tests/unit, including a download test against a local HTTP server). The newtests/commandsfiles import-check (--collect-only); I did not runtests/commandsthrough the repo fixture (a scratch conftest without Docker was used for the live runs above).NOT verified
404path (not applicable to these APIs, so not exercised).Server oddities found (handled or documented)
/api/admin/backup/file/fess_config.bulk) gets a bare404 Not Found.(text/plain) on 15.9 and a302on 14.19.2 / 15.8.0 instead of running the action. With a trailing slash it works on all three.log listhands out URL-safe Base64 ids butlog downloaddecodes standard Base64, so an id containing-or_(file names with characters such as>or?) cannot be downloaded. Not worked around..loglog id answers200with an empty body.fess.jsonanddoc.jsonare listed but download as 0 bytes before 15.9.0.log listreturnslastModifiedin camelCase and without a time zone, unlike the rest of the API.Could not find index for backup.).uv.lockpins click 8.3.0, which breaks required options with typer 0.16.0 (a missing--destreaches the command asNone;webconfig createwithout--namehas the same problem). Click 8.2.1 behaves correctly.Stacked PRs (merge from the bottom; each PR's base is the branch below it, so no conflicts remain):
main← #45 theme timeout (+ CI runs for stacked PRs) ← #46 typer ← #43 ops commands ← #44 dict ← #41 general/plugin/storage ← #42 searchlist/documents.After a PR is squash-merged GitHub retargets the next one to
main.