internal/menuauth was a copy of the client: D-Modem/menu has it now as
the public package authd, beside the server, so the protocol is in one
place. cmd/bbs imports github.com/D-Modem/menu/authd; internal/menuauth
goes, its tests with the client in menu.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRbjf74j8oq9R3PXhA
Rewrite the wiki's prose in the plain style of the rest of the D-Modem
docs: an opening sentence on every page saying what it covers, full
sentences, labelled table headers, British spelling (colour), one space
after full stops, and See also at the foot of every page. Page-title
headings are dropped, since the wiki and the site both show the title.
Home becomes a landing page: what bbs is, a Start here table by goal,
the features grouped by who they are for, and the list of every page.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRSqjp9Pn2KBr9N9LAn
[modemmenu] auth_socket: the accounts modemmenu logs in (external, no
password here) log in any other way (telnet, SSH, TN3270, the web forum
and terminal, the API, FTP, NNTP, IRC) with their modemmenu password:
BBS.Authenticate asks modemmenu's [authd] socket, and modemmenu its
backends (users file, LDAP, SQL, PAM) as at its own prompt. Nothing of
the password is kept here.
An account with a password of its own here is never asked of modemmenu.
create_users (yes): a user modemmenu knows and the BBS does not gets an
external account at their first login, a name the BBS takes and the
name_deny_file allows. A wrong password counts as any failed login;
modemmenu not answering is trouble, not counted against the caller.
Connections and modems has the keys.
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
bbs backup makes one archive (bbs-YYYYMMDD-HHMMSS.tar.gz) of bbs.conf,
the database and the files' directories, while callers are on: the
database as a SQLite file whatever its engine, taken whole at one moment
(SQLite's by VACUUM INTO, a server's in one read-only repeatable-read
transaction: store.Snapshot). It is written beside its final name and
renamed when whole; past [backup] keep the oldest go.
[backup] says where (beside an SQLite database by default), when (at =
HH:MM, daily, in serve), how many, and whether the files go too; it is
live at a reload. bbs backup list, and bbs backup restore ARCHIVE -yes
with the BBS stopped: each thing put where this system's configuration
says, what is there renamed aside (.before-restore-STAMP), a server's
database copied into a new empty one; an archive whose names climb out
is refused before anything changes.
The configuration screens' Maintenance has Back up now, the backups
made, and [backup]'s keys.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
The configuration screens are menus by what a sysop looks for: Board
(names, location, postal address, dial-in numbers, internet addresses,
what callers see, menus and prompts), System (database, log, file
locations, security, scheduled events, every section), Connections and
modems (modem lines, listeners, login limits, caller ID, GeoIP), Services
(telnet, TN3270, SSH, RLogin, finger, gopher, FTP, IRC, news, the web,
MRC, FidoNet, QWK networks, doors), Users and groups (accounts and
access levels) and Maintenance (disk space, what areas keep, old
messages taken out, the image boards' archive, backups). Running as
another user, PAM, LDAP and database and file backups are shown as not
available yet.
Nothing changes until F10 (or Save and exit): changed lines are marked
and counted; then the file is checked and written, the accounts' and
areas' changes made, and on a running BBS the live ones put in force.
F9 (or Quit without saving) leaves it all, after a yes.
view.Sheet is the full-screen page: drawn with the cursor keys on ANSI
terminals (the terminal now reads F1-F12), with fields and PF keys on a
3270, as numbered lines elsewhere. [general] gains postal_address,
phone and addresses, in the system info and as @POSTAL@, @PHONE@ and
@ADDRESSES@.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
bbs -config FILE config is screens on the local terminal for bbs.conf:
its sections and keys, each with the sample's comment on it, its default
and examples, and whether it takes effect at once or at a restart. The
same screens are the sysop's tools' Configuration (F), on text terminals
and 3270s. Keys are edited in place, unset, or taken from the sample's
examples; sections made (uncommented where the file has them commented
out), renamed and deleted (commented out). The file is checked as the
BBS would read it, written whole with its permissions and owner kept and
the old one as bbs.conf.bak, and not over a file changed since it was
read. config get/set/unset do a key at a time, for scripts.
internal/confedit edits the file as a sysop would by hand: every comment
kept, a new key below the sample's example of it. Its catalog is read
from bbs.conf.sample (embedded); a test keeps every key the loader reads
in the sample, which gained comments where keys had none.
SIGHUP (ExecReload in bbs.service.sample), or writing on the sysop's
screen, reads the file again and puts in force what may change while
callers are on: [general]'s names, texts, limits, timeouts, GeoIP and
levels, [level], [menu], [strings], [chan] (but dir) and the forum's
options; the rest is logged as waiting for a restart. A file the BBS
would not start with changes nothing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
NANPA's report of 14 October 2026 (reports.nanpa.com/public/
npa_report.csv) has thirteen geographic area codes in service that
libphonenumber's data of 8 October lacks: 357, 436, 457, 465, 471, 483,
621, 624, 679, 729, 837, 861 and 924 (the nine dropped before among
them), and 538, 542 and 543 for personal services.
The generator now takes the report too (-nanpa; make phone-data
NANPA=...) and writes nanpa.go: each area code in service, or announced
with its day, with its country and state or province, or what service
it is. A number in an area code NANPA has in service is one even
before libphonenumber has it; the area's place is NANPA's state or
province unless libphonenumber names the exchange; an announced code
(273 Quebec, 565 Georgia...) becomes a number on its day.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
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
- 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
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
Themes may now have a parent: a theme wears its ancestors' templates
under its own, so versions of one look share their markup and differ
in their stylesheets.
- phpbb31: prosilver made responsive, in a white frame on a pale page;
the header's search box with icon buttons, Quick links and the user's
menu as <details> (no script), breadcrumbs, white gradient buttons
with red words, icon-only post buttons, the last post's subject in
the forum list, small coloured icons, coloured poll bars, quick reply
- phpbb32 (on phpbb31): its pictures turned to icon-font glyphs, grey
and link blue, drawn by the BBS (no icon font loaded); names in the
lists in normal weight
- phpbb33 (on phpbb32): what 3.3 changed in the look, which was little:
taller list headings
The layout's stylesheet is now the theme's name, so a child theme's
page links its own sheet; the 3.2 and 3.3 sheets @import their
parent's. Their own CSS and templates; no code or images taken from
phpBB.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
The forum can wear more than one look. A theme is a stylesheet and,
in themes/NAME/, templates of its own for the pages it lays out
differently, parsed over the default's.
- ipb2: a board of the mid-2000s in the manner of Invision Power Board
2's default skin: white page, navy-outlined boxes, gradient title and
sub-title bars, pale blue rows, Logged in as / Welcome Guest bars,
Last Post Info, topic folders, post tables with Member No. and Top,
quote boxes, big blue buttons, Fast Reply, the footer bar. Its own
CSS and templates; no code or images taken from IPB.
- ipb3: the existing look (its stylesheet now ipb3.css)
- a theme chooser at the foot of every page, for guests too, kept in a
cookie; [http] forum_theme sets the forum's own, checked by bbs check
- docs: Web-Forum themes, configuration, development
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
The HTTP API's server serves /forum/ (and / when it is on): the areas as
categories of forums, topics and posts with their authors beside them,
laid out in the manner of Invision Power Board 3's default skin with CSS
of its own (no code or assets taken from it, no scripts on the pages).
- store: messages carry their topic (thread), set on posting, found for
messages from before, mended when a topic's first post or a reply's
parent goes; per-user topic read marks; topic lists and counts
- forum: board index with groups, statistics and who's online; area
topic lists with unread marks and pages; topics with quotes, likes
(the BBS's votes), polls, deleting, replies; new topics with polls and
aliases; profiles, search, who's online, login and sign-up
- logins are the API's session tokens in an HttpOnly, SameSite cookie;
every logged-in form carries a CSRF token; strict CSP, no framing
- [http] forum and forum_guests settings
- bbs.WrapBody: text typed in paragraphs (the forum, the API's posts and
mail) wrapped to the terminals' 79 columns instead of cut, quotes
carried onto wrapped lines
- docs: Web-Forum wiki page, configuration, HTTP API, development
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
internal/mrc joins the BBS to MRC as its own connector: one connection
to the MRC server ([mrc]: address, TLS) carries all its users. The
chat rooms beginning mrc- are MRC's (mrc-lobby is its lobby), so
callers on terminals, 3270s, the web and IRC (#mrc-lobby) chat with
other BBSes there under their names.
The protocol is as Synchronet's mrc-connector.js and mrc-session.js
speak it: the SYSTEM~PLATFORM handshake, INFO, IMALIVE and
CAPABILITIES; IMALIVE to the server's PING; each user's IAMHERE every
minute, NEWROOM:old:new, arrival and leaving notices, LOGOFF; lines as
<name> text and actions; Mystic's pipe colors taken out of what comes.
!COMMAND in a room goes to the MRC server, its answer to the asker
alone; private messages likewise. A dropped line is retried, those
here put back. [mrc] require limits who may go in.
The chat hub gains a Relay: told of joins, leaves and lines in the
rooms it carries, giving them what comes (RelayEvent, RelayTo). On
IRC, MRC's users show as nick_Site!mrc@site, and room notices go to
the channel.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
A door may be elsewhere ([door NAME] type = telnet, rlogin, bbslink or
doorparty): the caller's line is joined to it over the network, with
the same time limit, idle time, access and CP437 translation as a door
run here (Door.Run's bridge now drives either).
- telnet: the server's negotiation answered (a binary ANSI terminal of
the caller's size), none of it shown to the caller; IACs doubled
- rlogin: RFC 1282's start ({user} and the rest filled in)
- bbslink: a token from BBSLink's web server, authenticated with the
BBS's codes (MD5s with the token), then telnet to games.bbslink.net
- doorparty: an SSH tunnel with DoorParty's account (no connector
needed), then RLogin through it as [TAG]user with the door's code;
host_key pins the server's key, else each call logs it
The protocols are as Synchronet's and ENiGMA's modules use them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
The sysop makes a room permanent (BBSServ ROOM ADD #room [topic], or
bbs room add): kept open when empty and across restarts (chat_rooms),
with a topic. Coming in shows the topic; setting it (BBSServ ROOM
TOPIC, TOPIC in the channel, /topic in the BBS's chat; the sysop only)
tells those in the room. ROOM DEL lets a room go with its last caller.
On IRC, BBSServ sits in each permanent channel as an operator (NAMES,
WHO, WHOIS's channels), LIST shows the rooms with their topics even
when empty, JOIN and TOPIC give 332; ROOMS lists them for anyone. On
the BBS, /rooms marks them with their topics. Numerics' last
parameters are now always trailing, as clients expect of lists.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
/msg BBSServ (or /BS) INFO shows the account: level, location, alias,
signature, settings, unread mail, keys, tokens, the new scan. SET
changes the profile's fields (location, about, alias, signature) and
the terminal and menu settings, with the BBS's own checks; PASSWD the
password; SCAN the areas of the new scan; KEYS lists, adds (with the
password) and deletes SSH keys; TOKENS lists and revokes API tokens.
Its framework (command table, parameters, HELP, CTCP) is adapted from
ergo's services, under its MIT license. The bot's nick is [irc]
service (default BBSServ); it answers WHOIS and ISON.
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
As a hub: an account flagged qwk_node (bbs user qwknode NAME, or the
API's qwk_node) is another BBS's. What its REPs bring is posted under
its writers' names, with its access checked, and its packets leave out
what came from it.
As a node: [qwknet NAME] calls the hub by FTP (FTPS explicit or
implicit) every so often, or on bbs qwknet call and POST
/api/v1/admin/qwknet/call. It puts a REP of what was written here in
the network's areas since the last call (nothing from before joining,
nothing that came by a network or peer), then takes the hub's packet
and posts it in the areas of its conferences (CONFERENCE = AREA).
Messages are known by conference and number (qwk_msgs), so nothing
comes twice and answers keep their threads.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
internal/qwk reads and writes QWK packets and REPs: MESSAGES.DAT's
blocks, CONTROL.DAT, conference and personal indexes (MBF floats),
QWKE kludges for long names and subjects, CP437 text.
A caller's packet holds their unread mail (conference 0) and the new
messages of the areas in their new scan (an area's ID its conference);
they count as read only once the packet has gone. A REP's messages are
posted and mailed as the caller, with their access checked; one brought
twice posts once (qwk_seen, kept 90 days). BBSID: qwk_id, or made of
the name.
Offline mail is O on the main menu (qwk in the sysop's menus): by
X/Y/ZMODEM or Kermit on the text BBS, IND$FILE GET and PUT on a 3270,
/qwk over FTP, and GET /api/v1/qwk, POST /api/v1/qwk/rep.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
For every front end (internal/app), the API and the CLI:
- Threads: from a message, the one it answers (O, PF2) and its whole
thread (T, PF6), replies under what they answer; GET
/messages/{id}/thread.
- Votes: up, down or none on a message (V, PF1), shown by its number;
POST /messages/{id}/vote.
- Polls: a question and 2 to 10 answers posted in an area (L, PF9),
answered (A, PF12) and shown with each answer's share; POST with
"poll", POST /messages/{id}/answer.
- Aliases: a user's alias (checked like a new name, no one's name or
alias) posted under in areas that allow it; the message's From is the
alias everywhere, newsgroup articles included (they used the real
name), while the sysop keeps whose it is.
- Signatures: up to three lines under posts and mail written on the BBS.
- Groups: areas listed by group, with a Group column.
- Retention: an area keeps its newest N messages and/or those of the
last D days, purged hourly and by bbs area purge.
Tested on SQLite, PostgreSQL, MySQL and MariaDB.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
A sysop's main menu has * (and custom menus a sysop action), on every
terminal:
- Watch a node: what a text caller is sent, as it is sent (the text
terminal's connection echoes to bbs.Node.Echo; a slow watcher misses
some, never slows the caller). A key stops; the caller leaving ends
it. Text terminals only.
- Chat with a node: the caller is told and taken into a private chat
(their page's room) at their next menu; the sysop waits there.
- Kick a node.
- Users: level, flags, lock, sysop rights, a new password (not one's
own lock or rights).
- Statistics: totals, and calls, new users, posts and uploads for each
of the last 14 days as bars.
- The bans (lifted by number) and the hack log.
- Scheduled events ([event NAME]: a program run without a shell, daily
at a time or every N minutes, with a timeout; internal/events): when
they run next, the last run's end and output, run now.
- Available: whether pages reach the sysop; when not, a caller who pages
may leave a message.
The API: GET /admin/events, POST /admin/events/{name}/run, PUT
/admin/available. Sysop-Tools is the wiki page.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
- Last callers (L, and a callers menu action): each login is recorded
(calls: the newest 10000 kept); GET /api/v1/callers.
- Feedback to the sysop (K, a feedback action): mail any caller may
send, whatever their level allows.
- The user list picks a user: their details (a sysop sees their access
and files too), and mail to them from there.
- A line about oneself, on the profile (Y; - clears it) and PATCH /me's
about, shown with one's details.
- Expert menus (the expert setting, X on a text terminal's profile): a
menu is its prompt, "Command (? for the menu): ", and ? shows it.
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
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
- FILE_ID.DIZ: an archive uploaded by any way (the BBS, IND$FILE, FTP,
the API, the CLI) is described by its DIZ, kept as the file's longer
description (CP437 decoded, colors and control characters out, at
most 20 lines); its first line that says something is the description
unless the uploader gave one.
- Archives: what is in a ZIP, tar or tar.gz, from a file's details (V,
PF6) and GET /files/{id}/listing.
- New files since the caller's last call (N, PF5) and finding files by
name and descriptions (F, PF10), across the areas they may see; the
API's GET /files?since= and ?q=.
- A batch: files tagged (T, by numbers such as 1 3 5-7, or from a
file's details) download together by YMODEM, ZMODEM or Kermit; a file
counts once the protocol has gone on past it. Frontend.Download takes
a list of files.
- Ratios: [level] ratio and ratio_free (files downloadable for each
upload, and before the ratio counts), checked with the day's limit for
a whole batch. Users' lifetime downloads and uploads are counted.
The store gains a {plain} token: PostgreSQL's LIKE refuses the
case-insensitive collation of {name} columns. Tested on SQLite,
PostgreSQL, MySQL and MariaDB.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
In the message areas, for every front end (internal/app):
- Scan setup (S, PF11): which areas the new scan goes through, kept per
user (scan_off: the areas left out; all are in until taken out).
- To you (T, PF4): the newest 100 messages addressed to the caller, in
any case, in the areas they read, unread ones marked.
- Find (F, PF10): messages whose subject, text or author has the words,
in any case, newest first; LIKE's wildcards are taken as text.
Reading what these found leaves the areas' last-read points as they
were. A 3270's key line closes up when a screen has many actions.
Tested through internal/app and in the store on SQLite, PostgreSQL,
MySQL and MariaDB. Message-Areas is the callers' wiki page for the
areas.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
Posts and mail on an ANSI terminal (40x12 or more, not a VT52 or a
Commodore) are written on the whole screen: the cursor and editing keys
(Term.EditKey reads them now, where other prompts still drop them),
words wrapping as typed, Backspace and Delete joining lines, ^Y
deleting one, ^Z (or /S on a line) saving, ^X giving up. A reply's
quote is no longer put in the body to cut: ^Q opens a window of the
message replied to, and Enter takes a line from it. Messages from
other nodes wait until the editor is left.
view.Draft gains Quote; the line editor and the 3270's editor begin the
body with it, as before. The profile switches between the full-screen
and line editors (kept as the editor setting).
The editor's text is its own type, tested by itself; an SSH caller
posts, replies quoting and switches editors. Writing-Messages is the
wiki page for the editors.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
The screens after the login (menus, message areas, reading and
writing, mail, file areas, who's online, the user list, system info,
the profile and SSH keys, validation, paging the sysop) were written
twice, once for text terminals and once for 3270s. They are now
written once in internal/app, as descriptions in internal/view's terms
(menus, tables, messages, forms, panels, drafts), and each front end
draws them its own way: prompts and keys a page at a time (RIP buttons
for menus) on a text terminal, fields and PF keys on a 3270.
What only a front end can do stays with it, behind app.Frontend: the
logins, display files, chat, doors, transfers (protocols, or IND$FILE),
the terminal's line on the profile and the goodbye.
The 3270 gains what it lacked: the main menu by letter like the text
BBS's, a new scan, messages to other nodes from who's online,
validation, SSH keys, editing and removing files, paging with a
message left when the sysop is away. The text prompts are as before.
Tests: internal/app driven by a scripted front end; the column layout
and text key labels; a 3270 (s3270) through areas, posting, reading
and the profile, with a text caller reading its post.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
MariaDB is a MySQL to the store but for its collations: MySQL 8's
utf8mb4_0900_* are not there. The store finds MariaDB when it connects
(behind mariadb:// or mysql://) and uses UCA 14.0's collations
(utf8mb4_uca1400_as_ci, 10.10 and later), which match names as MySQL's
do. MariaDB 10.6, without them, gets utf8mb4_unicode_520_ci: names
ignore accents as well as case there, which the engine's description
says.
mariadb://user:password@host/db and mariadb:DSN are taken beside the
mysql forms, by the configuration, bbs db copy and BBS_TEST_DATABASE.
The whole suite passes on MariaDB 11.4, 10.11 and 10.6.
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
Users have a level (0-255) and flags (A-Z). [level N] sections say what
a range of levels may do: time online a day (warned at 5 and 1 minutes,
hung up at the end; doors' limits cut to what is left), downloads a day
(counted by every way: the BBS, 3270, FTP, the API), and whether they
may post, mail (else only the sysop), chat, page, download, upload and
open doors.
Requirements ("30 F !X", "sysop") are put on message areas (reading and
posting), file areas (downloading and uploading), doors, menus and menu
items ("x = menu:extras Extras | 50 X"). They are checked in the core,
so the text BBS, 3270s, FTP, NNTP and the API keep them alike: an area a
user may not read is not listed, opened or found by number or
Message-ID.
New users start at new_user_level and are told they wait; the sysop
validates them on the BBS (V on the main menu), by bbs user
waiting/validate/level/flags, or by PATCH /api/v1/admin/users. Users
see their access in the profile and /api/v1/me; no one changes their
own. Drop files carry the caller's level.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
[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
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
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
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
[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
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
[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
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
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
The README's sections become pages (Building, Running, Administration,
Configuration, Modem callers, TN3270, Sixel graphics, Files and FTP, File
transfers, Doors, Newsgroups and NNTP, FidoNet, Security, Development)
with a Home page, sidebar and footer, kept in docs/wiki in the wiki's own
file layout. Administration gains the whole command reference and
Configuration a map of every section. docs/wiki/publish.sh copies them
to the wiki, and the Wiki workflow does it when they change on the
default branch. The README keeps the introduction, a quick start and
links to the pages.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr