1. 17 Jan, 2022 1 commit
  2. 16 Jan, 2022 5 commits
    • Rob Swindell's avatar
      Fix printf format issue in previous commit. · 27f8668c
      Rob Swindell authored
      27f8668c
    • Rob Swindell's avatar
      Add JS properties to assist with web-access to filebase · 9f772107
      Rob Swindell authored
      file_area.web_vpath_prefix
      file-metadata-object (return value of FileBase.get()).vpath
      9f772107
    • Rob Swindell's avatar
      Correct JSDOCS for get_path, get_size, and get_time methods · 3e5326e0
      Rob Swindell authored
      These methods also (optionally) accept a file-meta-object as an argument.
      3e5326e0
    • Rob Swindell's avatar
      Add support for web request path aliases (defined in web_alias.ini) · f2858ee6
      Rob Swindell authored
      Similar to the ctrl/ftpalias.cfg file, the new ctrl/web_alias.ini file (optional) can be used to map a portion (the first portion, only) of a web request path to a different physical or virtual path. For example, I'm using it to map:
      /Synchronet/ = /files/main/sbbs/
      for filebase access to my main->sbbs directory of Vertrauen's filebase using a /Synchronet/* web request (i.e. for slightly prettier or shorter custom URLs, if desired).
      f2858ee6
    • Rob Swindell's avatar
      Add direct filebase access from the web server (optional) · 1ab2956b
      Rob Swindell authored
      By setting SCFG->File Options->Web File Virtual Path Prefix to something (e.g. "/files/"), all HTTP or HTTPS requests to the Synchronet Web Server with request paths beginning with this prefix will be interpreted as filebase access requests (with full access control enforcement). This is configured here (in SCFG) rather than, say, the [web] section of sbbs.ini, because I have plans for the terminal server to use this prefix to generate Web-URLs for files to display or email to users.
      
      Currently, only requests to *files* (for download) are supported (no index generation, file information, etc. and definitely no upload support). Full access control (using HTTP auth, not cookies) is used for libraries and directories with controlled access. Credits are deducted and awarded and uploaders are notified of downloads, as one would expect. Requests to any dynamic-web-content files (e.g. .SSJS, .XJS, etc.) will be treated as static file download requests (no script will be executed).
      
      I'm reusing the same virtual path parsing logic from the FTP server (moved to the userdat lib), so the virtual path to a file for download would be, for example, http://yourdomain/files/lib/dir-code/filename.ext
      
      The main motivation for this feature is: FTP-links in email and web pages are just not useful to many users these days and I don't think that sysops should have to rely on a SSJS web UI (e.g. ecWebv4, cool as it is), to provide web-access to the filebases. Using this feature, you can share simpler/shorter web links to your files that will be more enduring.
      1ab2956b
  3. 14 Jan, 2022 2 commits
    • Rob Swindell's avatar
      Address Coverty reported issue about dereferencing a NULL pointer · 063d4700
      Rob Swindell authored
      CID 345291
      It's actually a false positive because if an extension (".suffix") exists in filespec, it must also exist in newfilespec since it's a copy, but whatever. It's better form to check.
      063d4700
    • Rob Swindell's avatar
      Disable libarchive support for creating/appending bundles · 55962a41
      Rob Swindell authored
      libarchive apparently cannot be used for in-place modification of (e.g. adding files to) existing archives, so if a bundle already exists, this code would over-write it with a new archive containing just the latest packet. Issue reported by acn (IMZADI) via DOVE-Net.
      
      I could and might create an update_archive() function which extracts and re-creates an archive with additional files, but since I don't have that yet, just disable this for now and always use an external archive utility to create or update bundles (so again, an "Archive" configuration is required in your sbbsecho.ini file, which you most likely already have).
      55962a41
  4. 13 Jan, 2022 4 commits
  5. 11 Jan, 2022 3 commits
    • Rob Swindell's avatar
      Allow maximum uploaded filename length to be configured · eb8114bd
      Rob Swindell authored
      Default to 64 characters. Maximum value is 65535 characters, but filenames larger than 64 characters may be problematic (e.g. searching for them, displaying them, security concerns), so only increase with caution. Shorter values are fine, but 0 will just revert back to the default.
      eb8114bd
    • Rob Swindell's avatar
      Log unallowed/illegal filenames in quotes · 7ccc618a
      Rob Swindell authored
      Prefixed or trailing white-space characters would be hard to discern without this.
      7ccc618a
    • Rob Swindell's avatar
      loadfiles() will perform liberal filename matching when len > 12 chars · 60e4d7af
      Rob Swindell authored
      As discovered while making the Synchronet v3.18b feature video (https://www.youtube.com/watch?v=_IWzIV0_sZ4), when only a shortened version of a long filename is displayed (e.g. due to 80 column terminal width limitations), trying to download that filename by specifying the filename at the Download File(s) Filespec [All Files]: prompt can be problematic.
      
      For example (as seen in the video), the file "SyncTERM-1.1-setup.exe" is displayed as "SyncTERM.exe" (on an 80-column terminal), yet trying to download "SyncTERM.exe" (or "syncterm.exe") using the 'D'ownload command would fail to find a file with that name (understandably, but frustratingly so).
      
      This change will transform the requested filename-to-load if it is at least 12 characters in length and contains no wildcards (* or ?), to include a filename extending wildcard: "filename.txt" will become "filename*.txt" and "longfilename" will become "longfilename*".
      
      For requested filespecs of NULL (all files) or specs containing wildcards or specs (filenames) less than 12 characters in length, no filespec transform takes place: so trying to list/download "a" doesn't match "apple.txt".
      60e4d7af
  6. 05 Jan, 2022 1 commit
  7. 04 Jan, 2022 3 commits
    • Rob Swindell's avatar
      The simpler fix to issue #317 (nested DIZ files) · 0553ef9b
      Rob Swindell authored
      By extracting with with_path=true, the file_list matching won't match the nested DIZ files.
      0553ef9b
    • Rob Swindell's avatar
      Add overwrite argument to extract_file_from_archive and Archive.extract · 16cfe2d3
      Rob Swindell authored
      Previously, extracted files were always overwritten (so that is the "default" for Archive.extract() and mostly what I'm specifying in the C/C++ code by default now), but this caused a problem with DIZ extraction: archives that contained multiple DIZ files (e.g in sub-directories), the last to be extracted would be used. A maximum of 3 DIZs can be extracted, so it would usually be the 3rd DIZ in the archive if there were that many.
      
      Another solution would be to *only* extract DIZ files from the root of the archive and I should look into that as well, but the always-overwrite behavior also seemed to be wrong, so that *also* needed fixing (allow caller to control behavior).
      
      This fixes issue #317, at least for archives where the root DIZ exists *before* any nested DIZ files. I'll have to try and create a purposeful archive to test the other conditions (where the root DIZ would appear *after* the nested DIZ(s)).
      16cfe2d3
    • Rob Swindell's avatar
  8. 02 Jan, 2022 11 commits
  9. 01 Jan, 2022 1 commit
  10. 30 Dec, 2021 3 commits
  11. 14 Dec, 2021 3 commits
  12. 06 Dec, 2021 3 commits
    • Rob Swindell's avatar
      Don't build sbbsexec.dll by default for debug builds · 366c05de
      Rob Swindell authored
      This build is touchy and requires an explicit path to a Win10 SDK
      directory, so just disable by default for (for debug build). We still
      want this built by default for CI, which are release builds.
      366c05de
    • Rob Swindell's avatar
      Fix FTPS upload failure: !DATA ERROR 0 receiving on data socket · 17a67ee9
      Rob Swindell authored
      Don't treat CRYPT_ERROR_COMPLETE (-24) as a socket error during upload since it's an indication that the remote closed the connection and is the normal "end of file/transfer" indicator, not an error. 'rd' is already 0 in this case, so no need to set at all (since recv() returns 0 upon disconnect and that's what we're emulating here).
      
      Fixes issue #309 reported by Jas Hud.
      17a67ee9
    • Rob Swindell's avatar
      Allow local abort/cancel to abort (more) retries/loops · 312daa40
      Rob Swindell authored
      While debugging a SyncTERM upload issue, I came across some scenarios where an out of control file transfer could not be aborted via local key press (e.g. Ctrl-C, Ctrl-Break).
      
      We use zm.local_abort for all local abort indications (even for X/YMODEM). <shrug>
      312daa40