• src/sbbs3/websrvr.c

    From Rob Swindell@1:103/705 to Git commit to main/sbbs/master on Sun Jan 16 22:23:06 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/005633b1fffb7b6df70cb13b
    Modified Files:
    src/sbbs3/websrvr.c
    Log Message:
    Log requests that resolve outside of the web root as hack attempts"Request for x is outside of the web root" was already logged (with a "NOTICE" log level), but would not sound the hack attempt alarm (on Windows) or log to the hack.log. Now it does.
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Digital Man@1:103/705 to Ragnarok on Mon Jan 17 13:05:44 2022
    Re: Re: src/sbbs3/websrvr.c
    By: Ragnarok to Rob Swindell on Mon Jan 17 2022 11:57 am

    alias portion (webrequest) can support multiple levels? like:

    /ftp/main/ansis = /sbbs/data/main/ansis
    /ftp/other/upload = /home/pepe/uploads

    Yes. But they likely should end in a '/' too.
    --
    digital man (rob)

    This Is Spinal Tap quote #25:
    Viv Savage: Have... a good... time... all the time. That's my philosophy. Norco, CA WX: 58.0øF, 80.0% humidity, 3 mph NW wind, 0.00 inches rain/24hrs
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to Git commit to main/sbbs/master on Sun Jan 30 14:35:52 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/d8c099dbc962727df2723650
    Modified Files:
    src/sbbs3/websrvr.c
    Log Message:
    Fix HTTP-requests for files >= 2GB in sizeAn int is 32-bits on all supported platforms, so this has always been broken. The actual file size/request-length sent would depend on fun 2's complement math (a 32GB file was being truncated to 433MB).Also fixed some wrong uses of PRIuOFF: off_t is a signed integer, so technically the maximum file size you can request now is 2^63 bytes, which is "big enough".
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Mon Feb 28 22:33:30 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/c0f42027dded92626251d686
    Modified Files:
    src/sbbs3/websrvr.c
    Log Message:
    I don't know what I was smoking when I did this, but it's fixed now.Weird early failure return on TLS sends. Most noticible on local(ie: fast) connections, but clearly stupid all around when youlook at the code.Fixed, but some day, I should go back and look how we eneded up inthis mess.
    --- SBBSecho 3.15-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to Git commit to main/sbbs/master on Tue Aug 9 19:38:24 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/b6cdc4730e6ca52fc0fc093b
    Modified Files:
    src/sbbs3/websrvr.c
    Log Message:
    Log message improvements: include protocol (HTTP vs HTTPS) and IP address
    --- SBBSecho 3.15-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Fri Jan 6 14:21:40 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/650abd10bff9293db51f22fd
    Modified Files:
    src/sbbs3/websrvr.c
    Log Message:
    Add a "scheme" property to http_request objectValue is "http" or "https" depending on if TLS is in use.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to Git commit to main/sbbs/master on Mon Jan 30 17:13:56 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/94f85d5f1c8d8792975b5b03
    Modified Files:
    src/sbbs3/websrvr.c
    Log Message:
    Fix MQTT-published action/login message for web server userse.g. 20230130T171211-480 0 <unknown user> 76.89.231.66 <no name>the user number name actually *are* known at this stage
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Debian Linux)@1:103/705 to Git commit to main/sbbs/master on Sat Feb 4 21:30:50 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/fe30acd5338cf267c284f0c0
    Modified Files:
    src/sbbs3/websrvr.c
    Log Message:
    More details in "Failure to send header/request to FastCGI socket" log msgElevate the log level back to ERROR (from WARNING), as this is not an expectedcondition and the sysop (me) should be alerted right away. This had previouslybe lowered (along with some other log messages) from ERROR to WARNING.When php-fpm is updated (on Debian, anyway), e.g. from 8.1 to 8.2, a newetc/php configuration (pool.d) directory was used which set me back to adefault www.conf file that uses Unix domain sockets instead of TCP sockets.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Debian Linux)@1:103/705 to Git commit to main/sbbs/master on Sat Feb 4 23:23:26 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/38b9bc8a15b819c87235b2c6
    Modified Files:
    src/sbbs3/websrvr.c
    Log Message:
    Add UNIX domain FastCGI supportResolves a long-standing todo comment and has made wiki.synchro.net pagerendering even faster.PHP-FPM defaults to creating/listening on UNIX domain sockets.This resolves gitlab issue #507
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows)@1:103/705 to Git commit to main/sbbs/master on Sun Feb 5 13:12:22 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/d2ef0fe2ccfacd2b5805b6c4
    Modified Files:
    src/sbbs3/websrvr.c
    Log Message:
    Fix webserver build on Windows - no UNIX domain socket supportAccording tohttps://devblogs.microsoft.com/commandline/af_unix-comes-to-windows/it is possible, but I think I'm using an WinSDK that's too old, so let's justnot support this feature on Windows just yet. Define UDS_SUPPORT whensupported.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows)@1:103/705 to Git commit to main/sbbs/master on Mon Feb 6 11:57:22 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/6049bc00c20620b31d6f2d41
    Modified Files:
    src/sbbs3/websrvr.c
    Log Message:
    If the FastCGI address starts with a '/', it's obviously a UNIX domain socketWe don't really need the "unix:" prefix now, but just leave that support infor backward compatibility.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows)@1:103/705 to Git commit to main/sbbs/master on Mon Feb 6 12:37:20 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/73a821b70820580fcf3bba9a
    Modified Files:
    src/sbbs3/websrvr.c
    Log Message:
    If the FastCGI address begins with a '.', treat as UNIX Domain Socket as well<Deuce> So the [previous] change doesn't work with relative paths?So... support relative UDS paths in this manner (without the "unix:" prefix)
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Debian Linux)@1:103/705 to Git commit to main/sbbs/master on Mon Mar 13 19:41:28 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/db6e54740d51622cfdda6ccc
    Modified Files:
    src/sbbs3/websrvr.c
    Log Message:
    Include protocol and client IP address in FastCGI send error log msg
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on ChromeOS)@1:103/705 to Git commit to main/sbbs/master on Sun Mar 26 19:58:08 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/2dc32fab0bda70f194ecd6cf
    Modified Files:
    src/sbbs3/websrvr.c
    Log Message:
    Don't query the active_clients count twice in a row
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows 11)@1:103/705 to Git commit to main/sbbs/master on Tue Nov 21 20:45:24 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/6697e52d90e024eb602aa2ac
    Modified Files:
    src/sbbs3/websrvr.c
    Log Message:
    Don't try to send 0-byte files

    Saves some opening, reading, and logging, but otherwise was harmeless.

    Fix issue #422
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows 11)@1:103/705 to Git commit to main/sbbs/master on Wed Nov 22 23:00:36 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/5546278f0146522c886cca18
    Modified Files:
    src/sbbs3/websrvr.c
    Log Message:
    Open SBBS_SSJS.*.html response file(s) only when actually writing data

    The first write to a the temporary SBBS_SSJS.*.html file will open the file. This should reduce the number of 0-byte files left laying around in the the temp directory, which shouldn't be happening in the first place.

    Also:
    Fixed bug noticed in temp file clean up loop: POST data files would *also*
    be retained when the DEBUG_SSJS option flag is set.

    Also:
    Replace some unsafe string operations with safe equivalents.

    Happy Thanksgiving Nelgin!
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows 11)@1:103/705 to Git commit to main/sbbs/master on Thu Nov 23 17:49:22 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/274efc589d79d20711f04da2
    Modified Files:
    src/sbbs3/websrvr.c
    Log Message:
    A little clean-up around FILE* opening/closing, error handling

    "HTTP Logging" replaced in log messages with "Web Server access-logging".

    Using new FCLOSE_OPEN_FILE macro to close and NULify open FILE*'s.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows 11)@1:103/705 to Git commit to main/sbbs/master on Sat Nov 25 20:27:48 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/786add2421406f8f9ed9e113
    Modified Files:
    src/sbbs3/websrvr.c
    Log Message:
    Replace IPv6 colons in access-log filenames with exclaimation marks on Windows

    Colons are not legal filename characters on Windows and when virtual hosts are enabled, the IPv6 address of the server may be used in the access-log filename so we need to clean that up or errors opening/creating the access-log files occur.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows 11)@1:103/705 to Git commit to main/sbbs/master on Sun Dec 17 17:53:22 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/b4f04d357b85fcb615dd400e
    Modified Files:
    src/sbbs3/websrvr.c
    Log Message:
    Log client address in "Sending file" and "Sent file" log messages

    For symmetry
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Mon Dec 18 23:58:18 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/df3d7d09a69ec2fdf20a0d73
    Modified Files:
    src/sbbs3/websrvr.c
    Log Message:
    Ensure do_cryptInit() is called before calling lock_ssl_cert()
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows 11)@1:103/705 to Git commit to main/sbbs/master on Tue Dec 19 20:20:18 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/6180a88022c5d1e3f3a02dcd
    Modified Files:
    src/sbbs3/websrvr.c
    Log Message:
    Look in mods dir for FileIndexScript before the exec dir

    ... unless the full path was specified.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows 11)@1:103/705 to Git commit to main/sbbs/master on Thu Jan 4 19:17:34 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/850a6595d70e78025c5a8f29
    Modified Files:
    src/sbbs3/websrvr.c
    Log Message:
    Don't pass a TLS session ID of 0 js_CreateCommonObjects() for non-TLS sessions

    The proper sentinel value here for "no TLS session" is -1, not 0.

    This, at minimum, was causing a lot of extraneous calls to destroy_session() (from js_socket.c's do_js_close()) with an invalid (hopefully, not
    otherwise used) cryptlib session ID of 0.

    Nothing checks or logs the return value of destroy_session(), but I'd expect
    it to be failing ... a lot.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows 11)@1:103/705 to Git commit to main/sbbs/master on Sun Jan 7 19:19:40 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/ec45b264572304e92c3e0839
    Modified Files:
    src/sbbs3/websrvr.c
    Log Message:
    Log an error if ssl_sync() fails, for W6RAY

    Hopefully help debug why HTTPS isn't working for him
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows 11)@1:103/705 to Git commit to main/sbbs/master on Mon Jan 15 21:14:44 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/5bea6c6be1f0e73a35176920
    Modified Files:
    src/sbbs3/websrvr.c
    Log Message:
    If socket is closed while in sess_sendbuf(), don't log a warning message

    ... with a socket descriptor value of -1.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Wed Feb 7 14:58:34 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/b973a74765fb50b36c045713
    Modified Files:
    src/sbbs3/websrvr.c
    Log Message:
    Fix off_t printf warning.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Fri Feb 9 09:07:36 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/5bd8253c7c482272b9a4ea1f
    Modified Files:
    src/sbbs3/websrvr.c
    Log Message:
    Temporary workaround for TLS issue.

    It appears that if the timing is "just wrong", a large POST can
    cause TLS to fail. This has shown up as an inability to edit
    pages in the wiki.

    This is not a fix however, but simple a workaround until this is
    root-caused.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows 11)@1:103/705 to Git commit to main/sbbs/master on Tue Feb 13 23:38:14 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/6326f6d0d33019f5af7b31fb
    Modified Files:
    src/sbbs3/websrvr.c
    Log Message:
    Set javascript callback "terminated" flag to true when recycling

    (or terminating) the server.

    This will allow background JS threads to terminate when recycling, so the server doesn't just hang indefinitelyi when recycling.

    Add more logging in cleanup() when waiting for children threads to terminate.

    Also, eliminate the global 'terminate' variable, answering the question:
    Can this be changed to a if(ws_set!=NULL) check instead?

    Yes, yes it can.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on ChromeOS)@1:103/705 to Git commit to main/sbbs/master on Wed Feb 14 00:28:02 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/95be5a80e00eebcb23370f92
    Modified Files:
    src/sbbs3/websrvr.c
    Log Message:
    Simplify the child thread wait loop in cleanup()
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows 11)@1:103/705 to Git commit to main/sbbs/master on Thu Feb 15 22:55:30 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/8d7d9eb22fbabde369e6ab31
    Modified Files:
    src/sbbs3/websrvr.c
    Log Message:
    Lower severity of "Response file path is NULL" log msg from CRIT to WARNING

    This is not a completely unexpected thing to happen during ungraceful termination
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Wed Feb 21 07:47:10 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/50be44416dbf437e93f0f283
    Modified Files:
    src/sbbs3/websrvr.c
    Log Message:
    Pass user_t as pointer.

    Silly to pass a 728-byte object as a parameter.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows 11)@1:103/705 to Git commit to main/sbbs/master on Mon Mar 18 21:22:06 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/e9778331b2584afc731f45bc
    Modified Files:
    src/sbbs3/websrvr.c
    Log Message:
    Fix a bunch of false "File sent" logs (and uploader-notifications)

    Web browsers tend start a download and then immediately close the socket
    (so now send_failed will be true), while on a secondary socket, do a range download of the same file.

    So log the range requests/completions and don't log successful file sends
    when the send was terminated due to a send failure.

    We still count very small (e.g. 2 byte) ranges as successful file transfers
    and notify the uploader (of a partial download), so we should fix those
    issues still. But at least now, there's a whole lot less "noise" created
    from HTTP[S} file downloads via browser.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows 11)@1:103/705 to Git commit to main/sbbs/master on Sat Mar 23 17:11:54 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/3711e03ad615c3183aa401b4
    Modified Files:
    src/sbbs3/websrvr.c
    Log Message:
    Use volatile keyword to (maybe) fix CID 488122: Data race condition

    Ideally, I'd use atomic_bool instead, but we're using an older WinSDK for Win7 compatibility and so... can't.

    Perhaps an xpdev 'protected_bool_t' should be created.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Sun Mar 24 15:46:02 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/90de10cf0dc28c25fab197b4
    Modified Files:
    src/sbbs3/websrvr.c
    Log Message:
    Grow another 4-byte string.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)