• exec/webfileindex.ssjs

    From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Thu Dec 5 17:00:15 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/37126d82ef319ffc51fb393b
    Modified Files:
    exec/webfileindex.ssjs
    Log Message:
    Display directory aliases from web_alias.ini as shortcuts on index page

    Other kinds of aliases are supported in web_alias.ini (e.g. libraries, files) but not displaying those here (yet).

    ---
    � Synchronet � Vertrauen � Home of Synchronet � [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Wed Jan 22 23:19:39 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/50d04b24aae59ae24d57d1bf
    Modified Files:
    exec/webfileindex.ssjs
    Log Message:
    Add support for viewing file (images and archive) contents

    ---
    � Synchronet � Vertrauen � Home of Synchronet � [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Wed Jan 22 23:58:33 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/6d41d290d62dc14fbf6dad09
    Modified Files:
    exec/webfileindex.ssjs
    Log Message:
    Filter out the non-viewable files for the next/prev file buttons

    ---
    � Synchronet � Vertrauen � Home of Synchronet � [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Thu Jan 23 01:59:25 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/9e039b2006a57b0d8b8ca4cd
    Modified Files:
    exec/webfileindex.ssjs
    Log Message:
    Display file SHA1 (if has one) and date/time in div title (hover text)

    ---
    � Synchronet � Vertrauen � Home of Synchronet � [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Thu Jan 23 02:54:19 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/f0ca1a1846408f01345d0f0d
    Modified Files:
    exec/webfileindex.ssjs
    Log Message:
    Minor beautification

    Indenting lib and dir lists use the ul tag, I'm sure this isn't technically the most correct way to do this, but its providing the cosmetic result I want.

    ---
    � Synchronet � Vertrauen � Home of Synchronet � [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Thu Jan 23 23:32:17 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/65f79e9c747589dc1a4ab53e
    Modified Files:
    exec/webfileindex.ssjs
    Log Message:
    Cosmetic improvements using Unicode characters as icons

    (file cabinets, folders)

    Bold the directory/library names and other markup improvements.

    Expand viewable types to more readable archive types supported by libarchive (many more than the list in Archive.supported_formats).

    ---
    � Synchronet � Vertrauen � Home of Synchronet � [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Wed Feb 5 18:44:18 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/c830577e0aab9ef087aedce7
    Modified Files:
    exec/webfileindex.ssjs
    Log Message:
    Handle files where the 'added' property is 0 or undefined

    ---
    � Synchronet � Vertrauen � Home of Synchronet � [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Thu Feb 20 20:29:35 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/936351241814cec19ee5e95a
    Modified Files:
    exec/webfileindex.ssjs
    Log Message:
    Fix links to filenames with spaces

    View images in a smaller viewport (I'm no CSS expert here, obviously)

    ---
    � Synchronet � Vertrauen � Home of Synchronet � [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Wed Jun 18 18:01:15 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/a4c1f9084748d37822c3fd99
    Modified Files:
    exec/webfileindex.ssjs
    Log Message:
    Fix viewing file contents broken in last commit of this file

    Need to remove the quotes that were added to all files as of 3 months ago
    in commit 936351241814cec19ee5e95aca029887b4b119b7

    ---
    � Synchronet � Vertrauen � Home of Synchronet � [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Fri Jul 18 19:03:11 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/8c7887462c87c52507f162f7
    Modified Files:
    exec/webfileindex.ssjs
    Log Message:
    If files are skipped because they don't exist, don't count them

    and display them in the total "files listed" line.

    ---
    � Synchronet � Vertrauen � Home of Synchronet � [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Mon Jun 1 22:25:27 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/d777bda5c58ee28593e539b2
    Modified Files:
    exec/webfileindex.ssjs
    Log Message:
    webfileindex: deflect crawlers from ?view= to prevent OOM crash

    The per-file ?view= path renders archive listings/images and explodes the crawlable URL space, while the index materializes the entire file_area on
    each request -- a large allocation in the 32-bit mozjs185 JS heap.
    Aggressive bots ignore robots.txt (webv4 already sends Disallow: /) and walk thousands of these, exhausting the heap; mozjs185 then turns the allocation failure into an access violation (0xc0000005 in mozjs185-1.0.dll) that
    crashes the whole in-process server (sbbsctrl) instead of a catchable JS OOM exception. Crashed sbbsctrl.exe on vert twice (5/29 + 6/1), each correlated with a "webfileindex.ssjs line 299: out of memory" web-log entry from a
    crawler hitting /files/...?view=...

    Deflect known crawler User-Agents with a cheap 429 *only* on ?view=
    requests, before any file_area access. Bots can still index directory
    listings; real browsers are unaffected. Stopgap until the SM128/64-bit migration, where OOM is catchable.

    Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

    ---
    � Synchronet � Vertrauen � Home of Synchronet � [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Wed Jul 29 20:43:50 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/3957d2aee3c84479ae2339e1
    Modified Files:
    exec/webfileindex.ssjs
    Log Message:
    webfileindex: quote the interpolated URL attributes

    Three attributes interpolated a filename into an unquoted value: the
    file-view href, the download href, and the image src that view_image()
    emits.

    The view href was the worst of them, because its opening quote sat on the
    wrong side of the ?view= token:

    <a href=?view="somefile.zip" title='View'>

    A parser reading an unquoted attribute value takes everything up to the
    first whitespace, so href became ?view="somefile.zip" - quotes included -
    which browsers then request as ?view=%22somefile.zip%22. Both forms
    resolve to the same archive listing, so every viewable file had two working URLs and crawlers walked both: 14,067 of one day's 20,583 ?view= requests
    on this host were the quoted duplicate.

    The other two were merely unquoted. encodeURIComponent leaves ' unencoded,
    and an apostrophe is not legal in an unquoted attribute value, so both
    relied on parser leniency. There is a real instance here: JAIL'M.ZIP in Cyber.Xpo.95/GOVWATCH rendered as href=JAIL'M.ZIP. Of 1412 file
    directories, 8 filenames contain a character encodeURIComponent leaves
    alone that an unquoted attribute disallows, and one of those is viewable.

    Spaces were never at risk in any of the three - encodeURIComponent had
    already turned them into %20, so nothing terminated the value early - and
    they still work; no URL that worked before stops working. Verified that the directory index still renders and that JAIL'M.ZIP both views and downloads.

    One unquoted attribute is left alone deliberately: the static href=http://www.synchro.net in the footer interpolates nothing, so its value cannot vary.

    Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

    ---
    � Synchronet � Vertrauen � Home of Synchronet � [vert/cvs/bbs].synchro.net