Commit Graph
32 Commits
Author SHA1 Message Date
Claude ae228616f2 Web forum themes: a classic theme in the manner of IPB 2
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
2026-10-12 23:39:12 +00:00
Claude 546af1eee3 Web forum: the message areas as a bulletin board in the browser
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
2026-10-12 23:22:17 +00:00
Claude 1e1a1ac049 MRC: Multi Relay Chat, its rooms as the BBS's chat rooms
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
2026-10-12 20:17:54 +00:00
Claude 1b3efb78a1 Networked doors: telnet, RLogin, BBSLink and DoorParty
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
2026-10-12 20:10:52 +00:00
Claude 34d2bae4d3 Permanent chat rooms, held open by BBSServ
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
2026-10-12 19:47:43 +00:00
Claude ad2d9b8414 BBSServ: an IRC services bot for a user's own account
/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
2026-10-12 19:33:19 +00:00
Claude 7142bf88ad IRC server: the chat rooms as channels, built on parts of ergo
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
2026-10-12 19:23:23 +00:00
Claude 09e9152049 QWK networking: the BBS as a hub, and as a node
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
2026-10-12 18:30:41 +00:00
Claude a00b469b5e QWK offline mail: packets of new messages and mail, REP replies
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
2026-10-12 18:21:59 +00:00
Claude bccdf2cc6a Deepen the message base: threads, votes, polls, aliases, signatures, groups, retention
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
2026-10-12 18:06:52 +00:00
Claude a93a2cf303 Add the sysop's tools: watching nodes, chat, users, statistics, events
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
2026-10-12 17:45:05 +00:00
Claude dd788e26a3 Add the last callers, feedback, user details, a line about oneself, expert menus
- 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
2026-10-12 17:33:55 +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 1805fcbd13 Add JavaScript scripting: the sysop's own screens, on every terminal
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
2026-10-12 14:52:12 +00:00
Claude 0cce335b88 Deepen the file base: DIZ, archive views, new files, search, batches, ratios
- 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
2026-10-12 14:41:19 +00:00
Claude 05022e2a82 Choose the new scan's areas, list messages to you, find messages
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
2026-10-12 14:26:54 +00:00
Claude 094ad0561f Add a full-screen editor for ANSI terminals
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
2026-10-12 14:18:08 +00:00
Claude de134e3308 Keep each user's terminal settings for their next call
What a caller switches on their profile (ANSI, UTF-8, sixel, RIP, a
Commodore's width) is kept with their account as settings (users.prefs,
"key=value" pairs) and applied after the next login: ANSI and UTF-8 as
set, sixel and RIP kept off when turned off and on only where the
terminal has them.  An editor setting (full or line) is there for the
full-screen editor.

The API shows them at GET /me and changes them with PATCH /me ("":
forgets one); unknown settings and values are refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
2026-10-12 14:13:25 +00:00
Claude ff2defc805 Share the screens: describe them once, draw them per front end
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
2026-10-12 11:21:40 +00:00
Claude b6f961b44e Support MariaDB
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
2026-10-12 09:33:12 +00:00
Claude 2861ba44f0 Run on SQLite, PostgreSQL or MySQL
[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
2026-10-12 09:09:42 +00:00
Claude b41f59ec55 Add access levels: levels, flags, requirements, limits, validation
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
2026-10-12 08:49:46 +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 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 8e29dfd427 Documentation as wiki pages: docs/wiki, published to the GitHub wiki
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
2026-10-10 23:04:13 +00:00