• Add Host: to Informational log for web

    From Nigel Reed@1:103/705 to GitLab issue in main/sbbs on Saturday, November 21, 2026 00:27:50
    open https://gitlab.synchro.net/main/sbbs/-/work_items/1376

    While waiting for #1375 to be implemented, would it be possible to add the Host: header to the Informational logging for the webserver? It already logs the User-Agent so it seems odd Host wouldn't be included too. This would help me block a lot of scraper bots and should be easy to implement.

    Thanks
    --- SBBSecho 3.38-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab note in main/sbbs on Saturday, November 21, 2026 10:03:26
    https://gitlab.synchro.net/main/sbbs/-/work_items/1376#note_11137

    The Host header is already logged, just not at the Informational level:

    - Since e5e65cc262 (rise-20-feed, 2025-06-18) the web server logs `Requested Host: <value>` for each request, but at the **Debug** log level, so it won't appear if your log level is set to Informational.
    - `User-Agent` is logged at the **Informational** level, which is why you see that one and not Host.
    - The HTTP access log (`data/logs/http-*.log`) can already include the host: set `CustomLogFormat` in the `[Web]` section of `sbbs.ini` and use `%v` (the requested virtual host) alongside `%{User-agent}i`, `%{Referer}i`, etc.

    Which log do you mean: the **access log** (where `%v` in `CustomLogFormat` does this today), or the **server log output** (console/syslog), where the fix would be raising the existing Host line from Debug to Informational?

    *Authored by Claude (Claude Code), on behalf of @rswindell*
    --- SBBSecho 3.38-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Nigel Reed@1:103/705 to GitLab note in main/sbbs on Saturday, November 21, 2026 14:45:23
    https://gitlab.synchro.net/main/sbbs/-/work_items/1376#note_11201

    Yes, it's in debug but that's a bit overkill and I'm trying to reduce a bit of load and disk space on my server since it's getting to a critical point again.

    I'm looking at the syslog ouput, which I actually split into separate files, term.sbbs.log, events.sbbs.log web.sbbs.log etc. Not all connections make it through to the access log. only valid connections. I'm also interested in capturing repeat connections that don't actually request a webpage. These are some of the most problematic for me. By collecting the host with Info level logging, I can get host/user agent but I can also get non-valid connections without having to check 2 log files. Of course, once it's added to the server then it's probably a moot point anyway, but I figured this would be a quick fix for what I need until it's added.

    I guess I'll just wait since this seems to be generating more questions that it really answers.
    --- SBBSecho 3.38-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab issue in main/sbbs on Saturday, November 21, 2026 15:20:38
    close https://gitlab.synchro.net/main/sbbs/-/work_items/1376
    --- SBBSecho 3.38-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab note in main/sbbs on Saturday, November 21, 2026 15:20:45
    https://gitlab.synchro.net/main/sbbs/-/work_items/1376#note_11208

    That's fair: Debug is a lot of extra volume just to get one line. Starting with 7a5005bddc (math-11-apps, 2026-11-21), the web server logs `Requested Host: <host>` at the Informational level, right next to the `User-Agent` line, so both will show up in your `web.sbbs.log` at Info.

    One limit: a connection that never sends a request has no Host header, so there's no host to log for those. The connection-accepted line (with the client IP) is still logged at Info, as before.

    — *Authored by Claude (Claude Code), on behalf of @rswindell*
    --- SBBSecho 3.38-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)