Commit Graph
14 Commits
Author SHA1 Message Date
Claude f87a7941d2 Test a terminal caller and a WebSocket caller chatting
A text caller and a web caller on the JSON WebSocket share a chat room:
lines and emotes both ways, /who, node messages each way, and the web
caller paging the sysop, who answers from the terminal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
2026-10-11 17:25:54 +00:00
Claude 284d0e08f5 Add an HTTP API with JSON and protobuf WebSockets
[http] serves a REST API under /api/v1 (accounts, message areas, mail,
file areas with uploads and ranged downloads, chat rooms, paging, and
sysop administration including FidoNet polls and news syncs), with
server-sent events and two WebSocket endpoints speaking the bbs.v1
protocol from proto/bbs.proto: JSON text frames at /api/v1/ws and
binary protobuf at /api/v1/ws/proto.  Stream clients get a real node,
so web users chat with terminal callers, get node messages and page
the sysop.

Tokens are login sessions or API keys (bbs token add/list/revoke),
stored as SHA-256 hashes, with scopes.  TLS by default, per-token and
per-address rate limits, strict bodies, one CORS origin at most,
Prometheus metrics on their own address, and an OpenAPI 3.1 document
checked against the routes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
2026-10-11 16:40:57 +00:00
Claude b45dfa58d9 Customization: screens of the sysop's, menus, @-codes, strings
screens_dir holds display files by name: NAME.ans (ANSI art in CP437,
SAUCE dropped; UTF-8 to UTF-8 terminals, CP437 bytes to the rest),
NAME.asc/.txt (text, paged) and NAME.3270 (text with {color} tags).
logon, newuser, welcome and goodbye are shown by themselves, on text
terminals and 3270s; others by menus.  @-codes (@USER@, @NEWMAIL@,
@NODE@, @ONLINE@ ... with @CODE:20@ widths, @CLS@, @PAUSE@) are filled
in, their values cleaned.

[menu NAME] sections: KEY = ACTION Label, actions the built-in parts or
door:, menu:, screen:, area:; [menu main] replaces the built-in main menu
on both kinds of terminal, with an optional screen in place of its list.
[strings]: the login and command prompts, the pause, the logoff question
and the welcome.  bbs check refuses menus naming what is not there.

screens.sample: a set of screens to start from.  Tested: the screens
package; menus and strings in the configuration; a text caller through
ANSI art, strings, menus and screens; a 3270 (s3270) through colored
screens and the sysop's main menu.  Wiki page Customization.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
2026-10-11 02:32:22 +00:00
Claude d61601320a Chat, node messages and paging the sysop; finger and gopher servers
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
2026-10-11 02:20:13 +00:00
Claude 41c3eb0758 Doors in dosemu2 under Docker, tested with a real FOSSIL door
doors/dosemu2 builds dosemu2, fdpp and comcom64 from source on Ubuntu (no
PPA) and runs a door with the caller's line on COM1 behind dosemu2's
FOSSIL: rundoor bridges the container's stdio to the port with socat,
the door's directory on F: and the node's drop files on G:.  It runs as
the BBS's user (not root, which dosemu2 refuses), with no network, and
goes when the door ends or the caller hangs up.  {uid}/{gid} fill in the
BBS's own ids for docker run --user; make doors-image builds it.

testdoor/FOSDOOR.COM, a FOSSIL door in assembly, reads DOOR.SYS, writes
CP437 and ANSI and echoes keys; TestDosemuDoor plays it through the BBS
when the image is built, hangs up in it and checks the container is gone.
README, sample config and service notes (the docker group's risk).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
2026-10-10 21:31:51 +00:00
Claude bb65fc1fc5 Doors: drop files, a door runner and a Doors menu; dosemu2 image (WIP)
[door NAME] sections configure door programs for text callers: the BBS
writes DOOR.SYS, DORINFO1.DEF, DOOR32.SYS and CHAIN.TXT into the node's
directory and joins the caller's line to the program (pipes or a pty),
translating CP437 for UTF-8 terminals, with a time limit, idle limit and
hangup handling, single-caller doors and a cleanup command.

doors/dosemu2 builds dosemu2 from source in Docker, with a rundoor
wrapper putting the caller on COM1 behind dosemu2's FOSSIL; it is still
being tested.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
2026-10-10 20:51:24 +00:00
Claude 9cf9442d4c Add FidoNet: echomail, netmail and a binkp mailer
Message areas given an echo tag are FTN echoes; mail addressed to
Name@zone:net/node is netmail, and netmail for this system arrives as
private mail that Reply answers.  The BBS is its own tosser and scanner
(Type 2+ packets, ZIP bundles, MSGID/REPLY threading, SEEN-BY and PATH,
character sets by CHRS, dupe and loop checks, forwarding between links)
and mailer: binkp answering and calling, with CRAM-MD5.  An area that is
both an echo and a newsgroup gates between them.  bbs area echo and
bbs fido poll|scan|toss administer it.  Tested between BBSes and against
binkd and CrashMail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
2026-10-10 19:59:39 +00:00
Claude aa4fcd2c16 Add newsgroups: an NNTP server and peer syncing
Message areas given a newsgroup name are served over NNTP (RFC 3977,
AUTHINFO, STARTTLS/implicit TLS) to newsreaders, and exchanged with peer
news servers: pulled by GROUP/OVER/ARTICLE, pushed by IHAVE (POST
fallback), fed by IHAVE from accept_from addresses.  Loops are stopped by
a Message-ID history and Path; BBS posts become MIME articles, incoming
articles are kept raw and shown decoded and cleaned.  bbs area newsgroup
and bbs news sync administer it.  Tested with nntplib, two peered BBSes
and INN.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
2026-10-10 18:51:31 +00:00
Claude cce9bfbf9f IND$FILE file transfer for 3270 callers
A 3270 file area's screen has a command line, the cursor on it, for an
emulator's file transfer to type IND$FILE into: PUT uploads into the
area (through the file store's checks, size limit and allowance), GET
downloads a file of it, in DFT mode with go3270-sec's new IND$FILE
support; the transfer ends with IND$FILE's own message (TRANS03, or
TRANS13-18 for what went wrong).  An emulator without DFT is told so.

go3270-sec moves to the commit with IND$FILE.  A test runs s3270
against the BBS: a binary upload, its download, and a GET of a file
that is not there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
2026-10-10 18:09:22 +00:00
Claude f57f4d32ff File transfers on the text BBS: XMODEM, YMODEM, ZMODEM, Kermit
internal/xfer has the protocols, both ways:

- XMODEM: CRC or checksum as the receiver asks, 128 or 1K blocks
- YMODEM batch: names and sizes in block 0, sizes kept exactly
- ZMODEM: hex and binary headers, CRC-16/32, ZDLE escaping; sent in
  32 KB segments ended by ZCRCW, so a ZRPOS costs at most a segment
  and nothing is read while streaming; refused files are skipped
- Kermit: short packets, control quoting, 8th-bit prefixing and repeat
  counts as agreed, block checks 1, 2 and 3

Each has timeouts and retry limits, and takes no more than the upload
behind it allows.  Tests run them against lrzsz (sx/rx, sb/rb, sz/rz)
and C-Kermit (over a raw socket), both ways, and ZMODEM over a line
that damages bytes.

In the file areas: D downloads a file, U uploads into an area (names a
terminal program sends lose their paths and odd characters; XMODEM
asks for one), then asks for descriptions.  The transfer uses the
terminal's buffered reader, so nothing typed ahead is lost, and the
line is let settle afterwards.  Telnet in binary mode now keeps a NUL
after a CR (it is data there); a telnet client that refused binary
mode is warned that X/Y/ZMODEM will likely fail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
2026-10-10 18:02:13 +00:00
Claude 2eb5424236 File areas, served by an FTP (FTPS) server
File areas hold files: records in the database, contents in files_dir
under the record's number, so no name a user gives becomes a path.
Callers browse them from the text BBS (F) and on 3270s (8): the files'
size, uploader, downloads, SHA-256 and where to fetch them; uploaders
and sysops edit descriptions and delete.

[ftp] runs an FTP server (fclairamb/ftpserverlib) whose file system is
the areas: / lists them, an area its files, nothing else exists.  Users
log in with their BBS name and password, through the BBS's own check
(fail delay, throttling by address).  They download anything, upload
new files into areas that take them (names checked, max_file_size and
a daily upload_quota, written to a temporary file and hashed before
they are recorded), and delete their own; overwriting, appending,
resumed uploads, renames, directories, SITE and MFMT are refused.
Active mode is off, data connections must come from the control
connection's address, and tls = required (the default) refuses USER
before AUTH TLS; implicit, optional and no exist, the last two with a
warning.  anonymous = yes lets anonymous download.  max_clients and
max_per_ip limit sessions.

bbs filearea add|del|list and bbs file add|list|del look after them;
bbs init makes an Uploads area.  Go 1.24 is needed now (the library's).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
2026-10-10 17:46:02 +00:00
Claude 27377f2a49 Sixel graphics for telnet callers
Every ANSI terminal is asked for its device attributes (CSI c) and its
cell size in pixels (CSI 16 t); one that has sixel (attribute 4) sees
the logo as a picture above the system's name: [general] logo, a PNG,
or the name drawn in a pixel font, fitted to the window.  Callers turn
it off or on in their profile.  Listeners have sixel = auto (telnet's
default) or no (raw and rlogin: modem lines are slow).

The encoder (internal/sixel) keeps a picture's own colors up to 255
and dithers to the web-safe palette beyond, leaves transparent pixels
as the background, run-length codes, and keeps register 0 black for
decoders that fill unset pixels with it; a test decodes its output
with ImageMagick.  The logo's PNG and pixel font move to internal/logo,
shared with the 3270 logo; the PNG's size is checked before it is
decoded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
2026-10-10 17:35:12 +00:00
Claude 128a0c5f52 3270 graphics: box drawing, programmed symbols, vector logo
go3270 is replaced by the Neo-Desktop/go3270-sec fork, which keeps the
terminal's query replies and builds Load PS and Object Picture
structured fields.  With it the 3270 BBS uses what the terminal has:

- graphic escape (nearly every 3270): a box around the main menu,
  rules, bar charts of messages by area; ASCII where there is none
- programmed symbols (PCOMM, HostExplorer): the logo on the logon
  screen, the system's name in a pixel font or a PNG (tn3270_logo),
  cut into character cells, deduplicated and loaded into the first
  loadable symbol set, format 1 (9x16) or 3 as the terminal says
- vector graphics (PCOMM's native host graphics): the logo as a bitmap
  image instead, with tn3270_vector = yes; experimental

Option 7, "Your terminal", shows what the terminal reported, every
query reply in hex included, and the log has a line of it for each
3270, for setting emulators up.  A panic while serving a caller now
costs that call only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
2026-10-10 17:24:54 +00:00
Claude 486ea73b1c A BBS for telnet, TN3270 and modem callers
One telnet port serves both kinds of terminal: a client that says it is
a 3270 (IBM-327x, IBM-DYNAMIC) is handed to go3270 and gets full 3270
screens with PF keys; any other gets a text BBS with ANSI color where
the terminal has it.  Modem callers come through the D-Modem suite:
app_dmodem's mode = tcp on a raw port, or modemmenu by rlogin, telnet,
or a unix socket whose session header (MODEM_*/DMODEM_*) gives the
call's details and, trusted, the user modemmenu logged in.

Message areas, private mail, who's online, the user list, profiles and
self-service sign-up, in SQLite.  User text is cleaned of escape
sequences and control characters before it is stored and shown;
passwords are bcrypt; logins are delayed, limited and throttled per
address or caller ID; every step has a size limit and a timeout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
2026-10-10 16:57:31 +00:00