Gopher has no login, but it listed and sent every file area's files,
those with a download requirement too. It now offers only areas anyone
may download from (the requirement a caller not logged in meets).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
Every function and method, tests included, has a doc comment: what it
is or does, what it returns and anything a caller needs to know. Only
comments are added; gofmt split a few aligned blocks of one-line
functions once each had its own comment. The generated protobuf code
is left as protoc writes it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
[general] user (and group): started as root, bbs serve reads the
configuration, binds every socket it listens on (the listeners, TCP and
unix; the HTTP API and metrics, FTP, NNTP, IRC, finger, gopher, binkp),
gives up root (setgroups to the user's groups, setgid, setuid) and
executes itself again, the same process (its PID, for systemd and
reload), the sockets handed down; each server's listen takes the one for
its address (internal/sockets). Nothing is written as root: database,
logs, host keys, backups and a unix socket without socket_group are the
user's.
Other commands as root give root up first, so the database stays the
user's (but check and config; backup restore puts things back as root
and gives them, but the configuration, to the user). System
configuration has Run as user and group.
TestRunAs (as root) serves a port under 1024 and a unix socket as
nobody, the same process through a reload.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
The BBS, image boards and forum read their settings through an atomic
snapshot (Conf, conf, opts), so a new configuration can be swapped in
while callers are on. Menus and [strings] swap the same way.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
[security] in bbs.conf (internal/guard):
- deny_file: addresses and networks (IPv4, IPv6, CIDR) whose
connections every service closes at once: the terminal listeners and
SSH, FTP, NNTP, the HTTP API, finger, gopher and binkp. Read again
when it changes; bbs check warns of bad lines. Unix-socket callers
(modem servers, menus) are never refused.
- ban_minutes: an address the login throttle turns away is banned from
every service for that long. The API lists bans and lifts them.
- name_deny_file: name patterns (* wildcards, any case) no new account,
nor one an upstream menu makes, may take; the text BBS says so as the
name is typed.
- hack_log: failed logins and the names tried, locked accounts,
throttles, bans, refused connections and names, one a line; the API
shows its end.
A telnet or raw listener with tls_cert and tls_key is telnet over TLS
(1.2 or later; port 992), with 15 seconds for the handshake.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
Chat rooms for callers on any node (C on the text menu, Chat on a 3270):
/join, /me, /who, /rooms, /msg, the last lines of a room for who comes
in, a flood limit. A line to one node, from who's online or /msg.
Paging the sysop (S): sysops online and not /busy are told, the caller
waits in a private room, /answer joins it; with no sysop on, page_command
runs (no shell) and the caller may leave a message. On the text BBS,
lines from other nodes show at whatever prompt the caller is at, above
what they type; on a 3270, on the next screen's message line, and the
chat screen refreshes on Enter or PF5.
[finger] (RFC 1288): who is on and who a user is, no addresses, no
forwarding. [gopher] (RFC 1436): about, who's online, and the message
and file areas the sysop opens to it (none by default; bbs check warns),
selectors naming records, not paths.
Also: the TN3270 handoff set the caller's Via while who's online could
read it (a data race the new test found); it is set under the lock now.
Tested: the chat hub; two text callers chatting and paging; s3270 chatting
with a text caller; finger with the finger program, gopher with curl.
Wiki pages Chat-and-Paging and Finger-and-Gopher.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr