Complete
Details
Assignee
Ievgen StepanovychIevgen StepanovychReporter
Peter BrayPeter BrayLabels
Impact
LowTime remaining
0mComponents
Fix versions
Affects versions
Priority
Low
Details
Details
Assignee
Ievgen Stepanovych
Ievgen StepanovychReporter
Peter Bray
Peter BrayLabels
Impact
Low
Time remaining
0m
Components
Fix versions
Affects versions
Priority
Katalon Platform
Katalon Platform
Katalon Platform
Created August 15, 2021 at 8:46 AM
Updated July 1, 2022 at 5:29 PM
Resolved January 12, 2022 at 9:23 AM
While trying TrueNAS Scale 21.06 BETA.1 (on the 14th August 2021), I noted several hard-coded references to obsolete versions of ZFS manual pages, and later references to FreeBSD Manual Pages on a Linux System.
I cloned the webui repo and used ack ( https://beyondgrep.com/ or GNU egrep's -o option to show only the matching portion of each line) to look for examples:
ack o 'href="http
+"' truenas-webui | grep zfsonlinux
truenas--webui/src/app/helptext/storage/volumes/manager/manager.ts:36:href=" https://zfsonlinux.org/manpages/0.8.3/man8/zfs.8.html "
truenas--webui/src/app/helptext/storage/volumes/datasets/dataset-form.ts:148:href=" https://zfsonlinux.org/manpages/0.7.13/man8/zpool.8.html "
Further, there are 50 hardcoded references to FreeBSD manual pages ( https://www.freebsd.org/cgi/man.cgi ?) with 4 of them hard-coded to a specific version of FreeBSD. See the output of the following command:
ack o 'href="http
+"' truenas-webui | grep -i www.freebsd.org/cgi
While there are a number of solutions to this problem, including:
Using a variable to hold the base URL for manual pages. Example: SYSTEM_MAN_PAGES=https://.../...?query= with different values for each supported operating system and using that in hrefs, like ${SYSTEM_MAN_PAGES}zfs.1 (note this a description of an approach, and not verified in the webui's framework actually in use)
During the TrueNAS build process find all manual page references, and statically generate the required ones for each supported OS. This solution is sub-par in that plugins can not use the system's own manual pages for documentation references as they will not have been generated at build time. Also system package updates during the lifetime a TrueNAS Mnajor.Minor version may not trigger the build process to regenerate the static manual pages.
Create an endpoint URL that accepts <name>[.<section>] references and using tools like groff -Thtml (via man-db's man -Thtml to let it do the manual page searching part) or other similar dynamic systems (man2html, mandoc, debiman, roffit, manly, oman, pandoc, ...) to generate HTML on the TrueNAS system on demand. This endpoint could be on localhost:<port> so only the TrueNAS WebUI could request manual page renders. It could also gracefully handle unknown / non-existant manual pages.
I personally like the last approach, but it can only render manual pages currently on the TrueNAS system
- but at least the manual page updates stay in-sync with system package updates
and OS version specific differences are handled on the TrueNAS system.
Ideally, something better than groff generated HTML would be better, that is, something that used CSS and could be styled in the way that iXsystem's deems reasonably consistent (i.e. follows the user's light/dark theme, etc)
Regards,
Peter
Sydney, Australia