Commit Graph
11 Commits
Author SHA1 Message Date
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 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 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 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 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 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 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