Commit Graph
27 Commits
Author SHA1 Message Date
Claude 12570cb4d7 Add an ACME client: certificates for every TLS server, renewed
[acme] gets certificates from Let's Encrypt, ZeroSSL or any ACME CA and
renews them before they run out, in the manner of acme.sh, built on lego
(MIT). [acme NAME] adds more. HTTP-01 (its own port 80 listener or the
BBS's web server there), TLS-ALPN-01 (any TLS server of the BBS on 443)
and DNS-01 (15 providers built in, exec:PROGRAM, or acme.sh's own dnsapi
scripts through acmesh:dns_xx) are supported; renewal follows renew_days
and the CA's ARI; a hook runs after each new certificate.

internal/certs is where every TLS server now gets its certificate: a
file pair read again when it changes, or the ACME client's (cert_file =
acme or acme:NAME, and by default when a TLS server has no files and
[acme] is set). Gemini keeps its pinned certificate and Yahoo its
login.yahoo.com one unless told.

bbs acme list / renew, bbs check lists them, a Certificates page in the
configurator, the sample config, Configuration Reference and a new
Certificates wiki page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRSjWGPJDHVw7cyWKvE
2026-11-09 06:01:07 +00:00
Claude 2c9dedb4b2 MSN Classic: the 1996 client's NTLM sign-in
MSN 1.3 (Windows 95 OSR2) signs in with NTLM on LOGSRV: a NEGOTIATE
answered with a CHALLENGE, then an AUTHENTICATE whose NTLMv1 response
(the LM one: the client leaves the NT one empty) is checked against the
account's kept hashes, throttled and logged as a password is.

The store keeps each account's LM and NT hashes (ntlm_keys) as it keeps
CompuServe's key: made whenever the password is seen in the clear, bound
to the password hash, and only while MSN Classic is served.

The context an accepted sign-in leaves seals the account methods as the
client expects: the Password dialog's change (0x12), the billing pages'
record (0x13) and the payment commit (0x14), RC4 under the 40-bit seal
key with a CRC-32 and sequence-numbered token.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRSzB4EzF1cUBt1ccvB
2026-11-09 05:12:52 +00:00
Claude 2c9fbd0b9a Add MSN Classic: The Microsoft Network for the Windows 95 client
internal/marvel serves the MSN client of 1995 to 1998 over its own
protocol (Marvel), by modem (frontend = marvel on a telnet or raw
listener) or over TCP ([marvel], port 569):

- the serial link (byte stuffing, CRC-32, Go-Back-N with a 16-packet
  window and retransmission) and the TCP "straight" records
- pipes, MPC host blocks and tagged parameters, property records
- LOGSRV: sign-in with BBS accounts (as a node), password change, the
  billing pages' name and address
- DIRSRV: MSN Central, Categories (a folder per area group), MSN Today
  (the boards with the newest posts), Go words, icons drawn here
- the BBS service: each readable message area is an MSN bulletin board,
  its messages listed with their reply threading, opened as articles,
  posted and replied to from the Compose window (plain, RTF or
  compressed RTF, kept as plain text) and deleted by their author

Written from the marvel-msn project's protocol notes and wire captures;
none of its code is used.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRSzB4EzF1cUBt1ccvB
2026-11-09 02:54:49 +00:00
NeoandClaude Opus 5.5 434a26e00b listen handoff = yes: the caller's line itself from modemmenu (#25)
* listen handoff = yes: the caller's line itself from modemmenu

A raw unix listener with header = yes and handoff = yes takes the
caller's line with the header (SCM_RIGHTS), as modemmenu's item with
handoff = yes sends it: the session runs on that terminal, nothing
copied between modemmenu and the BBS.  What modemmenu had read and not
used comes on the connection after the header, ahead of the terminal.
The connection then only marks the session's life: logging off closes
it (the line goes back to the menu, its flags as they came), and the
menu closing it (its time limit, the caller gone) hangs the session up.
A header without a line is an ordinary call.

Tests: four callers on handed-over lines at once, each on its own
terminal; logging off closes the connection; the connection closed
takes the terminal away.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRxseyEuLRFbFaBoX3

* handoff: a closed or hung-up line ends the call quietly

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRxseyEuLRFbFaBoX3

* oscar test: let bob's arrival come again before Carol's

TestAIMToIRC failed on CI when alice saw a second arrival for bob
before Carol Ann's; the test now passes over repeats of bob's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRxseyEuLRFbFaBoX3

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-08 09:07:38 -08:00
NeoandClaude 237ea990a5 CompuServe: CIM's way in (Secure Login, B+ Transport Layer, HMI pages) (#22)
A CIM client (AP in its ESC I answer) now gets the GUI service instead
of "?LOG CAI", following what 24high/CompuServe-Emulator recovered from
WinCIM 3.0.2:

- Secure Login (+ before the User ID): RA:/RB:/UR:/HR:, checked
  against a key kept from the password (cis_keys, bound to the password
  hash, kept only while a compuserve listener runs), "No." on failure
- the terminal-mode trade: ESC [ > 0 q, ESC [ > 3;3 p, the parameter
  line's sum checked, ACK (NAK and again if wrong)
- xfer.BTransport: the B Plus Transport Layer, counters per direction,
  1 KB blocks, messages as M packets and a final L
- HMI: session open, pages (menus as 0x27, articles as 0x28 and their
  text in pieces), the rest of a menu, Find, the directory lookup, acks,
  logoff; CIS:/HOM: names on the ASCII service's page tree

Forums, Mail and CB in CIM say to use a terminal for now.


Claude-Session: https://claude.ai/code/session_01B82eRRPWCkk1Ro91AuzXFM

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-08 05:03:36 -08:00
Claude 20908882c9 CompuServe front end: logon, ESC I, pages, and the B / B Plus protocols
A listener with frontend = compuserve serves the CompuServe Information
Service on the BBS's users: Host Name, User ID (an account's number as a
CompuServe ID, or its name) and Password, ?LOG codes, ESC I terminal
identification, the banner and logoff text, and the ASCII service's menu
and article pages with GO, FIND, T/M/B/F/R/N/P, SET and ; chaining.  CIM
clients are told ?LOG CAI until the HMI service is built.

internal/xfer/cisb.go is CompuServe B, Quick B and B Plus, the host's side
and the terminal's: ENQ start, + parameter negotiation, quoting, all four
check methods, a send window with ENQ resynchronization, downloads and
uploads.  Tested against the spec's checksum and CRC values and over a
noisy loopback.

docs/cis holds the research and design behind it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRPWCkk1Ro91AuzXFM
2026-11-08 11:16:10 +00:00
Claude 945a3fa6a5 Use github.com/D-Modem/go3270 directly, no replace line
go3270's module path is now github.com/D-Modem/go3270 (D-Modem/go3270#1),
so bbs requires it under that name and imports it there; the replace
of racingmars/go3270 goes. Build, vet and tests pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRSqjp9Pn2KBr9N9LAn
2026-11-05 10:52:33 +00:00
Claude 7399e0fa36 Point repository references at the D-Modem organisation
The repositories moved from Neo-Desktop to the D-Modem GitHub
organisation: D-Modem-RE is now D-Modem/D-Modem, pico-serial is
D-Modem/hardware, modemmenu (PBX-Modem) is D-Modem/menu, bbs-sec is
D-Modem/bbs and go3270-sec is D-Modem/go3270.  Update links, module
paths, submodule URLs and source-location strings to match.  Copyright
notices still name Neo-Desktop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRUwD2JJ5d6fgHmpVTw
2026-10-29 09:02:40 +00:00
Claude a4ff918953 Stop spins and races in door telnet, SSH pump, Fido lock, tn3270
- door: telnetClient.Read returns at once for an empty buffer; a failed
  answer to an option is returned by the next Read or Write rather than
  reading on for ever.
- ssh: sshTerm.pump stops once closed when the channel reads nothing
  without error, instead of spinning.
- ssh: makeHostKey removes the key file when Close fails, not only Write.
- fido: flock retries EINTR; Lock retries a failed lock file briefly.
- tn3270: negotiation and its 30s watchdog decide by one flag, so a
  negotiation ending as time runs out keeps its connection.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
2026-10-18 22:03:13 +00:00
Claude 8cac5066f6 Doc comments on every function
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
2026-10-18 21:26:18 +00:00
Claude e9fc5ed156 Run as a user of its own: ports bound as root, then root given up
[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
2026-10-14 21:28:57 +00:00
Claude 14aa6d40ac Fix two races behind the flaky door test
TestDoorSession failed about once in 100-200 runs, two ways:

- "fork/exec door.sh: permission denied": the server made unix sockets
  under a umask of 0177, and the umask is the whole process's.  A file
  made by another goroutine meanwhile lost its mode: here the test's
  door script, written as the server started, came out 0600.  In the
  BBS the same could befall anything made while a listener started.
  The socket is now made in a private directory beside its place, given
  its mode and group there, then renamed into place: still no moment
  when others could connect, and no umask touched.  Closing the
  listener removes the socket.

- the door's last output lost ("Bye from the door" never came): a door
  without a pty wrote to cmd.StdoutPipe, which Wait closes as soon as
  the door exits, while the reader may not have drained it.  The door
  now writes to a pipe of the runner's own, read to its end.

TestOutputAfterExit (door) lost 28-48 KB of a door's last output on
every run before; TestSocketLeavesUmask (server) saw 0755 files made
0600 within a few dozen tries.  Both pass now, and TestDoorSession
passed 500 runs in a row under -race.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
2026-10-14 09:13:27 +00:00
Claude b89bac2a38 geoip: regions and cities, from city databases
- the reader gives an address's region (the first subdivision) and city
  where the database has them: GeoLite2/GeoIP2 City and DB-IP's City
  Lite as MaxMind DBs; DB-IP's city CSV and IP2Location LITE DB3 and up
  as CSVs (now read with encoding/csv, quoted fields and all)
- CSVs stream in (gzipped or not) and are kept small: each place once,
  each range by its start, IPv4 apart in 4 bytes; DB-IP's city list,
  7.8 million ranges, in 135 MB
- geoip.File reads the first time at once and later changes in the
  background, the old reader answering meanwhile; the server reads the
  database when it starts; the image boards share the BBS's when the
  file is the same
- bbs.Place has the city; the log and the sysop's node list show
  "Mountain View, California, United States"; who's online, the API and
  the forum's flags still show only the country
- checked against MaxMind's reader on DB-IP's city database of October
  2026 in both formats: the same country, region and city for 200,000
  addresses

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
2026-10-14 08:48:51 +00:00
Claude 2f34dfc09d phone: every country's numbering plan, from libphonenumber
NANPA's site was out of reach, so the hand-made tables were checked
against Google's libphonenumber (its data of 2026-10-08, kept up from
NANPA and the national regulators) and then replaced by it:

- the area-code check found 273 (Quebec) and 633 (Canadian personal)
  missing, and nine US codes it has nowhere (357, 436, 457, 483, 624,
  679, 837, 861, 924): those are gone with the old tables
- internal/phone/gen makes metadata.go (every territory's calling code,
  international and trunk prefixes, shared-code rules, number kinds and
  formats) and places.gz (269,198 prefixes to places, 151 calling codes)
  from a libphonenumber checkout: make phone-data
- Parse follows libphonenumber's rules: national prefixes taken off and
  transformed, shared codes told apart by leading digits and plans,
  the kind of number (fixed line, mobile, toll-free...), the place to
  the exchange where known, and numbers written as each country does
  (+44 20 7123 4567, +81 3-1234-5678)
- checked against nyaruka/phonenumbers on 34,362 numbers: the same
  country, kind and place for all; formats differ only for the Faroes,
  where its bundled data is older
- the tables load when first wanted (about 6 MB); the sysop's node list
  says which callers are on mobiles

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
2026-10-14 08:26:38 +00:00
Claude 4d49631d37 Where callers are: GeoIP for the forums, caller ID decoding
- internal/phone reads modem caller IDs with its own tables: the ITU's
  country calling codes (shared ones told apart), the NANP's area codes
  by state and province, toll-free and other services, and how each
  country dials, so national numbers read as [general] phone_country
- [general] geoip (with geoip_credit) is the BBS's country database;
  [chan] geoip falls back to it.  geoip.File keeps a database file up
  to date for both
- bbs.Locate and Node.Place: a caller's place by caller ID, else by
  address; the connect log, who's online (the country), the sysop's node
  list (number and state) and the API's /who show it
- messages keep the poster's country (messages.country); the web forum
  shows its flag by the poster's name in every theme and on Online
  Users, with the database's credit at the foot ([http] forum_flags)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
2026-10-14 08:05:27 +00:00
Claude 32529543d6 Image boards on the terminals, with their pictures
The text BBS and 3270s have the image boards (B on the main menu, or a
menu's boards): the boards, threads by bump order, posts read as
messages with who posted, the thread, and the posts that quote them.
Callers post as the web's posters do (names, tripcodes, sage, staff's
capcodes), through the same checks: posting is now Submit, shared by
the web's form and bbs.ImageBoards. A thread's image comes by the
terminal's transfer protocol.

Pictures (view.Picture, on messages and panels) are shown as well as
the terminal can: kitty's graphics protocol (kitty, Ghostty), sixel,
iTerm2's inline images (iTerm2, mintty), or coloured half blocks in 256
colours on other UTF-8 terminals; described in words elsewhere and on
3270s. V shows the image whole; pictures on/off is on the profile. The
web terminal has xterm.js's image addon, so sixel there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
2026-10-14 02:16:21 +00:00
Claude 8ab9e8a24b Keep callers out: deny lists, bans, a name filter, the hack log, telnet over TLS
[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
2026-10-12 17:27:43 +00:00
Claude f832430916 Add a web terminal page: the BBS in a browser
[http] serves /terminal (and / goes there): a page with xterm.js 5.5 and
its fit addon, built into the binary (MIT licensed, license included),
joined by a WebSocket (/terminal/ws, subprotocol bbs.terminal, binary
frames) to the text BBS, run in-process as for a telnet caller: a node
shown as "web terminal", the BBS's own login, ANSI and UTF-8, the size
the page fitted.

The page has a strict Content Security Policy (scripts only from the
BBS, no inline scripts, no framing); the WebSocket is taken only from
the BBS's own pages (or the cors origin), under the HTTP server's TLS,
connection and rate limits.  terminal = no turns it off.

The WebSocket's own stream closes the connection when a read deadline
passes, which the text BBS uses for idle time and notices: the line
adapter SSH sessions had (reads with deadlines that only end the read)
now serves both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
2026-10-12 08:26:24 +00:00
Claude 4beb797f08 Find Commodores by their keys while they log in
A Commodore's terminal answers no question, so petscii = auto no longer
asks every caller that is not ANSI to press DEL.  Such a caller is
watched while it logs in, its logon screen and name prompt in capitals
(which a C64 and anyone else both read):

- a key only a Commodore has (DEL, cursor keys but down/XON, F1-F8, CLR,
  a shifted letter not followed by a UTF-8 continuation byte) switches
  to PETSCII at once: the screen cleared, with the questions' leftovers,
  and the logon and name prompt again;
- a name in lower case is ASCII, with nothing asked;
- a name all in capitals brings the DEL question; a Commodore's DEL
  makes it PETSCII and the name is taken in lower case, as typed.

What is not settled by the end of the login is ASCII.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
2026-10-12 08:01:06 +00:00
Claude b20533e6ff Identify VT terminals as DEC's were asked
internal/vt asks an ANSI terminal everything at once (ENQ answerback,
DA1, DA2, XTVERSION, its cell size), with a cursor position report last
so the answers are complete when it comes, and reads them into a name
(XTVERSION, SyncTERM's CTerm, DEC models by DA2 and firmware, tmux,
screen, mintty, rxvt, xterm, VTE, the answerback, the VT class), a VT
level, sixel and color.  A terminal that is not ANSI is asked ESC Z: a
VT52 answers.

What it said changes what the caller gets: a VT without UTF-8 (not a
PC's CP437 BBS terminal) gets line drawing in DEC Special Graphics and
Latin-1 on a VT220 or later; a DEC monochrome terminal gets bold for
color; a VT52 its own escapes (VT52Writer) with its cursor keys ignored.
Sixel now comes from the same answers.  The name shows in the profile,
the log and the API's who (terminal).  A listener's vt = no asks nothing.

Also: the terminal type and rlogin's rate are set under the BBS's lock
(who's online reads them).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
2026-10-12 07:07:23 +00:00
Claude 7ce2d8aacb Serve Commodore (PETSCII) and RIPscrip terminals
PETSCII: internal/petscii translates what the text BBS writes for ANSI
terminals (UTF-8, SGR colors, clearing, cursor movement, box drawing)
into the C64's lower/upper case set and color codes, and reads its keys
back (DEL, RETURN, shifted letters).  A listener's petscii = yes makes
every caller a Commodore, auto asks a non-ANSI caller to press DEL, and
telnet terminal types like c64 or petscii are believed.  Callers get 40
columns (80 for a C128 from the profile): one column menus and lists
that fit.  .seq display files are sent as they are; doors are not
offered.

RIPscrip: internal/rip writes RIPscrip 1.54 (MegaNums, drawing, button
styles, buttons, text windows).  rip = auto asks BBS terminals with
ESC [ ! and a position report; a RIP terminal gets every menu, built-in
or the sysop's, as a scene of buttons that send their keys, cleared on
a choice, and .rip display files before .ans.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
2026-10-12 06:19:46 +00:00
Claude 41e16cd38b Add an SSH listener, with users' keys
[listen NAME] type = ssh serves the text BBS over SSH.  Users log in
with their BBS password (password or keyboard-interactive, throttled
and delayed as on a terminal) or with one of their public keys; the
user "new" gets the BBS's own prompt to sign up.  The pty's terminal
type and size go to the text BBS.  Commands, SFTP, forwarding and
second sessions are refused.

Host keys (ed25519 and RSA by default, beside the database) are made
0600 the first time and refused when others may read them; legacy = yes
adds CBC ciphers and group1 DH for old clients.

Keys live in a new ssh_keys table and are managed by bbs sshkey
add/list/del, the profile on the text BBS (after the password again),
and /api/v1/me/keys (from a login's session only, not an API key).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
2026-10-11 21:42:16 +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 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 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