Skip to content
Snippets Groups Projects
  1. Dec 17, 2023
  2. Dec 15, 2023
  3. Nov 26, 2023
  4. Nov 13, 2023
  5. Jun 26, 2023
    • Rob Swindell's avatar
      Eliminate STRERROR macro · 4a53863e
      Rob Swindell authored
      This macro hasn't done anything meaningful since we stopped using really old
      versions of Borland compilers (and std libraries) where strerror() returned a
      string terminated with a line-feed (\n) character.
      4a53863e
  6. Jun 04, 2023
  7. Apr 13, 2023
    • Rob Swindell's avatar
      Fix false "SUSPECTED BOUNCE ATTACK ATTEMPT" for IPv6 FTP-data connections · b25b5734
      Rob Swindell authored
      This bug only impacted non-passive FTP connections. Using an FTP client
      with active (not passive) data connections over an IPv6 connection would
      false-trigger the "bounce attack" detection and the FTP server responded with
      "504 Bad port number" and logged a hack attempt in data/hack.log.
      
      The issue was that we were comparing the socket address structure (which
      contains other fields besides the address itself) between the control and
      proposed-data connections. While this logic worked okay for IPv4,
      it did not for IPv6 (the 2 structs contained some non-address differences).
      Rather than modify the socket address structures to match where needed, I'm
      just comparing the string representation of the addresses, since that's
      what we really care about anyway.
      
      Thank to "mark i" of Truck Stop BBS for alerting me to this issue
      b25b5734
  8. Mar 24, 2023
  9. Mar 19, 2023
  10. Mar 04, 2023
  11. Feb 19, 2023
  12. Feb 16, 2023
  13. Feb 10, 2023
  14. Feb 09, 2023
  15. Feb 03, 2023
    • Rob Swindell's avatar
      Fix uploader-notification, credit awards, download-counters in FTP downloads · 45b128c0
      Rob Swindell authored
      Since v3.19 (the new filebases), when a user FTP-downloaded a file, we failed
      to properly find/load that file's record from the filebase (searching for the
      file's full path, rather than just the filename), so the code the increments
      the file's download counter, notifies the uploader, awards credits, etc. did
      not ever execute. This means that FTP-downloads for all files downloaded via
      FTP were effectively "free" (and nobody noticed). No error was logged either.
      
      I discovered this while debugging the case of "(null)" filenames in the
      action/download MQTT topic messages being published by the FTP server. So
      that issue is fixed as part of this commit as well.
      
      Oh, and if this code had executed before, it would have memory-leaked the
      file information, so that's fixed too (added call to smb_freefilemem). Ugh.
      45b128c0
  16. Jan 30, 2023
    • Rob Swindell's avatar
      5b522af3
    • Rob Swindell's avatar
      The 3rd great MQTT data scheme update (sorry Nelgin) · e94281e6
      Rob Swindell authored
      - Most published messages (besides log entries) have a timestamp (in ISO8601 format) prepended and tab-separated
      - The order and number of elements in client messages (list and activities) has been updated, now includes user number
      - Server client lists are now published to .../SERVER/client/list
      - Server client activities (connect, disconnect, update) are now published to .../SERVER/client/action/#
      - Server client count is now published to .../SERVER/client (with the maximum client count, if applicable)
      - Server states are now just represented by name (e.g. initializing, ready, stopping, stopped) and not number
      - BBS errors are logged to sbbs/BBS/action/error/LEVEL (where LEVEL is the log level name, e.g. "critical" or "error')
      - All server hack-attempts, SPAM attempts, logins, logouts, uploads, downloads, are published to sbbs/BBS/action/ACTION/*
      - Chat pages are published to sbbs/BBS/action/page/node/#
      - New users (on the terminal server) are published to sbbs/BBS/action/newuser
      - Posted messages and executed external programs (on the terminal server) are published to sbbs/BBS/action/ACTION/CODE topic
      - The event thread started/stopped status is published to .../SERVER/event
      
      Yeah, the wiki will get updated soon to reflect/document all these changes
      e94281e6
  17. Jan 24, 2023
  18. Jan 09, 2023
  19. Jan 04, 2023
    • Rob Swindell's avatar
      Public hack, spam, and error logs at the MQTT BBS-ID topic depth · 7ce24b48
      Rob Swindell authored
      This is more consistent with how these events are logged in a BBS-common log file in data/*.log.
      
      This change also restores the server abbreviation to the error log entries that used to be there until recently.
      7ce24b48
    • Rob Swindell's avatar
      Over-overhaul of MQTT support · 916fdacb
      Rob Swindell authored
      Each Synchronet server is now its own MQTT client. This means there's no
      longer any MQTT logic in the Synchronet "hosts" (e.g. sbbscon.c, ctrl/*.cpp)
      and none needed for SBBS NT services (they'll "just work" with MQTT).
      
      This also means that just about everything (except for nodes, spam and hack)
      is now published per-server (in the sbbs/BBS-ID/hostname/server/ topic branch)
      and if you want aggregated totals or client lists, you'll have to do that in
      your own MQTT client or dashboard.
      
      I also removed the publishing of thread_count and socket_count topics as
      they weren't universally supported across all servers and are of questionable
      value. They can be added back later if determined to be useful.
      916fdacb
  20. Jan 02, 2023
    • Rob Swindell's avatar
      Second part of MQTT overhaul · d1c07811
      Rob Swindell authored
      Now support subscriptions (e.g. recycle topics, node input topics) in SBBSCTRL.
      This required a lot of search/replace and fun with circular struct pointers.
      d1c07811
    • Rob Swindell's avatar
      MQTT support overhaul, mainly for SBBSCTRL compatibility · eb5fdedb
      Rob Swindell authored
      The only difference in the data/scheme is that the "error" topic (error log) is now under each server rather than each host. I don't *think* there are any other changes from the MQTT consumer side.
      
      Still not done: subscribing (e.g. support for recycle or node-spy-input via MQTT) and NT services support.
      
      This change also includes a cool feature that will prompt the sysop if there's a timeout (30 seconds) while waiting for servers to shutdown gracefully and giving the sysop the option to abort (Cancel) the wait (and shutdown ungracefully) or continue the wait (OK).
      eb5fdedb
  21. Dec 30, 2022
    • Rob Swindell's avatar
      Common login control (e.g. via real name) using new find_login_id() function · 7679dcf8
      Rob Swindell authored
      Previously, many servers and services didn't support login by real name
      (e.g. issue #469) even if the sysop had that option enabled in SCFG.
      
      Move login control settings from node.ini to system (main.ini -> login)
      
      The 3 node toggle options:
      - Allow Login by User Number
      - Allow Login by Real Name
      - Always Prompt for Password
      
      ... have been now moved from SCFG->Nodes->Node x->Toggle Options to
      SCFG-System->Toggle Options.
      
      If you upgraded to v3.20a before now, you'll want to double-check these
      settings to make sure they're how you want them set. New upgraders that run
      upgrade_to_v320.js (e.g. via 'jsexec update') will get these settings migrated
      automatically.
      
      Added some error detection/logging to upgrade_to_v320.js when failing to open
      .cnf files.
      
      Constified some more user/login related function args and return types.
      7679dcf8
  22. Dec 29, 2022
  23. Dec 23, 2022
  24. Dec 12, 2022
  25. Dec 05, 2022
    • Rob Swindell's avatar
      Add support for systemd system state notifications · 7e320d92
      Rob Swindell authored
      When the systemd dev package (e.g. libsystemd-dev) is installed, we can use
      sd_notify() to inform systemd of Synchronet server state/status. The state
      values (READY, STOPPING, RELOADING) are "well known" while the status
      value is a free-form text string (the last lputs output).
      
      Eliminated the free-form status() callback from *startup_t.
      Eliminated the now-redundant started() callback from *startup_t.
      
      Eliminated the use of sbbs_status.c/h as nothing is using that interface
      and while I do plan on using a remote control/monitor interface, I'm
      considering use of a standard pub/sub lib and protocol.
      
      This commit is going to break the Windows sbbsctrl build for sure.
      Probably break the sbbsNTsvcs build.
      7e320d92
  26. Nov 17, 2022
  27. Oct 18, 2022
    • Rob Swindell's avatar
      Full read/write support of new user.tab userbase file · 8a22b246
      Rob Swindell authored
      Also resolved some 32 vs 64-bit 'long' issues/ambiguities that have long-remained. :-)
      
      This commit also removes logon.lst file support.
      
      There's a TODO block remaining in js_user.c for setting portions of a user's birthdate (e.g. just the year or month or day).
      8a22b246
  28. Apr 30, 2022
    • Rob Swindell's avatar
      Fix DIZ extraction/use for FTP uploads · 77d72d0e
      Rob Swindell authored
      1. Was not setting f->dir to the correct directory number, so only ftp-uploads to the *first* directory (dirnum = 0) would extract DIZ files of uploaded files.
      
      Removing the 'dirnum' parameter to addfile() since that implied that you did not have to initialize the 'dir' element of the passed file_t, but you do: to get the correct file path for file size/date detection and the DIZ extraction.
      
      2. Was getting heap-corruption when freeing the imported/formatted DIZ text on Windows once the above problem was fixed: can't free() in one DLL memory that was allocated in another DLL. Created and now using free_diz() to free the memory allocated in read_diz().
      
      format_diz() handles a NULL 'lines' argument correctly/gracefully, so no need for the NULL lines check in sbbs_t::uploadfile().
      
      Added FTP server log messages for successful file upload or update by user.
      77d72d0e
  29. Mar 28, 2022
    • Rob Swindell's avatar
      Overhaul statistics files · f963dcbf
      Rob Swindell authored
      */dsts.dab (daily statistics and running totals) -> */dsts.ini
      */csts.dab (cumulative statistics / log) -> */csts.tab
      
      * dsts.ini now has both daily and total stats for all fields (not just timeon and logons).
      * dsts.ini is now an easily modifiable text file - no longer need dstsedit (here-by deprecated and soon to be deleted)
      * dsts.ini and csts.tab support 64-bit upload/download byte stats and are very extensible for future fields to be added or extended > 32-bit (this was the main inspiration for this overhaul, but it was overdue and already designed for v4, pretty much)
      * csts.tab is a tab-delimited fixed length record format suitable for easy import to a spreadsheet program or parsing with scripts. Each day is a 128-character LF-delimited record with tab-delimited fields of plain ASCII text.
      * All fields except timeon in dsts.ini files are updated immediately and by more non-terminal servers (e.g. post statistics from web UI scripts).
      * New user stats are tracked more than just for "today".
      
      The upgrade of these files is automatic and built-into SBBS.
      
      Still to do: overhaul the slog utility to support the new csts.tab file format.
      f963dcbf
  30. Mar 24, 2022
    • Rob Swindell's avatar
      Support user credits and transfer stats > 4GB in total · 2d4ec7b8
      Rob Swindell authored
      Credits and daily free credits are accurate to the byte up to (a maximum) of 18446744073709551615 (that's 18 Exbibytes - 1).
      
      User's upload and download byte stats are now similarly extended in maximum range, but the accuracy is only "to the byte" for values less than 10,000,000,000. Beyond that value, the accuracy declines, but is generally pretty damn accurate (to 4 decimal places beyond the nearest multiple of a power of 1024), so I don't expect that to be an issue. This method of storing upload/download byte stats allowed me to use the same 10-character user record fields in the user.dat file.
      
      As a side-effect of this enhancements:
      * User and file credit values are now expressed in multiples of powers of 1024 (e.g. 4.0G rather than 4,294,967,296).
      * Free credits per day per security level has now been extended from 32 to 64-bits (to accommodate values >= 4GB).
      * adjustuserrec() now longer takes the record length since we can easily determine that automatically and don't need more "sources of truth" that can be out-of-sync (e.g. the U_CDT field length going from 10 to 20 chars with this change).
      * setting the stage for locale-dependent thousands-separators (e.g. space instead of comma) - currently still hard-coded to comma
      * more/better support for files > 4GB in size (e.g. in the batch download queue)
      * user_t ulong fields changed to either uint32_t or uint64_t - I didn't realize how many long/ulong's remained in the code (which are sometmies 32-bit, sometimes 64-bit) - ugh
      * Steve's ultoac() function renamed to u32toac() and created a C++ wrapper that still uses the old name, for homage
      2d4ec7b8
  31. Mar 21, 2022
    • Rob Swindell's avatar
      SMB items (messages or files) can now have 32-bit or 64-bit cost value · f1332d3e
      Rob Swindell authored
      To fully support files > 4GB in size in file bases, credit values larger than 32-bits must be supported too.
      
      There's a couple of todo comments/items included in this commit, but that's mainly to do with messages (which don't really have costs anyway).
      
      The main thing to deal with now is the fact that users can't have more than 4GB in credits in the first place! That's got to be fixed next.
      f1332d3e
Loading