- Comments that named something else now name their own function:
ircd member, imageboard srcPath and linker, forum when, redirect and
errNoArea, textui sheetDraw.first; a stray comment in rest.go gone.
- confui: changeLines uses diffLines instead of repeating it.
- nntp: accept_from names are looked up when the configuration loads
(start and reload), now said in the code and the wiki.
- Tests: tnClient.read grows its buffer for a command split at its end
(a full buffer read nothing for ever); freeAddr folded into freeTCP;
zipOf is a helper.
- go3270-sec 6c7224e: its comment fixes and gfxtest tidying.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
Picks up go3270-sec ff000f5: TSO member names kept in IND$FILE
commands, a terminal that does not answer the Query sized by its model,
and IBM-DYNAMIC with no Usable Area 24x80.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
Where the terminal has triple-plane symbol sets and takes the extended
Load PS that loads one plane (PCOMM with programmed symbols alone: 3 of
them, and 3 single-plane), a picture's pels are each any of 8 colors:
the picture error-diffused to the planes' colors, a cell of several
colors a symbol in a triple-plane set, its blue, red and green planes
loaded one by one (cleared with the first) and the cell shown neutral
(X'F7', which shows its planes added); a cell of one color and black a
symbol in a single-plane set in that color while there is room, then in
a triple-plane set in its color's planes. The picture is as large as
its cells fit both.
A terminal without the extended form loads its triple-plane sets whole
and uses them as single-plane ones, a color a cell, as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
Between vector graphics and blocks: the picture cut into character
cells, each one of the 3270's 7 colors (the color that, with black,
comes nearest its pels) and a symbol of its pels, error-diffused over
the whole picture with each pel black or its cell's color. The symbols
are loaded into the terminal's single-plane sets (LCIDs 0xC2 on) before
the screen, 190 a set, so the picture is as large as its cells fit in
the sets there are (PCOMM: 2 with vector graphics on, 380 cells); a
blank cell needs none, cells alike share one. A row's runs of a set and
a color are each a Set Attribute of both (go3270's AttributeOnly
CharSet).
A picture's Set Attributes lasted the rest of the screen's write, so the
caption and body after a block picture took its last color: the
attributes are set back after a picture (the character set too after
symbols). colorTerminal read the Color reply's pair count from the
wrong byte, so PCOMM (a 3278 by its type) was not taken for color.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
An image board's pictures (a post's thumbnail, the image whole) are now
drawn on a 3270 instead of only said in words:
- vector graphics (PCOMM): bitmaps a pel a pixel, error-diffused to the
terminal's own palette (PCOMM's 16 colors, from the Graphic Color
reply go3270 now asks for), overpainted (PCOMM's exclusive or does not
combine blue), cropped and split over segments by go3270's
ImagePictures; drawn after the screen over cells left empty, since a
character over a picture clears it in its cell
- blocks (x3270, any color 3270 with graphic escape): ▀ ▄ ▌ ▐ █ in the
7 colors, a cell two pixels by two, each cell the color and block
nearest its pixels, a run of a color one Set Attribute
and in words on the rest, as before, under the picture where there is
one. Pictures on/off (M, PF11) on the profile, kept as the text
terminals' preference is; the profile's terminal line says how they are
drawn. tn3270_vector is on by default now that PCOMM draws them.
go3270-sec: GraphicColors, DitherBitmaps, ImagePictures, the Query List.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
internal/ircd serves IRC ([irc]: plain and TLS listeners, limits at
once and per address, the deny list and bans). Users log in with
their BBS names and passwords, by SASL PLAIN or PASS name:password,
throttled and hack-logged like any login; their nicks are their names.
Each connection is a node (via irc): in who's online, reached by node
messages, thrown off by the sysop.
#ROOM is the chat room ROOM: IRC clients talk with callers on
terminals, the web and the API. PRIVMSG to a nick is a node message;
/me is an emote; pages, mail and notices come as NOTICEs, and a sysop
answers a page by joining #sysop-N. NAMES, WHO, WHOIS, LIST, ISON,
USERHOST, MOTD, LUSERS; IRCv3 sasl, server-time (history replayed on
join with its times), echo-message, multi-prefix, userhost-in-names.
The protocol's parts are ergo's: messages read and written by its
irc-go library (ircmsg, ircreader, ircfmt), the numerics and the
ISUPPORT list taken from its source under the MIT license
(internal/ircd/LICENSE.ergo). A node may now be in several rooms at
once (JoinAlso, SayIn, Part) for IRC's channels.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
A script (scripts_dir/NAME.js, run by a menu's script:NAME, and logon.js
after each login) draws the BBS's shared screens through ui (menus,
tables, forms, panels, messages, the editor, confirmations), so one
script works on text, RIP and 3270 terminals. It acts as its caller,
with their access: msg (areas, messages, posting, mail), node (who's
online, node messages, its activity), user, bbs; and keeps JSON values
in data, for everyone or (data.user) for the caller, in the database
(script_data).
goja runs it in strict mode, with no files, network or processes. A
watchdog stops a script that computes more than two seconds between
screens (the caller's time at a screen is not counted); the caller
hanging up ends a script whatever it catches; failures are logged and
told (to a sysop, with why). Scripts are compiled once, again when
changed; bbs check refuses scripts that do not compile and menus naming
missing ones.
goja is pinned to its June 2026 commit (the last that builds with Go
1.24; it is changing quickly now).
scripts.sample has one-liners and a poll; both are tested, the
one-liners on a text terminal and on a 3270 (s3270). That test found
3270 forms broken since the shared screens: the input field began
under its label's last character, whose attribute byte erased it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
[general] database = takes SQLite's file as before, or a server's
address: postgres://... (pgx) or mysql://... / mysql:DSN
(go-sql-driver). The store's SQL is written once; internal/store's
dialect gives each engine its forms of what differs: ? placeholders
($1 for PostgreSQL), ids returned by RETURNING or LastInsertId, upserts
(ON DUPLICATE KEY UPDATE), INSERT OR IGNORE, GREATEST, booleans, unique
violations, column checks for migrations, indexes. The schema is one
list with types per engine: names match in any case (NOCASE, an ICU
collation made on PostgreSQL, utf8mb4_0900_as_ci), MySQL keeps indexed
text in VARCHARs and connects with the SQL mode the store wants (ANSI
quotes for "read" and "key", strict, rows matched not changed).
Existing SQLite databases are kept as they are.
bbs db copy DATABASE copies every table into a new database of any
engine, keeping ids (PostgreSQL's sequences set after). Logs and bbs
check never show a server's password.
Under go test, BBS_TEST_DATABASE puts every test's store on a
PostgreSQL or MySQL server (a schema or database each, dropped after):
the whole suite passes on PostgreSQL 16 and MySQL 8.4 as on SQLite.
The store's own tests check what the engines do differently, and
copying from SQLite into each.
Also: the FTP tests' readiness probe now waits to be counted out, so the
per-address limit test no longer fails at random.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
[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
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
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
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
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