Add galaxy-web: browsable/searchable web UI for galaxy archives - #3
Conversation
The existing web server (web.cpp) only supports looking up a single message by Message-ID, with no way to browse groups or threads. This adds a new tool that serves a proper local browsing UI on top of a galaxy: a newsgroup listing, paginated per-group thread lists, a threaded message view, message permalinks, and full-text search (within one group or across the whole galaxy) using each archive's already-embedded lexicon, so no extra indexing step is required. Message rendering (header/quote/signature styling) reuses the same MessageLines-based approach as web.cpp. News: links in quoted text now resolve through a /msgid/<id> route that looks the message up via the galaxy and redirects to its proper group+message URL.
|
Auto-review below. Most things actionable. Review: usenetarchive PR #3 —
|
- Fix stack buffer overflow in PackMsgId (/msgid/<id>): cap message-ID length before packing. - Install galaxy-web binary and register it in the uat dispatcher. - Revert unrelated README removal of "pan-group search" future-work item. - 404 on non-numeric /msg and /thread indices instead of silently resolving to message 0. - Stop UriDecode from turning '+' into space in path segments (broke msgids containing literal '+'). - Report accurate truncation on group-level search results. - Add cycle guard to FindRoot against corrupt connectivity data. - Restrict D_Url-decorated links to a scheme allowlist, blocking javascript: URLs from message bodies. - Cap each group's contribution to global search at SearchGlobalCap (was 20) so a group's real top matches aren't dropped before the merge, and normalize per-group ranks to [0,1] before merging so raw TF/IDF magnitudes from different-sized corpora aren't compared directly. - Grow GetQueryVar's buffer to MG_MAX_HTTP_REQUEST_SIZE so long query values can no longer be silently dropped to empty.
Summary
web.cppcurrently only supports looking up a single message by Message-ID — there's no way to browse groups or threads through a web UI.galaxy-web, a new local web server built on top oflibuat/Galaxy/Archive, providing:/— newsgroup listing with description, message and thread counts/group/<name>— paginated thread list (50/page)/group/<name>/thread/<id>— full threaded message view (nested replies)/group/<name>/msg/<id>— single message permalink/search?q=...and/group/<name>/search?q=...— full-text search across the whole galaxy or within one group/msgid/<id>— resolves a bare Message-ID (as found in quotednews:links) to its group+message URLlexdata/lexstr/etc.) is already embedded in packaged archives, soSearchEngineworks immediately per group; global search loops over all available archives.MessageLines-based approach already used byweb.cpp.man/uat-galaxy-web.1, wired into the CMake install list, and listed the new tool (plus the pre-existing but undocumentedweb) under### End-user Utilitiesin the README. Also removed the "Implement pan-group search mechanism" future-work bullet, since this delivers it.Test plan
cmake --build build --target galaxy-webbuilds cleanlygalaxy-util) and exercised every route withcurl: group list, thread list + pagination, thread view, message permalink, group-scoped search, global search, and/msgid/<id>redirect resolutionweb.cpp's existing styling